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

Multiarch fakeovirt-image #3519

Open
zhlhahaha opened this issue Nov 7, 2024 · 13 comments
Open

Multiarch fakeovirt-image #3519

zhlhahaha opened this issue Nov 7, 2024 · 13 comments
Labels

Comments

@zhlhahaha
Copy link
Contributor

The image quay.io/kubevirt/fakeovirt:v1.38.0 in manifests/templates/imageio.yaml.inwhich only supports x86_64. We may need to make it support multi-arch.

@brianmcarey @dhiller I did not see any jobs for releasing the image, is the image copy from dockerhub?

@dhiller
Copy link
Contributor

dhiller commented Nov 7, 2024

TBH I have never heard of that image.

@mrnold @machacekondra can you help out here?

@dhiller
Copy link
Contributor

dhiller commented Nov 7, 2024

@awels do you happen to know where that image comes from?

@dhiller
Copy link
Contributor

dhiller commented Nov 7, 2024

Hm, it seems to come from this repo: https://github.com/machacekondra/fakeovirt

@awels
Copy link
Member

awels commented Nov 7, 2024

IIRC I created a container from that repo a long time ago, I forget the details. I would have to go through the git logs to see the details.

@mrnold
Copy link
Contributor

mrnold commented Nov 7, 2024

From what I can recall this was just a copy of machacekondra/fakeovirt:test from Dockerhub. I don't think I ended up needing any changes to the image.

@machacekondra
Copy link
Contributor

I think it should support multi arch just fine. Is there any action needed from me?

@awels
Copy link
Member

awels commented Nov 7, 2024

Probably just need to create the actual containers for multi arch.

@zhlhahaha
Copy link
Contributor Author

zhlhahaha commented Nov 8, 2024

I just write a script to build the multi-arch fakeovirt image, I can run it successfully on my loacl x86 server.
Maybe you can give it a try. Only need to

  1. put the script in the https://github.com/machacekondra/fakeovirt
  2. modify the registry_org, registry and tag
  3. Then run the script
#!/bin/bash -xe
archs=(amd64 arm64 x390)
registry_org="docker.io"
registry="zhlhahaha"
image_name="fakeovirt"
base_image="golang:latest"
tag="latest"
amend=""
docker run --privileged --rm tonistiigi/binfmt --install all
for arch in ${archs[*]};do
  docker rmi ${base_image}
  DOCKER_CLI_EXPERIMENTAL=enabled docker buildx build --platform "linux/${arch}" . -t ${registry_org}/${registry}/${image_name}:${arch}
  docker push ${registry_org}/${registry}/${image_name}:${arch}
  # if docker push failed, you can try
  # skopeo copy "docker-daemon:${registry_org}/${registry}/${image_name}:${arch}" "docker://${registry_org}/${registry}/${image_name}:${arch}"
  amend+=" --amend ${registry_org}/${registry}/${image_name}:${arch}"
done

docker manifest create ${registry_org}/${registry}/${image_name}:${tag} \
--amend ${registry_org}/${registry}/${image_name}:${tag} ${amend}

docker manifest push ${registry_org}/${registry}/${image_name}:${tag}
# if docker mainfest push failed, you can try
# docker manifest push ${registry_org}/${registry}/${image_name}:${tag} "docker://${registry_org}/${registry}/${image_name}:${tag}"

@dhiller
Copy link
Contributor

dhiller commented Nov 14, 2024

@zhlhahaha would it make sense to transfer the repo to kubevirt org? Then we could store the script inside it and create a prowjob that creates/updates the image whenever changes occur? Also we'd just push it to quay.io/kubevirtci or quay.io/kubevirt?

@dhiller
Copy link
Contributor

dhiller commented Nov 14, 2024

"Someone" would then need to maintain it though. @awels would you know any takers on the maintenance?

@awels
Copy link
Member

awels commented Nov 14, 2024

I can own it. There have not been many changes to this so it should be pretty easy to maintain.

@zhlhahaha
Copy link
Contributor Author

Hi @dhiller,

would it make sense to transfer the repo to kubevirt org? Then we could store the script inside it and create a prowjob that creates/updates the image whenever changes occur?

Yes, I think so, as there is no script for build multi-arch image in the original repo, we need to do it by ourselves.

Also we'd just push it to quay.io/kubevirtci or quay.io/kubevirt?

I think quay.io/kubevirtci is good as the image is only need in the CI/CD tests? @awels How do you think?

@awels
Copy link
Member

awels commented Nov 15, 2024

It is actually only needed in CDI tier1 tests. Nothing else uses it. So it makes sense to have it in the CDI repo.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

5 participants