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

Use buildah instead of docker, support multi-arch builds #243

Merged
merged 3 commits into from
Aug 3, 2022

Conversation

maya-r
Copy link
Contributor

@maya-r maya-r commented Jul 6, 2022

Which issue(s) this PR fixes (optional, in fixes #<issue number>(, fixes #<issue_number>, ...) format, will close the issue(s) when PR gets merged):
hostpath-provisioner-operator part of fixing kubevirt/hostpath-provisioner#98, we also need to change project-infra for both projects.

Release note:

Use buildah and podman, enable building multi-arch manifests

This passes them to all subprocesses, but they can still be overridden
due to the ?= construct.

Signed-off-by: Maya Rashish <mrashish@redhat.com>
Now we can run:
make clean && \
GOARCH=arm64 make manifest && GOARCH=amd64 make manifest && \
make manifest-push

And spit out a manifest for both arm64 and amd64, in the same image.

Caveats:
- We have a special 'manifest-clean' target, as we can add arbitrarily
  many images to a manifest and don't want the old ones.
  Delete old image in case a regular non-manifest image exists by the
  same name, too.
- The push and image/manifest creation are split, so we can run the
  image creation for more than one architecture and push the combined
  manifest including both.
- We keep `make push` behaving the same to avoid breaking CI.

Signed-off-by: Maya Rashish <mrashish@redhat.com>
@kubevirt-bot kubevirt-bot added release-note Denotes a PR that will be considered when it comes time to generate release notes. dco-signoff: yes Indicates the PR's author has DCO signed all their commits. labels Jul 6, 2022
@awels
Copy link
Member

awels commented Jul 6, 2022

Do we want to make an arm lane in kubevirt/project-infra ?

@maya-r
Copy link
Contributor Author

maya-r commented Jul 10, 2022

@zhlhahaha seems to be behind the arm64 testing for kubevirt.
Could we use your resources to test hostpath-provisioner and hostpath-provisioner-operator on arm64?

Besides an initial smoke test, I am most concerned that the release artifacts might be dysfunctional due to something going wrong with cross-building. I might try to configure it as a periodic testing the released binaries instead of re-building it locally.

@zhlhahaha
Copy link

Could we use your resources to test hostpath-provisioner and hostpath-provisioner-operator on arm64?

Hi, Maya, of course, currently we have two Arm64 servers for kubevirt project. And one of the servers has already in the kubevirt project CI infrastructure.

Besides an initial smoke test, I am most concerned that the release artifacts might be dysfunctional due to something going wrong with cross-building. I might try to configure it as a periodic testing the released binaries instead of re-building it locally.

But currently the all build work is on x86_64 server. And in order to run normal unit tests or build work on Arm64 server via prow, we need multi-arch bootstrap image. I have submit a PR for build multi-arch bootstrap image, but have not get any reply. kubevirt/project-infra#1149

@maya-r
Copy link
Contributor Author

maya-r commented Aug 2, 2022

ping @awels

Makefile Outdated
push: clean manifest manifest-push

manifest-push:
buildah manifest push $(BUILDAH_PUSH_FLAGS) --all $(DOCKER_REPO)/$(OPERATOR_IMAGE):local docker://$(DOCKER_REPO)/$(OPERATOR_IMAGE):$(TAG)
Copy link
Member

Choose a reason for hiding this comment

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

Where is the BUILDAH_PUSH_FLAGS set? I don't see it.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

thanks, removed.

Signed-off-by: Maya Rashish <mrashish@redhat.com>
@awels
Copy link
Member

awels commented Aug 3, 2022

/lgtm
/approve

@kubevirt-bot kubevirt-bot added the lgtm Indicates that a PR is ready to be merged. label Aug 3, 2022
@kubevirt-bot
Copy link

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: awels

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 Aug 3, 2022
@kubevirt-bot kubevirt-bot merged commit 717af8d into kubevirt:main Aug 3, 2022
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. lgtm Indicates that a PR is ready to be merged. release-note Denotes a PR that will be considered when it comes time to generate release notes. size/M
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants