Skip to content

Commit

Permalink
docker: limit arm build
Browse files Browse the repository at this point in the history
  • Loading branch information
mloubout committed Aug 9, 2023
1 parent 1d31fd1 commit 4cf8825
Show file tree
Hide file tree
Showing 2 changed files with 85 additions and 10 deletions.
93 changes: 84 additions & 9 deletions .github/workflows/docker-bases.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,20 +18,40 @@ on:
# Run once a week
- cron: "0 13 * * 1"

jobs:
#######################################################
############## Basic gcc CPU ##########################
#######################################################
deploy-cpu-bases:
name: "cpu-base"
jobs:
build:
name: cpu-base-${{ matrix.platform }}
runs-on: ubuntu-latest
env:
DOCKER_BUILDKIT: "1"

strategy:
fail-fast: false
matrix:
platform:
- linux/amd64
- linux/arm/v6
- linux/arm/v7
- linux/arm64

steps:
- name: Checkout devito
uses: actions/checkout@v3

- name: Docker meta
id: meta
uses: docker/metadata-action@v4
with:
images: |
devitocodes/bases
tags: |
type=raw,value=cpu-gcc
flavor: |
latest=false
- name: Check event name
run: echo ${{ github.event_name }}

Expand All @@ -47,19 +67,74 @@ jobs:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}

- name: cleanup
run: docker system prune -a -f

- name: GCC image
uses: docker/build-push-action@v3
with:
context: .
file: './docker/Dockerfile.cpu'
push: true
target: 'gcc'
labels: ${{ steps.meta.outputs.labels }}
build-args: 'arch=gcc'
tags: 'devitocodes/bases:cpu-gcc'
platforms: linux/amd64,linux/arm64,linux/arm/v6,linux/arm/v7
platforms: ${{ matrix.platform }}
outputs: type=image,name=devitocodes/bases,push-by-digest=true,name-canonical=true,push=true

- name: Export digest
run: |
mkdir -p /tmp/digests
digest="${{ steps.build.outputs.digest }}"
touch "/tmp/digests/${digest#sha256:}"
- name: Upload digest
uses: actions/upload-artifact@v3
with:
name: digests
path: /tmp/digests/*
if-no-files-found: error
retention-days: 1

merge:
runs-on: ubuntu-latest
needs:
- build
env:
DOCKER_BUILDKIT: "1"

steps:
- name: Download digests
uses: actions/download-artifact@v3
with:
name: digests
path: /tmp/digests

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2

- name: Docker meta
id: meta
uses: docker/metadata-action@v4
with:
images: |
devitocodes/bases
tags: |
type=raw,value=cpu-gcc
flavor: |
latest=false
- name: Login to Docker Hub
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}

- name: Create manifest list and push
working-directory: /tmp/digests
run: |
docker buildx imagetools create $(jq -cr '.tags | map("-t " + .) | join(" ")' <<< "$DOCKER_METADATA_OUTPUT_JSON") \
$(printf 'devitocodes/bases@sha256:%s ' *)
- name: Inspect image
run: |
docker buildx imagetools inspect ${{ env.REGISTRY_IMAGE }}:${{ steps.meta.outputs.version }}
#######################################################
############## Intel OneApi CPU #######################
Expand Down
2 changes: 1 addition & 1 deletion docker/Dockerfile.cpu
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ ARG OMPI_BRANCH="v4.1.4"
RUN mkdir -p /deps && mkdir -p /opt/openmpi && cd /deps && \
git clone --depth 1 --recursive --branch ${OMPI_BRANCH} https://github.com/open-mpi/ompi.git openmpi && \
cd openmpi && ./autogen.pl && \
mkdir build && cd build && \
mkdir build && cd build && \
../configure --prefix=/opt/openmpi/ \
--enable-mca-no-build=btl-uct --enable-mpi1-compatibility && \
make -j ${nproc} && \
Expand Down

0 comments on commit 4cf8825

Please sign in to comment.