Build base compilers docker images #165
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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' | |
workflow_dispatch: | |
inputs: | |
tags: | |
description: 'Build compiler bases' | |
schedule: | |
# Run once a week | |
- cron: "0 13 * * 1" | |
####################################################### | |
############## Basic gcc CPU ########################## | |
####################################################### | |
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 }} | |
- 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: GCC image | |
uses: docker/build-push-action@v3 | |
with: | |
context: . | |
file: './docker/Dockerfile.cpu' | |
target: 'gcc' | |
labels: ${{ steps.meta.outputs.labels }} | |
build-args: 'arch=gcc' | |
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 ####################### | |
####################################################### | |
deploy-oneapi-bases: | |
name: "oneapi-base" | |
runs-on: ubuntu-latest | |
env: | |
DOCKER_BUILDKIT: "1" | |
steps: | |
- name: Checkout devito | |
uses: actions/checkout@v3 | |
- 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@v3 | |
with: | |
context: . | |
file: './docker/Dockerfile.cpu' | |
push: true | |
target: 'icx' | |
build-args: 'arch=icx' | |
tags: 'devitocodes/bases:cpu-icx' | |
####################################################### | |
################### Nvidia nvhpc ###################### | |
####################################################### | |
deploy-nvidia-bases: | |
name: "nvidia-bases" | |
runs-on: ["self-hosted", "nvidiagpu"] | |
env: | |
DOCKER_BUILDKIT: "1" | |
steps: | |
- name: Checkout devito | |
uses: actions/checkout@v3 | |
- 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@v3 | |
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@v3 | |
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@v3 | |
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@v3 | |
- 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@v3 | |
with: | |
context: . | |
file: './docker/Dockerfile.amd' | |
push: true | |
target: 'amdclang' | |
tags: devitocodes/bases:amd | |
- name: AMD HIP image | |
uses: docker/build-push-action@v3 | |
with: | |
context: . | |
file: './docker/Dockerfile.amd' | |
push: true | |
target: 'hip' | |
build-args: | | |
arch=hip | |
tags: devitocodes/bases:amd-hip |