Skip to content

Commit bf726df

Browse files
committed
feat: add multi-architecture (arm64) support for tier 1 images
Enable linux/amd64,linux/arm64 builds for all tier 1 images while keeping readflag as amd64-only due to architecture-specific assembly code. - Add support_multi_arch config flag - Setup QEMU and Buildx in GitHub Actions - Update gen_action.py for conditional platform configuration
1 parent 5af9c96 commit bf726df

16 files changed

Lines changed: 190 additions & 3 deletions

.github/workflows/base.flask.yml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,12 @@ jobs:
2525
- name: Checkout repository
2626
uses: actions/checkout@v4
2727

28+
- name: Set up QEMU
29+
uses: docker/setup-qemu-action@v3
30+
31+
- name: Set up Docker Buildx
32+
uses: docker/setup-buildx-action@v3
33+
2834
- name: Log in to the Container registry
2935
uses: docker/login-action@v3
3036
with:
@@ -45,6 +51,7 @@ jobs:
4551
with:
4652
context: base/${{ env.NAME }}
4753
file: base/${{ env.NAME }}/Dockerfile
54+
platforms: linux/amd64,linux/arm64
4855
tags: ${{ steps.meta.outputs.tags }}
4956
labels: ${{ steps.meta.outputs.labels }}
5057
push: true

.github/workflows/base.numpy.yml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,12 @@ jobs:
2525
- name: Checkout repository
2626
uses: actions/checkout@v4
2727

28+
- name: Set up QEMU
29+
uses: docker/setup-qemu-action@v3
30+
31+
- name: Set up Docker Buildx
32+
uses: docker/setup-buildx-action@v3
33+
2834
- name: Log in to the Container registry
2935
uses: docker/login-action@v3
3036
with:
@@ -45,6 +51,7 @@ jobs:
4551
with:
4652
context: base/${{ env.NAME }}
4753
file: base/${{ env.NAME }}/Dockerfile
54+
platforms: linux/amd64,linux/arm64
4855
tags: ${{ steps.meta.outputs.tags }}
4956
labels: ${{ steps.meta.outputs.labels }}
5057
push: true

.github/workflows/base.php-7.4.yml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,12 @@ jobs:
2525
- name: Checkout repository
2626
uses: actions/checkout@v4
2727

28+
- name: Set up QEMU
29+
uses: docker/setup-qemu-action@v3
30+
31+
- name: Set up Docker Buildx
32+
uses: docker/setup-buildx-action@v3
33+
2834
- name: Log in to the Container registry
2935
uses: docker/login-action@v3
3036
with:
@@ -45,6 +51,7 @@ jobs:
4551
with:
4652
context: base/${{ env.NAME }}
4753
file: base/${{ env.NAME }}/Dockerfile.7.4
54+
platforms: linux/amd64,linux/arm64
4855
tags: ${{ steps.meta.outputs.tags }}
4956
labels: ${{ steps.meta.outputs.labels }}
5057
push: true

.github/workflows/base.php.yml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,12 @@ jobs:
2525
- name: Checkout repository
2626
uses: actions/checkout@v4
2727

28+
- name: Set up QEMU
29+
uses: docker/setup-qemu-action@v3
30+
31+
- name: Set up Docker Buildx
32+
uses: docker/setup-buildx-action@v3
33+
2834
- name: Log in to the Container registry
2935
uses: docker/login-action@v3
3036
with:
@@ -45,6 +51,7 @@ jobs:
4551
with:
4652
context: base/${{ env.NAME }}
4753
file: base/${{ env.NAME }}/Dockerfile
54+
platforms: linux/amd64,linux/arm64
4855
tags: ${{ steps.meta.outputs.tags }}
4956
labels: ${{ steps.meta.outputs.labels }}
5057
push: true

.github/workflows/base.python-3.11.yml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,12 @@ jobs:
2525
- name: Checkout repository
2626
uses: actions/checkout@v4
2727

28+
- name: Set up QEMU
29+
uses: docker/setup-qemu-action@v3
30+
31+
- name: Set up Docker Buildx
32+
uses: docker/setup-buildx-action@v3
33+
2834
- name: Log in to the Container registry
2935
uses: docker/login-action@v3
3036
with:
@@ -45,6 +51,7 @@ jobs:
4551
with:
4652
context: base/${{ env.NAME }}
4753
file: base/${{ env.NAME }}/Dockerfile.3.11
54+
platforms: linux/amd64,linux/arm64
4855
tags: ${{ steps.meta.outputs.tags }}
4956
labels: ${{ steps.meta.outputs.labels }}
5057
push: true

.github/workflows/base.python-3.12.yml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,12 @@ jobs:
2525
- name: Checkout repository
2626
uses: actions/checkout@v4
2727

