From 21efd4c31721b8c0f5a787a9bd3c565a66da1ce2 Mon Sep 17 00:00:00 2001 From: Kishen V Date: Tue, 25 Jun 2024 18:45:57 +0530 Subject: [PATCH] Add workflow to build kind cluster components --- .github/workflows/kind-dependent-images.yaml | 67 ++++++++++++++++++++ build-ppc64le.patch | 55 ---------------- 2 files changed, 67 insertions(+), 55 deletions(-) create mode 100644 .github/workflows/kind-dependent-images.yaml diff --git a/.github/workflows/kind-dependent-images.yaml b/.github/workflows/kind-dependent-images.yaml new file mode 100644 index 0000000..7091bd0 --- /dev/null +++ b/.github/workflows/kind-dependent-images.yaml @@ -0,0 +1,67 @@ +name: Build kind cluster component images + +# This workflow uses actions that are not certified by GitHub. +# They are provided by a third-party and are governed by +# separate terms of service, privacy policy, and support +# documentation. + +on: + workflow_dispatch: + +jobs: + build: + runs-on: ubuntu-latest + permissions: + packages: write + strategy: + fail-fast: false + env: + # Use docker.io for Docker Hub if empty + IMAGE_REGISTRY: quay.io + + # Override Makefile default variables + REGISTRY: quay.io/powercloud + PLATFORMS: linux/ppc64le + + steps: + - name: Checkout repository + uses: actions/checkout@v4.1.6 + + - name: Log into registry ${{ env.IMAGE_REGISTRY }} + uses: docker/login-action@v3 + with: + registry: ${{ env.IMAGE_REGISTRY }} + username: ${{ secrets.QUAY_USERNAME }} + password: ${{ secrets.QUAY_PASSWORD }} + + - name: Clone and patch kubernetes-sigs/kind repository + run: | + git clone --depth 1 --branch $(cat KIND_VERSION) https://github.com/kubernetes-sigs/kind.git + cd kind + git apply ../build-ppc64le.patch + echo "TAG=$(date +v%Y%m%d)-$(git describe --always)" >> $GITHUB_ENV + + - name: Build local-path-provisioner + working-directory: ./kind + run: | + IMAGE_NAME=kind-local-path-provisioner make -C images/local-path-provisioner push + + - name: Build local-path-helper + working-directory: ./kind + run: | + IMAGE_NAME=kind-local-path-helper make -C images/local-path-helper push + + - name: Build base + working-directory: ./kind + run: | + IMAGE_NAME=kind-base make -C images/base push + + - name: Build kindnetd + working-directory: ./kind + run: | + IMAGE_NAME=kind-kindnetd make -C images/kindnetd push + + - name: Build haproxy + working-directory: ./kind + run: | + IMAGE_NAME=kind-haproxy make -C images/haproxy push diff --git a/build-ppc64le.patch b/build-ppc64le.patch index d2d21ab..4883a2a 100644 --- a/build-ppc64le.patch +++ b/build-ppc64le.patch @@ -12,33 +12,6 @@ index fddb7c7..962e00c 100755 exit 0 fi -diff --git a/images/Makefile.common.in b/images/Makefile.common.in -index 821d9c5..20b6c02 100644 ---- a/images/Makefile.common.in -+++ b/images/Makefile.common.in -@@ -17,11 +17,11 @@ - # get image name from directory we're building - IMAGE_NAME?=$(notdir $(CURDIR)) - # docker image registry, default to upstream --REGISTRY?=gcr.io/k8s-staging-kind -+REGISTRY?=quay.io/powercloud - # for appending build-meta like "_containerd-v1.7.1" - TAG_SUFFIX?= - # tag based on date-sha --TAG?=$(shell echo "$$(date +v%Y%m%d)-$$(git describe --always --dirty)") -+TAG?=$(shell echo "$$(date +v%Y%m%d)-$$(git describe --always)") - # the full image tag - IMAGE?=$(REGISTRY)/$(IMAGE_NAME):$(TAG)$(TAG_SUFFIX) - # Go version to use, respected by images that build go binaries -@@ -31,7 +31,7 @@ GO_VERSION=$(shell cat $(CURDIR)/../../.go-version | head -n1) - export DOCKER_CLI_EXPERIMENTAL=enabled - - # build with buildx --PLATFORMS?=linux/amd64,linux/arm64 -+PLATFORMS?=linux/ppc64le - OUTPUT?= - PROGRESS=auto - EXTRA_BUILD_OPT?= diff --git a/images/base/Dockerfile b/images/base/Dockerfile index 6a04799..31d9455 100644 --- a/images/base/Dockerfile @@ -71,31 +44,3 @@ index f8226e1..dc9980f 100755 *) exit 1 ;; esac -diff --git a/pkg/build/nodeimage/const_cni.go b/pkg/build/nodeimage/const_cni.go -index 6715884..bde6799 100644 ---- a/pkg/build/nodeimage/const_cni.go -+++ b/pkg/build/nodeimage/const_cni.go -@@ -20,7 +20,7 @@ package nodeimage - The default CNI manifest and images are our own tiny kindnet - */ - --const kindnetdImage = "docker.io/kindest/kindnetd:v20240513-cd2ac642" -+const kindnetdImage = "quay.io/kviswana/kindnetd:v20240611-d897688d" - - var defaultCNIImages = []string{kindnetdImage} - -diff --git a/pkg/build/nodeimage/const_storage.go b/pkg/build/nodeimage/const_storage.go -index 7ddb8a6..f1ec3a9 100644 ---- a/pkg/build/nodeimage/const_storage.go -+++ b/pkg/build/nodeimage/const_storage.go -@@ -25,8 +25,8 @@ NOTE: we have customized it in the following ways: - - install as the default storage class - */ - --const storageProvisionerImage = "docker.io/kindest/local-path-provisioner:v20240513-b9bba138" --const storageHelperImage = "docker.io/kindest/local-path-helper:v20230510-486859a6" -+const storageProvisionerImage = "quay.io/kviswana/local-path-provisioner:v20240611-d897688d" -+const storageHelperImage = "quay.io/kviswana/local-path-helper:v20240611-d897688d" - - // image we need to preload - var defaultStorageImages = []string{storageProvisionerImage, storageHelperImage}