areusch commented on a change in pull request #9031:
URL: https://github.com/apache/tvm/pull/9031#discussion_r711223304



##########
File path: tests/scripts/git_check_tree.sh
##########
@@ -0,0 +1,40 @@
+#!/usr/bin/env bash
+
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+#
+#   http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied.  See the License for the
+# specific language governing permissions and limitations
+# under the License.
+

Review comment:
       add set -eux

##########
File path: Jenkinsfile
##########
@@ -201,192 +205,240 @@ def unpack_lib(name, libs) {
 }
 
 stage('Build') {
-  parallel 'BUILD: GPU': {
-    node('GPUBUILD') {
-      ws(per_exec_ws("tvm/build-gpu")) {
-        init_git()
-        sh "${docker_run} ${ci_gpu} ./tests/scripts/task_config_build_gpu.sh"
-        make(ci_gpu, 'build', '-j2')
-        pack_lib('gpu', tvm_multilib)
-        // compiler test
-        sh "${docker_run} ${ci_gpu} 
./tests/scripts/task_config_build_gpu_vulkan.sh"
-        make(ci_gpu, 'build2', '-j2')
+    parallel 'BUILD: GPU': {
+      node('GPUBUILD') {
+        ws(per_exec_ws('tvm/build-gpu')) {
+          init_git()
+          sh "${docker_run} ${ci_gpu} ./tests/scripts/task_config_build_gpu.sh"
+          make(ci_gpu, 'build', '-j2')
+          pack_lib('gpu', tvm_multilib)
+          // compiler test
+          sh "${docker_run} ${ci_gpu} 
./tests/scripts/task_config_build_gpu_vulkan.sh"
+          make(ci_gpu, 'build2', '-j2')
+        }
       }
-    }
   },
   'BUILD: CPU': {
-    node('CPU') {
-      ws(per_exec_ws("tvm/build-cpu")) {
-        init_git()
-        sh "${docker_run} ${ci_cpu} ./tests/scripts/task_config_build_cpu.sh"
-        make(ci_cpu, 'build', '-j2')
-        pack_lib('cpu', tvm_multilib_tsim)
-        timeout(time: max_time, unit: 'MINUTES') {
-          sh "${docker_run} ${ci_cpu} ./tests/scripts/task_ci_setup.sh"
-          sh "${docker_run} ${ci_cpu} ./tests/scripts/task_python_unittest.sh"
-          sh "${docker_run} ${ci_cpu} 
./tests/scripts/task_python_integration.sh"
-          sh "${docker_run} ${ci_cpu} ./tests/scripts/task_python_vta_fsim.sh"
-          sh "${docker_run} ${ci_cpu} ./tests/scripts/task_python_vta_tsim.sh"
-          // sh "${docker_run} ${ci_cpu} ./tests/scripts/task_golang.sh"
-          // TODO(@jroesch): need to resolve CI issue will turn back on in 
follow up patch
-          sh "${docker_run} ${ci_cpu} ./tests/scripts/task_rust.sh"
-          junit "build/pytest-results/*.xml"
+    if (docs == 1) {
+      node('CPU') {
+        ws(per_exec_ws('tvm/build-cpu')) {
+          init_git()
+          sh "${docker_run} ${ci_cpu} ./tests/scripts/task_config_build_cpu.sh"
+          make(ci_cpu, 'build', '-j2')
+          pack_lib('cpu', tvm_multilib_tsim)
+          timeout(time: max_time, unit: 'MINUTES') {
+            sh "${docker_run} ${ci_cpu} ./tests/scripts/task_ci_setup.sh"
+            sh "${docker_run} ${ci_cpu} 
./tests/scripts/task_python_unittest.sh"
+            sh "${docker_run} ${ci_cpu} 
./tests/scripts/task_python_integration.sh"
+            sh "${docker_run} ${ci_cpu} 
./tests/scripts/task_python_vta_fsim.sh"
+            sh "${docker_run} ${ci_cpu} 
./tests/scripts/task_python_vta_tsim.sh"
+            // sh "${docker_run} ${ci_cpu} ./tests/scripts/task_golang.sh"
+            // TODO(@jroesch): need to resolve CI issue will turn back on in 
follow up patch
+            sh "${docker_run} ${ci_cpu} ./tests/scripts/task_rust.sh"
+            junit 'build/pytest-results/*.xml'
+          }
         }
       }
+    } else {
+      Utils.markStageSkippedForConditional('BUILD: CPU')
     }
-    },
+  },
   'BUILD: WASM': {
-    node('CPU') {
-      ws(per_exec_ws("tvm/build-wasm")) {
-        init_git()
-        sh "${docker_run} ${ci_wasm} ./tests/scripts/task_config_build_wasm.sh"
-        make(ci_wasm, 'build', '-j2')
-        timeout(time: max_time, unit: 'MINUTES') {
-          sh "${docker_run} ${ci_wasm} ./tests/scripts/task_ci_setup.sh"
-          sh "${docker_run} ${ci_wasm} ./tests/scripts/task_web_wasm.sh"
+    if (docs == 1) {
+      node('CPU') {
+        ws(per_exec_ws('tvm/build-wasm')) {
+          init_git()
+          sh "${docker_run} ${ci_wasm} 
./tests/scripts/task_config_build_wasm.sh"
+          make(ci_wasm, 'build', '-j2')
+          timeout(time: max_time, unit: 'MINUTES') {
+            sh "${docker_run} ${ci_wasm} ./tests/scripts/task_ci_setup.sh"
+            sh "${docker_run} ${ci_wasm} ./tests/scripts/task_web_wasm.sh"
+          }
         }
       }
+    } else {
+      Utils.markStageSkippedForConditional('BUILD: WASM')
     }
   },
   'BUILD : i386': {
-    node('CPU') {
-      ws(per_exec_ws("tvm/build-i386")) {
-        init_git()
-        sh "${docker_run} ${ci_i386} ./tests/scripts/task_config_build_i386.sh"
-        make(ci_i386, 'build', '-j2')
-        pack_lib('i386', tvm_multilib_tsim)
+    if ( docs == 1) {

Review comment:
       nit: extra space

##########
File path: Jenkinsfile
##########
@@ -42,41 +42,42 @@
 // Hashtag in the source to build current CI docker builds
 //
 //
+import org.jenkinsci.plugins.pipeline.modeldefinition.Utils
 
 // NOTE: these lines are scanned by docker/dev_common.sh. Please update the 
regex as needed. -->
-ci_lint = "tlcpack/ci-lint:v0.67"
-ci_gpu = "tlcpack/ci-gpu:v0.77"
-ci_cpu = "tlcpack/ci-cpu:v0.77"
-ci_wasm = "tlcpack/ci-wasm:v0.71"
-ci_i386 = "tlcpack/ci-i386:v0.73"
-ci_qemu = "tlcpack/ci-qemu:v0.08"
-ci_arm = "tlcpack/ci-arm:v0.06"
+ci_lint = 'tlcpack/ci-lint:v0.67'

Review comment:
       +1 would be great to avoid too many formatting changes. in particular 
this one also requires updates to docker/dev_common.sh

##########
File path: Jenkinsfile
##########
@@ -148,11 +149,15 @@ stage('Prepare') {
   }
 }
 
-stage("Sanity Check") {
+stage('Sanity Check') {
   timeout(time: max_time, unit: 'MINUTES') {
     node('CPU') {
-      ws(per_exec_ws("tvm/sanity")) {
+      ws(per_exec_ws('tvm/sanity')) {
         init_git()
+        docs = sh (returnStatus: true, script: '''

Review comment:
       could we name this `is_docs_only_build`?

##########
File path: Jenkinsfile
##########
@@ -201,192 +205,240 @@ def unpack_lib(name, libs) {
 }
 
 stage('Build') {
-  parallel 'BUILD: GPU': {
-    node('GPUBUILD') {
-      ws(per_exec_ws("tvm/build-gpu")) {
-        init_git()
-        sh "${docker_run} ${ci_gpu} ./tests/scripts/task_config_build_gpu.sh"
-        make(ci_gpu, 'build', '-j2')
-        pack_lib('gpu', tvm_multilib)
-        // compiler test
-        sh "${docker_run} ${ci_gpu} 
./tests/scripts/task_config_build_gpu_vulkan.sh"
-        make(ci_gpu, 'build2', '-j2')
+    parallel 'BUILD: GPU': {
+      node('GPUBUILD') {
+        ws(per_exec_ws('tvm/build-gpu')) {
+          init_git()
+          sh "${docker_run} ${ci_gpu} ./tests/scripts/task_config_build_gpu.sh"
+          make(ci_gpu, 'build', '-j2')
+          pack_lib('gpu', tvm_multilib)
+          // compiler test
+          sh "${docker_run} ${ci_gpu} 
./tests/scripts/task_config_build_gpu_vulkan.sh"
+          make(ci_gpu, 'build2', '-j2')
+        }
       }
-    }
   },
   'BUILD: CPU': {
-    node('CPU') {
-      ws(per_exec_ws("tvm/build-cpu")) {
-        init_git()
-        sh "${docker_run} ${ci_cpu} ./tests/scripts/task_config_build_cpu.sh"
-        make(ci_cpu, 'build', '-j2')
-        pack_lib('cpu', tvm_multilib_tsim)
-        timeout(time: max_time, unit: 'MINUTES') {
-          sh "${docker_run} ${ci_cpu} ./tests/scripts/task_ci_setup.sh"
-          sh "${docker_run} ${ci_cpu} ./tests/scripts/task_python_unittest.sh"
-          sh "${docker_run} ${ci_cpu} 
./tests/scripts/task_python_integration.sh"
-          sh "${docker_run} ${ci_cpu} ./tests/scripts/task_python_vta_fsim.sh"
-          sh "${docker_run} ${ci_cpu} ./tests/scripts/task_python_vta_tsim.sh"
-          // sh "${docker_run} ${ci_cpu} ./tests/scripts/task_golang.sh"
-          // TODO(@jroesch): need to resolve CI issue will turn back on in 
follow up patch
-          sh "${docker_run} ${ci_cpu} ./tests/scripts/task_rust.sh"
-          junit "build/pytest-results/*.xml"
+    if (docs == 1) {

Review comment:
       i'm not sure it can be done :/
   
   perhaps if we switch to Declarative Jenkins, but unfortunately I'm not an 
expert either. I would love for the boilerplate to be templated.

##########
File path: tests/scripts/git_check_tree.sh
##########
@@ -0,0 +1,40 @@
+#!/usr/bin/env bash
+
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+#
+#   http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied.  See the License for the
+# specific language governing permissions and limitations
+# under the License.
+
+DOCS_DIR=0
+OTHER_DIR=0
+DOC_DIR="\docs"
+
+changed_files=`git diff --no-commit-id --name-only -r origin/main`
+
+for file in $changed_files; do
+    if grep -q "$DOC_DIR" <<< "$file"; then
+        DOCS_DIR=1
+    else
+        OTHER_DIR=1
+        break
+    fi
+done
+
+if [[ ($OTHER_DIR -eq 1) ]]; then

Review comment:
       can we use the simpler bash syntax `if [ ${OTHER_DIR} -eq 1 ]; then`?




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to