Skip to content

Commit 4cf8825

Browse files
committed
docker: limit arm build
1 parent 1d31fd1 commit 4cf8825

File tree

2 files changed

+85
-10
lines changed

2 files changed

+85
-10
lines changed

.github/workflows/docker-bases.yml

Lines changed: 84 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -18,20 +18,40 @@ on:
1818
# Run once a week
1919
- cron: "0 13 * * 1"
2020

21-
jobs:
2221
#######################################################
2322
############## Basic gcc CPU ##########################
2423
#######################################################
25-
deploy-cpu-bases:
26-
name: "cpu-base"
24+
jobs:
25+
build:
26+
name: cpu-base-${{ matrix.platform }}
2727
runs-on: ubuntu-latest
2828
env:
2929
DOCKER_BUILDKIT: "1"
30+
31+
strategy:
32+
fail-fast: false
33+
matrix:
34+
platform:
35+
- linux/amd64
36+
- linux/arm/v6
37+
- linux/arm/v7
38+
- linux/arm64
3039

3140
steps:
3241
- name: Checkout devito
3342
uses: actions/checkout@v3
3443

44+
- name: Docker meta
45+
id: meta
46+
uses: docker/metadata-action@v4
47+
with:
48+
images: |
49+
devitocodes/bases
50+
tags: |
51+
type=raw,value=cpu-gcc
52+
flavor: |
53+
latest=false
54+
3555
- name: Check event name
3656
run: echo ${{ github.event_name }}
3757

@@ -47,19 +67,74 @@ jobs:
4767
username: ${{ secrets.DOCKER_USERNAME }}
4868
password: ${{ secrets.DOCKER_PASSWORD }}
4969

50-
- name: cleanup
51-
run: docker system prune -a -f
52-
5370
- name: GCC image
5471
uses: docker/build-push-action@v3
5572
with:
5673
context: .
5774
file: './docker/Dockerfile.cpu'
58-
push: true
5975
target: 'gcc'
76+
labels: ${{ steps.meta.outputs.labels }}
6077
build-args: 'arch=gcc'
61-
tags: 'devitocodes/bases:cpu-gcc'
62-
platforms: linux/amd64,linux/arm64,linux/arm/v6,linux/arm/v7
78+
platforms: ${{ matrix.platform }}
79+
outputs: type=image,name=devitocodes/bases,push-by-digest=true,name-canonical=true,push=true
80+
81+
- name: Export digest
82+
run: |
83+
mkdir -p /tmp/digests
84+
digest="${{ steps.build.outputs.digest }}"
85+
touch "/tmp/digests/${digest#sha256:}"
86+
87+
- name: Upload digest
88+
uses: actions/upload-artifact@v3
89+
with:
90+
name: digests
91+
path: /tmp/digests/*
92+
if-no-files-found: error
93+
retention-days: 1
94+
95+
merge:
96+
runs-on: ubuntu-latest
97+
needs:
98+
- build
99+
env:
100+
DOCKER_BUILDKIT: "1"
101+
102+
steps:
103+
- name: Download digests
104+
uses: actions/download-artifact@v3
105+
with:
106+
name: digests
107+
path: /tmp/digests
108+
109+
- name: Set up Docker Buildx
110+
uses: docker/setup-buildx-action@v2
111+
112+
- name: Docker meta
113+
id: meta
114+
uses: docker/metadata-action@v4
115+
with:
116+
images: |
117+
devitocodes/bases
118+
tags: |
119+
type=raw,value=cpu-gcc
120+
flavor: |
121+
latest=false
122+
123+
- name: Login to Docker Hub
124+
uses: docker/login-action@v2
125+
with:
126+
username: ${{ secrets.DOCKER_USERNAME }}
127+
password: ${{ secrets.DOCKER_PASSWORD }}
128+
129+
- name: Create manifest list and push
130+
working-directory: /tmp/digests
131+
run: |
132+
docker buildx imagetools create $(jq -cr '.tags | map("-t " + .) | join(" ")' <<< "$DOCKER_METADATA_OUTPUT_JSON") \
133+
$(printf 'devitocodes/bases@sha256:%s ' *)
134+
135+
- name: Inspect image
136+
run: |
137+
docker buildx imagetools inspect ${{ env.REGISTRY_IMAGE }}:${{ steps.meta.outputs.version }}
63138
64139
#######################################################
65140
############## Intel OneApi CPU #######################

docker/Dockerfile.cpu

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ ARG OMPI_BRANCH="v4.1.4"
4040
RUN mkdir -p /deps && mkdir -p /opt/openmpi && cd /deps && \
4141
git clone --depth 1 --recursive --branch ${OMPI_BRANCH} https://github.com/open-mpi/ompi.git openmpi && \
4242
cd openmpi && ./autogen.pl && \
43-
mkdir build && cd build && \
43+
mkdir build && cd build && \
4444
../configure --prefix=/opt/openmpi/ \
4545
--enable-mca-no-build=btl-uct --enable-mpi1-compatibility && \
4646
make -j ${nproc} && \

0 commit comments

Comments
 (0)