You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tvm.apache.org by GitBox <gi...@apache.org> on 2021/11/23 06:06:03 UTC

[GitHub] [tvm] driazati opened a new pull request #9556: Add labels to each Jenkins step

driazati opened a new pull request #9556:
URL: https://github.com/apache/tvm/pull/9556


   This uses the optional [`label` argument](https://www.jenkins.io/doc/pipeline/steps/workflow-durable-task-step/#sh-shell-script) on shell scripts in Jenkins to assign each one in CI a human-friendly name. This should help make it more clear what is going on in CI without having to dig into individual commands.
   
   Tested in the test Jenkins [here](https://jenkins.tvm.octoml.ai/blue/organizations/jenkins/octoml-tvm/activity?branch=driazati%2Fjenkins_names)
   


-- 
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: commits-unsubscribe@tvm.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [tvm] Mousius commented on pull request #9556: Add labels to each Jenkins step

Posted by GitBox <gi...@apache.org>.
Mousius commented on pull request #9556:
URL: https://github.com/apache/tvm/pull/9556#issuecomment-977251460


   Thanks for the simple quality of life improvement here @driazati, just have a few questions but in general I think this can only improve things :smile_cat: 


-- 
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: commits-unsubscribe@tvm.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [tvm] Mousius commented on pull request #9556: Add labels to each Jenkins step

Posted by GitBox <gi...@apache.org>.
Mousius commented on pull request #9556:
URL: https://github.com/apache/tvm/pull/9556#issuecomment-979100212


   Thanks @driazati, this improvement has landed :smile_cat: 


-- 
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: commits-unsubscribe@tvm.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [tvm] Mousius merged pull request #9556: Add labels to each Jenkins step

Posted by GitBox <gi...@apache.org>.
Mousius merged pull request #9556:
URL: https://github.com/apache/tvm/pull/9556


   


-- 
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: commits-unsubscribe@tvm.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [tvm] Mousius commented on a change in pull request #9556: Add labels to each Jenkins step

Posted by GitBox <gi...@apache.org>.
Mousius commented on a change in pull request #9556:
URL: https://github.com/apache/tvm/pull/9556#discussion_r755561910



##########
File path: Jenkinsfile
##########
@@ -154,54 +148,94 @@ stage('Sanity Check') {
     node('CPU') {
       ws(per_exec_ws('tvm/sanity')) {
         init_git()
-        is_docs_only_build = sh (returnStatus: true, script: '''
-        ./tests/scripts/git_change_docs.sh
-        '''
+        is_docs_only_build = sh (
+          returnStatus: true,
+          script: './tests/scripts/git_change_docs.sh',
+          label: "Check for docs only changes",
+        )
+        sh (
+          script: "${docker_run} ${ci_lint}  ./tests/scripts/task_lint.sh",
+          label: "Run lint",
         )
-        sh "${docker_run} ${ci_lint}  ./tests/scripts/task_lint.sh"
       }
     }
   }
 }
 
 // Run make. First try to do an incremental make from a previous workspace in hope to
-// accelerate the compilation. If something wrong, clean the workspace and then
+// accelerate the compilation. If something is wrong, clean the workspace and then
 // build from scratch.
 def make(docker_type, path, make_flag) {
   timeout(time: max_time, unit: 'MINUTES') {
     try {
-      sh "${docker_run} ${docker_type} ./tests/scripts/task_build.sh ${path} ${make_flag}"
+      sh (
+        script: "${docker_run} ${docker_type} ./tests/scripts/task_build.sh ${path} ${make_flag}",
+        label: "Run cmake build",
+      )

Review comment:
       This is repeated a lot, should we extract it out into a function also?

##########
File path: Jenkinsfile
##########
@@ -315,10 +373,19 @@ stage('Unit Test') {
             init_git()
             unpack_lib('gpu', tvm_multilib)
             timeout(time: max_time, unit: 'MINUTES') {
-              sh "${docker_run} ${ci_gpu} ./tests/scripts/task_ci_setup.sh"
-              sh "${docker_run} ${ci_gpu} ./tests/scripts/task_sphinx_precheck.sh"
-              sh "${docker_run} ${ci_gpu} ./tests/scripts/task_python_unittest_gpuonly.sh"
-              sh "${docker_run} ${ci_gpu} ./tests/scripts/task_python_integration_gpuonly.sh"
+              ci_setup(ci_gpu)
+              sh (
+                script: "${docker_run} ${ci_gpu} ./tests/scripts/task_sphinx_precheck.sh",
+                label: "Check Sphinx warnings in docs",
+              )
+              sh (
+                script: "${docker_run} ${ci_gpu} ./tests/scripts/task_python_unittest_gpuonly.sh",
+                label: "Run GPU unit tests",

Review comment:
       If these are specifically the Python tests and not other languages, should we label them so?
   
   ```suggestion
                   label: "Run Python GPU unit tests",
   ```

##########
File path: Jenkinsfile
##########
@@ -154,54 +148,94 @@ stage('Sanity Check') {
     node('CPU') {
       ws(per_exec_ws('tvm/sanity')) {
         init_git()
-        is_docs_only_build = sh (returnStatus: true, script: '''
-        ./tests/scripts/git_change_docs.sh
-        '''
+        is_docs_only_build = sh (
+          returnStatus: true,
+          script: './tests/scripts/git_change_docs.sh',
+          label: "Check for docs only changes",
+        )
+        sh (
+          script: "${docker_run} ${ci_lint}  ./tests/scripts/task_lint.sh",
+          label: "Run lint",
         )
-        sh "${docker_run} ${ci_lint}  ./tests/scripts/task_lint.sh"
       }
     }
   }
 }
 
 // Run make. First try to do an incremental make from a previous workspace in hope to
-// accelerate the compilation. If something wrong, clean the workspace and then
+// accelerate the compilation. If something is wrong, clean the workspace and then
 // build from scratch.
 def make(docker_type, path, make_flag) {
   timeout(time: max_time, unit: 'MINUTES') {
     try {
-      sh "${docker_run} ${docker_type} ./tests/scripts/task_build.sh ${path} ${make_flag}"
+      sh (
+        script: "${docker_run} ${docker_type} ./tests/scripts/task_build.sh ${path} ${make_flag}",
+        label: "Run cmake build",
+      )
       // always run cpp test when build
-      sh "${docker_run} ${docker_type} ./tests/scripts/task_cpp_unittest.sh"
+      sh (
+        script: "${docker_run} ${docker_type} ./tests/scripts/task_cpp_unittest.sh",
+        label: "Build and run C++ tests",
+      )
     } catch (hudson.AbortException ae) {
       // script exited due to user abort, directly throw instead of retry
       if (ae.getMessage().contains('script returned exit code 143')) {
         throw ae
       }
       echo 'Incremental compilation failed. Fall back to build from scratch'
-      sh "${docker_run} ${docker_type} ./tests/scripts/task_clean.sh ${path}"
-      sh "${docker_run} ${docker_type} ./tests/scripts/task_build.sh ${path} ${make_flag}"
-      sh "${docker_run} ${docker_type} ./tests/scripts/task_cpp_unittest.sh"
+      sh (
+        script: "${docker_run} ${docker_type} ./tests/scripts/task_clean.sh ${path}",
+        label: "Clear old cmake workspace",
+      )
+      sh (
+        script: "${docker_run} ${docker_type} ./tests/scripts/task_build.sh ${path} ${make_flag}",
+        label: "Run cmake build",
+      )
+      sh (
+        script: "${docker_run} ${docker_type} ./tests/scripts/task_cpp_unittest.sh",
+        label: "Build and run C++ tests",
+      )
     }
   }
 }
 
 // pack libraries for later use
 def pack_lib(name, libs) {
-  sh """
+  sh (script: """
      echo "Packing ${libs} into ${name}"
      echo ${libs} | sed -e 's/,/ /g' | xargs md5sum
-     """
+     """, label: "Stash libraries and show md5")
   stash includes: libs, name: name
 }
 
 // unpack libraries saved before
 def unpack_lib(name, libs) {
   unstash name
-  sh """
+  sh (script: """
      echo "Unpacked ${libs} from ${name}"
      echo ${libs} | sed -e 's/,/ /g' | xargs md5sum
-     """
+     """, label: "Unstash libraries and show md5")
+}
+
+def ci_setup(image) {
+  sh (
+    script: "${docker_run} ${image} ./tests/scripts/task_ci_setup.sh",
+    label: "Set up CI environment",
+  )
+}
+
+def unittest(image) {

Review comment:
       ```suggestion
   def python_unittest(image) {
   ```




-- 
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: commits-unsubscribe@tvm.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org