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

build multiarch bootstrap image #1149

Merged
merged 1 commit into from
Jul 27, 2022
Merged

build multiarch bootstrap image #1149

merged 1 commit into from
Jul 27, 2022

Conversation

zhlhahaha
Copy link
Contributor

@zhlhahaha zhlhahaha commented Apr 20, 2021

build bootstrap image for amd64 and arm64
New Dockerfile for bootstrap has ARG ARCH which is not acquired in the build-bootstrap-image test, so the test would always fail.

@kubevirt-bot kubevirt-bot added the dco-signoff: yes Indicates the PR's author has DCO signed all their commits. label Apr 20, 2021
@zhlhahaha
Copy link
Contributor Author

cc: @rmohr
cc: @fgimenez

@kubevirt-bot kubevirt-bot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Sep 6, 2021
@rmohr
Copy link
Member

rmohr commented Oct 12, 2021

@zhlhahaha do we still need multi-arch bootstrap images? If possible it would be great if we can stay with the cross-build (and unit-tests arch-free).

@zhlhahaha
Copy link
Contributor Author

zhlhahaha commented Oct 13, 2021

@zhlhahaha do we still need multi-arch bootstrap images? If possible it would be great if we can stay with the cross-build (and

Yes, once we have multi-arch bootstrap images, we can run unit-tests and kind-e2e tests parallelly on the ARM64 server.

The prow utility images have already supported multi-arch. kubernetes/test-infra#22362
For the Bootstrap image, there is a PR but no maintainer review it. kubernetes/test-infra#23044

Anyway, I will rebase this PR tomorrow.

@rmohr
Copy link
Member

rmohr commented Oct 13, 2021

Yes, once we have multi-arch bootstrap images, we can run unit-tests and kind-e2e tests parallelly on the ARM64 server.

The prow utility images have already supported multi-arch. kubernetes/test-infra#22362 For the Bootstrap image, there is a PR but no maintainer review it. kubernetes/test-infra#23044

Anyway, I will rebase this PR tomorrow.

Ok, let me try to rephrase my question because I am still not sure we talk about the same things. I see that it would be possible for us to run arm64 workloads in CI, but do we really need it now? The unit-tests do not depend on the architecture (thanks to your change) and the whole build process, including container builds is architecture agnostic (no emulation or slow-down). Therefore I wonder if we want to increase our CI complexity. Especially since nested-virt does not work on arm64, we can not even adopt the kubevirtci cluster-spawning model for arm64.

But maybe you think about other projects in the kubevirt org which can not cross-compile?

@zhlhahaha
Copy link
Contributor Author

zhlhahaha commented Oct 13, 2021

Ok, let me try to rephrase my question because I am still not sure we talk about the same things. I see that it would be possible for us to run arm64 workloads in CI, but do we really need it now?

I am working on making kubevirt officially support the ARM64 arch, and I know there is a lot of work to do. How do you think we can achieve this? I thought enabling arm64 workloads in CI is a part of it.
For the CI, I think expanding the e2e tests for the arm64 arch is necessary, as it is a good way to show which features have been supported on ARM64. As I do not have a stable local environment for verifying kubevirt test, a periodic CI test is a good way for me to see if verified e2e tests work fine on ARM64, so the periodic arm64 e2e test is useful.
I am looking forward to your suggestion on the following plan on ARM64.

But maybe you think about other projects in the kubevirt org which can not cross-compile?

No, currently I am only working on kubevirt project and the CDI project. They both support crossbuild binary or image on x86 for arm64.

@rmohr
Copy link
Member

rmohr commented Oct 13, 2021

I am working on making kubevirt officially support the ARM64 arch, and I know there is a lot of work to do. How do you think we can achieve this? I thought enabling arm64 workloads in CI is a part of it.

I think we need a stable build process (we have it thanks to the cross compilatin), we need to be able to run the unit tests in CI and locally for the new architecture (we have that by allowing setting the go arch for the tests from outside and executing all unit tests for all architectures independent of the host platform), we need a stable release process (we have it, we already use it for the developer releases).

So what is in my opinion missing: Running enough e2e tests to ensure that what we ship is working on arm. For that you are providing the clusters. They execute the code on the right architecture. There we need to enable more tests and potentially get the chance to run at least a subset of the e2e tests on PRs to guarantee a minimum protection against protections. I am not sure if arm64 base images and CI jobs as such help us there.

@zhlhahaha
Copy link
Contributor Author

I am not sure if arm64 base images and CI jobs as such help us there.

It does not need, I will close is PR.
for the CI tests I have submitted two PRs: one is for periodic test and another is for presubmit test:
#1666
#1667
For the rest tests, I have summarised them in kubevirt/kubevirt#5976

@zhlhahaha
Copy link
Contributor Author

/open

@zhlhahaha zhlhahaha reopened this Jun 29, 2022
@kubevirt-bot kubevirt-bot removed the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Jun 29, 2022
@kubevirt-bot kubevirt-bot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Jun 30, 2022
@zhlhahaha
Copy link
Contributor Author

@dhiller @xpivarc would you like review it when you have time?

@kubevirt-bot kubevirt-bot removed the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Jul 1, 2022
@dhiller
Copy link
Contributor

dhiller commented Jul 12, 2022

/rehearse

Copy link
Contributor

@dhiller dhiller left a comment

Choose a reason for hiding this comment

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

Looks very good already, besides the IMHO missing ARCH inside the golang Dockerfile.

@@ -1,4 +1,4 @@
FROM bootstrap
FROM bootstrap-amd64
Copy link
Contributor

Choose a reason for hiding this comment

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

Don't we need the ARCH here? If we don't we would just create a regular amd64 golang image and could thus replace the publish_multiarch_image.sh for golang with the regular publish_image.sh no?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

We need multi-arch golang image, I have update the PR.

@zhlhahaha
Copy link
Contributor Author

Hi @dhiller the PR has updated, would you like to take a look?

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

@dhiller dhiller left a comment

Choose a reason for hiding this comment

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

/approve

/hold @brianmcarey mind taking another look? If you don't find anything, then let's remove the hold

@kubevirt-bot kubevirt-bot added the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Jul 15, 2022
@kubevirt-bot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: dhiller

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 Jul 15, 2022
@dhiller
Copy link
Contributor

dhiller commented Jul 15, 2022

/retest-required

@zhlhahaha
Copy link
Contributor Author

Hi @dhiller
I see the two required tests build-bootstrap-image and build-golang-image have failed. As you can see in this PR, the build command for this two images has changed to following command, but in the tests, it still used old version build command. So the tests failed.

./publish_multiarch_image.sh bootstrap quay.io kubevirtci
./publish_multiarch_image.sh -l golang quay.io kubevirtci

@@ -85,7 +85,7 @@ presubmits:
memory: "1Gi"
limits:
memory: "1Gi"
- name: build-bootstrap-image
- name: build-multiarch-bootstrap-image
always_run: false
run_if_changed: "images/bootstrap/.*|images/golang/.*"
decorate: true
Copy link
Member

Choose a reason for hiding this comment

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

As we are doubling the number of images that we are building - we may need to update the default 2 hours timeout for this job. I tried running this locally and it timed out - I updated the timeout to 3 hours and the job passed. Here is an example of how to configure the timeout:

decoration_config:
grace_period: 5m0s
timeout: 4h0m0s

Once we have the timeout increased for this and the publish job - I think this looks good.

for arch in ${archs[*]};do
amend+=" --amend ${full_image_name}-${arch}"
done
docker manifest create ${full_image_name} ${amend}
Copy link
Member

Choose a reason for hiding this comment

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

It would be cool to try this with a tool like buildah but we can try doing that later. Other kubevirt projects are starting to adopt buildah for multi-arch builds - kubevirt/hostpath-provisioner#115

@zhlhahaha zhlhahaha requested a review from brianmcarey July 22, 2022 10:37
@kubevirt-bot kubevirt-bot removed the lgtm Indicates that a PR is ready to be merged. label Jul 22, 2022
Copy link
Member

@brianmcarey brianmcarey left a comment

Choose a reason for hiding this comment

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

/lgtm

/unhold

@kubevirt-bot kubevirt-bot removed the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Jul 25, 2022
@kubevirt-bot kubevirt-bot added the lgtm Indicates that a PR is ready to be merged. label Jul 25, 2022
@brianmcarey
Copy link
Member

/override build-bootstrap-image

Local run of job completed successfully.

@kubevirt-bot
Copy link
Contributor

@brianmcarey: Overrode contexts on behalf of brianmcarey: build-bootstrap-image

In response to this:

/override build-bootstrap-image

Local run of job completed successfully.

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.

Copy link
Member

@xpivarc xpivarc left a comment

Choose a reason for hiding this comment

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

Looks good. I think we should have just one publish-image in the end but this will keep us going.

./publish_image.sh bootstrap quay.io kubevirtci
./publish_image.sh golang quay.io kubevirtci
./publish_multiarch_image.sh bootstrap quay.io kubevirtci
./publish_multiarch_image.sh -l golang quay.io kubevirtci
Copy link
Member

Choose a reason for hiding this comment

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

Why do you need this option?

Copy link
Member

Choose a reason for hiding this comment

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

Good point - we probably don't need this specific local image flag.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

We need this flag. For Dockerfile whose baseimage is from remote repository, we need manually pull correct CPU arch base image, otherwise it would use local image even if the local image has different CPU arch with --platform.
For these Dockerfile we use local built image, like the golang image, we do not need to pull base image.

@brianmcarey
Copy link
Member

/hold

@kubevirt-bot kubevirt-bot added the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Jul 25, 2022
@brianmcarey
Copy link
Member

/unhold

@kubevirt-bot kubevirt-bot removed the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Jul 27, 2022
@kubevirt-bot
Copy link
Contributor

kubevirt-bot commented Jul 27, 2022

@zhlhahaha: The following tests failed, say /retest to rerun all failed tests or /retest-required to rerun all mandatory failed tests:

Test name Commit Details Required Rerun command
build-golang-image 7fdb90c link true /test build-golang-image
rehearsal-pull-node-maintenance-operator-check ed9d8f5 link unknown /test pull-node-maintenance-operator-check
rehearsal-pull-node-maintenance-operator-build ed9d8f5 link unknown /test pull-node-maintenance-operator-build
rehearsal-pull-controller-lifecycle-operator-sdk-e2e-k8s-1.18 ed9d8f5 link unknown /test pull-controller-lifecycle-operator-sdk-e2e-k8s-1.18
rehearsal-build-kubevirt-userguide-image ed9d8f5 link unknown /test build-kubevirt-userguide-image
rehearsal-pull-kubevirt-code-lint ed9d8f5 link unknown /test pull-kubevirt-code-lint
rehearsal-pull-kubevirt-build-arm64 ed9d8f5 link unknown /test pull-kubevirt-build-arm64
rehearsal-build-autoowners-image ed9d8f5 link unknown /test build-autoowners-image
rehearsal-build-kubot-image ed9d8f5 link unknown /test build-kubot-image
rehearsal-pull-cdi-linter ed9d8f5 link unknown /test pull-cdi-linter
rehearsal-pull-kubevirt-generate ed9d8f5 link unknown /test pull-kubevirt-generate
rehearsal-build-prow-deploy-image ed9d8f5 link unknown /test build-prow-deploy-image
rehearsal-pull-kubevirt-verify-go-mod ed9d8f5 link unknown /test pull-kubevirt-verify-go-mod
rehearsal-pull-kubevirt-client-python ed9d8f5 link unknown /test pull-kubevirt-client-python
rehearsal-build-kubekins-e2e-image ed9d8f5 link unknown /test build-kubekins-e2e-image
rehearsal-pull-kubevirt-verify-rpms ed9d8f5 link unknown /test pull-kubevirt-verify-rpms
rehearsal-build-vm-image-builder-image ed9d8f5 link unknown /test build-vm-image-builder-image
rehearsal-pull-kubevirt-fossa ed9d8f5 link unknown /test pull-kubevirt-fossa
rehearsal-check-up-kind-1.23-vgpu ed9d8f5 link unknown /test check-up-kind-1.23-vgpu
rehearsal-check-up-kind-1.22-sriov ed9d8f5 link unknown /test check-up-kind-1.22-sriov
rehearsal-pull-project-infra-test-external-plugins ed9d8f5 link unknown /test pull-project-infra-test-external-plugins
rehearsal-check-provision-k8s-1.23 ed9d8f5 link unknown /test check-provision-k8s-1.23
rehearsal-check-provision-k8s-1.22 ed9d8f5 link unknown /test check-provision-k8s-1.22
rehearsal-check-provision-k8s-1.24-ipv6 ed9d8f5 link unknown /test check-provision-k8s-1.24-ipv6
rehearsal-check-provision-k8s-1.21 ed9d8f5 link unknown /test check-provision-k8s-1.21
rehearsal-check-provision-k8s-1.22-ipv6 ed9d8f5 link unknown /test check-provision-k8s-1.22-ipv6
rehearsal-pull-cluster-api-provider-kubevirt-e2e ed9d8f5 link unknown /test pull-cluster-api-provider-kubevirt-e2e
rehearsal-check-provision-k8s-1.24 ed9d8f5 link unknown /test check-provision-k8s-1.24
rehearsal-pull-kubevirt-e2e-kind-1.22-sriov-nonroot ed9d8f5 link unknown /test pull-kubevirt-e2e-kind-1.22-sriov-nonroot
rehearsal-pull-terraform-provider-kubevirt-e2e-k8s-1.20 ed9d8f5 link unknown /test pull-terraform-provider-kubevirt-e2e-k8s-1.20
rehearsal-pull-kubevirt-e2e-arm64 ed9d8f5 link unknown /test pull-kubevirt-e2e-arm64
rehearsal-check-provision-k8s-1.21-cgroupsv2 ed9d8f5 link unknown /test check-provision-k8s-1.21-cgroupsv2
rehearsal-pull-kubevirt-e2e-k8s-1.21-sig-compute-migrations ed9d8f5 link unknown /test pull-kubevirt-e2e-k8s-1.21-sig-compute-migrations
rehearsal-pull-nmstate-integ_tier1-k8s ed9d8f5 link unknown /test pull-nmstate-integ_tier1-k8s
rehearsal-pull-kubevirt-e2e-k8s-1.22-sig-compute-migrations ed9d8f5 link unknown /test pull-kubevirt-e2e-k8s-1.22-sig-compute-migrations
rehearsal-pull-containerized-data-importer-e2e-nfs ed9d8f5 link unknown /test pull-containerized-data-importer-e2e-nfs
rehearsal-pull-kubernetes-nmstate-e2e-handler-k8s-future ed9d8f5 link unknown /test pull-kubernetes-nmstate-e2e-handler-k8s-future
rehearsal-build-multiarch-bootstrap-image ed9d8f5 link unknown /test build-multiarch-bootstrap-image

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. I understand the commands that are listed here.

@brianmcarey
Copy link
Member

/override build-bootstrap-image

@kubevirt-bot
Copy link
Contributor

@brianmcarey: Overrode contexts on behalf of brianmcarey: build-bootstrap-image

In response to this:

/override build-bootstrap-image

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.

@kubevirt-bot kubevirt-bot merged commit fa4d2de into kubevirt:main Jul 27, 2022
@kubevirt-bot
Copy link
Contributor

@zhlhahaha: Updated the job-config configmap in namespace kubevirt-prow at cluster default using the following files:

  • key project-infra-postsubmits.yaml using file github/ci/prow-deploy/files/jobs/kubevirt/project-infra/project-infra-postsubmits.yaml
  • key project-infra-presubmits.yaml using file github/ci/prow-deploy/files/jobs/kubevirt/project-infra/project-infra-presubmits.yaml

In response to this:

build bootstrap image for amd64 and arm64
New Dockerfile for bootstrap has ARG ARCH which is not acquired in the build-bootstrap-image test, so the test would always fail.

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.

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. size/L
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants