From 3df64ca5847c9f1c9597972efcf397d3d638fb87 Mon Sep 17 00:00:00 2001 From: Toby Bellwood Date: Fri, 26 Apr 2024 15:39:26 +1000 Subject: [PATCH 1/2] build: enable multiarch image and update GHA --- .github/workflows/aergia-controller.yaml | 8 ++++---- .github/workflows/build_and_publish.yml | 19 +++++++++---------- Dockerfile | 2 +- 3 files changed, 14 insertions(+), 15 deletions(-) diff --git a/.github/workflows/aergia-controller.yaml b/.github/workflows/aergia-controller.yaml index 6900dc2..0f78aa6 100644 --- a/.github/workflows/aergia-controller.yaml +++ b/.github/workflows/aergia-controller.yaml @@ -22,13 +22,13 @@ jobs: experimental: true steps: - name: Checkout - uses: actions/checkout@v2 + uses: actions/checkout@v4 with: fetch-depth: "0" - name: Set up testing dependencies run: sudo apt-get update && sudo apt-get -y install build-essential && sudo apt-get clean - name: Setup correct Go version - uses: actions/setup-go@v2 + uses: actions/setup-go@v5 with: go-version: '1.21' - name: Install kustomize, kubebuilder, helm @@ -53,9 +53,9 @@ jobs: node_image: kindest/node:${{ matrix.kindest_node_version }} config: test-resources/kind-cluster.yaml - name: Set up Docker Buildx - uses: docker/setup-buildx-action@v1 + uses: docker/setup-buildx-action@v3 - name: Build - uses: docker/build-push-action@v2 + uses: docker/build-push-action@v5 with: context: . load: true diff --git a/.github/workflows/build_and_publish.yml b/.github/workflows/build_and_publish.yml index 664207d..7b0b79e 100644 --- a/.github/workflows/build_and_publish.yml +++ b/.github/workflows/build_and_publish.yml @@ -16,11 +16,11 @@ jobs: steps: - name: Checkout - uses: actions/checkout@v2 + uses: actions/checkout@v4 - name: Docker meta id: meta - uses: docker/metadata-action@v3 + uses: docker/metadata-action@v5 with: # list of Docker images to use as base name for tags images: | @@ -28,30 +28,29 @@ jobs: ghcr.io/amazeeio/aergia - name: Set up QEMU - uses: docker/setup-qemu-action@v1 + uses: docker/setup-qemu-action@v3 - name: Set up Docker Buildx - uses: docker/setup-buildx-action@v1 + uses: docker/setup-buildx-action@v3 - name: Login to DockerHub - if: github.event_name != 'pull_request' - uses: docker/login-action@v1 + uses: docker/login-action@v3 with: username: ${{ secrets.DOCKERHUB_USERNAME }} password: ${{ secrets.DOCKERHUB_TOKEN }} - name: Login to GHCR - if: github.event_name != 'pull_request' - uses: docker/login-action@v1 + uses: docker/login-action@v3 with: registry: ghcr.io username: ${{ github.repository_owner }} password: ${{ secrets.GITHUB_TOKEN }} - name: Build and push - uses: docker/build-push-action@v2 + uses: docker/build-push-action@v5 with: context: . - push: ${{ github.event_name != 'pull_request' }} + platforms: linux/amd64,linux/arm64 + push: true tags: ${{ steps.meta.outputs.tags }} labels: ${{ steps.meta.outputs.labels }} \ No newline at end of file diff --git a/Dockerfile b/Dockerfile index a556644..54ed68d 100644 --- a/Dockerfile +++ b/Dockerfile @@ -16,7 +16,7 @@ COPY handlers/ handlers/ COPY controllers/ controllers/ # Build -RUN CGO_ENABLED=0 GOOS=linux GOARCH=amd64 GO111MODULE=on go build -a -o manager main.go metrics.go +RUN CGO_ENABLED=0 GOOS=linux GOARCH=${ARCH} GO111MODULE=on go build -a -o manager main.go metrics.go # Use distroless as minimal base image to package the manager binary # Refer to https://github.com/GoogleContainerTools/distroless for more details From 13da7ac3765559ad9cb2cfd75e194dfcf0a2a2a9 Mon Sep 17 00:00:00 2001 From: Toby Bellwood Date: Fri, 26 Apr 2024 15:43:02 +1000 Subject: [PATCH 2/2] build: use non-amazeeio namespace for images --- .github/workflows/aergia-controller.yaml | 4 ++-- .github/workflows/build_and_publish.yml | 4 ++-- Makefile | 2 +- test-resources/aergia-backend.yaml | 2 +- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/.github/workflows/aergia-controller.yaml b/.github/workflows/aergia-controller.yaml index 0f78aa6..3559d61 100644 --- a/.github/workflows/aergia-controller.yaml +++ b/.github/workflows/aergia-controller.yaml @@ -59,8 +59,8 @@ jobs: with: context: . load: true - tags: amazeeiolocal/aergia:test-tag + tags: testlagoon/aergia:test-tag - name: Run Tests run: | - kind load docker-image amazeeiolocal/aergia:test-tag --name chart-testing + kind load docker-image testlagoon/aergia:test-tag --name chart-testing make controller-test \ No newline at end of file diff --git a/.github/workflows/build_and_publish.yml b/.github/workflows/build_and_publish.yml index 7b0b79e..b568b06 100644 --- a/.github/workflows/build_and_publish.yml +++ b/.github/workflows/build_and_publish.yml @@ -24,8 +24,8 @@ jobs: with: # list of Docker images to use as base name for tags images: | - amazeeio/aergia - ghcr.io/amazeeio/aergia + uselagoon/aergia + ghcr.io/uselagoon/aergia - name: Set up QEMU uses: docker/setup-qemu-action@v3 diff --git a/Makefile b/Makefile index 502bd07..d75c8a6 100644 --- a/Makefile +++ b/Makefile @@ -1,6 +1,6 @@ # Image URL to use all building/pushing image targets -IMG ?= amazeeiolocal/aergia:test-tag +IMG ?= testlagoon/aergia:test-tag # Produce CRDs that work back to Kubernetes 1.11 (no version conversion) CRD_OPTIONS ?= "crd:trivialVersions=true" diff --git a/test-resources/aergia-backend.yaml b/test-resources/aergia-backend.yaml index d826328..b5298ef 100644 --- a/test-resources/aergia-backend.yaml +++ b/test-resources/aergia-backend.yaml @@ -258,7 +258,7 @@ spec: name: backend command: - /manager - image: amazeeiolocal/aergia:test-tag + image: testlagoon/aergia:test-tag name: manager resources: limits: