Skip to content

Commit f0d75af

Browse files
committed
* Enabling power arch builds for v2
* Enabling plano tool for image builds * Added new github action workflow files for frontend and backend * updated python version in Containerfiles as tag alpine uses updated python v3.14 Signed-off-by: Kaushik Talathi <kaushik.talathi1@ibm.com>
1 parent 5f371cb commit f0d75af

File tree

6 files changed

+56
-6
lines changed

6 files changed

+56
-6
lines changed
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
name: Build and Push Multi-Arch Image
2+
on: [push]
3+
4+
jobs:
5+
build-and-push:
6+
runs-on: ubuntu-latest
7+
steps:
8+
- name: Check out code
9+
uses: actions/checkout@v3
10+
11+
- name: Set up QEMU
12+
uses: docker/setup-qemu-action@v2
13+
14+
- name: Set up Buildx
15+
uses: docker/setup-buildx-action@v2
16+
17+
- name: Login to Quay
18+
run: |
19+
echo "${{ secrets.QUAY_TOKEN }}" | docker login quay.io -u "${{ secrets.QUAY_USER }}" --password-stdin
20+
21+
- name: Build and Push Multi-Arch Image
22+
run: |
23+
./plano --file backend/.plano.py build,push
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
name: Build and Push Multi-Arch Image
2+
on: [push]
3+
4+
jobs:
5+
build-and-push:
6+
runs-on: ubuntu-latest
7+
steps:
8+
- name: Check out code
9+
uses: actions/checkout@v3
10+
11+
- name: Set up QEMU
12+
uses: docker/setup-qemu-action@v2
13+
14+
- name: Set up Buildx
15+
uses: docker/setup-buildx-action@v2
16+
17+
- name: Login to Quay
18+
run: |
19+
echo "${{ secrets.QUAY_TOKEN }}" | docker login quay.io -u "${{ secrets.QUAY_USER }}" --password-stdin
20+
21+
- name: Build and Push Multi-Arch Image
22+
run: |
23+
./plano --file frontend/.plano.py update-gesso,build,push

backend/.plano.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,9 @@
2525
def build(no_cache=False):
2626
no_cache_arg = "--no-cache" if no_cache else ""
2727

28-
run(f"podman build {no_cache_arg} --format docker -t {image_tag} .")
28+
run(f"podman manifest rm {image_tag}", check=False)
29+
run(f"podman rmi {image_tag}", check=False)
30+
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")
2931

3032
@command
3133
def run_():
@@ -38,4 +40,4 @@ def debug():
3840
@command
3941
def push():
4042
run("podman login quay.io")
41-
run(f"podman push {image_tag}")
43+
run(f"podman manifest push {image_tag}")

backend/Containerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ FROM python:alpine AS run
2626
RUN adduser -S fritz -G root
2727
USER fritz
2828

29-
COPY --from=build /usr/local/lib/python3.12/site-packages /usr/local/lib/python3.12/site-packages
29+
COPY --from=build /usr/local/lib/python3.14/site-packages /usr/local/lib/python3.14/site-packages
3030
COPY --chown=fritz:root python /home/fritz/python
3131

3232
EXPOSE 8080

frontend/.plano.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,9 @@
2626
def build(no_cache=False):
2727
no_cache_arg = "--no-cache" if no_cache else ""
2828

29-
run(f"podman build {no_cache_arg} --format docker -t {image_tag} .")
29+
run(f"podman manifest rm {image_tag}", check=False)
30+
run(f"podman rmi {image_tag}", check=False)
31+
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")
3032

3133
@command
3234
def run_():
@@ -57,7 +59,7 @@ def debug():
5759
@command
5860
def push():
5961
run("podman login quay.io")
60-
run(f"podman push {image_tag}")
62+
run(f"podman manifest push {image_tag}")
6163

6264
@command
6365
def update_gesso():

frontend/Containerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ FROM python:alpine AS run
2626
RUN adduser -S fritz -G root
2727
USER fritz
2828

29-
COPY --from=build /usr/local/lib/python3.12/site-packages /usr/local/lib/python3.12/site-packages
29+
COPY --from=build /usr/local/lib/python3.14/site-packages /usr/local/lib/python3.14/site-packages
3030
COPY --chown=fritz:root python /home/fritz/python
3131
COPY --chown=fritz:root static /home/fritz/static
3232

0 commit comments

Comments
 (0)