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

[SYNPY-1341] Add CI step to containerize and upload synpy to the GHCR #1100

Merged
merged 36 commits into from
May 29, 2024

Conversation

jaymedina
Copy link
Collaborator

@jaymedina jaymedina commented May 22, 2024

problem

We recently added a GHCR image for the python client because there was no up-to-date image hosted anywhere. We should add a step to the CI workflow to publish new versions of the client as docker images automatically when a new version is released.

solution

Two new jobs (ghcr-build-and-push-on-merge, ghcr-build-and-push-on-develop) are created to build a multi-platform image of the repository and push it to the GitHub Container Registry.

ghcr-build-and-push-on-release

  • The job should be triggered only for an official version release
    - [ ] The docker image should be multi-platform (AMD64, ARM64)
  • The docker image tag should be named after the release version number

ghcr-build-and-push-on-develop

  • The job should be triggered only for pushes to develop (i.e. PR merges)
    - [ ] The docker image should be multi-platform (AMD64, ARM64)
  • The docker image tag should be named after the latest commit SHA on develop

testing & preview

ghcr-build-and-push-on-release

I manually fed a version v1.2.3test that will be fed into the Build and push Docker image step to test that this communication happens between Extract Release Version and Build and push Docker image.
image

Triggering the job results in a new release with the expected version name
image

I pulled the docker image and ran a container to confirm that the latest version v4.2.0 of the python client is running in the container:
image

ghcr-build-and-push-on-develop

develop image tag name reflects the latest commit it points to. Below is the example for commit 8303999 of this branch:

image

@jaymedina jaymedina changed the title [SYNPY-1341] Add CI step to containerize and release synpy to the GHCR [SYNPY-1341] Add CI step to containerize and upload synpy to the GHCR May 22, 2024
@jaymedina jaymedina marked this pull request as ready for review May 28, 2024 23:19
@jaymedina jaymedina requested a review from a team as a code owner May 28, 2024 23:19
Copy link
Contributor

@rxu17 rxu17 left a comment

Choose a reason for hiding this comment

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

LGTM! Just a question

.github/workflows/build.yml Show resolved Hide resolved
Copy link
Contributor

@BryanFauble BryanFauble left a comment

Choose a reason for hiding this comment

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

Excellent work!

@jaymedina
Copy link
Collaborator Author

jaymedina commented May 29, 2024

This PR is now ready for a final review.

Latest changes:

  • Each push to develop will trigger the job to generate a new image tagged with develop-[commit SHA] so that all images can be traced back to a point in the commit history. Examples:
image
  • TLDR: The scope of this PR is adjusted to work with single platform images. The support of multi-platform images will be an enhancement ticket after this one is complete. The original intention was to support multi-platform images, however the way this has been working so far has led to untagged images being pushed alongside the official tagged image (see example below). These untagged images seem to be individual layers corresponding to one of the designated platforms (e.g. linux/arm64 created an untagged image, and linux/amd64 creates another). These extra untagged images being pushed to the registry add extra clutter, which I would like to minimize since the develop images will be filling up the registry on top of this, so I'll be opening a new ticket for tackling this behavior in a separate PR, and this feature will introduce automating the creation and push of SINGLE platform images onto the registry.

image

Feedback is welcome. Thanks!

Copy link
Contributor

@BryanFauble BryanFauble left a comment

Choose a reason for hiding this comment

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

This all looks good to me! We can test this out and adjust based on feedback.

@jaymedina
Copy link
Collaborator Author

Great thanks @BryanFauble - Once all tests pass I'll squash and merge this.

@jaymedina jaymedina merged commit 486aefc into develop May 29, 2024
23 checks passed
@jaymedina jaymedina deleted the SYNPY-1341-ghcr-step branch May 29, 2024 19:45
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.

None yet

4 participants