Skip to content
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

Create a proof-of-concept self-hosted runner for Github Actions #66

Open
tstellar opened this issue Aug 20, 2021 · 16 comments
Open

Create a proof-of-concept self-hosted runner for Github Actions #66

tstellar opened this issue Aug 20, 2021 · 16 comments
Assignees

Comments

@tstellar
Copy link
Collaborator

We should create a proof-of-concept self-hosted runner for Github Actions and enable it for some of the existing CI jobs in the release branch. Once this is working, we should document how to do this, so that community members can easily create their own self-hosted runners.

@tstellar tstellar self-assigned this Aug 20, 2021
@lazyparser
Copy link
Collaborator

I'm just curious that how many workers/bots are sufficient for LLVM project. I had built a few internal CI for LLVM. It taks ~15mins for clean build and ~10mins to run the regression tests on 52 core Xeon 2.5GHz / 200GB RAM VM.

@ChristianKuehnel
Copy link
Collaborator

ChristianKuehnel commented Aug 20, 2021 via email

@lazyparser
Copy link
Collaborator

So I've create two type of runners for a downstream llvm repo.

Turns out the runner for github actions (or post commit runners) are kinda easy to set up: I just followed the github docs and the commands showed in the setting tab of the repo.

CI for pull requests are a bit complicated. I forked the runner that the riscv v8 team used, and set up a CI runner for pull requests successfully. the repo is here. It written in JavaScript, and the source code is kinda straight forward. feel free to check it out.

@tstellar
Copy link
Collaborator Author

So I've create two type of runners for a downstream llvm repo.

Turns out the runner for github actions (or post commit runners) are kinda easy to set up: I just followed the github docs and the commands showed in the setting tab of the repo.

Are you interested in using your runner for some release branch testing?

@tstellar
Copy link
Collaborator Author

There is some interested in setting up a self-hosted runner on Mac hardware, so we are going to request Mac resources from the LLVM Foundation.

@lazyparser
Copy link
Collaborator

So I've create two type of runners for a downstream llvm repo.
Turns out the runner for github actions (or post commit runners) are kinda easy to set up: I just followed the github docs and the commands showed in the setting tab of the repo.

Are you interested in using your runner for some release branch testing?

Yes. Will do. I can set up 2~3 runners in next week.

@lazyparser
Copy link
Collaborator

There is some interested in setting up a self-hosted runner on Mac hardware, so we are going to request Mac resources from the LLVM Foundation.

I have two mac mini for (RISC-V) CI purpose. turned out that neither the x86 mini or M1 mini with the 8GB memory could not build LLVM quickly enough. for pre or post commit CI. IMHO the iMac or Mac Pro might suit.

If we just want to a nightly build, then it would be ok to use mac mini as a start.

@tstellar
Copy link
Collaborator Author

@lazyparser The Github runners take 2hr 20min to build and run make check for llvm (and no other sub-projects). Anything that is faster than that would be an improvement.

@lazyparser
Copy link
Collaborator

@lazyparser The Github runners take 2hr 20min to build and run make check for llvm (and no other sub-projects). Anything that is faster than that would be an improvement.

It takes 7-10 minutes for building (clang+llvm on x86 and RISCV) and 8-12 minutes for regression testing on the 128c200g VM. For a 32c128g VM it takes 30-35 minutes.

These workers(VMs) are idle most of the time, because my team had turned to upstream directly. I'd like to use the VMs for LLVM building. Either adding IWG members to root access or config actions on the VMs myself are good to me.

btw thete is yet another daily CI for LLVM created by me:
https://ci.rvperf.org/job/upstream-llvm-main-branch/

@lazyparser
Copy link
Collaborator

Not sure If one project can has multiple build workers. If so, then perhaps I can connect 2 big workers and a few medium workers to github actions.

@lazyparser
Copy link
Collaborator

So what should to be done next?

@tstellar
Copy link
Collaborator Author

@lazyparser Do you have a runner set up that we can add to the llvm-project repo?

@lazyparser
Copy link
Collaborator

@lazyparser Do you have a runner set up that we can add to the llvm-project repo?

Yes. For the action, just copy the command list on the action tab (Please send it in private email or other non-public channel).

If we want to use self-built runner for PRs, then

  1. a webhook need to be added.
  2. a github token that can access and comment on the repo should be created.

We can start from the actions.

@ChristianKuehnel ChristianKuehnel added this to Open in IWG working group backlog 📜 via automation Sep 14, 2021
@ChristianKuehnel ChristianKuehnel moved this from Open to In Progress in IWG working group backlog 📜 Sep 14, 2021
@tstellar
Copy link
Collaborator Author

@lazyparser Do you have a runner set up that we can add to the llvm-project repo?

Yes. For the action, just copy the command list on the action tab (Please send it in private email or other non-public channel).

I don't understand what this is, can you clarify?

@lazyparser
Copy link
Collaborator

@lazyparser Do you have a runner set up that we can add to the llvm-project repo?

Yes. For the action, just copy the command list on the action tab (Please send it in private email or other non-public channel).

I don't understand what this is, can you clarify?

If we want to add a new runner for github actions, we can follow

https://docs.github.com/en/actions/hosting-your-own-runners/adding-self-hosted-runners#adding-a-self-hosted-runner-to-a-repository

For example:

image

Press the add new self-runner button, then

image

You can see several hash string in the command script. That is the secrets/token for the runner which should be keep private.

The other way is that I can provide an account on the runner VM, so that you (or other maintainer) can log into the runner VM and run the commands directly.

@ChristianKuehnel
Copy link
Collaborator

meeting on 2021-10-26:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants