fix: CI (distributed) for Intel #88
This file contains hidden or 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
| # SPDX-FileCopyrightText: (C) The Kokkos-FFT development team, see COPYRIGHT.md file | |
| # | |
| # SPDX-License-Identifier: MIT OR Apache-2.0 WITH LLVM-exception | |
| # Generate base images for each compiler environment. Images are stored on | |
| # Github registry as Docker format inconditionnaly and as Singularity format | |
| # only if requested. Docker images are used for building Kokkos FFT, while | |
| # Singularity images are used for test execution on the righteous hardware. | |
| # It runs once month, on any push on `main` if Docker files are changed, and | |
| # mannualy. | |
| # It also runs on pull requests, but then the Singularity image is not created, | |
| # and no images are pushed to the registry. | |
| name: Create base images | |
| on: | |
| schedule: | |
| - cron: "0 1 2 * *" # every 2nd of the month at 1am UTC | |
| push: | |
| branches: | |
| - 'main' | |
| paths: | |
| - 'docker/**/Dockerfile' | |
| pull_request: | |
| paths: | |
| - 'docker/**/Dockerfile' | |
| workflow_dispatch: | |
| env: | |
| # Force the use of BuildKit for Docker | |
| DOCKER_BUILDKIT: 1 | |
| jobs: | |
| create_base: | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: read | |
| packages: write | |
| strategy: | |
| matrix: | |
| image: | |
| - name: gcc | |
| use_singularity: false | |
| - name: clang | |
| use_singularity: false | |
| - name: nvcc | |
| use_singularity: true | |
| - name: rocm | |
| use_singularity: false | |
| - name: intel | |
| use_singularity: false | |
| steps: | |
| - name: Free Disk Space (Ubuntu) | |
| uses: jlumbroso/free-disk-space@54081f138730dfa15788a46383842cd2f914a1be # v1.3.1 | |
| with: | |
| tool-cache: true | |
| large-packages: false | |
| - name: Checkout repository | |
| uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 | |
| - name: Get Singularity | |
| env: | |
| SINGULARITY_VERSION: 3.11.2 | |
| run: | | |
| wget https://github.com/sylabs/singularity/releases/download/v${{ env.SINGULARITY_VERSION }}/singularity-ce_${{ env.SINGULARITY_VERSION }}-jammy_amd64.deb | |
| sudo apt-get install ./singularity-ce_${{ env.SINGULARITY_VERSION }}-jammy_amd64.deb | |
| - name: Login in GitHub Containers Repository with Docker | |
| uses: docker/login-action@5e57cd118135c172c3672efd75eb46360885c0ef # v3.6.0 | |
| with: | |
| registry: ghcr.io | |
| username: ${{ github.actor }} | |
| password: ${{ secrets.GITHUB_TOKEN }} | |
| - name: Login in GitHub Containers Repository with Singularity | |
| run: echo ${{ secrets.GITHUB_TOKEN }} | singularity remote login -u ${{ github.actor }} --password-stdin oras://ghcr.io | |
| - name: Build Docker image | |
| run: | | |
| docker build \ | |
| -t ghcr.io/kokkos/kokkos-fft/base_${{ matrix.image.name }}:latest \ | |
| --cache-from ghcr.io/kokkos/kokkos-fft/base_${{ matrix.image.name }}:latest \ | |
| --build-arg BUILDKIT_INLINE_CACHE=1 \ | |
| --progress=plain \ | |
| docker/${{ matrix.image.name }} | |
| - name: Push Docker image | |
| run: docker push ghcr.io/kokkos/kokkos-fft/base_${{ matrix.image.name }}:latest | |
| if: ${{ github.event != 'pull_request' }} | |
| - name: Convert Docker image to Singularity | |
| run: singularity build base.sif docker://ghcr.io/kokkos/kokkos-fft/base_${{ matrix.image.name }}:latest | |
| if: ${{ matrix.image.use_singularity && github.event != 'pull_request' }} | |
| - name: Push Singularity image | |
| run: singularity push base.sif oras://ghcr.io/kokkos/kokkos-fft/base_${{ matrix.image.name }}_singularity:latest | |
| if: ${{ matrix.image.use_singularity && github.event != 'pull_request' }} |