Commit fc50e068 by Tianqi Chen Committed by GitHub

[CI] Switch to use prebuilt docker instead of build from scratch (#1442)

parent 82f78d1e
......@@ -11,7 +11,7 @@ tvm_multilib = "build/libtvm.so, " +
"build/libvta.so, build/libtvm_topi.so, build/libnnvm_compiler.so, " + tvm_runtime
// command to start a docker container
docker_run = 'docker/build.sh'
docker_run = 'docker/bash.sh'
// timeout in minutes
max_time = 60
......@@ -39,7 +39,7 @@ stage("Sanity Check") {
node('linux') {
ws('workspace/tvm/sanity') {
init_git()
sh "${docker_run} ci_lint ./tests/scripts/task_lint.sh"
sh "${docker_run} tvmai/ci-lint ./tests/scripts/task_lint.sh"
}
}
}
......@@ -100,7 +100,7 @@ stage('Build') {
echo set\\(CMAKE_CXX_COMPILER g++\\) >> config.cmake
echo set\\(CMAKE_CXX_FLAGS -Werror\\) >> config.cmake
"""
make('ci_gpu', 'build', '-j2')
make('tvmai/ci-gpu', 'build', '-j2')
pack_lib('gpu', tvm_multilib)
// compiler test
sh """
......@@ -113,7 +113,7 @@ stage('Build') {
echo set\\(CMAKE_CXX_COMPILER clang-6.0\\) >> config.cmake
echo set\\(CMAKE_CXX_FLAGS -Werror\\) >> config.cmake
"""
make('ci_gpu', 'build2', '-j2')
make('tvmai/ci-gpu', 'build2', '-j2')
}
}
},
......@@ -130,11 +130,11 @@ stage('Build') {
echo set\\(CMAKE_CXX_COMPILER g++\\) >> config.cmake
echo set\\(CMAKE_CXX_FLAGS -Werror\\) >> config.cmake
"""
make('ci_cpu', 'build', '-j2')
make('tvmai/ci-cpu', 'build', '-j2')
pack_lib('cpu', tvm_lib)
timeout(time: max_time, unit: 'MINUTES') {
sh "${docker_run} ci_cpu ./tests/scripts/task_cpp_unittest.sh"
sh "${docker_run} ci_cpu ./tests/scripts/task_python_vta.sh"
sh "${docker_run} tvmai/ci-cpu ./tests/scripts/task_cpp_unittest.sh"
sh "${docker_run} tvmai/ci-cpu ./tests/scripts/task_python_vta.sh"
}
}
}
......@@ -153,7 +153,7 @@ stage('Build') {
echo set\\(CMAKE_CXX_COMPILER g++\\) >> config.cmake
echo set\\(CMAKE_CXX_FLAGS -Werror\\) >> config.cmake
"""
make('ci_i386', 'build', '-j2')
make('tvmai/ci-i386', 'build', '-j2')
pack_lib('i386', tvm_multilib)
}
}
......@@ -167,7 +167,7 @@ stage('Unit Test') {
init_git()
unpack_lib('gpu', tvm_multilib)
timeout(time: max_time, unit: 'MINUTES') {
sh "${docker_run} ci_gpu ./tests/scripts/task_python_unittest.sh"
sh "${docker_run} tvmai/ci-gpu ./tests/scripts/task_python_unittest.sh"
}
}
}
......@@ -178,9 +178,9 @@ stage('Unit Test') {
init_git()
unpack_lib('i386', tvm_multilib)
timeout(time: max_time, unit: 'MINUTES') {
sh "${docker_run} ci_i386 ./tests/scripts/task_python_unittest.sh"
sh "${docker_run} ci_i386 ./tests/scripts/task_python_integration.sh"
sh "${docker_run} ci_i386 ./tests/scripts/task_python_vta.sh"
sh "${docker_run} tvmai/ci-i386 ./tests/scripts/task_python_unittest.sh"
sh "${docker_run} tvmai/ci-i386 ./tests/scripts/task_python_integration.sh"
sh "${docker_run} tvmai/ci-i386 ./tests/scripts/task_python_vta.sh"
}
}
}
......@@ -191,7 +191,7 @@ stage('Unit Test') {
init_git()
unpack_lib('gpu', tvm_multilib)
timeout(time: max_time, unit: 'MINUTES') {
sh "${docker_run} ci_gpu ./tests/scripts/task_java_unittest.sh"
sh "${docker_run} tvmai/ci-gpu ./tests/scripts/task_java_unittest.sh"
}
}
}
......@@ -205,10 +205,10 @@ stage('Integration Test') {
init_git()
unpack_lib('gpu', tvm_multilib)
timeout(time: max_time, unit: 'MINUTES') {
sh "${docker_run} ci_gpu ./tests/scripts/task_python_integration.sh"
sh "${docker_run} ci_gpu ./tests/scripts/task_python_topi.sh"
sh "${docker_run} ci_gpu ./tests/scripts/task_cpp_topi.sh"
sh "${docker_run} ci_gpu ./tests/scripts/task_python_nnvm.sh"
sh "${docker_run} tvmai/ci-gpu ./tests/scripts/task_python_integration.sh"
sh "${docker_run} tvmai/ci-gpu ./tests/scripts/task_python_topi.sh"
sh "${docker_run} tvmai/ci-gpu ./tests/scripts/task_cpp_topi.sh"
sh "${docker_run} tvmai/ci-gpu ./tests/scripts/task_python_nnvm.sh"
}
}
}
......@@ -219,7 +219,7 @@ stage('Integration Test') {
init_git()
unpack_lib('gpu', tvm_multilib)
timeout(time: max_time, unit: 'MINUTES') {
sh "${docker_run} ci_gpu ./tests/scripts/task_python_docs.sh"
sh "${docker_run} tvmai/ci-gpu ./tests/scripts/task_python_docs.sh"
}
pack_lib('mydocs', 'docs.tgz')
}
......
......@@ -3,15 +3,28 @@
# Start a bash, mount /workspace to be current directory.
#
# Usage: docker/bash.sh <CONTAINER_NAME>
# Starts an interactive session
#
# Usage2: docker/bash.sh <CONTAINER_NAME> [COMMAND]
# Execute command in the docker image, non-interactive
#
if [ "$#" -lt 1 ]; then
echo "Usage: docker/bash.sh <CONTAINER_NAME>"
echo "Usage: docker/bash.sh <CONTAINER_NAME> [COMMAND]"
exit -1
fi
DOCKER_IMAGE_NAME=("$1")
if [ "$#" -eq 1 ]; then
COMMAND="bash"
CI_DOCKER_EXTRA_PARAMS=("-it --net=host")
else
shift 1
COMMAND=("$@")
fi
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
WORKSPACE="$(pwd)"
DOCKER_IMAGE_NAME=$1
# Use nvidia-docker if the container is GPU.
if [[ "${DOCKER_IMAGE_NAME}" == *"gpu"* ]]; then
......@@ -22,14 +35,16 @@ fi
# Print arguments.
echo "WORKSPACE: ${WORKSPACE}"
echo "DOCKER CONTAINER NAME: ${DOCKER_IMG_NAME}"
echo "DOCKER CONTAINER NAME: ${DOCKER_IMAGE_NAME}"
echo ""
echo "Running '${COMMAND[@]}' inside ${DOCKER_IMAGE_NAME}..."
# By default we cleanup - remove the container once it finish running (--rm)
# and share the PID namespace (--pid=host) so the process inside does not have
# pid 1 and SIGKILL is propagated to the process inside (jenkins can kill it).
echo ${DOCKER_BINARY}
${DOCKER_BINARY} run --rm -it --pid=host --net=host\
${DOCKER_BINARY} run --rm --pid=host\
-v ${WORKSPACE}:/workspace \
-v ${SCRIPT_DIR}:/docker \
-w /workspace \
......@@ -38,6 +53,7 @@ ${DOCKER_BINARY} run --rm -it --pid=host --net=host\
-e "CI_BUILD_UID=$(id -u)" \
-e "CI_BUILD_GROUP=$(id -g -n)" \
-e "CI_BUILD_GID=$(id -g)" \
${CI_DOCKER_EXTRA_PARAMS[@]} \
${DOCKER_IMAGE_NAME}\
bash /docker/with_the_same_user \
bash
${COMMAND[@]}
......@@ -65,7 +65,7 @@ enable=indexing-exception,old-raise-syntax
# --enable=similarities". If you want to run only the classes checker, but have
# no Warning level messages displayed, use"--disable=all --enable=classes
# --disable=W"
disable=design,similarities,no-self-use,attribute-defined-outside-init,locally-disabled,star-args,pointless-except,bad-option-value,global-statement,fixme,suppressed-message,useless-suppression,locally-enabled,no-member,no-name-in-module,import-error,unsubscriptable-object,unbalanced-tuple-unpacking,undefined-variable,protected-access
disable=design,similarities,no-self-use,attribute-defined-outside-init,locally-disabled,star-args,pointless-except,bad-option-value,global-statement,fixme,suppressed-message,useless-suppression,locally-enabled,no-member,no-name-in-module,import-error,unsubscriptable-object,unbalanced-tuple-unpacking,undefined-variable,protected-access,useless-object-inheritance
[REPORTS]
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment