k8snetworkplumbingwg / ovs-cni

Open vSwitch CNI plugin
Apache License 2.0
218 stars 70 forks source link

Add github actions to publish images to GH registry #307

Closed ykulazhenkov closed 4 months ago

ykulazhenkov commented 4 months ago

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 commented 4 months ago

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](https://git.k8s.io/community/contributors/guide/pull-requests.md). If you have questions or suggestions related to my behavior, please file an issue against the [kubernetes/test-infra](https://github.com/kubernetes/test-infra/issues/new?title=Prow%20issue:) repository.
phoracek commented 4 months ago

/retest

phoracek commented 4 months ago

@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.

ykulazhenkov commented 4 months ago

@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 commented 4 months ago

/retest

ykulazhenkov commented 4 months ago

/test pull-e2e-ovs-cni

kubevirt-bot commented 4 months ago

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

In response to [this](https://github.com/k8snetworkplumbingwg/ovs-cni/pull/307#issuecomment-2064258741): >/test pull-e2e-ovs-cni Instructions for interacting with me using PR comments are available [here](https://git.k8s.io/community/contributors/guide/pull-requests.md). If you have questions or suggestions related to my behavior, please file an issue against the [kubernetes/test-infra](https://github.com/kubernetes/test-infra/issues/new?title=Prow%20issue:) repository.
phoracek commented 4 months ago

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

ykulazhenkov commented 4 months ago

@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:

https://github.com/k8snetworkplumbingwg/ovs-cni/blob/98a60a49448cac47444e29dc8e7434fe78b82c2e/cluster/sync.sh#L39

https://github.com/k8snetworkplumbingwg/ovs-cni/blob/98a60a49448cac47444e29dc8e7434fe78b82c2e/cluster/sync.sh#L53

I think this should fix the problem

phoracek commented 4 months ago

/retest

phoracek commented 4 months ago

Looks good, thanks a lot @ykulazhenkov

kubevirt-bot commented 4 months ago

[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: - ~~[OWNERS](https://github.com/k8snetworkplumbingwg/ovs-cni/blob/main/OWNERS)~~ [phoracek] Approvers can indicate their approval by writing `/approve` in a comment Approvers can cancel approval by writing `/approve cancel` in a comment