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 actions to publish images to GH registry #307

Merged
merged 2 commits into from
Apr 19, 2024

Conversation

ykulazhenkov
Copy link
Contributor

@ykulazhenkov ykulazhenkov commented Apr 18, 2024

What this PR does / why we need it:
Add support for multiach (linux/amd64,linux/arm64,linux/ppc64le) image build with GitHub actions and publish resulting images to Github registry.

Special notes for your reviewer:
Example of PR check: https://github.com/ykulazhenkov/ovs-cni/actions/runs/8735994526
Example of push to master: https://github.com/ykulazhenkov/ovs-cni/actions/runs/8735447193
Example of push on release: https://github.com/ykulazhenkov/ovs-cni/actions/runs/8735569774

Example of artifacts: https://github.com/ykulazhenkov/ovs-cni/pkgs/container/ovs-cni

Validate binary arch:

root@cloud-dev-17:~/foo# docker pull --platform linux/arm64 ghcr.io/ykulazhenkov/ovs-cni:v0.0.1
v0.0.1: Pulling from ykulazhenkov/ovs-cni
0117dee8e815: Already exists 
0176767d615d: Already exists 
79424b46edd7: Already exists 
90e055d9c187: Already exists 
Digest: sha256:8b03ff2b9869dff82e07e26a80c3b9ce25c3e99c34abcc05ffae29c00c51d27c
Status: Downloaded newer image for ghcr.io/ykulazhenkov/ovs-cni:v0.0.1
ghcr.io/ykulazhenkov/ovs-cni:v0.0.1

root@cloud-dev-17:~/foo# docker create ghcr.io/ykulazhenkov/ovs-cni:v0.0.1
WARNING: The requested image's platform (linux/arm64) does not match the detected host platform (linux/amd64/v4) and no specific platform was requested
917e6995414181c0f56763b5848e58c11d46fe00932153126565b3add962d881

root@cloud-dev-17:~/foo# docker cp 917e6995414181c0f56763b5848e58c11d46fe00932153126565b3add962d881:/ovs .
Successfully copied 7.74MB to /root/foo/.

root@cloud-dev-17:~/foo# file ovs
ovs: ELF 64-bit LSB executable, ARM aarch64, version 1 (SYSV), statically linked, Go BuildID=ve0PYRQc45bRGHwoMZ6U/6uwx9CZDgopFlyJ4crUm/IPjfOx0tRjSzN9X3qlNH/Ih4mI5QNFRHHMAWezQzy, not stripped

Release note:

NONE

Based on a great work by @zeeke in another k8snetworkplumbingwg repo.

@e0ne @SchSeba please, take a look

@kubevirt-bot kubevirt-bot added release-note-none Denotes a PR that doesn't merit a release note. dco-signoff: yes Indicates the PR's author has DCO signed all their commits. needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. labels Apr 18, 2024
@kubevirt-bot
Copy link
Collaborator

Hi @ykulazhenkov. Thanks for your PR.

I'm waiting for a k8snetworkplumbingwg member to verify that this patch is reasonable to test. If it is, they should reply with /ok-to-test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work. Regular contributors should join the org to skip this step.

Once the patch is verified, the new status will be reflected by the ok-to-test label.

I understand the commands that are listed here.

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.

@phoracek
Copy link
Member

/retest

@phoracek
Copy link
Member

@ykulazhenkov this is great, thank you. Would you please also update the manifests, so they reference the new image location instead of Quay? It should be enough to update https://github.com/k8snetworkplumbingwg/ovs-cni/blob/main/Makefile#L1 and make manifests.

Signed-off-by: Yury Kulazhenkov <ykulazhenkov@nvidia.com>
@ykulazhenkov
Copy link
Contributor Author

@ykulazhenkov this is great, thank you. Would you please also update the manifests, so they reference the new image location instead of Quay? It should be enough to update https://github.com/k8snetworkplumbingwg/ovs-cni/blob/main/Makefile#L1 and make manifests.

@phoracek done
I also changed GH actions to publish image as "ovs-cni-plugin" instead of "ovs-cni" to match existing image name in quay.

@phoracek
Copy link
Member

/retest

@ykulazhenkov
Copy link
Contributor Author

/test pull-e2e-ovs-cni

@kubevirt-bot
Copy link
Collaborator

@ykulazhenkov: Cannot trigger testing until a trusted user reviews the PR and leaves an /ok-to-test message.

In response to this:

/test pull-e2e-ovs-cni

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.

@phoracek
Copy link
Member

@ykulazhenkov that seems like a legit issue with the PR. The tests are probably not able to pull the image.

Signed-off-by: Yury Kulazhenkov <ykulazhenkov@nvidia.com>
@ykulazhenkov
Copy link
Contributor Author

ykulazhenkov commented Apr 19, 2024

@ykulazhenkov that seems like a legit issue with the PR. The tests are probably not able to pull the image.

I updated the following lines with the right repo:

sed 's/ghcr.io\/k8snetworkplumbingwg/registry:5000/g' examples/ovs-cni.yml | ./cluster/kubectl.sh delete --ignore-not-found -f -

sed 's/ghcr.io\/k8snetworkplumbingwg/registry:5000/g' examples/ovs-cni.yml | ./cluster/kubectl.sh apply -f -

I think this should fix the problem

@phoracek
Copy link
Member

/retest

@phoracek
Copy link
Member

Looks good, thanks a lot @ykulazhenkov

@kubevirt-bot
Copy link
Collaborator

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: phoracek, ykulazhenkov

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

@kubevirt-bot kubevirt-bot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Apr 19, 2024
@phoracek phoracek merged commit 7434914 into k8snetworkplumbingwg:main Apr 19, 2024
4 of 5 checks passed
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. dco-signoff: yes Indicates the PR's author has DCO signed all their commits. needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. release-note-none Denotes a PR that doesn't merit a release note.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants