Skip to content

CI Add commit status and comment bot to CUDA CI - #29245

Closed
betatim wants to merge 4 commits into
scikit-learn:mainfrom
betatim:cuda-ci-comment
Closed

betatim wants to merge 4 commits into
scikit-learn:mainfrom
betatim:cuda-ci-comment

Conversation

@betatim

@betatim betatim commented Jun 13, 2024

Copy link
Copy Markdown
Member

This adds a script that will comment on PRs it tests and set a "commit status" for the commit it tested. This will make the CI workflow show up in the "checks" section at the bottom of a PR.

Not sure how we can test this on this repository, so I used it in a private repo: betatim/scikit-learn-ci#4 This PR was tested by a version of this workflow. You can see the comment in action as well as the "check".

Existing PRs that were forked before this PR was merged need rebasing/main merging in order for this to work. It is a bit annoying, but it seems even more annoying to add special handling for these "legacy" PRs.

Towards #29221

This adds a script that will comment on PRs it tests and set a "commit
status" for the commit it tested. This will make the CI workflow show up
in the "checks" section at the bottom of a PR.
@github-actions

github-actions Bot commented Jun 13, 2024 •

Copy link
Copy Markdown

✔️ Linting Passed

All linting checks passed. Your pull request is in excellent shape! ☀️

Generated for commit: 57ac826. Link to the linter CI: here

@betatim

betatim commented Jun 13, 2024

Copy link
Copy Markdown
Member Author

@EdAbati what do you think of linking to https://gist.github.com/EdAbati/ff3bdc06bafeb92452b3740686cc8d7c from the comment that the bot makes? That would let contributors test/debug build issues without having to wait for a maintainer to trigger the workflow. If we do that, could you add a short instruction text to the gist's description?

@betatim

betatim commented Jun 13, 2024

Copy link
Copy Markdown
Member Author

@lesteve and/or @ogrisel if you want to already review this, go for it. I am leaving this as a draft for now until we make a decision on including (or not) the "test via colab" gist from the above comment.

Comment thread .github/workflows/cuda-gpu-ci.yml Resolved
Comment thread .github/workflows/cuda-gpu-ci.yml Resolved
Comment thread .github/workflows/cuda-gpu-ci.yml Resolved
@EdAbati

EdAbati commented Jun 13, 2024 •

Copy link
Copy Markdown
Contributor

Hi @betatim,
Happy to add some instructions!

Since this gist is becoming part of the process, we could also transfer it to the scikit-learn org (can we do that on GitHub? 🤔) if you prefer. So you all have more control and I don't become the bottleneck for updates :)

UPDATE:

The gist is updated, let me know what you think

@betatim

betatim commented Jun 18, 2024

Copy link
Copy Markdown
Member Author

I was wondering about moving the gist to the scikit-learn org, but not sure if that is possible? Maybe not https://github.com/orgs/community/discussions/7923?

I think it is fine to host it on your account. We can link to a particular revision of it so that you aren't on the hook for someone stealing your account on adding evil things to the gist which people then blindly run.

@ogrisel

ogrisel commented Jun 19, 2024

Copy link
Copy Markdown
Member

I think this would be more natural (and safer) to implement if we make this workflow run in a pull_request context instead of the main branch environment.

Maybe it's possible to leverage the required reviewers feature of custom environments as documented here:

Alternatively we could use a label based trigger of for the workflow as we do for the .github/workflows/check-changelog.yml workflow.

@ogrisel

ogrisel commented Jun 19, 2024 •

Copy link
Copy Markdown
Member

I was wondering about moving the gist to the scikit-learn org, but not sure if that is possible? Maybe not https://github.com/orgs/community/discussions/7923?

We could host the notebook under a build_tools/google-colab folder of the scikit-learn repo itself instead.

@lesteve

lesteve commented Jun 19, 2024 •

Copy link
Copy Markdown
Member

I think this would be more natural (and safer) to implement if we make this workflow run in a pull_request context instead of the main branch environment.

Maybe it's possible to leverage the required reviewers feature of custom environments as documented here:

* [docs.github.com/en/actions/deployment/targeting-different-environments/using-environments-for-deployment#required-reviewers](https://docs.github.com/en/actions/deployment/targeting-different-environments/using-environments-for-deployment#required-reviewers)

I kind of agrees about the pull_request context, here is what I said in internal email (mostly to have it in a public place).

It would kind of feel more natural to have the trigger be pull_request like most other CI builds, have a step that waits for manual approval, and then the approval triggers the GPU workflow. Not quite sure how to do this, but it feels like a common usage and surely someone in the world have found a way to do it ...

Searching a bit I haven't found anything clear-cut, here is what I found so far ...

@lesteve

lesteve commented Jun 19, 2024 •

Copy link
Copy Markdown
Member

About the label-based stuff I am wondering whether it has inherently the same security issues as our previous approach. Between the time you set the label and the time the worflow start there is an opportunity for someone to push a commit. Even if you do time-based checks I think there is still some small time window that is exploitable. This is super hard to exploit I know, you'd have to read the mind of the person who is about to set the label, so maybe it is still acceptable I don't know 🤔 ...

@ogrisel

ogrisel commented Jun 19, 2024 •

Copy link
Copy Markdown
Member

Between the time you set the label and the time the worflow start there is an opportunity for someone to push a commit.

Yes but it could happen in a pull_request github actions environment which comes with cache isolation from the main branch environment by default. It could not be used to trigger cache poisoning attacks on other workflows with more privileges (e.g. to grab token keys or inject malware into release artifacts).

@betatim

betatim commented Jun 28, 2024

Copy link
Copy Markdown
Member Author

I will tackle running the CUDA CI workflow in a PR context in a new PR. And either integrate this work in that or come back to this PR.

@betatim

betatim commented Jul 1, 2024

Copy link
Copy Markdown
Member Author

Closing

@betatim betatim closed this Jul 1, 2024
@betatim betatim mentioned this pull request Jul 1, 2024
5 tasks done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants