diff --git a/.github/workflows/build-multiarch-backend.yml b/.github/workflows/build-multiarch-backend.yml new file mode 100644 index 0000000..1fc265e --- /dev/null +++ b/.github/workflows/build-multiarch-backend.yml @@ -0,0 +1,23 @@ +name: Build and Push Multi-Arch Image +on: [push] + +jobs: + build-and-push: + runs-on: ubuntu-latest + steps: + - name: Check out code + uses: actions/checkout@v3 + + - name: Set up QEMU + uses: docker/setup-qemu-action@v2 + + - name: Set up Buildx + uses: docker/setup-buildx-action@v2 + + - name: Login to Quay + run: | + echo "${{ secrets.QUAY_TOKEN }}" | docker login quay.io -u "${{ secrets.QUAY_USER }}" --password-stdin + + - name: Build and Push Multi-Arch Image + run: | + ./plano --file backend/.plano.py build,push \ No newline at end of file diff --git a/.github/workflows/build-multiarch-frontend.yml b/.github/workflows/build-multiarch-frontend.yml new file mode 100644 index 0000000..187525a --- /dev/null +++ b/.github/workflows/build-multiarch-frontend.yml @@ -0,0 +1,23 @@ +name: Build and Push Multi-Arch Image +on: [push] + +jobs: + build-and-push: + runs-on: ubuntu-latest + steps: + - name: Check out code + uses: actions/checkout@v3 + + - name: Set up QEMU + uses: docker/setup-qemu-action@v2 + + - name: Set up Buildx + uses: docker/setup-buildx-action@v2 + + - name: Login to Quay + run: | + echo "${{ secrets.QUAY_TOKEN }}" | docker login quay.io -u "${{ secrets.QUAY_USER }}" --password-stdin + + - name: Build and Push Multi-Arch Image + run: | + ./plano --file frontend/.plano.py update-gesso,build,push \ No newline at end of file diff --git a/backend/.plano.py b/backend/.plano.py index 45b59b6..f1dd087 100644 --- a/backend/.plano.py +++ b/backend/.plano.py @@ -25,7 +25,9 @@ def build(no_cache=False): no_cache_arg = "--no-cache" if no_cache else "" - run(f"podman build {no_cache_arg} --format docker -t {image_tag} .") + run(f"podman manifest rm {image_tag}", check=False) + run(f"podman rmi {image_tag}", check=False) + run(f"podman build {no_cache_arg} --format docker --platform linux/amd64,linux/arm64,linux/s390x,linux/ppc64le --file backend/Containerfile --manifest {image_tag} ./backend") @command def run_(): @@ -38,4 +40,4 @@ def debug(): @command def push(): run("podman login quay.io") - run(f"podman push {image_tag}") + run(f"podman manifest push {image_tag}") diff --git a/backend/Containerfile b/backend/Containerfile index d31ac76..c41fcfc 100644 --- a/backend/Containerfile +++ b/backend/Containerfile @@ -26,7 +26,7 @@ FROM python:alpine AS run RUN adduser -S fritz -G root USER fritz -COPY --from=build /usr/local/lib/python3.12/site-packages /usr/local/lib/python3.12/site-packages +COPY --from=build /usr/local/lib/python3.14/site-packages /usr/local/lib/python3.14/site-packages COPY --chown=fritz:root python /home/fritz/python EXPOSE 8080 diff --git a/frontend/.plano.py b/frontend/.plano.py index 5901e3b..c42f30f 100644 --- a/frontend/.plano.py +++ b/frontend/.plano.py @@ -26,7 +26,9 @@ def build(no_cache=False): no_cache_arg = "--no-cache" if no_cache else "" - run(f"podman build {no_cache_arg} --format docker -t {image_tag} .") + run(f"podman manifest rm {image_tag}", check=False) + run(f"podman rmi {image_tag}", check=False) + run(f"podman build {no_cache_arg} --format docker --platform linux/amd64,linux/arm64,linux/s390x,linux/ppc64le --file frontend/Containerfile --manifest {image_tag} ./frontend") @command def run_(): @@ -57,7 +59,7 @@ def debug(): @command def push(): run("podman login quay.io") - run(f"podman push {image_tag}") + run(f"podman manifest push {image_tag}") @command def update_gesso(): diff --git a/frontend/Containerfile b/frontend/Containerfile index f098493..c62fac0 100644 --- a/frontend/Containerfile +++ b/frontend/Containerfile @@ -26,7 +26,7 @@ FROM python:alpine AS run RUN adduser -S fritz -G root USER fritz -COPY --from=build /usr/local/lib/python3.12/site-packages /usr/local/lib/python3.12/site-packages +COPY --from=build /usr/local/lib/python3.14/site-packages /usr/local/lib/python3.14/site-packages COPY --chown=fritz:root python /home/fritz/python COPY --chown=fritz:root static /home/fritz/static