Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

General Makefile update and support for building multi-arch images #429

Merged
merged 8 commits into from
May 21, 2021
Merged

General Makefile update and support for building multi-arch images #429

merged 8 commits into from
May 21, 2021

Conversation

gouttegd
Copy link
Contributor

@gouttegd gouttegd commented May 20, 2021

This PR replaces both PR #422 and #423.

It provides:

  • streamlined Makefile rules [1];
  • support for building multi-arch images (x86_64 and arm64) with buildx;
  • automatic building and publishing of images upon release [2];
  • the possibility to manually trigger the GitHub Actions workflows if necessary.

It also fixes running the tests in situations where the user calling make tests does not have a ~/.gitconfig file.

[1] As part of this change, make docker-build becomes make build and make docker-test becomes make tests; the README has been updated accordingly to provide up-to-date instructions.

[2] Automatically publishing the images requires the repository to be configured with two secrets for the username and password for the obolibrary Docker account (DOCKER_USERNAME and DOCKER_PASSWORD).

Running the test suite requires a minimal Git configuration. The
seed-via-docker.sh script normally takes care of that by mapping the
calling user's own $HOME/.gitconfig file inside the Docker container
used to run the tests, but this assumes that the calling user does have
a .gitconfig file -- an assumption that is seemingly wrong on the
machines used to run the Github Actions workflows.
Rewrite some rules to avoid duplicated recipes. Remove useless docker-
prefix from rule names. Add rules to build multi-arch images.
The deploy_m1 script is no longer necessary now that we can build
multi-arch images from the standard Makefile.
Add a section in the developers' README on how to use buildx to build
multi-arch images.
Add a workflow triggered on each release to build the multi-arch images
and push them to Docker Hub.
Configure the build-and-test workflow to be automatically triggered only
when a PR is opened, not everytime it is updated with new commits (to
save runtime credits).

Also add the possibility to manually trigger the workflows.
@gouttegd gouttegd requested a review from matentzn May 20, 2021 17:31
Copy link
Contributor

@matentzn matentzn left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just some comments, but will try to test soon! Thanks a ton for this! Great work!

.travis.yml Outdated Show resolved Hide resolved
docker/odklite/Makefile Outdated Show resolved Hide resolved
docker/robot/Makefile Show resolved Hide resolved
We won't use Travis CI anymore now that we have the GA workflows in
place.
The VERSION variable in docker/odklite/Makefile is overriden by the
top-level Makefile, bit it should still be kept in sync in the sub-level
Makefile in case someone wants to build odklite only.
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants