Build base image in test #33
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 and test | ||
on: | ||
pull_request: | ||
branches: | ||
- main | ||
env: | ||
# Customize the CMake build type here (Release, Debug, RelWithDebInfo, etc.) | ||
BUILD_TYPE: RelWithDebInfo | ||
jobs: | ||
lint: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- uses: DoozyX/[email protected] | ||
with: | ||
source: 'common/ fft/ examples/' | ||
exclude: '' | ||
extensions: 'hpp,cpp' | ||
clangFormatVersion: 12 | ||
build_base: | ||
runs-on: ubuntu-latest | ||
strategy: | ||
matrix: | ||
backend: | ||
# - openmp | ||
- cuda | ||
# - hip | ||
steps: | ||
- name: Free Disk Space (Ubuntu) | ||
uses: jlumbroso/[email protected] | ||
with: | ||
tool-cache: true | ||
large-packages: false | ||
- name: Checkout repository | ||
uses: actions/checkout@v3 | ||
# TODO check if current build has a different Dockerfile | ||
- name: Build image | ||
# TODO improve with caching https://docs.docker.com/engine/reference/commandline/image_build/#cache-from | ||
run: docker build \ | ||
-t ghcr.io/cexa-project/kokkos-fft/base_${{ matrix.backend }} \ | ||
--cache-from ghcr.io/cexa-project/kokkos-fft/base_${{ matrix.backend }} \ | ||
--build-arg BUIDKIT_INLINE_CACHE=1 \ | ||
docker/${{ matrix.backend }} | ||
- name: Login in GitHub Containers Repository | ||
run: echo ${{ secrets.GITHUB_TOKEN }} | docker login ghcr.io -u ${{ github.actor }} --password-stdin | ||
- name: Push image | ||
run: docker push ghcr.io/cexa-project/kokkos-fft/base_${{ matrix.backend }} | ||
build: | ||
runs-on: ubuntu-latest | ||
strategy: | ||
matrix: | ||
backend: | ||
# - name: openmp | ||
# cmake_flags: -DKokkos_ENABLE_OPENMP | ||
- name: cuda | ||
cmake_flags: -DKokkos_ENABLE_CUDA -DKokkos_ARCH_AMPERE80 | ||
# - name: hip | ||
# cmake_flags: -DKokkos_ENABLE_HIP -DKokkos_ARCH_VEGA90A | ||
target: | ||
- name: native | ||
cmake_flags: "" | ||
- name: host_device | ||
cmake_flags: -DKokkosFFT_ENABLE_HOST_AND_DEVICE=ON | ||
exclude: | ||
- backend: | ||
name: openmp | ||
target: | ||
name: host_device | ||
needs: | ||
- build_base | ||
steps: | ||
- name: Free Disk Space (Ubuntu) | ||
uses: jlumbroso/[email protected] | ||
with: | ||
tool-cache: true | ||
large-packages: false | ||
- name: Checkout built branch | ||
uses: actions/checkout@v3 | ||
with: | ||
submodules: recursive | ||
- name: Login in GitHub Containers Repository | ||
run: echo ${{ secrets.GITHUB_TOKEN }} | docker login ghcr.io -u ${{ github.actor }} --password-stdin | ||
- name: Pull image | ||
run: docker pull ghcr.io/cexa-project/kokkos-fft/base_${{ matrix.backend.name }} | ||
- name: Configure | ||
run: | | ||
docker run -v ${{github.workspace}}:/work base_${{ matrix.backend.name }} \ | ||
cmake -B build \ | ||
-DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} \ | ||
-DCMAKE_CXX_STANDARD=17 \ | ||
-DBUILD_TESTING=ON \ | ||
-DKokkosFFT_INTERNAL_Kokkos=ON \ | ||
${{ matrix.backend.cmake_flags }} \ | ||
${{ matrix.target.cmake_flags }} \ | ||
- name: Build | ||
run: | | ||
docker run -v ${{github.workspace}}:/work base_${{ matrix.backend.name }} \ | ||
cmake --build build -j 2 | ||
- name: Save image | ||
run: docker commit nvidia_base ghcr.io/cexa-project/kokkos-fft/kokkos_fft_${{ matrix.backend.name }} | ||
- name: Install | ||
run: docker run -v ${{github.workspace}}:/work base_${{ matrix.backend.name }} \ | ||
./install_test/bin/install_${{ matrix.backend.name }}.sh /tmp ${{ matrix.backend.name }} | ||
- name: Push image | ||
run: docker push ghcr.io/cexa-project/kokkos-fft/kokkos_fft_${{ matrix.backend.name }} | ||
- name: Install test for HIP backend | ||
run: | | ||
docker run -v ${{github.workspace}}:/work ${{ env.container }} ./install_test/bin/install_hip.sh /tmp ${{matrix.target.name}} |