Skip to content

Build base compilers docker images #267

Build base compilers docker images

Build base compilers docker images #267

Workflow file for this run

name: Build base compilers docker images
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
on:
push:
paths:
- '/docker/Dockerfile.nvidia'
- '/docker/Dockerfile.cpu'
- '/docker/Dockerfile.amd'
- '/docker/Dockerfile.intel'
workflow_dispatch:
inputs:
tags:
description: 'Build compiler bases'
schedule:
# Run once a week
- cron: "0 13 * * 1"
jobs:
#######################################################
############## Basic gcc CPU ##########################
#######################################################
deploy-cpu-bases:
name: cpu-${{ matrix.platform }}
runs-on: ${{ matrix.os }}
env:
DOCKER_BUILDKIT: "1"
REGISTRY_IMAGE: "devitocodes/bases:cpu-gcc"
strategy:
fail-fast: false
matrix:
name: [gcc-arm, gcc-amd64]
include:
- name: gcc-arm
platform: linux/arm
os: macos-latest
- name: gcc-amd64
platform: linux/amd64
os: ubuntu-latest
steps:
- name: Prepare
run: |
platform=${{ matrix.platform }}
echo "PLATFORM_PAIR=${platform//\//-}" >> $GITHUB_ENV
- name: Checkout devito
uses: actions/checkout@v4
- name: Check event name
run: echo ${{ github.event_name }}
- name: Docker meta
id: meta
uses: docker/metadata-action@v5
with:
images: ${{ env.REGISTRY_IMAGE }}
- name: Set up QEMU
uses: docker/setup-qemu-action@v2
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
- name: Login to DockerHub
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
- name: cleanup
run: docker system prune -a -f
- name: GCC image
id: build
uses: docker/build-push-action@v6
with:
context: .
file: './docker/Dockerfile.cpu'
push: true
target: 'gcc'
build-args: 'arch=gcc'
platform: ${{ matrix.platform }}
tags: 'devitocodes/bases:cpu-gcc'
labels: ${{ steps.meta.outputs.labels }}
outputs: type=image,name=${{ env.REGISTRY_IMAGE }},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@v4
with:
name: digests-${{ env.PLATFORM_PAIR }}
path: /tmp/digests/*
if-no-files-found: error
retention-days: 1
merge:
runs-on: ubuntu-latest
needs:
- deploy-cpu-bases
env:
DOCKER_BUILDKIT: "1"
REGISTRY_IMAGE: "devitocodes/bases:cpu-gcc"
steps:
- name: Download digests
uses: actions/download-artifact@v4
with:
path: /tmp/digests
pattern: digests-*
merge-multiple: true
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Docker meta
id: meta
uses: docker/metadata-action@v5
with:
images: ${{ env.REGISTRY_IMAGE }}
- name: Login to Docker Hub
uses: docker/login-action@v3
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 '${{ env.REGISTRY_IMAGE }}@sha256:%s ' *)
- name: Inspect image
run: |
docker buildx imagetools inspect ${{ env.REGISTRY_IMAGE }}:${{ steps.meta.outputs.version }}
#######################################################
############## Intel OneApi CPU #######################
#######################################################
deploy-oneapi-bases:
name: "oneapi-base"
runs-on: ubuntu-latest
env:
DOCKER_BUILDKIT: "1"
steps:
- name: Checkout devito
uses: actions/checkout@v4
- name: Check event name
run: echo ${{ github.event_name }}
- name: Set up QEMU
uses: docker/setup-qemu-action@v2
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
- name: Login to DockerHub
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
- name: cleanup
run: docker system prune -a -f
- name: ICX image
uses: docker/build-push-action@v5
with:
context: .
file: './docker/Dockerfile.intel'
push: true
target: 'icx'
build-args: 'arch=icx'
tags: 'devitocodes/bases:cpu-icx'
- name: SYCL CPU image
uses: docker/build-push-action@v5
with:
context: .
file: './docker/Dockerfile.intel'
push: true
target: 'cpu-sycl'
build-args: 'arch=cpu-sycl'
tags: 'devitocodes/bases:cpu-sycl'
- name: SYCL GPU image
uses: docker/build-push-action@v5
with:
context: .
file: './docker/Dockerfile.intel'
push: true
target: 'gpu-sycl'
build-args: 'arch=gpu-sycl'
tags: 'devitocodes/bases:gpu-sycl'
#######################################################
################### Nvidia nvhpc ######################
#######################################################
deploy-nvidia-bases:
name: "nvidia-bases"
runs-on: ["self-hosted", "nvidiagpu"]
env:
DOCKER_BUILDKIT: "1"
steps:
- name: Checkout devito
uses: actions/checkout@v4
- name: Check event name
run: echo ${{ github.event_name }}
- name: Set up QEMU
uses: docker/setup-qemu-action@v2
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
- name: Login to DockerHub
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
- name: cleanup
run: docker system prune -a -f
- name: NVC image
uses: docker/build-push-action@v5
with:
context: .
file: './docker/Dockerfile.nvidia'
push: true
target: 'nvc'
build-args: 'arch=nvc'
tags: 'devitocodes/bases:nvidia-nvc'
- name: NVCC image
uses: docker/build-push-action@v5
with:
context: .
file: './docker/Dockerfile.nvidia'
push: true
target: 'nvcc'
build-args: 'arch=nvcc'
tags: 'devitocodes/bases:nvidia-nvcc'
- name: NVC host image
uses: docker/build-push-action@v5
with:
context: .
file: './docker/Dockerfile.nvidia'
push: true
target: 'nvc-host'
build-args: 'arch=nvc-host'
tags: 'devitocodes/bases:cpu-nvc'
#######################################################
##################### AMD #############################
#######################################################
deploy-amd-bases:
name: "amd-base"
runs-on: ["self-hosted", "amdgpu"]
env:
DOCKER_BUILDKIT: "1"
steps:
- name: Checkout devito
uses: actions/checkout@v4
- name: Check event name
run: echo ${{ github.event_name }}
- name: Set up QEMU
uses: docker/setup-qemu-action@v2
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
- name: Login to DockerHub
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
- name: cleanup
run: docker system prune -a -f
- name: AMD image
uses: docker/build-push-action@v5
with:
context: .
file: './docker/Dockerfile.amd'
push: true
target: 'amdclang'
tags: devitocodes/bases:amd
- name: AMD HIP image
uses: docker/build-push-action@v5
with:
context: .
file: './docker/Dockerfile.amd'
push: true
target: 'hip'
build-args: |
arch=hip
tags: devitocodes/bases:amd-hip