-
-
Notifications
You must be signed in to change notification settings - Fork 9.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Migrate Homebrew/homebrew-core CI to GitHub Actions CI #6255
Comments
Last I heard was about 3 weeks from now. Let me check in and see if there's an update. |
@ethomson Great, thanks Ed! |
Several items say “will require Microsoft doing X”… do we have a agreement on principle to those things? |
@fxcoudert Yes, this is work that we (Microsoft) are doing. |
Why is it that way? |
@Moisan Homebrew/brew currently already uses Azure Pipelines whereas Homebrew/homebrew-core uses Jenkins and our own agents. |
Special bonus: you can clone the linuxbrew-core release pipeline which is already being used. There will be 2-3 env variables and tokens to change, but that should be it. I can help with that part, but it is pretty straightforward. |
Amazing! Are you using it for builds that time out or exceed memory on CircleCI? |
Yes. In these cases I manually trigger the release pipeline for that build, and upload the bottles that way. Far better than building the bottles on my computer locally ... |
I chatted with MacStadium today and they pointed me to Orka (https://www.macstadium.com/orka) and their improved Cloud Automation docs (https://docs.macstadium.com/docs/cloud-automation). If this worked out for us it could be something we use with our dedicated hardware while still migrating our CI frontend from Jenkins to Azure Pipelines. |
I would be impressed & surprised if Azure pipelines started supporting beta macOS releases. For this reason I suspect we would want to keep MacStadium infra for dealing with new OS releases. But, in general, looks great! |
I've updated this to suggest we move towards https://github.blog/2019-08-08-github-actions-now-supports-ci-cd/ instead. It's pretty similar under the hood and the lack of separate access control will make our lives much easier. I will start investigating the move of Homebrew/brew and other repos to that. |
My third-party tap https://github.com/brewsci/homebrew-bio has migrating to building and publishing bottles using GitHub Actions. |
Self hosted runners seem to work well: Homebrew/homebrew-core#50468 We'd only be able to build bottles on one macOS version until support for custom labels is added. |
I'm thinking about the maintainer workflow for this. Currently I think this is the space of what is possible based on the Github Actions permissions model. Homebrew/linuxbrew-core workflow:
Pros: Everything happens in the GitHub UI. Cons: Bottles lag updated formulae by about 60-90 seconds, which means users might get errors about missing bottles in that time frame. brewsci/homebrew-bio workflow:
Pros: Everything happens in the Github UI. Users receive bottles and formula updates at the same time. Cons: Maintainers must remember to base their pull requests on the Repository branch workflow:
Pros: Everything happens in the Github UI. Cons: Impossible for non-maintainers to contribute bottles New
Pros: Maintainer experience identical to current workflow. Cons: Bottled formulae don't use Github UI. Pull requests show up as "closed" rather than "merged". Example
Pros: Users receive bottles and formula updates at the same time. Cons: Bottled formulae don't use Github UI. Need to write and test new |
Interesting. This is a hard blocker for us for now, I'm surprised it's not supported yet.
Unfortunately this makes it a non-started for Homebrew/homebrew-core given our scale.
I think this could be OK if
Non-starter, unfortunately. Too many contributions from non-maintainers.
I think this would be fine and is preferable to the linuxbrew-core or repository branch workflows. I agree that using a more GitHub-native solution would be preferable if possible.
You need a merge commit which merges the same SHA1 as the PR branch into the default branch. As a result, you need to push any commits to the PR before you can "merge" it. With our current I was thinking a slight deviation from This wouldn't allow us to use the "merge PR" button (for bottled PRs) but it would allow everything to be done within the GitHub UI on desktop or mobile using normal workflows. |
This wouldn't be possible with standard actions because I believe comments and label actions on pull requests from forked repositories do not have access to secrets. However we could implement some kind of web hook like we already do with pinging BrewTestBot which could then do those actions on our behalf. |
Yeh, this would be cool 👍 |
Can you point me to where the current code that does this lives? Is it just a Jenkins config? |
Yes, just Jenkins configuration. The TL;DR will be to configure a webhook to hit an endpoint which then calls a script with a GitHub API key. I'd suggest a simple Heroku Ruby app for this. |
Actually, thinking about it this could be done entirely in GitHub Actions on the |
To remove Jenkins:
To remove
To remove tedious VM image building:
|
I know that approving a fork pull request does not have access to secrets, I tested that myself, but I haven't tested a comment or label. It'd be worth testing to find out definitively. |
This sounds great 👏. I'd suggest we have a CI check on this so that we can't accidentally merge PRs that haven't had the job run yet. Otherwise: this flow sounds perfect!
Sounds good. My suggestion would be to have the CI jobs both running side-by-side for a bit and switching over the
I like the idea of splitting these into two "tasks".
I think once we're zeroed in on a single setup we can probably make better use of scripts than we already are. There will probably remain some minor tedium, indeed. Thanks for all your work on this @jonchang! |
Do we have an equivalent for "Homebrew Testing"? There were a couple of use cases for it. Besides the obvious of testing builds (which can perhaps be done instead with a "do not merge" revision bump pull request), it was also used to generate bottles without performing any actual formula changes prior. I believe this workflow (or rather "Homebrew Catalina Testing") was used to generate many Catalina bottles after Catalina's release. "Homebrew Testing" has also been used to generate bottles when someone accidentally merged without |
I intend to adapt https://github.com/Homebrew/linuxbrew-core/blob/master/.github/workflows/dispatch-build-bottle.yml |
I noticed that there is an on-going work to use self-hosted GitHub Actions runner for CI. However, for your information, I want to remind you that this may not be secure. Per Github document (https://help.github.com/en/actions/hosting-your-own-runners/about-self-hosted-runners#self-hosted-runner-security-with-public-repositories)
For example, a malicious PR can do the followings:
|
There's nothing more inherently insecure about using these runners than our existing Jenkins setup. If you find an actual vulnerability with our setup please follow our responsible security disclosure process: https://github.com/Homebrew/brew#security |
@jonchang (and everyone else in this thread) I've noticed that the GHA runners are timing out for formulae PRs that need a lot of revision bumps for dependencies, e.g., Homebrew/homebrew-core#51116 With self hosted runners can we set arbitrary timeout limits? If not, is there a plan for a mechanism to breakup PRs with tons of revision bumps? Sincere apologies if this was addressed in a comment above that I missed, but it's hard to keep up with every thread. |
Yeah there’s a timeout setting. By default it’s six hours but we can raise that on self hosted runners. What would be a good timeout? |
I'd rather it be "too high" (if that's even possible) and something we're confident we won't hit rather than something that we "probably" won't hit. We are able to identify and kill hanging jobs ourselves. If something has been running for over a day, it's likely intentional. |
Yeh, I'd say setting it to ~3 days would be a decent starting point once we switch over. For now, though, I think a short timeout is sensible as the bottles aren't actually being used. |
If the formula being updated is versioned, then the revision bumps can be done in batches. |
This was done! Thanks so much to everyone who was involved but a particular shout-out to @jonchang who has pushed this forward more than any other individual. Well done everyone, pour one out for Jenkins 🍻 |
A detailed description of the proposed feature
We should migrate the CI for Homebrew/homebrew-core from our own hosted Linux Jenkins instance with our own ESXi clients to Azure Pipelines. This should be done in several stages:
azure-pipelines.yml
for Homebrew/homebrew-core which triggers Microsoft's build agents and upload bottles from all PRs to Azure Pipelines.azure-pipelines.yml
upload bottles to Bintray through a release pipeline in a form thatbrew pull --bottle
can access/publish for testing.azure-pipelines.yml
to use our own build agents. We will test this with some PRs to ensure that things can be built, tested and bottles published with this new system.The motivation for the feature
The current CI for Homebrew/homebrew-core works good enough but has the following issues:
It would be good to avoid all of the above work and outsource all (or: as much as possible) system administration work to third-parties who specialise at doing that at scale.
How the feature would be relevant to at least 90% of Homebrew users
What alternatives to the feature have been considered
@Homebrew/maintainers any thoughts on any of the above? Anything I've missed? Any major problems I've not anticipated?
The text was updated successfully, but these errors were encountered: