This project is all about a continous integration approach for the LLVM project. At the time of writing, the LLVM code lives in Github but reviews are done in Phabricator.
One assumption for this project is that we open up the possibility to submit patches, author reviews and run checks within Github as well, so that code and reviews sit side-by-side.
Another assumption is we want to test patches before they are merged into the main or master branch of the LLVM codebase.
With LLVM's buildbot infrastructure still in place but slightly modified I believe that we can create a very slick user experience for change authors and reviewers, that hides and at the same time incrementally exposes a lot of the possibilities already present with the current buildbot infrastructure.
As humans we have intentions, motivations and memory and I believe we can use regular Github comments to utter, express and track our thoughts to control and drive the continous integration system. With a bit of clever comment formatting we can have github actions parse the comments and possible enter a dialogue.
For general CI in most modern projects that have a dedicated target platform, architecture and operating system you have to answer just one question:
In such a project you spin up a fast machine somewhere that matches the requirements and you're good to test on it. Then just test every commit before it hits the main branch.
For LLVM this is a bit trickier and things cannot be fully automated.
This project tries to answer these simple questions by replicating the main components of the LLVM buildbot infrastructure and putting them into an a rather easy consumable composition of a few containers that directly hook into a github repository. We would like interested people to modify the actual workflow by providing them with this project and a set of ready-to-use and wired up github actions as a starting ground.
NOTE: This project started and I used OpenShift for it but when I found out more about Github Actions and self-hosted runners I came up with the idea to lower the entry barrier and use plain docker-compose
to bring up the required applications locally. Here and there accross the project you'll find k8s (short for Kubernetes) folders and files or Makefile targets. Those can safely be ignored as it is completely sufficient to just use docker-compose. I hesitate to remove them yet because I still think the knowledge I gathered when writing them is burried inside of those files.
I use docker
and docker-compose
to as my container and orchestration tool. I only have limited amount of testing capabilities due to time constraints. Feel free to experiment with podman
and podman-compose
. The Makefile
s are agnostic to what tool you use. I try to not use any fancy features from docker
or docker-compose
for which there's no equivalent in podman
or podman-compose
but I cannot guarantee that everything will be working.
gh version
.gh auth login
gh repo fork kwk-org/llvm-ci --remote=true --clone=true
.cd llvm-ci/infra
.make prepare-secrets
.buildbot-write-discussion
here: https://github.com/settings/tokens/new.
write:discussion
permissions.infra/master/k8s/secret.yaml
and plain in infra/master/compose-secrets/github-pat
.actions-runner-registration
here: https://github.com/settings/tokens/new.
repo
permissions.infra/runner/k8s/secret.yaml
and plain in infra/runner/compose-secrets/github-pat
.TRY_USER=alice-try
and TRY_PASSWORD=password
) for the actions runner to federate requests to the local buildbot master: make buildbot-try-secrets-in-github
. These secrets will be used by the workflow defined in ../.github/workflows/build-on-builder.yaml
.<ctrl>-<c>
out of the logs, you'll still have the infrastructure running in the background. To stop it, run make stop
.For the workflow to be demonstrated, we need to create a new PR. Let's use the gh
tool that I've mentioned earlier.
git checkout -b say-hello
README.md
just to put some content in the change: echo "I was here" >> README.md
gh pr create --fill
say-hello
the branch.gh pr checks
shows a passing test.gh pr view -c
..github/workflows/give-tips-on-new-pr.yaml
.