This is an automated email from the ASF dual-hosted git repository. areusch pushed a commit to branch areusch/freeze-dependencies in repository https://gitbox.apache.org/repos/asf/tvm.git
commit ef579329c3a88afde16c59d0b9d7e2f4a25ceb32 Author: Andrew Reusch <[email protected]> AuthorDate: Tue May 17 13:47:12 2022 -0700 build and test with img --- Jenkinsfile | 20 +++++++++++--------- docker/build.sh | 22 ++++++++++++---------- jenkins/Jenkinsfile.j2 | 4 +++- 3 files changed, 26 insertions(+), 20 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index 229bef8ad2..674b6f8512 100755 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -45,7 +45,7 @@ // 'python3 jenkins/generate.py' // Note: This timestamp is here to ensure that updates to the Jenkinsfile are // always rebased on main before merging: -// Generated at 2022-05-17T10:23:30.174515 +// Generated at 2022-05-17T13:48:28.023057 import org.jenkinsci.plugins.pipeline.modeldefinition.Utils // NOTE: these lines are scanned by docker/dev_common.sh. Please update the regex as needed. --> @@ -428,6 +428,8 @@ def build_image(image_name) { script: "docker rmi ${full_name}", label: 'Remove docker image' ) + + return full_name } if (rebuild_docker_images) { @@ -448,7 +450,7 @@ if (rebuild_docker_images) { node('ARM') { timeout(time: max_time, unit: 'MINUTES') { init_git() - build_image('ci_arm') + ci_arm = build_image('ci_arm') } } }, @@ -456,7 +458,7 @@ if (rebuild_docker_images) { node('CPU') { timeout(time: max_time, unit: 'MINUTES') { init_git() - build_image('ci_cpu') + ci_cpu = build_image('ci_cpu') } } }, @@ -464,7 +466,7 @@ if (rebuild_docker_images) { node('CPU') { timeout(time: max_time, unit: 'MINUTES') { init_git() - build_image('ci_gpu') + ci_gpu = build_image('ci_gpu') } } }, @@ -472,7 +474,7 @@ if (rebuild_docker_images) { node('CPU') { timeout(time: max_time, unit: 'MINUTES') { init_git() - build_image('ci_hexagon') + ci_hexagon = build_image('ci_hexagon') } } }, @@ -480,7 +482,7 @@ if (rebuild_docker_images) { node('CPU') { timeout(time: max_time, unit: 'MINUTES') { init_git() - build_image('ci_i386') + ci_i386 = build_image('ci_i386') } } }, @@ -488,7 +490,7 @@ if (rebuild_docker_images) { node('CPU') { timeout(time: max_time, unit: 'MINUTES') { init_git() - build_image('ci_lint') + ci_lint = build_image('ci_lint') } } }, @@ -496,7 +498,7 @@ if (rebuild_docker_images) { node('CPU') { timeout(time: max_time, unit: 'MINUTES') { init_git() - build_image('ci_qemu') + ci_qemu = build_image('ci_qemu') } } }, @@ -504,7 +506,7 @@ if (rebuild_docker_images) { node('CPU') { timeout(time: max_time, unit: 'MINUTES') { init_git() - build_image('ci_wasm') + ci_wasm = build_image('ci_wasm') } } }, diff --git a/docker/build.sh b/docker/build.sh index f495bba8d0..ee09c5a01e 100755 --- a/docker/build.sh +++ b/docker/build.sh @@ -162,29 +162,31 @@ function upsearch () { cd .. && upsearch "$1" } +# Under Jenkins matrix build, the build tag may contain characters such as +# commas (,) and equal signs (=), which are not valid inside docker image names. +# Convert to all lower-case, as per requirement of Docker image names +function sanitize_docker_name() { + echo "$@" | sed -e 's/=/_/g' -e 's/,/-/g' -e 's/\//-/g' | tr '[:upper:]' '[:lower:]' +} + # Set up WORKSPACE and BUILD_TAG. Jenkins will set them for you or we pick # reasonable defaults if you run it outside of Jenkins. WORKSPACE="${WORKSPACE:-${SCRIPT_DIR}/../}" BUILD_TAG=$(echo "${BUILD_TAG:-tvm}" | sed 's/-/--/g' | sed 's/%/-/g') -DOCKER_IMAGE_TAG="${DOCKER_IMAGE_TAG:-latest}" # Determine the docker image name -DOCKER_IMG_NAME="${BUILD_TAG}.${CONTAINER_TYPE}" - -# Under Jenkins matrix build, the build tag may contain characters such as -# commas (,) and equal signs (=), which are not valid inside docker image names. -DOCKER_IMG_NAME=$(echo "${DOCKER_IMG_NAME}" | sed -e 's/=/_/g' -e 's/,/-/g') - -# Convert to all lower-case, as per requirement of Docker image names -DOCKER_IMG_NAME=$(echo "${DOCKER_IMG_NAME}" | tr '[:upper:]' '[:lower:]') +DOCKER_IMG_NAME=$(echo "${BUILD_TAG}.${CONTAINER_TYPE}" | sanitize_docker_name) +DOCKER_IMAGE_TAG=$(echo "${DOCKER_IMAGE_TAG:-latest}" | sanitize_docker_name) # Compose the full image spec with "name:tag" e.g. "tvm.ci_cpu:v0.03" DOCKER_IMG_SPEC="${DOCKER_IMG_NAME}:${DOCKER_IMAGE_TAG}" if [[ -n ${OVERRIDE_IMAGE_SPEC+x} ]]; then - DOCKER_IMG_SPEC="$OVERRIDE_IMAGE_SPEC" + DOCKER_IMG_SPEC=$(echo "$OVERRIDE_IMAGE_SPEC" | sanitize_docker_name) fi +DOCKER_IMG_SPEC= + # Print arguments. echo "WORKSPACE: ${WORKSPACE}" echo "CI_DOCKER_EXTRA_PARAMS: ${CI_DOCKER_EXTRA_PARAMS[@]}" diff --git a/jenkins/Jenkinsfile.j2 b/jenkins/Jenkinsfile.j2 index 9359534f27..c66ed42de0 100644 --- a/jenkins/Jenkinsfile.j2 +++ b/jenkins/Jenkinsfile.j2 @@ -345,6 +345,8 @@ def build_image(image_name) { script: "docker rmi ${full_name}", label: 'Remove docker image' ) + + return full_name } if (rebuild_docker_images) { @@ -366,7 +368,7 @@ if (rebuild_docker_images) { node('{{ image.platform }}') { timeout(time: max_time, unit: 'MINUTES') { init_git() - build_image('{{ image.name }}') + {{ image.name }} = build_image('{{ image.name }}') } } },
