From e425baf7348fc46dea772b17c3bec4e1e33b33cb Mon Sep 17 00:00:00 2001 From: Ricardo Lopes Date: Fri, 17 May 2024 16:59:52 +0100 Subject: [PATCH] Load images from ci build cache Signed-off-by: Ricardo Lopes --- .github/workflows/ci.yaml | 6 ++++++ .github/workflows/zz-tmpl-k8s-e2e.yaml | 2 ++ images/Makefile | 8 ++++---- test/e2e/CUSTOMERRORPAGES_IMAGE | 2 +- test/e2e/run-kind-e2e.sh | 4 ++-- 5 files changed, 15 insertions(+), 7 deletions(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 6d0532105..1d6188517 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -193,12 +193,18 @@ jobs: export TAGNGINX=$(cat images/nginx/TAG) make BASE_IMAGE=registry.k8s.io/ingress-nginx/nginx:${TAGNGINX} clean-image build image image-chroot make -C test/e2e-image image + cd images/custom-error-pages/rootfs && docker image build \ + --build-arg=BASE_IMAGE=registry.k8s.io/ingress-nginx/nginx-1.25:${TAGNGINX} \ + --build-arg GOLANG_VERSION=$(cat ../../../GOLANG_VERSION) \ + --tag ingress-controller/custom-error-pages:1.0.0-dev . \ + && cd ../../.. echo "creating images cache..." docker save \ nginx-ingress-controller:e2e \ ingress-controller/controller:1.0.0-dev \ ingress-controller/controller-chroot:1.0.0-dev \ + ingress-controller/custom-error-pages:1.0.0-dev \ | gzip > docker.tar.gz - name: cache diff --git a/.github/workflows/zz-tmpl-k8s-e2e.yaml b/.github/workflows/zz-tmpl-k8s-e2e.yaml index 996b673f9..3eaab8c82 100644 --- a/.github/workflows/zz-tmpl-k8s-e2e.yaml +++ b/.github/workflows/zz-tmpl-k8s-e2e.yaml @@ -43,6 +43,8 @@ jobs: SKIP_CLUSTER_CREATION: true SKIP_INGRESS_IMAGE_CREATION: true SKIP_E2E_IMAGE_CREATION: true + SKIP_CUSTOMERRORPAGES_IMAGE_CREATION: true + ENABLE_VALIDATIONS: ${{ inputs.variation == 'VALIDATIONS' }} IS_CHROOT: ${{ inputs.variation == 'CHROOT' }} run: | kind get kubeconfig > $HOME/.kube/kind-config-kind diff --git a/images/Makefile b/images/Makefile index 31560168d..ca7b52803 100644 --- a/images/Makefile +++ b/images/Makefile @@ -41,9 +41,9 @@ EXTRAARGS ?= $(shell cat $(NAME)/EXTRAARGS) export DOCKER_CLI_EXPERIMENTAL=enabled # build with buildx -PLATFORMS?=linux/amd64,linux/arm,linux/arm64 -OUTPUT= -PROGRESS=plain +BUILDX_PLATFORMS ?= linux/amd64,linux/arm,linux/arm64,linux/s390x +OUTPUT ?= +PROGRESS = plain precheck: @@ -58,7 +58,7 @@ build: precheck ensure-buildx --label=org.opencontainers.image.description="Ingress NGINX $(NAME) image" \ --build-arg BASE_IMAGE=$(BASE_IMAGE) \ --build-arg GOLANG_VERSION=$(GO_VERSION) \ - --platform=${PLATFORMS} $(OUTPUT) \ + --platform=${BUILDX_PLATFORMS} $(OUTPUT) \ --progress=$(PROGRESS) \ --pull $(EXTRAARGS) \ -t $(IMAGE):$(TAG) $(NAME)/rootfs diff --git a/test/e2e/CUSTOMERRORPAGES_IMAGE b/test/e2e/CUSTOMERRORPAGES_IMAGE index 865e0bb3e..cd3f9faa2 100644 --- a/test/e2e/CUSTOMERRORPAGES_IMAGE +++ b/test/e2e/CUSTOMERRORPAGES_IMAGE @@ -1 +1 @@ -localhost/custom-error-pages:e2e +ingress-controller/custom-error-pages:1.0.0-dev diff --git a/test/e2e/run-kind-e2e.sh b/test/e2e/run-kind-e2e.sh index 2e09872e2..c507d8658 100755 --- a/test/e2e/run-kind-e2e.sh +++ b/test/e2e/run-kind-e2e.sh @@ -107,7 +107,7 @@ fi if [ "${SKIP_CUSTOMERRORPAGES_IMAGE_CREATION}" = "false" ]; then echo "[dev-env] building custom-error-pages image" - REGISTRY=localhost NAME=custom-error-pages TAG=e2e make -C "${DIR}"/../../images build + make NAME=custom-error-pages -C "${DIR}"/../../images build echo "[dev-env] .. done building custom-error-pages image" fi @@ -118,6 +118,6 @@ echo "[dev-env] copying docker images to cluster..." kind load docker-image --name="${KIND_CLUSTER_NAME}" --nodes="${KIND_WORKERS}" nginx-ingress-controller:e2e kind load docker-image --name="${KIND_CLUSTER_NAME}" --nodes="${KIND_WORKERS}" "${REGISTRY}"/controller:"${TAG}" -kind load docker-image --name="${KIND_CLUSTER_NAME}" --nodes="${KIND_WORKERS}" "localhost/custom-error-pages:e2e" +kind load docker-image --name="${KIND_CLUSTER_NAME}" --nodes="${KIND_WORKERS}" "${REGISTRY}"/custom-error-pages:"${TAG}" echo "[dev-env] running e2e tests..." make -C "${DIR}"/../../ e2e-test