tvm icon indicating copy to clipboard operation
tvm copied to clipboard

[CI Problem] Deduplicate the `retry` function from the Jenkinsfile

Open gigiblender opened this issue 3 years ago • 1 comments
trafficstars

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?

gigiblender avatar Aug 07 '22 13:08 gigiblender

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

driazati avatar Aug 08 '22 16:08 driazati

This is implemented now in https://github.com/apache/tvm/blob/main/ci/scripts/jenkins/retry.sh

driazati avatar Nov 16 '22 21:11 driazati