-
Notifications
You must be signed in to change notification settings - Fork 18
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 and publish 'decidim' and 'decidim-generator' images on Github. #50
Build and publish 'decidim' and 'decidim-generator' images on Github. #50
Conversation
@tramuntanal @oriolgual what do you think? (pinging the two of you as you're the latest committers :) I'm assuming you're both maintaining the repo?) |
Hi @oliverbarnes, this looks great! |
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.
I understand that by merging this PR we would have two parallel ways to push to docker hub.
It would be better to stick with only one.
@oliverbarnes how do you propose to do the transition?
Good question, I don't I have a clear path in mind yet and would like to discuss. The workflow in this PR actually pushes to Github's own registry, but it could publish to Docker Hub as well. I'm publishing to GH here as it integrates well with Github Actions and it's an alternative to consider in face of Docker Hub's latest restrictions to repos on free plans. Docker Hub has the clear advantage of being the default, one just has to run: docker run decidim:latest as opposed to this in Github's case: docker run docker.pkg.github.com/decidim/docker/decidim:latest With Github the user also needs to be previously authenticated with GH beforehand, whereas Docker Hub allows for anonymous pulls (for now). Here's a comparison between both registry's (and Amazon's), for reference. One possibility is to publish to both for a while, to see how it goes?
That's true. I'm proposing to replace the build scripts and circle ci with the Github workflow. |
Note that this also changes the name of the image generated from the main Dockerfile from |
I've set this PR back to draft, and am now updating the workflow according to the reviews on a sandbox PR against my own repo, to test out the build there on pull request rather than on merge: https://github.com/oliverbarnes/decidim-docker/pull/2 |
Just learned about the new Github Container Registry in beta, which will replace the Package Registry. I haven't read-up much on it yet, but it'll at least allow for shorter image urls: ghcr.io/decidim/decidim Instead of
(it won't be repo based) |
Ready for another pass. Updates:
|
Ended up switching to the new registry already, as it fixes an issue I was having with publishing the built Here are the published images on the new registry, published through my account while this is WIP: https://github.com/users/oliverbarnes/packages/container/package/decidim-generator |
keeps original circleci workflow for now, and moves original Dockerfiles to a separate directory, for backwards compatibility
@tramuntanal would you review this again when you get a chance, please? |
@tramuntanal Docker Hub publishing is preserved and automated Github publishing is now done in parallel (and we can eventually publish to Docker Hub as well). I think this is good for another review and possibly merge? Merging now would be good to unblock work on automating releases, and work that's under way with configurable images (#61) as well 🙏 |
@oliverbarnes we must take into account that other repos are using *-test images to execute their test suites like https://github.com/AjuntamentdeBarcelona/decidim-barcelona, https://github.com/AjuntamentdeBarcelona/decidim-barcelona-organizations or https://github.com/AjuntamentdeBarcelona/decidim-barcelona, when we have this merged we should check these repos |
Thanks @tramuntanal! That's good to know - I've created an issue to add it to the flow, as well as the *-dev images. |
Btw, @tramuntanal a few steps are still needed to be taken for the flow to be enabled:
|
A first stab at building Decidim docker images using Github Actions.
You can see it in action (pun intended) here: https://github.com/oliverbarnes/decidim-docker/actions?query=workflow%3ACI
The images are published to the new Github Container Registry, available in beta and opted-in through the organization's settings.
Images generated during testing this PR ca be seen here:
https://github.com/users/oliverbarnes/packages/container/package/decidim-generator
https://github.com/users/oliverbarnes/packages/container/package/decidim
It adapts the existing Dockerfile and Dockerfile-deploy files to build images and publish them to the Github registry. It doesn't build the
-dev
and-test
Dockerfiles, as there's an ongoing discussion about which should be the canonical images (#53).(The original circleci workflow publishing to Docker Hub is preserved, with original Dockerfiles, and can be run in parallel during a transition period.)
Note that this also changes the name of the image generated from the main Dockerfile from
decidim
todecidim-generator
, to better describe that the image contains the ruby/node env to generate a Decidim app, leaving thedecidim
image name for the deployable production image generated from Dockerfile-deploy.The Github workflow extracts the Decidim version from the latest decidim/decidim repo tag, and latest ruby version from the .ruby-version file on the same repo and tag.
Not implemented yet: triggering this automatically when a new decidim/decidim tag is released. There's a possible route available through repository dispatchesAutomatic triggering of this build is ready for review at decidim/decidim#6931.
Closes #49