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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]