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

MDBF-773 - QUAY,GHCR move / create tags for Production images #552

Merged

Conversation

RazvanLiviuVarzaru
Copy link
Collaborator

@RazvanLiviuVarzaru RazvanLiviuVarzaru commented Aug 29, 2024

Implement dev tag feature as per MDBF-773.

Scope:

  • speed up production releases.
  • implement a way to test the images in the Buildbot development instance before they are ready for Production.

Description:

  • BuildBot (Development) will work with images tagged with DEV_ . Switching between different registries is achieved via an environment variable.
  • every push to a non-Main branch will create DEV_ tags (builds + push ghcr, quay).
  • pushes to Main will trigger a manifest copy in the upstream registry (no rebuild).

Other improvements:

  • build RHEL images for changes pushed to a non-Main branch. No Builds for forks / PR's.
  • Release container uses workflow template.

Considerations:

  • workflow dispatch supports a maximum of 10 input parameters.

.github/workflows/bbw_build_container_template.yml Outdated Show resolved Hide resolved
.github/workflows/bbw_build_container_template.yml Outdated Show resolved Hide resolved
@RazvanLiviuVarzaru RazvanLiviuVarzaru changed the title Feature/build strategy MDBF-773 - QUAY,GHCR move / create tags for Production images Aug 29, 2024
@RazvanLiviuVarzaru RazvanLiviuVarzaru marked this pull request as ready for review August 29, 2024 19:32
Make BB be environment aware when choosing the image tag.
Development environment will use tags starting with dev_

- define CONTAINER_REGISTRY_URL environment variable for both Prod/Dev
- default is required i.e. Production not running in containers
- pushes to other buildbot branch other than Main will create an image tagged with dev_
- forks / pull request - Only Build
- pushes to Main will update the tags with skopeo copy on the same upstream registry
- forks / PR's won't build. Only checking the Dockerfile
- pushes to other branches than Main will build and push a DEV_ tag
- pushed to Main will update the tag with skopeo copy on the same upstream registry
- the release container will use DEV tags
Copy link
Collaborator

@vladbogo vladbogo left a comment

Choose a reason for hiding this comment

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

Maybe consider moving the CONTAINER_REGISTRY_URL in the create_worker function and only pass the tag as a param when using addWorker

Copy link
Collaborator

@fauust fauust left a comment

Choose a reason for hiding this comment

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

That's a really really nice improvement!
This PR is quite big (and I understand why), but it's difficult to be entirely sure with my review. To proceed I think that (after the small change requested), it's okay to merge to DEV and start verifying directly on the DEV infra that everything looks OK.

I don't see how this could impact production if merged only on dev branch but probably other should confirm.

.github/workflows/bbw_build_container_rhel.yml Outdated Show resolved Hide resolved
docker-compose/.env Show resolved Hide resolved
@RazvanLiviuVarzaru
Copy link
Collaborator Author

RazvanLiviuVarzaru commented Aug 30, 2024

That's a really really nice improvement! This PR is quite big (and I understand why), but it's difficult to be entirely sure with my review. To proceed I think that (after the small change requested), it's okay to merge to DEV and start verifying directly on the DEV infra that everything looks OK.

I don't see how this could impact production if merged only on dev branch but probably other should confirm.

@fauust
I will merge this to DEV with CI disabled and then manually run all the workflows and create the DEV _ tags.
Then a test on BB-DEV on a few builders and I will watch the workers closely to see if they are pulling the DEV tag.

As for Production impact.
The merge to main should be done with CI disabled, no need to update the tags, but I'm thinking of a few workflows to let them update to tags just to confirm the feature is working properly.

@RazvanLiviuVarzaru
Copy link
Collaborator Author

RazvanLiviuVarzaru commented Aug 30, 2024

Maybe consider moving the CONTAINER_REGISTRY_URL in the create_worker function and only pass the tag as a param when using addWorker

@vladbogo so if I understand correctly, most of the time adding a worker follows the above steps:
invoke AddWorker function --> addWorker will invoke createWorker function which is defined in utils.py

And we have a small percentage of workers which are defined directly without using the addWorker function but rather appending directly to c["workers"] list .

Your suggestion is really good but I would keep this kind of refactoring for a different patch where we normalize all worker addition to follow the addWorker path. I'm a little bit concerned about adding it to this patch as there are already a lot of changes .

@RazvanLiviuVarzaru RazvanLiviuVarzaru merged commit 7074c07 into MariaDB:dev Aug 30, 2024
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

4 participants