Skip to content

Commit

Permalink
Add github action
Browse files Browse the repository at this point in the history
  • Loading branch information
lentzi90 committed Jan 26, 2024
1 parent 427620d commit d813e41
Show file tree
Hide file tree
Showing 3 changed files with 84 additions and 1 deletion.
52 changes: 52 additions & 0 deletions .github/workflows/osimages.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
name: E2E node images

on:
pull_request:
branches: [main]
paths-ignore:
- '**/*.md'
- 'docs/**'
- '.gitignore'
- 'hack/*.sh'
- 'LICENSE'
- 'SECURITY_CONTACTS'
- 'OWNERS'

permissions: {}

jobs:
build:
name: Build and upload node images
runs-on: ubuntu-latest

permissions:
contents: read

steps:
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1

- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
with:
repository: kubernetes-sigs/image-builder
path: image-builder
ref: v0.1.22

- name: Patch image-builder Dockerfile with root user
run: git apply "../osimages/image-builder.patch"
working-directory: "./image-builder"

- name: Build image-builder image with root user
run: make docker-build
working-directory: "./image-builder/images/capi"

- name: Build images
env:
OSIMAGE_BUILDER: gcr.io/scl-image-builder/cluster-node-image-builder-amd64:dev
run: make -C osimages -j2 ACCELERATOR=kvm \
osimage-flatcar-1.27.2 \
osimage-flatcar-1.28.2 \
osimage-ubuntu-2204-1.28.2 \
osimage-ubuntu-2204-1.27.2

- name: Upload images
run: make -C osimages osimage-upload
2 changes: 1 addition & 1 deletion osimages/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ osimage-%: FORCE
.PHONY: FORCE
FORCE:

.PHONY: osimage-upload:
.PHONY: osimage-upload
osimage-upload:
ls $(OSIMAGE_DIR)
gsutil cp $(OSIMAGE_DIR)/* gs://$(STAGING_BUCKET)/test
31 changes: 31 additions & 0 deletions osimages/image-builder.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
index 9514c03ae..372b8dfc2 100644
--- a/images/capi/Dockerfile
+++ b/images/capi/Dockerfile
@@ -38,18 +38,15 @@ RUN apt-get update && DEBIAN_FRONTEND=noninteractive apt-get install -y \
ARG ARCH
ARG PASSED_IB_VERSION

-USER imagebuilder
-WORKDIR /home/imagebuilder/
-
-COPY --chown=imagebuilder:imagebuilder ansible ansible/
-COPY --chown=imagebuilder:imagebuilder ansible.cfg ansible.cfg
-COPY --chown=imagebuilder:imagebuilder cloudinit cloudinit/
-COPY --chown=imagebuilder:imagebuilder hack hack/
-COPY --chown=imagebuilder:imagebuilder packer packer/
-COPY --chown=imagebuilder:imagebuilder Makefile Makefile
-COPY --chown=imagebuilder:imagebuilder azure_targets.sh azure_targets.sh
-
-ENV PATH="/home/imagebuilder/.local/bin:${PATH}"
+COPY ansible ansible/
+COPY ansible.cfg ansible.cfg
+COPY cloudinit cloudinit/
+COPY hack hack/
+COPY packer packer/
+COPY Makefile Makefile
+COPY azure_targets.sh azure_targets.sh
+
+ENV PATH="/root/.local/bin:${PATH}"
ENV PACKER_ARGS ''
ENV PACKER_VAR_FILES ''
ENV IB_VERSION "${PASSED_IB_VERSION}"

0 comments on commit d813e41

Please sign in to comment.