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

🌱 Add github action to trigger container images build #1456

Merged

Conversation

mquhuy
Copy link
Member

@mquhuy mquhuy commented Nov 22, 2023

This PR adds an action to trigger the bmo and keepalived container builds whenever a PR is merged in this repo.

@metal3-io-bot metal3-io-bot added the size/M Denotes a PR that changes 30-99 lines, ignoring generated files. label Nov 22, 2023
@mquhuy mquhuy force-pushed the mquhuy/add-container-image-build-action branch 2 times, most recently from 3021677 to 23bb442 Compare November 24, 2023 10:07
@elfosardo
Copy link
Member

/test-ubuntu-integration-main
/test-centos-e2e-integration-main

@elfosardo
Copy link
Member

/lgtm

@metal3-io-bot metal3-io-bot added the lgtm Indicates that a PR is ready to be merged. label Nov 24, 2023
@mquhuy mquhuy force-pushed the mquhuy/add-container-image-build-action branch from 23bb442 to c18f646 Compare November 24, 2023 13:38
@metal3-io-bot metal3-io-bot removed the lgtm Indicates that a PR is ready to be merged. label Nov 24, 2023
@mquhuy mquhuy force-pushed the mquhuy/add-container-image-build-action branch from c18f646 to 3a54ea8 Compare November 24, 2023 13:43
@mquhuy
Copy link
Member Author

mquhuy commented Nov 27, 2023

/hold

@metal3-io-bot metal3-io-bot added the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Nov 27, 2023
@mquhuy mquhuy force-pushed the mquhuy/add-container-image-build-action branch 2 times, most recently from 152ca40 to 562464c Compare December 1, 2023 10:55
job_name: "metal3_keepalived_container_image_building"
job_params: |
{
"BUILD_CONTAINER_IMAGE_NAME": "keepalived",
Copy link
Member

Choose a reason for hiding this comment

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

How does this job know which Dockerfile to build for keepalived?

Copy link
Member Author

Choose a reason for hiding this comment

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

Copy link
Member

Choose a reason for hiding this comment

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

Is that file used for anything else? It seems that we could pass that information via the env, so we wouldn't need to maintain a separate file, that is then out of sync. For example, utliity-images or sles-ipa repo etc.

Same argument as having the tag config in the workflow, we could have this config in the workflow as well?

Copy link
Member Author

@mquhuy mquhuy Dec 1, 2023

Choose a reason for hiding this comment

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

I think you have a good argument, but there're a couple of reasons that I still prefer a centralized database of images:

  1. I don't like the idea of putting repo address as parameter, which is error-prone imo. Any small typo could fail the job, while we actually still have cases when we need to run the builds manually.
  2. Having no centralized file means we will allow build and push of any repos, not just the ones we care about. Anyone on Nordix jenkins can trigger it, it can build anything, and all will be pushed to our repository in quay.

Copy link
Member

Choose a reason for hiding this comment

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

  1. Typo anywhere would make it fail. You can probably get it via GH reference, same as branch anyways.
  2. I don't think they can run builds. You need group membership to launch them. As anon, I cannot access any build option. If it was possible, our current jobs could be equally abused as they're all parametrized.

Copy link
Member Author

Choose a reason for hiding this comment

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

  1. Yes, but typo in url is generally harder to check. And I think the bigger problem than failed jobs is jobs that do the wrong things, and generally more params = more errors. That's of course not a problem with github triggered runs, but we still have manual builds. It can happen that we paste one url while were meant to use another: say we want to build bmo but mistakenly use url from capm3 --> BMO image will be pushed with capm3 content, quite difficult to check.
  2. I agree, I'm not sure regarding of jenkins permissions, it's likely that only us can trigger those jobs. Anyway, my points regarding the "any image" still checks.

Copy link
Member

Choose a reason for hiding this comment

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

  1. We won't allow pushing images from manual builds, so that is non issue.

Copy link
Member Author

Choose a reason for hiding this comment

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

How do you check that, if I may ask? And if I recall correctly, one of the requirements was that the workflow should allow custom builds should it's needed.

Copy link
Member

Choose a reason for hiding this comment

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

This was cleared off-line.

We do not do manual or custom builds that are built to Quay. We define the tag patterns in the workflow file, and the typical list is:

  • main/latest for main branch updates
  • release-* tags for release branch updates
  • v* tags or capm3-v* tags for releases

We do keep X number of builds that are timestamped + sha encoded for the branch builds.

We do not want to build lightweight tags like:

  • apis/v*

And we definitely do not support building and pushing images based on user input that might mess up with the above mentioned "official" images.

@mquhuy mquhuy force-pushed the mquhuy/add-container-image-build-action branch from bf49fd0 to 8c99098 Compare December 7, 2023 07:58
@mquhuy
Copy link
Member Author

mquhuy commented Jan 10, 2024

/unhold

@metal3-io-bot metal3-io-bot removed the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Jan 10, 2024
Copy link
Member

@tuminoid tuminoid left a comment

Choose a reason for hiding this comment

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

/lgtm

@metal3-io-bot metal3-io-bot added the lgtm Indicates that a PR is ready to be merged. label Jan 10, 2024
@tuminoid
Copy link
Member

/override test-centos-e2e-integration-main test-ubuntu-integration-main
Not relevant.

@metal3-io-bot
Copy link
Contributor

@tuminoid: Overrode contexts on behalf of tuminoid: test-centos-e2e-integration-main, test-ubuntu-integration-main

In response to this:

/override test-centos-e2e-integration-main test-ubuntu-integration-main
Not relevant.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

@tuminoid
Copy link
Member

/override metal3-bmo-e2e-test
/assign @kashifest

@metal3-io-bot
Copy link
Contributor

@tuminoid: Overrode contexts on behalf of tuminoid: metal3-bmo-e2e-test

In response to this:

/override metal3-bmo-e2e-test
/assign @kashifest

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

Copy link
Member

@kashifest kashifest left a comment

Choose a reason for hiding this comment

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

/approve

@metal3-io-bot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: kashifest

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@metal3-io-bot metal3-io-bot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Jan 15, 2024
@kashifest kashifest changed the title ✨ Add github action to trigger container images build 🌱 Add github action to trigger container images build Jan 15, 2024
@metal3-io-bot metal3-io-bot merged commit c9467a0 into metal3-io:main Jan 15, 2024
16 checks passed
@metal3-io-bot metal3-io-bot deleted the mquhuy/add-container-image-build-action branch January 15, 2024 09:00
@tuminoid
Copy link
Member

Disabled build triggers in Quay for BMO and keepalived. It should now all flow thru this workflow + Jenkins.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. lgtm Indicates that a PR is ready to be merged. size/M Denotes a PR that changes 30-99 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants