11name : ' build libcloudph++'
2- description : ' builds libcloudph++, libcloudph++ code needs to be check out before running this action '
2+ description : ' builds libcloudph++, loads UWLCM Singularity image for dependencies '
33inputs :
44 disable_cuda :
55 description : ' disable CUDA build?'
66 required : true
7- default : false
7+ default : " false"
88 build_type :
99 description : ' CMake build type: Release, Debug, ...'
1010 required : true
@@ -13,54 +13,87 @@ inputs:
1313 description : " number of threads used by make"
1414 required : true
1515 default : 1
16+ path :
17+ description : " path to the dir with libcloudphxx code"
18+ required : true
19+ install_prefix :
20+ description : " CMake install prefix"
21+ required : true
22+ default : " /usr/local"
23+ tag :
24+ description : ' Singularity image tag'
25+ required : true
26+ default : ' ubuntu_20_04_cuda_11_4'
27+ cxx :
28+ description : ' C++ compiler'
29+ required : true
30+ default : ' g++'
1631
1732runs :
1833 using : " composite"
1934 steps :
2035 - name : Install Nvidia driver
2136 shell : bash
22- if : ${{!inputs.disable_cuda}}
23- run : sudo apt install --no-install-recommends nvidia-driver-470
24-
25- - name : Install Singularity
26- # when installed from this action, .SIF is always converted to sandbox (could be related to: https://githubmemory.com/repo/hpcng/singularity/issues/6065)
27- uses : eWaterCycle/setup-singularity@v6
28- with :
29- singularity-version : 3.7.1
30- # 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
31- # run: |
32- # wget -O- http://neuro.debian.net/lists/focal.de-fzj.libre | sudo tee /etc/apt/sources.list.d/neurodebian.sources.list
33- # sudo apt-key adv --recv-keys --keyserver hkps://keyserver.ubuntu.com 0xA5D32F012649A5A9
34- # sudo apt-get update
35- # sudo apt-get install -y singularity-container
36-
37- - name : Cache UWLCM Singularity image
38- id : cache_singularity
39- uses : actions/cache@v2
40- with :
41- path : ' ${{ github.workspace }}/singularity_images/uwlcm_ubuntu_20_04_cuda_11_4.sif'
42- key : ' sng_ubuntu_20_04_cuda_11_4'
43-
44- - name : Download UWLCM Singularity image
45- shell : bash
46- if : steps.cache_singularity.outputs.cache-hit != 'true'
4737 run : |
48- mkdir '${{ github.workspace }}/singularity_images'
49- singularity pull --disable-cache --dir '${{ github.workspace }}/singularity_images' library://pdziekan/default/uwlcm:ubuntu_20_04_cuda_11_4
50- # disable Singularity cache, we cache manually
38+ [ "${{inputs.disable_cuda}}" = "false" ] && sudo apt install --no-install-recommends nvidia-driver-470 || true
39+ # if: ${{!inputs.disable_cuda}}
5140
52- - name : Set friendly Singularity image name
53- uses :
allenevans/[email protected] 41+ - name : load UWLCM Singularity image
42+ uses : ./.github/actions/load_UWLCM_singularity_image
5443 with :
55- SI : ' ${{ github.workspace }}/singularity_images/uwlcm_ubuntu_20_04_cuda_11_4.sif'
44+ path : ${{ inputs.path }}/singularity_images
45+ tag : ${{ inputs.tag }}
46+
47+ # - name: Install Singularity
48+ # #when installed from this action, .SIF is always converted to sandbox (could be related to: https://githubmemory.com/repo/hpcng/singularity/issues/6065)
49+ # uses: eWaterCycle/setup-singularity@v6
50+ # with:
51+ # singularity-version: 3.7.1
52+ # #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
53+ # # run: |
54+ # # wget -O- http://neuro.debian.net/lists/focal.de-fzj.libre | sudo tee /etc/apt/sources.list.d/neurodebian.sources.list
55+ # # sudo apt-key adv --recv-keys --keyserver hkps://keyserver.ubuntu.com 0xA5D32F012649A5A9
56+ # # sudo apt-get update
57+ # # sudo apt-get install -y singularity-container
58+ #
59+ # - name: Cache UWLCM Singularity image
60+ # id: cache_singularity
61+ # uses: actions/cache@v2
62+ # with:
63+ # path: '${{ github.workspace }}/singularity_images/uwlcm_ubuntu_20_04_cuda_11_4.sif'
64+ # key: 'sng_ubuntu_20_04_cuda_11_4'
65+ #
66+ # - name: Download UWLCM Singularity image
67+ # shell: bash
68+ # # if: steps.cache_singularity.outputs.cache-hit != 'true'
69+ # run: |
70+ # [ "${{steps.cache_singularity.outputs.cache-hit}}" != "true" ] && \
71+ # {
72+ # mkdir '${{ github.workspace }}/singularity_images';
73+ # singularity pull --disable-cache --dir '${{ github.workspace }}/singularity_images' library://pdziekan/default/uwlcm:ubuntu_20_04_cuda_11_4;
74+ # } \
75+ # || \
76+ # true
77+ # # disable Singularity cache, we cache manually
78+ #
79+ # - name: Set friendly Singularity image name
80+ # uses: allenevans/[email protected] 81+ # with:
82+ # SI: '${{ github.workspace }}/singularity_images/uwlcm_ubuntu_20_04_cuda_11_4.sif'
83+
84+
85+ # Debugging with a ssh session
86+ # - name: Setup tmate session
87+ # uses: mxschmitt/action-tmate@v3
88+
5689
5790 - name : Configure CMake
5891 shell : bash
5992 # Configure CMake in a 'build' subdirectory. `CMAKE_BUILD_TYPE` is only required if you are using a single-configuration generator such as make.
6093 # See https://cmake.org/cmake/help/latest/variable/CMAKE_BUILD_TYPE.html?highlight=cmake_build_type
61- 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}}
94+ run : singularity exec $SI cmake -B ${{inputs.path }}/build -DCMAKE_BUILD_TYPE=${{inputs.build_type}} -DLIBCLOUDPHXX_FORCE_MULTI_CUDA=True -DLIBCLOUDPHXX_DISABLE_CUDA=${{inputs.disable_cuda}} -DCMAKE_INSTALL_PREFIX=${{inputs.install_prefix}} -DCMAKE_CXX_COMPILER=${{inputs.cxx }}
6295#
6396 - name : Build libcloudph++
6497 shell : bash
6598 # Build your program with the given configuration
66- run : VERBOSE=1 singularity exec $SI cmake --build ${{github.workspace }}/build --config ${{inputs.build_type}} -j${{inputs.threads}}
99+ run : VERBOSE=1 singularity exec $SI cmake --build ${{inputs.path }}/build --config ${{inputs.build_type}} -j${{inputs.threads}}
0 commit comments