kubevirt / containerized-data-importer

Data Import Service for kubernetes, designed with kubevirt in mind.
Apache License 2.0
429 stars 269 forks source link

Multiarch fakeovirt-image #3519

Open zhlhahaha opened 3 weeks ago

zhlhahaha commented 3 weeks ago

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 commented 3 weeks ago

TBH I have never heard of that image.

@mrnold @machacekondra can you help out here?

dhiller commented 3 weeks ago

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

dhiller commented 3 weeks ago

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

awels commented 3 weeks ago

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 commented 3 weeks ago

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 commented 3 weeks ago

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

awels commented 3 weeks ago

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

zhlhahaha commented 3 weeks ago

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 commented 2 weeks ago

@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 commented 2 weeks ago

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

awels commented 2 weeks ago

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

zhlhahaha commented 2 weeks ago

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 commented 1 week ago

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