28+
- name: Set up QEMU
29+
uses: docker/setup-qemu-action@v3
30+
31+
- name: Set up Docker Buildx
32+
uses: docker/setup-buildx-action@v3
33+
2834
- name: Log in to the Container registry
2935
uses: docker/login-action@v3
3036
with:
@@ -45,6 +51,7 @@ jobs:
4551
with:
4652
context: base/${{ env.NAME }}
4753
file: base/${{ env.NAME }}/Dockerfile.3.12
54+
platforms: linux/amd64,linux/arm64
4855
tags: ${{ steps.meta.outputs.tags }}
4956
labels: ${{ steps.meta.outputs.labels }}
5057
push: true
Lines changed: 82 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,82 @@
1+
name: Python 3.13
2+
3+
on:
4+
push:
5+
branches: ["main"]
6+
paths:
7+
- "base/python/**"
8+
- "updates/tier1.md"
9+
- ".github/workflows/base.python-3.13.yml"
10+
workflow_dispatch:
11+
12+
env:
13+
REGISTRY: ghcr.io
14+
NAME: python
15+
TAG: 3.13-alpine
16+
17+
jobs:
18+
build-and-push-image:
19+
runs-on: ubuntu-latest
20+
permissions:
21+
contents: read
22+
packages: write
23+
24+
steps:
25+
- name: Checkout repository
26+
uses: actions/checkout@v4
27+
28+
- name: Set up QEMU
29+
uses: docker/setup-qemu-action@v3
30+
31+
- name: Set up Docker Buildx
32+
uses: docker/setup-buildx-action@v3
33+
34+
- name: Log in to the Container registry
35+
uses: docker/login-action@v3
36+
with:
37+
registry: ${{ env.REGISTRY }}
38+
username: ${{ github.actor }}
39+
password: ${{ secrets.GITHUB_TOKEN }}
40+
41+
- name: Extract metadata (tags, labels) for Docker
42+
id: meta
43+
uses: docker/metadata-action@v5
44+
with:
45+
images: ${{ env.REGISTRY }}/${{ github.repository }}/${{ env.NAME }}
46+
tags: |
47+
${{ env.TAG }}
48+
49+
- name: Build and push Docker image
50+
uses: docker/build-push-action@v5
51+
with:
52+
context: base/${{ env.NAME }}
53+
file: base/${{ env.NAME }}/Dockerfile.3.13
54+
platforms: linux/amd64,linux/arm64
55+
tags: ${{ steps.meta.outputs.tags }}
56+
labels: ${{ steps.meta.outputs.labels }}
57+
push: true
58+
59+
cleanup-images:
60+
runs-on: ubuntu-latest
61+
needs: build-and-push-image
62+
permissions:
63+
contents: read
64+
packages: write
65+
concurrency:
66+
group: cleanup-images-python
67+
steps:
68+
- name: Get lower case repository name
69+
id: lower_repo
70+
run: |
71+
export REPO_NAME=${{ github.event.repository.name }}
72+
echo "repo_name=${REPO_NAME@L}" >> $GITHUB_OUTPUT
73+
74+
- name: Prune old packages
75+
uses: dataaxiom/ghcr-cleanup-action@v1
76+
with:
77+
token: ${{ secrets.GITHUB_TOKEN }}
78+
package: ${{ steps.lower_repo.outputs.repo_name }}/${{ env.NAME }}
79+
dry-run: false
80+
delete-untagged: true
81+
delete-ghost-images: true
82+
delete-partial-images: true

.github/workflows/base.python.yml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,12 @@ jobs:
2525
- name: Checkout repository
2626
uses: actions/checkout@v4
2727

28+
- name: Set up QEMU
29+
uses: docker/setup-qemu-action@v3
30+
31+
- name: Set up Docker Buildx
32+
uses: docker/setup-buildx-action@v3
33+
2834
- name: Log in to the Container registry
2935
uses: docker/login-action@v3
3036
with:
@@ -45,6 +51,7 @@ jobs:
4551
with:
4652
context: base/${{ env.NAME }}
4753
file: base/${{ env.NAME }}/Dockerfile
54+
platforms: linux/amd64,linux/arm64
4855
tags: ${{ steps.meta.outputs.tags }}
4956
labels: ${{ steps.meta.outputs.labels }}
5057
push: true

.github/workflows/base.readflag-minimal.yml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,12 @@ jobs:
2525
- name: Checkout repository
2626
uses: actions/checkout@v4
2727

28+
- name: Set up QEMU
29+
uses: docker/setup-qemu-action@v3
30+
31+
- name: Set up Docker Buildx
32+
uses: docker/setup-buildx-action@v3
33+
2834
- name: Log in to the Container registry
2935
uses: docker/login-action@v3
3036
with:
@@ -45,6 +51,7 @@ jobs:
4551
with:
4652
context: base/${{ env.NAME }}
4753
file: base/${{ env.NAME }}/Dockerfile.minimal
54+
4855
tags: ${{ steps.meta.outputs.tags }}
4956
labels: ${{ steps.meta.outputs.labels }}
5057
push: true

.github/workflows/base.readflag.yml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,12 @@ jobs:
2525
- name: Checkout repository
2626
uses: actions/checkout@v4
2727

28+
- name: Set up QEMU
29+
uses: docker/setup-qemu-action@v3
30+
31+
- name: Set up Docker Buildx
32+
uses: docker/setup-buildx-action@v3
33+
2834
- name: Log in to the Container registry
2935
uses: docker/login-action@v3
3036
with:
@@ -45,6 +51,7 @@ jobs:
4551
with:
4652
context: base/${{ env.NAME }}
4753
file: base/${{ env.NAME }}/Dockerfile
54+
4855
tags: ${{ steps.meta.outputs.tags }}
4956
labels: ${{ steps.meta.outputs.labels }}
5057
push: true

0 commit comments

Comments
 (0)