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

Consider using GitHub Actions to build Docker images #65

Closed
10 tasks done
mikegerber opened this issue Feb 6, 2023 · 11 comments
Closed
10 tasks done

Consider using GitHub Actions to build Docker images #65

mikegerber opened this issue Feb 6, 2023 · 11 comments
Assignees

Comments

@mikegerber
Copy link
Member

mikegerber commented Feb 6, 2023

GitHub Actions is free for public repositories (unlike CircleCI and Travis CI).

  • Branch test/github-actions
  • Build based on matrix
  • Dynamically create build matrix
  • Tag images based on branch IF all builds were successful
  • Correct tags for branch/release tags
  • It should be possible to run edge (or any other tag) instead of latest
  • Processors should work with the default models/resources #46
  • Test built container images
  • Rename DRONE_COMMIT
  • Remove build on test branch again
@mikegerber mikegerber self-assigned this Feb 6, 2023
@mikegerber
Copy link
Member Author

I'd prefer using this over a private Drone CI installation or even Jenkins. Reasons:

  • Jenkins does not spark any joy at all.
  • I do not want to maintain a Drone CI installation if not necessary.
  • I also would like to have the CPU/IO load at GitHub
  • Drone CI has some shortcoming/inflexibilites
  • GitHub Actions was really great to use in another project, I just need to see if it can cope with this multiple-image build
  • I'd much prefer a transparent build process (i.e. people can audit the logs) over a private build

@mikegerber
Copy link
Member Author

This might make it possible to only tag all images latest (#64) if all images are built successfully:
https://stackoverflow.com/questions/59180385/using-an-array-of-values-to-repeat-a-step-in-github-actions-workflow

Pseudo code:

  • fail if anything is wrong ("set -e")
  • build image
    for image in images
  • tag image latest
    for image in images

@mikegerber
Copy link
Member Author

Finally all builds work in the test branch:

https://github.com/qurator-spk/ocrd-galley/actions/runs/4145656085

This just needs some polishing (setting the correct tags for a release), testing and then prebuilt images are finally usable again.

@mikegerber
Copy link
Member Author

* [x]  It should be possible to run `edge` (or any other tag) instead of `latest`

Yeah, it's done by setting DOCKER_IMAGE_TAG and the build already uses it, I just forgot.

@mikegerber
Copy link
Member Author

* [ ]  Tag images based on branch IF all builds were successful

Done in test/github-actions!

@mikegerber
Copy link
Member Author

* [ ]  Correct tags for branch/release tags

Our config of docker's meta-data-action should do this fine:

        type=ref,event=branch
        type=semver,pattern={{version}}

I've only tested the event=branch part, but the semver version tags should work fine.

@mikegerber
Copy link
Member Author

* [ ]  Test built container images

We currently just 1. call a few processor --versions, and 2. tested manually. This is not perfect, but for now this suffices.

@mikegerber
Copy link
Member Author

* [ ]  Rename `DRONE_COMMIT`

Now using GIT_COMMIT. It uses the sha- prefix from metadata-action but as I think most users wouldn't use it anyway and we are the main users ourselves (used in the build), that's alright.

@mikegerber
Copy link
Member Author

#46 is now solved in a minimal way to make these images work. Going to add some documentation and then this is ready to be merged!!

@mikegerber
Copy link
Member Author

This is now merged!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant