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

Move container images creation to release workflow #386

Merged
merged 1 commit into from
Jul 28, 2023

Conversation

mgoerens
Copy link
Contributor

This makes it possible to retrigger the entire release process, including all assets creation, by retagging the main branch.

Starting with this commit, build triggers on the
quay.io/redhat-certification/chart-verifier repo are no longer needed.

close #383

Comment on lines 107 to 110
tags: |
${{ steps.get_tag.outputs.release_version }}
latest
main
Copy link
Contributor

Choose a reason for hiding this comment

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

This syntax looks strange. The doc does seem to imply you can specify multiple tags separated by whitespace, so I'm sure this works, but wow it looks odd! (Feel free to resolve this, as there's no action I'm really looking to have done here)

Copy link
Contributor

Choose a reason for hiding this comment

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

Actually, I lied - I'm pretty sure we don't want to tag main here. Maybe latest. This is a release workflow that triggers on tags. Main and often will contain commits that are beyond a given release.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Sorry about the syntax 🙃 I agree it's not super pretty, but I'd say I've seen worse.

You're right, I'll remove building and pushing of main. I'm wondering if we should keep the Build Trigger or create a new Github Workflow to build the main image.

To clarify, we have 4 types of images:

  • x.y.z (i.e. version tags): built as part of the release process (currently using Quay Build Triggers, replaced in this PR by a step in "release.yaml" worfklow)
  • latest: follows the latest x.y.z. Currently retagged at the end of the "build.yaml" on release, moved in this PR to "release.yaml"
  • 0.1.0 (i.e. dev release): built on each push to the main branch, currently in "dev_release.yaml" workflow. I think we should leave this untouched.
  • main: built for each push on the main branch via a Quay Build Trigger.

So, AFAICT the 0.1.0 and the main tag are always in sync. How do we want to build main ? We have following options:

  1. Leave the current Build Trigger untouched.
  2. Create a new GitHub workflow specifically for building the main image (triggered on each push to the main branch)
  3. Reuse the "dev_release.yaml" workflow as it is triggered for each push to the main branch already, and integrate building the main image there.

Not a big fan of 3. personally, as I prefer to separate concerns. 1. means that we keep a build trigger active, and I was hoping to get rid of all Build Triggers here (not that I dislike Build Triggers, but I'd prefer having all the builds happening in the same place i.e. GitHub Actions). That leaves us with 2., even though I'd prefer not to create yet another workflow, I believe that's reasonable.

Copy link
Contributor

Choose a reason for hiding this comment

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

Option 2 or 3 is the right way forward. We don't have to make them the same workflow, we can just make the existing workflow for 0.1.0 reusable. Easy enough!

Copy link
Contributor

Choose a reason for hiding this comment

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

Clarity: Dealing with the main tag doesn't need to happen in this PR. We can do it at a later time. The build trigger won't go away until this lands anyway.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I added a workflow for tagging the main branch in this PR.

podman build \
-t quay.io/redhat-certification/chart-verifier:$image_tag \
-t quay.io/redhat-certification/chart-verifier:latest \
-t quay.io/redhat-certification/chart-verifier:main .
Copy link
Contributor

Choose a reason for hiding this comment

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

Same thing here re: main (see other comment for details)

run: |
# Build podman images locally
image_tag=${{ steps.get_tag.outputs.release_version }}
podman build \
Copy link
Contributor

Choose a reason for hiding this comment

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

Do we want this to exist as a make target?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Created a make target

Copy link
Contributor

@komish komish left a comment

Choose a reason for hiding this comment

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

Couple of things to consider mentioned in comments. Otherwise, looks pretty good. Once merged, I'll go disconnect the Quay auto-build.

Oh! You might want to remove the build status from README.md.

@mgoerens mgoerens requested a review from komish July 27, 2023 14:10
This makes it possible to retrigger the entire release process,
including all assets creation, by retagging the main branch.

Starting with this commit, build triggers on the
quay.io/redhat-certification/chart-verifier repo are no longer needed.

close redhat-certification#383
@mgoerens mgoerens force-pushed the move_container_build branch 2 times, most recently from a523da1 to 1f8b13a Compare July 28, 2023 15:16
Copy link
Contributor

@komish komish left a comment

Choose a reason for hiding this comment

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

/lgtm

Build triggers have been disabled in Quay.

@komish komish merged commit 1062421 into redhat-certification:main Jul 28, 2023
5 checks passed
@mgoerens mgoerens deleted the move_container_build branch July 31, 2023 08:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Build container images in the release workflow instead of using Build triggers
2 participants