Skip to content

Commit

Permalink
Init action
Browse files Browse the repository at this point in the history
  • Loading branch information
pdziekan committed Oct 6, 2021
0 parents commit f19aeb1
Showing 1 changed file with 62 additions and 0 deletions.
62 changes: 62 additions & 0 deletions action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
name: 'build libcloudph++'
description: 'builds libcloudph++, libcloudph++ code needs to be check out before running this action'
inputs:
disable_cuda:
description: 'disable CUDA build?'
required: true
default: false
build_type:
description: 'CMake build type: Release, Debug, ...'
required: true
default: "Release"
threads:
description: "number of threads used by make"
required: true
default: 1

runs:
using: "composite"
steps:
- name: Install Nvidia driver
if: ${{!inputs.disable_cuda}}
run: sudo apt install --no-install-recommends nvidia-driver-470

- name: Install Singularity
#when installed from this action, .SIF is always converted to sandbox (could be related to: https://githubmemory.com/repo/hpcng/singularity/issues/6065)
uses: eWaterCycle/setup-singularity@v6
with:
singularity-version: 3.7.1
#apt installation following https://sylabs.io/guides/3.0/user-guide/installation.html, but this is a too old version and uninstalls python-is-python3
# run: |
# wget -O- http://neuro.debian.net/lists/focal.de-fzj.libre | sudo tee /etc/apt/sources.list.d/neurodebian.sources.list
# sudo apt-key adv --recv-keys --keyserver hkps://keyserver.ubuntu.com 0xA5D32F012649A5A9
# sudo apt-get update
# sudo apt-get install -y singularity-container

- name: Cache UWLCM Singularity image
id: cache_singularity
uses: actions/cache@v2
with:
path: '${{ github.workspace }}/singularity_images/uwlcm_ubuntu_20_04_cuda_11_4.sif'
key: 'sng_ubuntu_20_04_cuda_11_4'

- name: Download UWLCM Singularity image
if: steps.cache_singularity.outputs.cache-hit != 'true'
run: |
mkdir '${{ github.workspace }}/singularity_images'
singularity pull --disable-cache --dir '${{ github.workspace }}/singularity_images' library://pdziekan/default/uwlcm:ubuntu_20_04_cuda_11_4
# disable Singularity cache, we cache manually

- name: Set friendly Singularity image name
uses: allenevans/set-env@v2.0.0
with:
SI: '${{ github.workspace }}/singularity_images/uwlcm_ubuntu_20_04_cuda_11_4.sif'

- name: Configure CMake
# Configure CMake in a 'build' subdirectory. `CMAKE_BUILD_TYPE` is only required if you are using a single-configuration generator such as make.
# See https://cmake.org/cmake/help/latest/variable/CMAKE_BUILD_TYPE.html?highlight=cmake_build_type
run: singularity exec $SI cmake -B ${{github.workspace}}/build -DCMAKE_BUILD_TYPE=${{inputs.build_type}} -DLIBCLOUDPHXX_FORCE_MULTI_CUDA=True -DLIBCLOUDPHXX_DISABLE_CUDA=${{inputs.disable_cuda}}
#
- name: Build libcloudph++
# Build your program with the given configuration
run: VERBOSE=1 singularity exec $SI cmake --build ${{github.workspace}}/build --config ${{inputs.build_type}} -j${{inputs.threads}}

0 comments on commit f19aeb1

Please sign in to comment.