l7mp / stunner-gateway-operator

STUNner Kubernetes Gateway Operator
Apache License 2.0
15 stars 6 forks source link

chore(CI/CD): Add pr-image-builder workflow #54

Closed davidkornel closed 2 months ago

davidkornel commented 3 months ago

This PR adds a workflow that builds a Docker image based on the pull requests. It gets triggered on additional commits also. The image naming is l7mp/stunner-gateway-operator:pr-<pr-number>.

The workflow comments on the PR with the built image name to notify the user.

Currently, the run unit test job is disabled, might be useful to enable it later.

davidkornel commented 3 months ago

@rg0now As stated the current image format is l7mp/stunner-gateway-operator:pr-<pr-number>. I'm afraid this would result in numerous extra tags under the l7mp/stunner-gateway-operator image which is used for prod. Should we change the image name to l7mp/stunner-gateway-operator-pr:<pr-number>

github-actions[bot] commented 3 months ago

The Docker image for this pull request (#54) has been successfully built and pushed to DockerHub as l7mp/stunner-gateway-operator:pr-54.

levaitamas commented 2 months ago

Nice work! See some minor comments in the code. Two additional things: 1) IMHO, using a new registry for PR builds requires extra effort from the users, and the missing -pr from the name might be a source of errors. Having many tags in a single image repo is a common practice. 2) Can we add an action similar to stunner?

Note: we should disable docker build/push actions in forks

rg0now commented 2 months ago

Thx, I like this. Minor wishlist item: is there any chance to garbage-collect the image at dockerhub once a PR is closed?

davidkornel commented 2 months ago

@levaitamas Alright, let's keep them under the same registry name. And we definitely should add the same action for stunner as well.

@rg0now Garbage collection is a good idea. I will add it.

github-actions[bot] commented 2 months ago

The Docker image for this pull request (#54) has been successfully built and pushed to DockerHub as docker.io/l7mp/stunner-gateway-operator:pr-54.

github-actions[bot] commented 2 months ago

The Docker image for this pull request (#54) has been successfully built and pushed to DockerHub as docker.io/l7mp/stunner-gateway-operator:pr-54.

github-actions[bot] commented 2 months ago

The Docker image for this pull request (#54) has been successfully built and pushed to DockerHub as docker.io/l7mp/stunner-gateway-operator:pr-54.

davidkornel commented 2 months ago

Testing garbage collection

davidkornel commented 2 months ago

Garbage collection tag results in 401. Need to figure out the issue with it and need to evaluate the response code properly.

github-actions[bot] commented 2 months ago

The Docker image for this pull request (#54) has been successfully built and pushed to DockerHub as docker.io/l7mp/stunner-gateway-operator:pr-54.

github-actions[bot] commented 2 months ago

The Docker image for this pull request (#54) has been successfully built and pushed to DockerHub as docker.io/l7mp/stunner-gateway-operator:pr-54.

github-actions[bot] commented 2 months ago

The Docker image for this pull request (#54) has been successfully built and pushed to DockerHub as docker.io/l7mp/stunner-gateway-operator:pr-54.

davidkornel commented 2 months ago

Garbage collection is fixed @levaitamas could you take a look?

github-actions[bot] commented 2 months ago

The Docker image for this pull request (#54) has been successfully built and pushed to DockerHub as docker.io/l7mp/stunner-gateway-operator:pr-54.