Skip to content

Commit b8ebab6

Browse files
Merge pull request #382 from jacobweinstock/update-image-building
Fix image building: ## Description <!--- Please describe what this PR is going to change --> This allows building and pushing image-builder raw images to the `tinkerbell/cluster-api-provider-tinkerbell` container image registry. ## Why is this needed <!--- Link to issue you have raised --> Fixes: # ## How Has This Been Tested? <!--- Please describe in detail how you tested your changes. --> <!--- Include details of your testing environment, and the tests you ran to --> <!--- see how your change affects other areas of the code, etc. --> ## How are existing users impacted? What migration steps/scripts do we need? <!--- Fixes a bug, unblocks installation, removes a component of the stack etc --> <!--- Requires a DB migration script, etc. --> ## Checklist: I have: - [ ] updated the documentation and/or roadmap (if required) - [ ] added unit or e2e tests - [ ] provided instructions on how to upgrade
2 parents 9202ef8 + d36c02a commit b8ebab6

File tree

1 file changed

+12
-6
lines changed

1 file changed

+12
-6
lines changed

.github/workflows/build-image.yaml

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,8 @@ on:
1717

1818
env:
1919
REGISTRY: ghcr.io
20+
# these variable are from image-builder: https://image-builder.sigs.k8s.io/capi/capi#customization
21+
# example versions can be found here: https://github.com/kubernetes-sigs/image-builder/tree/main/images/capi/packer/gce/ci/nightly
2022
KUBERNETES_DEB_VERSION: ${{ github.event.inputs.kubernetesDebVersion }}
2123
KUBERNETES_RPM_VERSION: ${{ github.event.inputs.kubernetesRPMVersion }}
2224
KUBERNETES_SEM_VERSION: ${{ github.event.inputs.kubernetesSemanticVersion }}
@@ -31,16 +33,20 @@ jobs:
3133
with:
3234
repository: kubernetes-sigs/image-builder
3335
path: image-builder
34-
# Workaround for breaking changes in upstream image-builder that need to be verified
35-
# ref: 9eea1153526d37969e96697cb1dacd15e28dbccf
36+
ref: v0.1.29
3637

3738
- name: Install QEMU
3839
run: |
3940
sudo apt update
40-
sudo -i apt install qemu-system-x86
41+
sudo -i apt install -y qemu-kvm libvirt-daemon-system libvirt-clients virtinst cpu-checker libguestfs-tools libosinfo-bin qemu-system-x86 wget unzip
4142
4243
- name: Build the images
4344
run: |
45+
set -x
46+
# https://github.com/hashicorp/packer/issues/12830
47+
wget https://releases.hashicorp.com/packer/1.9.5/packer_1.9.5_linux_amd64.zip
48+
unzip packer_1.9.5_linux_amd64.zip
49+
sudo mv packer /usr/local/bin/
4450
export PATH=$PWD/.bin:$PATH
4551
cd image-builder/images/capi
4652
cat << EOF > packer/raw/overwrite-kubernetes.json
@@ -54,7 +60,7 @@ jobs:
5460
EOF
5561
make deps-raw
5662
packer plugins install github.com/hashicorp/qemu
57-
PACKER_VAR_FILES=packer/raw/overwrite-kubernetes.json make build-raw-all
63+
PACKER_VAR_FILES=packer/raw/overwrite-kubernetes.json make build-raw-ubuntu-2004
5864
5965
- name: Log in to the Container registry
6066
uses: docker/login-action@v3
@@ -65,5 +71,5 @@ jobs:
6571

6672
- name: Push the images
6773
run: |
68-
# oras push ${REGISTRY}/${{ github.repository }}/ubuntu-1804:${KUBERNETES_SEM_VERSION}.gz --manifest-config /dev/null:application/vnd.acme.rocket.config image-builder/images/capi/output/ubuntu-1804-kube-${KUBERNETES_SEM_VERSION}.gz
69-
oras push ${REGISTRY}/${{ github.repository }}/ubuntu-2004:${KUBERNETES_SEM_VERSION}.gz --manifest-config /dev/null:application/vnd.acme.rocket.config image-builder/images/capi/output/ubuntu-2004-kube-${KUBERNETES_SEM_VERSION}.gz
74+
oras version
75+
oras push ${REGISTRY}/${{ github.repository }}/ubuntu-2004:${KUBERNETES_SEM_VERSION}.gz --artifact-type application/vnd.acme.rocket.config image-builder/images/capi/output/ubuntu-2004-kube-${KUBERNETES_SEM_VERSION}.gz

0 commit comments

Comments
 (0)