From 956d57f4e275632e51de5b29a627d6b675ea97e6 Mon Sep 17 00:00:00 2001 From: Misha Sakhnov Date: Mon, 21 Oct 2024 13:06:05 +0200 Subject: [PATCH] vm-builder,ci: pass target arch as vm-builder argument --- .github/workflows/build-test-vm.yaml | 3 ++- .github/workflows/vm-example.yaml | 13 ++++++++----- 2 files changed, 10 insertions(+), 6 deletions(-) diff --git a/.github/workflows/build-test-vm.yaml b/.github/workflows/build-test-vm.yaml index 2c7f991be..265b807bc 100644 --- a/.github/workflows/build-test-vm.yaml +++ b/.github/workflows/build-test-vm.yaml @@ -31,6 +31,7 @@ env: IMG_POSTGRES_16_BULLSEYE: "neondatabase/vm-postgres-16-bullseye" # using image built in the same workflow IMG_DAEMON: "daemon:dev" + TARGET_ARCH: "amd64" defaults: run: @@ -85,7 +86,7 @@ jobs: - name: build ${{ needs.tags.outputs.vm-postgres-16-bullseye }} run: | - ./bin/vm-builder -src postgres:16-bullseye -spec tests/e2e/image-spec.yaml -dst ${{ needs.tags.outputs.vm-postgres-16-bullseye }} -daemon-image ${{ needs.tags.outputs.daemon }} + ./bin/vm-builder -src postgres:16-bullseye -spec tests/e2e/image-spec.yaml -dst ${{ needs.tags.outputs.vm-postgres-16-bullseye }} -daemon-image ${{ needs.tags.outputs.daemon }} -target-arch linux/${TARGET_ARCH} - name: docker push ${{ needs.tags.outputs.vm-postgres-16-bullseye }} run: | docker push ${{ needs.tags.outputs.vm-postgres-16-bullseye }} diff --git a/.github/workflows/vm-example.yaml b/.github/workflows/vm-example.yaml index 394a69ddf..15ee7599c 100644 --- a/.github/workflows/vm-example.yaml +++ b/.github/workflows/vm-example.yaml @@ -5,6 +5,9 @@ on: - cron: '42 4 * * 2' # run once a week workflow_dispatch: # adds ability to run this manually +env: + TARGET_ARCH: amd64 + jobs: vm-example: runs-on: ubuntu-latest @@ -31,26 +34,26 @@ jobs: password: ${{ secrets.NEON_DOCKERHUB_PASSWORD }} - name: build vm-alpine:3.16 - run: bin/vm-builder -src alpine:3.16 -dst neondatabase/vm-alpine:3.16 + run: bin/vm-builder -src alpine:3.16 -dst neondatabase/vm-alpine:3.16 -target-arch/${TARGET_ARCH} - name: push vm-alpine:3.16 run: docker push -q neondatabase/vm-alpine:3.16 - name: build vm-ubuntu:22.04 - run: bin/vm-builder -src ubuntu:22.04 -dst neondatabase/vm-ubuntu:22.04 + run: bin/vm-builder -src ubuntu:22.04 -dst neondatabase/vm-ubuntu:22.04 -target-arch/${TARGET_ARCH} - name: push vm-ubuntu:22.04 run: docker push -q neondatabase/vm-ubuntu:22.04 - name: build vm-debian:11 - run: bin/vm-builder -src debian:11 -dst neondatabase/vm-debian:11 + run: bin/vm-builder -src debian:11 -dst neondatabase/vm-debian:11 -target-arch/${TARGET_ARCH} - name: push vm-debian:11 run: docker push -q neondatabase/vm-debian:11 - name: build vm-postgres:14-alpine - run: bin/vm-builder -src postgres:14-alpine -dst neondatabase/vm-postgres:14-alpine + run: bin/vm-builder -src postgres:14-alpine -dst neondatabase/vm-postgres:14-alpine -target-arch/${TARGET_ARCH} - name: push vm-postgres:14-alpine run: docker push -q neondatabase/vm-postgres:14-alpine - name: build vm-postgres:15-alpine - run: bin/vm-builder -src postgres:15-alpine -dst neondatabase/vm-postgres:15-alpine + run: bin/vm-builder -src postgres:15-alpine -dst neondatabase/vm-postgres:15-alpine -target-arch/${TARGET_ARCH} - name: push vm-postgres:15-alpine run: docker push -q neondatabase/vm-postgres:15-alpine