Repository navigation
Add parallel ci pipelines - #71
Conversation
|
Hi, @ralphlange (happy new year!). You have certainly gone to a lot of effort here and made much better use of github actions. But as you mention, the previous builds did all run in parallel, even though they were just calling a script. Now that you are correctly using docker/build-push-action you could take advantage of githubs build cache to improve speed. e.g. see you would need to take care to use a different scope for each of the 4 workflows that calls into This way you would get speed up for the whole of the container build. In fact I don't think you need the two stage build if you get this working right. e.g. look at the build-image job here https://github.com/epics-containers/ioc-adsimdetector/actions/runs/19670901234/job/56339244267 all the container build steps are being pulled from the cache and it is significantly faster than those builds where there is a change early in the Dockerfile. |
|
Excellent idea! (happy new year!) I will try that. I will also add some special handling for pull requests, as we certainly don't want those to push images to the target organization's docker repo. (Found an action that allows storing images as build artefacts, which is exactly how things should be handled for PRs: scoped with the PR build itself, downloadable, not requiring authentication and auto-deleted after a while.) Stay tuned... |
We usually build containers for PRs but only push them to the registry for tagged builds (although this means you don't get a container image to test locally until release or beta tag - your idea of using artefacts would give you that, but I guess you would need to manually download the image instead of use an ghcr.io registry address for it). DLS best practice for use of github actions might give you a few pointers, it comes from our python project template, the simplest example of which is here https://github.com/DiamondLightSource/python-copier-template-example/tree/main/.github/workflows |
There was a problem hiding this comment.
Overall seems fine to me; a few minor comments/questions though.
| # to local.yml and adjust as needed | ||
| # Setting all module switches to false (just make sure the variables exist) | ||
| initial_setup: false | ||
| docker: true # for rootful this needs to happen before first reboot |
There was a problem hiding this comment.
This seems not obviously related to the commit message, and now the comment doesn't seem to match...
(That said, this file is deleted later so meh...)
1bbc87d to
6d4f223
Compare
|
This is the updated, rebased PR as of after the Codeathon. |
|
Now the CI duration is flexible and varies: |
|
@simon-ess: Which of your comments on the old version do you retain? I'll take care of those. |
Restructure the GitHub Actions CI pipeline into two independent stages. - Stage 1 (rebuild-container-images): Rebuilds base container images for Debian, Fedora, Rocky, and Ubuntu when base roles or Containerfiles are changed - Stage 2 (test-roles-*): Installs downstream EPICS module roles and applications using the base images. Triggered by downstream role changes or completion of Stage 1. Includes a 'prep' job to handle lowercase repository names for GHCR. Refactor the Ansible setup to support modular testing. - Use 'ansible/configs/' to store CI profiles and local overrides. - Convert 'playbook.yml' to use 'include_role' in 'tasks:' for granular control. - Implement explicit dependencies in 'meta/main.yml'. - Fix 'update.sh' to use the new configuration path structure. - Resolve GHCR tagging issues by ensuring lowercase repository names. Co-authored-by: google-labs-jules[bot]
- distro-dependent settings in vars/os - playbook pre-task to load the correct settings8000 div>
- epics-module was not a proper role - as the build system is under m-base, the build_module task belongs there
gets rid of GitHub Actions warnings about the default value resulting in an empty base image name
Required for the upcoming switch to Node.js 24 - actions/checkout to v6 - docker/login-action to v4 - docker/build-push-action to v7
- requires explicit configuration from command line using '-e "@vars/foobar.yml"'
6d4f223 to
d29aee1
Compare
|
Builds fail because of PRs not being able to push container images. Merging. Thanks for the reviews! |
Thanks-to: Giles Knap (see epics-training#71 (comment))
Thanks-to: Giles Knap (see epics-training#71 (comment))
Thanks-to: Giles Knap (see epics-training#71 (comment))
Thanks-to: Giles Knap (see epics-training#71 (comment))
Thanks-to: Giles Knap (see #71 (comment))
First part of reducing the duration of CI testing:
Use a two-stage pipeline, to
Alas, the time savings are considerably less that I hoped for.
That's why a second part (different PR) will break the fixed pipeline and run the first stage (container image build) only when needed, so that the usual CI tests (changes on a second-stage role) will save 10-20 minutes (depending on flavour).
(fixes #63)