Skip to content

Commit 26e9002

Browse files
authored
ci: workflow to run second instance (#6)
This introduces the running of multiple instances consecutively. Currently that's not possible because a single instance is started with a fixed name. We can reuse the name if it already exists. (TDD, will fail until implemented)
1 parent 4929239 commit 26e9002

File tree

2 files changed

+34
-3
lines changed

2 files changed

+34
-3
lines changed

.github/workflows/double.yml

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
name: double
2+
on: [push, pull_request]
3+
jobs:
4+
singularity:
5+
runs-on: ubuntu-latest
6+
steps:
7+
- uses: actions/checkout@v2
8+
- uses: cvmfs-contrib/github-action-cvmfs@v2
9+
with:
10+
cvmfs_repositories: 'singularity.opensciencegrid.org'
11+
- uses: eic/run-cvmfs-osg-eic-shell@main
12+
with:
13+
run_local_checkout: 'true'
14+
platform-release: "jug_xl:nightly"
15+
run: |
16+
gcc --version
17+
which gcc
18+
eic-info
19+
- uses: eic/run-cvmfs-osg-eic-shell@main
20+
with:
21+
run_local_checkout: 'true'
22+
platform-release: "jug_xl:nightly"
23+
run: |
24+
gcc --version
25+
which gcc
26+
eic-info

run-linux.sh

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -43,11 +43,16 @@ echo "Install Singularity"
4343
conda install --quiet --yes -c conda-forge singularity > /dev/null 2>&1
4444
eval "$(conda shell.bash hook)"
4545

46-
echo "Starting Singularity image from ${SANDBOX_PATH}"
47-
singularity instance start --bind /cvmfs --bind ${GITHUB_WORKSPACE}:${GITHUB_WORKSPACE} ${SANDBOX_PATH} view_worker
46+
worker=$(echo ${SANDBOX_PATH} | sha256sum | awk '{print$1}')
47+
if singularity instance list | grep ${worker} ; then
48+
echo "Reusing exisitng Singularity image from ${SANDBOX_PATH}"
49+
else
50+
echo "Starting Singularity image from ${SANDBOX_PATH}"
51+
singularity instance start --bind /cvmfs --bind ${GITHUB_WORKSPACE}:${GITHUB_WORKSPACE} ${SANDBOX_PATH} ${worker}
52+
fi
4853

4954
echo "####################################################################"
5055
echo "###################### Executing user payload ######################"
5156
echo "VVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVV"
5257

53-
singularity exec instance://view_worker /bin/bash -c "cd ${GITHUB_WORKSPACE}; ./action_payload.sh"
58+
singularity exec instance://${worker} /bin/bash -c "cd ${GITHUB_WORKSPACE}; ./action_payload.sh"

0 commit comments

Comments
 (0)