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

chore(build): Add a CI workflow to build and push multiubuntu image whenever a change detected #1878

Open
wants to merge 8 commits into
base: main
Choose a base branch
from

Conversation

sikehish
Copy link

Purpose of PR?:
Add a CI workflow to build and push the multi-architecture Ubuntu-based image for KubeArmor on changes to the main branch.

Fixes #1876

Does this PR introduce a breaking change?
No

If the changes in this PR are manually verified, list down the scenarios covered::

  • Verified that the CI workflow builds the Docker image successfully using multi-architecture (amd64 and arm64) support.
  • Confirmed that the Docker image pushes correctly to Docker Hub when the workflow is triggered by push or pull_request on the main branch.

Additional information for reviewer? :
This PR introduces a new CI workflow and is not dependent on any previous PR or design.

Checklist:

  • Bug fix. Fixes N/A
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • This change requires a documentation update
  • PR Title follows the convention of <type>(<scope>): <subject>
  • Commit has unit tests
  • Commit has integration tests

.github/workflows/ci-build-and-push.yml Outdated Show resolved Hide resolved
.github/workflows/ci-build-and-push.yml Outdated Show resolved Hide resolved
.github/workflows/ci-build-and-push.yml Outdated Show resolved Hide resolved
password: ${{ secrets.DOCKER_AUTHTOK }}

- name: Build and push multi-architecture image
uses: docker/build-push-action@v6
Copy link
Collaborator

Choose a reason for hiding this comment

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

examples/multiubuntu/build/build.sh can handle build and push as well, no need to setup docker action for it.
build and push

Copy link
Member

Choose a reason for hiding this comment

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

We need multiarch builds, they are not handled in the script.

Copy link
Collaborator

Choose a reason for hiding this comment

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

my bad, in that case keep repo name same that used in the script

Copy link
Author

Choose a reason for hiding this comment

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

examples/multiubuntu/build/build.sh can handle build and push as well, no need to setup docker action for it. build and push

Do I need to make any changes? Do I need to use examples/multiubuntu/build/build.sh? A bit confused here. Would love for some clarity :))

Copy link
Collaborator

Choose a reason for hiding this comment

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

@sikehish no need to use build.sh script, changes with your PR looks good just change image tag kubearmor/ubuntu-w-utils:latest

Copy link
Author

Choose a reason for hiding this comment

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

Hi @rksharma95 . Ive made the change. Let me know if you need me to change anything else :)

@rksharma95
Copy link
Collaborator

@sikehish thanks for the PR, just some suggestions, looks good otherwise. also can you test it on your fork first??

@sikehish
Copy link
Author

@sikehish thanks for the PR, just some suggestions, looks good otherwise. also can you test it on your fork first??

Thanks for the oppurtunity too :) I've made all the other changes that you had requested for, barring #1878 (comment) . It's working on my fork.

image

rksharma95
rksharma95 previously approved these changes Oct 21, 2024
@rksharma95
Copy link
Collaborator

rksharma95 commented Oct 22, 2024

@sikehish can you please add examples/multiubuntu/build path as well here, to run the e2e tests for any change

edit: we'll need to handle the case that latest built ubuntu image should be used in the tests

Added examples/multiubuntu/build path in the CI workflow to run end-to-end tests for any changes.
@sikehish
Copy link
Author

@sikehish can you please add examples/multiubuntu/build path as well here, to run the e2e tests for any change

edit: we'll need to handle the case that latest built ubuntu image should be used in the tests

Yup. I've added it. Let me know if any other changes need to be made.

@rksharma95
Copy link
Collaborator

@sikehish can you please add examples/multiubuntu/build path as well here, to run the e2e tests for any change

edit: we'll need to handle the case that latest built ubuntu image should be used in the tests

Yup. I've added it. Let me know if any other changes need to be made.

we'll need handling that the locally built image with changes pushed with PR used in testing. at this point it will just pull the image from kubearmor repo.

@sikehish
Copy link
Author

@sikehish can you please add examples/multiubuntu/build path as well here, to run the e2e tests for any change

edit: we'll need to handle the case that latest built ubuntu image should be used in the tests

Yup. I've added it. Let me know if any other changes need to be made.

we'll need handling that the locally built image with changes pushed with PR used in testing. at this point it will just pull the image from kubearmor repo.

I didn't quite get you. Do I have make any change in any of the test yml file? What change do I need to make and in which file? Also, how do I handle the case that latest built ubuntu image be used in the tests? Could you elaborate a bit more.
Thank you!

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.

add CI workflow to build and push multiubuntu image on change
3 participants