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

Unable to build images with qemu #1378

Closed
cunningr opened this issue Jan 18, 2024 · 3 comments
Closed

Unable to build images with qemu #1378

cunningr opened this issue Jan 18, 2024 · 3 comments
Labels
kind/bug Categorizes issue or PR as related to a bug.

Comments

@cunningr
Copy link

What steps did you take and what happened:

  1. Clone this repo on main into the latest hashicorp/packer docker container from Dockerhub
  2. Run make build-qemu-ubuntu-2204 inside images/capi
  3. Packer throws an error about not having the qemu provider.

I believe we just need a provider file config.pkr.hcl in images/capi/packer/qemu to declare the provider:

packer {
  required_plugins {
    qemu = {
      version = "~> 1"
      source  = "github.com/hashicorp/qemu"
    }
  }
}

What did you expect to happen:

The provider should be installed automatically.

Anything else you would like to add:
[Miscellaneous information that will assist in solving the issue.]

Environment:

Project (Image Builder for Cluster API: qemu

Additional info for Image Builder for Cluster API related issues:

NAME="Alpine Linux"
ID=alpine
VERSION_ID=3.17.0
PRETTY_NAME="Alpine Linux v3.17"
HOME_URL="https://alpinelinux.org/"
BUG_REPORT_URL="https://gitlab.alpinelinux.org/alpine/aports/-/issues"
/ # packer -v
1.8.5
<missing provider for qemu>

/kind bug
[One or more /area label. See https://github.com/kubernetes-sigs/cluster-api/labels?q=area for the list of labels]

@k8s-ci-robot k8s-ci-robot added the kind/bug Categorizes issue or PR as related to a bug. label Jan 18, 2024
@AverageMarcus
Copy link
Member

@cunningr Are you sure the version of Packer you're using is 1.8.5? 😕 The in-built qemu provider was removed in v1.10.0 and the latest version supported by image-builder is v1.9.5 (due to the licence change).

@cunningr
Copy link
Author

cunningr commented Jan 19, 2024

apologies - you're right (I was trying to fix multiple things at the same time):

docker run --entrypoint /bin/sh -it hashicorp/packer:latest
/ # packer -v
Packer v1.10.0

I took the latest packer to try and satisfy the latest Ansible constraint 2.15.8:

https://github.com/kubernetes-sigs/image-builder/blob/main/images/capi/hack/ensure-ansible.sh#L26

but I still had to bump the apk repo version:

RUN sed -i 's/v3.18/v3.19/g' /etc/apk/repositories

Although it looks like image-builder should take care of installing packer for us *if it is not there. In our case we were starting FROM hashicorp/packer:latest so I guess we should fix this our end.

Thanks for your help!

@AverageMarcus
Copy link
Member

No worries, you're not the first to hit this. I've opened #1379 to look at how we could handle this and restrict the versions allowed to try and avoid this confusion for others. :)

If you use our provided container image as the base (e.g. registry.k8s.io/scl-image-builder/cluster-node-image-builder-amd64:v0.1.22) it should contain all the versions you'd need. This is how I work with image-builder.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/bug Categorizes issue or PR as related to a bug.
Projects
None yet
Development

No branches or pull requests

3 participants