-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Build base image in a different workflow
- Loading branch information
Showing
3 changed files
with
76 additions
and
105 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,73 @@ | ||
name: Build base images | ||
|
||
on: | ||
workflow_call: | ||
inputs: | ||
# suffix of the Docker and Singularity images | ||
image_name_suffix: | ||
required: false | ||
default: main | ||
type: string | ||
|
||
env: | ||
# Force the use of BuildKit for Docker | ||
DOCKER_BUILDKIT: 1 | ||
|
||
jobs: | ||
build_base: | ||
runs-on: ubuntu-latest | ||
|
||
strategy: | ||
matrix: | ||
backend: | ||
- name: openmp | ||
use_singularity: false | ||
- name: cuda | ||
use_singularity: true | ||
- name: hip | ||
use_singularity: false | ||
- name: sycl | ||
use_singularity: false | ||
|
||
steps: | ||
- name: Free Disk Space (Ubuntu) | ||
uses: jlumbroso/[email protected] | ||
with: | ||
tool-cache: true | ||
large-packages: false | ||
|
||
- name: Checkout repository | ||
uses: actions/checkout@v4 | ||
|
||
- 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 | ||
run: echo ${{ secrets.GITHUB_TOKEN }} | docker login ghcr.io -u ${{ github.actor }} --password-stdin | ||
|
||
- 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/cexa-project/kokkos-fft/base_${{ matrix.backend.name }}_${{ inputs.image_name_suffix }} \ | ||
--cache-from ghcr.io/cexa-project/kokkos-fft/base_${{ matrix.backend.name }}_main \ | ||
--build-arg BUILDKIT_INLINE_CACHE=1 \ | ||
--progress=plain \ | ||
docker/${{ matrix.backend.name }} | ||
- name: Push Docker image | ||
run: docker push ghcr.io/cexa-project/kokkos-fft/base_${{ matrix.backend.name }}_${{ inputs.image_name_suffix }} | ||
|
||
- name: Convert Docker image to Singularity | ||
run: singularity build base.sif docker://ghcr.io/cexa-project/kokkos-fft/base_${{ matrix.backend.name }}_${{ inputs.image_name_suffix }} | ||
if: ${{ matrix.backend.use_singularity }} | ||
|
||
- name: Push Singularity image | ||
run: singularity push base.sif oras://ghcr.io/cexa-project/kokkos-fft/base_${{ matrix.backend.name }}_singularity_${{ inputs.image_name_suffix }} | ||
if: ${{ matrix.backend.use_singularity }} |
This file was deleted.
Oops, something went wrong.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -55,66 +55,14 @@ jobs: | |
done | ||
build_base: | ||
runs-on: ubuntu-latest | ||
|
||
needs: check_docker_files | ||
|
||
if: ${{ needs.check_docker_files.outputs.docker_files_have_changed == 'true' }} | ||
|
||
strategy: | ||
matrix: | ||
backend: | ||
- name: openmp | ||
use_singularity: false | ||
- name: cuda | ||
use_singularity: true | ||
- name: hip | ||
use_singularity: false | ||
- name: sycl | ||
use_singularity: false | ||
|
||
steps: | ||
- name: Free Disk Space (Ubuntu) | ||
uses: jlumbroso/[email protected] | ||
with: | ||
tool-cache: true | ||
large-packages: false | ||
|
||
- name: Checkout repository | ||
uses: actions/checkout@v4 | ||
|
||
- 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 | ||
run: echo ${{ secrets.GITHUB_TOKEN }} | docker login ghcr.io -u ${{ github.actor }} --password-stdin | ||
|
||
- name: Login in GitHub Containers Repository with Singularity | ||
run: echo ${{ secrets.GITHUB_TOKEN }} | singularity remote login -u ${{ github.actor }} --password-stdin oras://ghcr.io | ||
uses: ./github/workflows/__build_base.yaml | ||
|
||
- name: Build Docker image | ||
run: | | ||
docker build \ | ||
-t ghcr.io/cexa-project/kokkos-fft/base_${{ matrix.backend.name }}_${{ needs.check_docker_files.outputs.image_name_suffix }} \ | ||
--cache-from ghcr.io/cexa-project/kokkos-fft/base_${{ matrix.backend.name }}_main \ | ||
--build-arg BUILDKIT_INLINE_CACHE=1 \ | ||
--progress=plain \ | ||
docker/${{ matrix.backend.name }} | ||
- name: Push Docker image | ||
run: docker push ghcr.io/cexa-project/kokkos-fft/base_${{ matrix.backend.name }}_${{ needs.check_docker_files.outputs.image_name_suffix }} | ||
|
||
- name: Convert Docker image to Singularity | ||
run: singularity build base.sif docker://ghcr.io/cexa-project/kokkos-fft/base_${{ matrix.backend.name }}_${{ needs.check_docker_files.outputs.image_name_suffix }} | ||
if: ${{ matrix.backend.use_singularity }} | ||
|
||
- name: Push Singularity image | ||
run: singularity push base.sif oras://ghcr.io/cexa-project/kokkos-fft/base_${{ matrix.backend.name }}_singularity_${{ needs.check_docker_files.outputs.image_name_suffix }} | ||
if: ${{ matrix.backend.use_singularity }} | ||
with: | ||
image_name_suffix: ${{ needs.check_docker_files.outputs.image_name_suffix }} | ||
|
||
build: | ||
runs-on: ubuntu-latest | ||
|