This is an automated email from the ASF dual-hosted git repository.

leandron pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/tvm.git


The following commit(s) were added to refs/heads/main by this push:
     new f2c5272  Enable custom images to be set in TVM Jenkinsfile (#8721)
f2c5272 is described below

commit f2c5272bdfb8d09c6dadde475d2a5420b28500d6
Author: Leandro Nunes <[email protected]>
AuthorDate: Tue Aug 17 13:42:18 2021 +0100

    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 2beb63b..92b34f8 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') {

Reply via email to