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

Automated building of images #36

Closed
marcbria opened this issue May 12, 2021 · 3 comments
Closed

Automated building of images #36

marcbria opened this issue May 12, 2021 · 3 comments
Labels
outdated The issue refers to old versions and won't be fixed.

Comments

@marcbria
Copy link
Collaborator

Context

One of my credos is "a job that can be done by a machine, deserves to be done by a machine".
Right now, pkp-ojs official images are created manually.

The process is as follows:

  1. PKP releases a new git tag or branch.
  2. Got the notification (from forum, slack, mailing list or gitHub RSS).
  3. Add the new version to versions.list file.
  4. Edit build.sh to specify the php version of the new release.
  5. Run "sudo build.sh" to generate the new version files and/or rebuild old ones.

If there is no need of new templates (for instance, in case we need to move to php74 or add new php_modules or libraries or tools) those steps could be automatized quite easily.

... At this point we have all ready to build new images locally, but we like to offer our images prebuilt from dockerHub, so more (manual) extra steps need to be done to create our docker tags according to the naming convention that we decided here.

And DockerHub comes to rescue with powerful automation tools to build "each time github is updated":

imagen

This will work great with "stable-*" images (highlighted in green in the screenshot), but will require from manual intervention to create the tag names in the immutable images (in red).

This issue is opened to talk in detail about how all this work could be automated.

@marcbria
Copy link
Collaborator Author

marcbria commented May 12, 2021

About 1: Discover a new version.
We can run a cron twice a day (no need more than this) asking PKP's gitHub for all branches/tags and diff with a local copy.
If there is a difference, it can run 4.

About 2: Add the new version
We can get it from 1 or we can ask again to PKP's github to get a full list of branches and tags.
We also need to keep a list of "banned" versions with the names of the versions that we don't like to build any more.
This could be implemented in build.sh.

About 3: php version for ojs version
We can keep a file files with php versions (php5.6.list / php7.3.list...) and assume the greatest php version avaliable if the ojs version is not found in the phpX.list files.
Again, this could be implemented in build.sh.

About 4: Run build.sh
Cron could be the responsible of running build and then, push it to gitHub.

About building in "DockerHub":

DockerHub will do alone the job for "static-*" images... but I don't know how to automatically create new docker-names.

One option would be building locally and pushing to DockerHub (not sure how, but seams feasible).

Other option is explore DockerHub advanced "autobuild" features to create names based on the original repo:
(but our docker-ojs is not creating any branches/tags so it will mean we will need to rethink and add probably add Dockerfiles to OJS repo).
imagen

Probably most promising is "remote build triggers".
If I understand it well, you can ask DockerHub to do the build by a simple curl call

Some additional information about it:

@marcbria
Copy link
Collaborator Author

DockerHub removed this feature this summer.
Testing gitLab CI/CD tools that are supposed to do the job and is real opensource (no vendor lock-in).

@marcbria marcbria added the outdated The issue refers to old versions and won't be fixed. label Feb 28, 2024
@marcbria
Copy link
Collaborator Author

Builds are now in gitLab and will be moved to gitHub Actions.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
outdated The issue refers to old versions and won't be fixed.
Projects
None yet
Development

No branches or pull requests

1 participant