Skip to content

Commit

Permalink
Specify container name when building a backend
Browse files Browse the repository at this point in the history
  • Loading branch information
giacomofiorin committed Aug 20, 2023
1 parent e37b7db commit 6bdfc02
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 9 deletions.
22 changes: 13 additions & 9 deletions .github/workflows/backend-template.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,10 @@ on:
description: "Name of the branch of the backend repository"
required: true
type: string
container_name:
description: "Name of the container used to build on"
required: true
type: string
vmd_plugins_repo:
description: "Name of the VMD plugins repository"
required: false
Expand Down Expand Up @@ -71,7 +75,7 @@ jobs:
with:
path: |
~/.ccache
~/ccache_CentOS7-devel
~/ccache_${{ inputs.container_name }}
key: ${{ runner.os }}-build-${{ inputs.backend_name }}-${{ github.sha }}
restore-keys: |
${{ runner.os }}-build-${{ inputs.backend_name }}-
Expand Down Expand Up @@ -122,11 +126,11 @@ jobs:
wget https://github.com/apptainer/apptainer/releases/download/v1.0.3/apptainer_1.0.3_amd64.deb
sudo apt-get -y install ./apptainer_1.0.3_amd64.deb
- name: Get container image of backends' dependencies
- name: Get container images for build dependencies
shell: bash
working-directory: devel-tools
run: |
# Pull CentOS 7 container used to build backends
# Pull all containers used to build backends
# (contains build tools, OpenMPI, FFTW, Tcl/Tk and Charm++)
apptainer remote status SylabsCloud || apptainer remote add --no-login SylabsCloud cloud.sylabs.io
apptainer remote use SylabsCloud
Expand All @@ -136,16 +140,16 @@ jobs:
- name : Get spiff
shell: bash
working-directory: devel-tools
run: sudo cp -f $(apptainer exec CentOS7-devel.sif ./get_spiff) /usr/local/bin
run: sudo cp -f $(apptainer exec ${{ inputs.container_name }} ./get_spiff) /usr/local/bin

- name: Update and build ${{ inputs.backend_name }}
shell: bash
env:
OPENMM_SOURCE: ${{ github.workspace }}/openmm-source
run: |
apptainer exec devel-tools/CentOS7-devel.sif ./update-colvars-code.sh -f ${{ inputs.backend_name }}-source
CCACHE_DIR=~/ccache_CentOS7-devel \
apptainer exec devel-tools/CentOS7-devel.sif \
apptainer exec devel-tools/${{ inputs.container_name }}.sif ./update-colvars-code.sh -f ${{ inputs.backend_name }}-source
CCACHE_DIR=~/ccache_${{ inputs.container_name }} \
apptainer exec devel-tools/${{ inputs.container_name }}.sif \
bash ${{ inputs.path_compile_script }} ${{ inputs.backend_name }}-source
Expand All @@ -158,13 +162,13 @@ jobs:
shell: bash
working-directory: ${{ inputs.test_lib_directory }}
run: |
apptainer exec ${{github.workspace}}/devel-tools/CentOS7-devel.sif \
apptainer exec ${{github.workspace}}/devel-tools/${{ inputs.container_name }}.sif \
./run_tests.sh ${{github.workspace}}/${{ inputs.backend_name }}-source/${{ inputs.rpath_exe }} 0??_*
- name: Run regression tests for ${{ inputs.backend_name }} interface code
if: ${{ inputs.test_interface_directory }}
shell: bash
working-directory: ${{ inputs.test_interface_directory }}
run: |
apptainer exec ${{github.workspace}}/devel-tools/CentOS7-devel.sif \
apptainer exec ${{github.workspace}}/devel-tools/${{ inputs.container_name }}.sif \
./run_tests.sh ${{github.workspace}}/${{ inputs.backend_name }}-source/${{ inputs.rpath_exe }}
6 changes: 6 additions & 0 deletions .github/workflows/test-backends.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ jobs:
test_lib_directory: lammps/tests/library
test_interface_directory: lammps/tests/interface
rpath_exe: install/bin/lmp
container_name: CentOS7-devel

namd:
name: NAMD
Expand All @@ -47,6 +48,7 @@ jobs:
test_lib_directory: namd/tests/library
test_interface_directory: namd/tests/interface
rpath_exe: Linux-x86_64-g++.multicore/namd2
container_name: CentOS7-devel
secrets:
# Choice of license by UIUC prevents sharing the code, hence the secret
private_key: ${{ secrets.PULL_NAMD_KEY }}
Expand All @@ -68,6 +70,7 @@ jobs:
# Interface tests disabled until map variables are merged into NAMD3
# test_interface_directory: namd/tests/interface
rpath_exe: Linux-x86_64-g++.multicore/namd3
container_name: CentOS7-devel
secrets:
# Choice of license by UIUC prevents sharing the code, hence the secret
private_key: ${{ secrets.PULL_NAMD_KEY }}
Expand Down Expand Up @@ -107,6 +110,7 @@ jobs:
test_lib_directory: gromacs/tests/library
# Gromacs need to be compiled in double precision to pass the tests
rpath_exe: install/bin/gmx_d
container_name: CentOS9-devel

gromacs-2021:
name: GROMACS 2021
Expand All @@ -119,6 +123,7 @@ jobs:
path_compile_script: devel-tools/compile-gromacs.sh
test_lib_directory: gromacs/tests/library
rpath_exe: install/bin/gmx_d
container_name: CentOS9-devel

gromacs-2022:
name: GROMACS 2022
Expand All @@ -131,3 +136,4 @@ jobs:
path_compile_script: devel-tools/compile-gromacs.sh
test_lib_directory: gromacs/tests/library
rpath_exe: install/bin/gmx_d
container_name: CentOS9-devel

0 comments on commit 6bdfc02

Please sign in to comment.