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

refactor(deploy): replace Makefile with build-push-action #3733

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

cweider
Copy link
Collaborator

@cweider cweider commented Feb 3, 2024

With the Makefile radically simplified by #3260, the work that it does can easily be done by a docker/build-push-action step in the deployment workflow. Beyond this simplicity, the use of the action makes build caching available and will trim a decent amount of time from the build job.

In this change, the method of referring to the image is changed: instead of a tag (e.g. c29346b-prod) the digest of the uploaded image is used. The digest is an unambiguous and immutable reference to an image, where a tag can be changed. For this reason, it's recommended for deployments (see https://cloud.google.com/kubernetes-engine/docs/concepts/about-container-images).

Also in this change is the use of docker/metadata-action. It is configured to produce the same tags as before (c29346b-prod), but it is capable of doing much more. A future direction is to replace the sha-based tag with either a build date or build id ($RUN_ID-$RUN_ATTEMPT). For now we only introduce labels, which attaches creation date and the full sha SHA to the built images.

With the Makefile radically simplified by freelawproject#3260, the work that it
does can easily be done by a `docker/build-push-action` step in the
deployment workflow. Beyond than simplicity, the use of the action
makes build caching available and will trim a decent amount of time
from the build job.

In this change, the method of referring to the image is changed:
instead of a tag (e.g. `c29346b-prod`), the digest of the uploaded
image is used. The digest is an unambiguous and immutable reference
to an image, whereas a tag can change and cause surprises. For this
reason, it's recommended for deployments (see https://cloud.google.com/kubernetes-engine/docs/concepts/about-container-images).

Also in this change is the use of `docker/metadata-action`. It is
configured to produce the same tags as before (`c29346b-prod`), but
it is capable of doing much more. A future direction is to replace
the `sha` tag with either a build date or build id (`$RUN_ID-$RUN_ATTEMPT`).
For now we only introduce `labels`, which add the creation date and
full sha SHA to the built image.
@mlissner
Copy link
Member

mlissner commented Feb 3, 2024

This looks good to me, but I'd love some more eyes since it could affect the dev workflow. I'm going to flag it in our internal slack channel for folks to look at.

@mlissner
Copy link
Member

@blancoramiro, this one got stalled a month+ ago because I didn't feel confident to merge it. Can you take a look?

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

Successfully merging this pull request may close these issues.

None yet

2 participants