tvm
tvm copied to clipboard
[CI Problem] Deduplicate the `retry` function from the Jenkinsfile
I am wondering if it's possible to duplicate the retry function from the Jenkinsfile. This increases quite a bit the size of our Jenkinsfile. I was thinking about something similar to what is done in #12291.
The drawback is that we could no longer test it with the Jenkinsfile linter.
Thoughts @driazati @areusch?
This would be nice (and we could do something similar to de-duplicate some other inlined code) but I think we'll need to re-implement some of the Jenkins trust mechanism first since it'd be pretty trivial for anyone to then mess with the CI runners (i.e. if a PR is not from a trusted user then we use the versions of files X Y and Z from the base commit and not from the PR HEAD, similar to how the Jenkinsfile works) with a test like
trusted = false
if env.BRANCH_NAME.startswith("PR-"):
if env.CHANGE_AUTHOR in `CONTRIBUTORS.md:
trusted = true
else:
trusted = true
This is implemented now in https://github.com/apache/tvm/blob/main/ci/scripts/jenkins/retry.sh