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
Build BB worker images in CI and push on quay.io #79
Conversation
|
Nice start @fauust. Pulling by container hash is recommended for obtaining a guaranteed stable interface on an image rather than a tag. The remain available for a period of time. But yes, more thought needed around the processes here. Yes there seem to be a large scope for container consolidation into single multiiarch compatible build (and push manifests of images). |
By container hash, you mean commit hash?
So, for example:
Yep indeed. There is a balance here between having very descriptive -RUN curl https://github.com/Yelp/dumb-init/releases/download/v1.2.2/dumb-init_1.2.2_amd64.deb -Lo /tmp/init.deb && dpkg -i /tmp/init.deb
+RUN curl https://github.com/Yelp/dumb-init/releases/download/v1.2.2/dumb-init_1.2.2_$(arch).deb -Lo /tmp/init.deb && dpkg -i /tmp/init.debThere is also the option of generating those I also would like us to consider @ottok proposition #43. Anyway, I don't have a good overview about all those Finally, @grooverdan do you think that we could use quay.io (I don't know if we have quota or storage limitation there) or should I create a container registry on Hetzner cloud. |
|
I was thinking pull by digest: Useful for keeping dev/prod environments identical. See https://github.com/Yelp/dumb-init/releases now has just the plain exec with as standard OS arch: But sure, use template if things get odd. Also build arg
There is no limits. Just be clear with with naming if public. Private quay.io repos need a microplan, I haven't checked details. You're welcome to create a repository or use another repository if you want. |
Ok, make sense. Let's concentrate on containers names then and use
👍
That's already handled in the CI ;) I will prepare
If we can relay on quay.io, this is less maintenance for us, I will give it a try then. |
|
Should those long RUN apt-get && lines be just own RUN commands or script which is executed on build as now they are very hard to parse with human eye (they are nicely intended and all) or is it just me? |
|
Its harder, but for the greater good: |
|
Ok I just need to adapt my brain. Where I can see builded images or build process? |
|
@illuusio for the moment, containers are build on workers but this PR tries to move the building process in a CI. |
bc568ca
to
44deae8
Compare
|
Hi Faustin! I'm trying to understand how this workflow will work. So here are my questions for you as well as things to consider when implementing this:
|
|
@cvicentiu I was actually wondering the same as I'm in impression that Github CI works only on commit based or is there webhook based system also?
Actually for SLES https://build.opensuse.org offers all SLE(S) versions for building from source spec to RPM and there is also possibility to build Docker/Podman images with it as we build our Buildbot master/slave images with Kiwi (Which is easier to use in some cases than Dockefile) but it also builds from Dockerfile (link for our Buildbot master/slave https://build.opensuse.org/package/show/home:illuusio:images/buildbot-container-kiwi). Pros are they are update every time rpm/deb updates or by webhook. |
|
@illuusio I have looked at build.opensuse.org. What we need is to be able to compile and run MariaDB in the same environment (libraries, compiler, etc.) as Suse Linux Enterprise Server. With OpenSuse it's easy. We can recreate docker files no problem. The enterprise version however has packages that can only be downloaded from special repositories that are only enabled with a subscription, much like Red Hat. Can one create that environment (Say SLES 12 SP4) with the build system linked above? |
|
Hi Vicentju!
The CI runs with those triggers: on:
push:
paths:
- .github/workflows/bb_containers.yml
- buildbot.mariadb.org/dockerfiles/ci/*
pull_request:
paths:
- .github/workflows/bb_containers.yml
- buildbot.mariadb.org/dockerfiles/ci/*But we can use any of these https://docs.github.com/en/actions/reference/workflow-syntax-for-github-actions#on. The
ATM, if the image builds correctly and check passes, it will be pushed to the registry. But we can have a better control of this (based on a tag, a particular commit message etc.). Plus we should keep old images, see my previous comments.
Good Q. No idea at the moment I should investigate, using our own runner is maybe an option (but see bellow 5.).
Yes, see actual working builds:
Yes, but then there is also the option of using BB for those builds. If building particular arch/os becomes too complicated with GH actions, I would vote for that option. Also we should keep in mind what happened with TravisCI and keep the possibility to switch to another CI. But in the present case, there is nothing very specific to GitHub actions as the biggest work is to manage correctly those Dockerfiles (that particular point really need improvement IMO).
This is a new requirement to me, we will have to think a bit more how to handle this. I am not sure that it's a good idea to rely on GH actions for those heavy builds.
Yes
Those are the pros IMO:
If it result better to use BB for that task (which we should definitively consider), I would vote for using actual builders (not the master). After all, this is just another build. |
|
@cvicentiu You can build SUSE SLE(S) RPM with OBS SLE 12-15 packages which should be the same as subscriptions packages which are behind paywall. Things get problematic if you provide those RPMs how they go legally?
SLES seems to be available: SUSE SLE-15-SP3, SUSE SLE-15-SP2, SUSE SLE-15-SP1, SUSE SLE-12-SP5 and SUSE SLE-11 SP 4 |
e966f84
to
ee44e54
Compare
282a0c5
to
abd59c6
Compare
abd59c6
to
505d8cb
Compare
|
Hi! This is ready for final review. @vladbogo images have been pushed on quay.io (https://quay.io/repository/mariadb-foundation/bb-worker). I guess that you can now start to test those images. Some images are missing:
Maybe @vladbogo you want to give it a try? I suggest you only build the images you are working on by commenting the CI action file, see https://github.com/fauust/mariadb.org-tools/blob/bb-build-container/.github/workflows/bb_containers.yml#L30-L33. Please take a look at the |
e2a254c
to
7c84295
Compare
7c84295
to
81435e9
Compare
|
@fauust Can find Containers from quay.io |
|
Hi @illuusio! The URL is in the commit: |
a62a7f5
to
cdfe5d5
Compare
|
@vladbogo please can you do the final review and merge so you can start working on the new dockerfiles? |
cdfe5d5
to
e6b5728
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi Faustin. Overall looks good. We will probably have a hard time trying to validate the RPM images. Maybe we can think of an automatic way to do that. Other than that I found some minor issues, but looks good. I also tested some of the images. Apart from the WORKDIR problem, they seem to be in a state where at least the build will not fail. Debian-9 seems to have some issues related to Python packages which I failed to debug, but I will look into it after the merge.
e442871
to
aea5f8a
Compare
This permits to build multi-arch containers in GH action CI. If check passes, images are pushed to quay.io (https://quay.io/repository/mariadb-foundation/bb-worker). Two couples of secrets are needed for the CI to work: - RHEL subscription credentials (only needed to build RHEL images); - quay.io robot token. If those are not provided, the CI will build and check non-rhel based images but it will not try to push it to the quay.io registry. TODO: - rebuild only dockerfiles that have changed; - schedule build.
aea5f8a
to
cc495a4
Compare
@vladbogo, @grooverdan this is a first attempt to build BB containers in a CI, comments are welcome!
Please take a look at the following TODO list, also @vladbogo has created a jira task so we can discuss and list all the requirements for this (https://jira.mariadb.org/browse/MDBF-273).
@vladbogo I am interested in testing those containers on BB (above all non amd64 arch because they are build with QEMU emulation). You can fetch them directly from https://hub.docker.com/r/fauust/bb/tags?page=1&ordering=last_updated
Example:
docker pull fauust/bb:ppc-debian-10Finally, take a look at the final step (
Check Dockerfile with hadolint) of the CI. This is a non failing test (for the moment) and it gives indications on what should be improved (or ignored) in the Dockerfiles.TODO: