From 0a11c043d2da28d9a1ededf565dd82a535b82c12 Mon Sep 17 00:00:00 2001 From: Leandro Nunes Date: Tue, 17 Aug 2021 13:42:18 +0100 Subject: [PATCH] Enable custom images to be set in TVM Jenkinsfile (#8721) * This work is needed to enable automatic testing of our newly built Docker images as part of CI * The default value is set by variables in the same Jenkinsfile and are used when no custom values are provided --- Jenkinsfile | 39 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 39 insertions(+) diff --git a/Jenkinsfile b/Jenkinsfile index 93a9a23ac621..91d99d773728 100755 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -53,6 +53,21 @@ ci_qemu = "tlcpack/ci-qemu:v0.07" ci_arm = "tlcpack/ci-arm:v0.06" // <--- End of regex-scanned config. +// Parameters to allow overriding (in Jenkins UI), the images +// to be used by a given build. When provided, they take precedence +// over default values above. +properties([ + parameters([ + string(name: 'ci_lint_param', defaultValue: ""), + string(name: 'ci_cpu_param', defaultValue: ""), + string(name: 'ci_gpu_param', defaultValue: ""), + string(name: 'ci_wasm_param', defaultValue: ""), + string(name: 'ci_i386_param', defaultValue: ""), + string(name: 'ci_qemu_param', defaultValue: ""), + string(name: 'ci_arm_param', defaultValue: "") + ]) +]) + // tvm libraries tvm_runtime = "build/libtvm_runtime.so, build/config.cmake" tvm_lib = "build/libtvm.so, " + tvm_runtime @@ -107,6 +122,30 @@ def cancel_previous_build() { cancel_previous_build() +stage('Prepare') { + node('CPU') { + // When something is provided in ci_*_param, use it, otherwise default with ci_* + ci_lint = ci_lint_param ?: ci_lint + ci_cpu = ci_cpu_param ?: ci_cpu + ci_gpu = ci_gpu_param ?: ci_gpu + ci_wasm = ci_wasm_param ?: ci_wasm + ci_i386 = ci_i386_param ?: ci_i386 + ci_qemu = ci_qemu_param ?: ci_qemu + ci_arm = ci_arm_param ?: ci_arm + + sh """ + echo "Docker images being used in this build:" + echo " ci_lint = ${ci_lint}" + echo " ci_cpu = ${ci_cpu}" + echo " ci_gpu = ${ci_gpu}" + echo " ci_wasm = ${ci_wasm}" + echo " ci_i386 = ${ci_i386}" + echo " ci_qemu = ${ci_qemu}" + echo " ci_arm = ${ci_arm}" + """ + } +} + stage("Sanity Check") { timeout(time: max_time, unit: 'MINUTES') { node('CPU') {