-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathrun-linux.sh
More file actions
executable file
·84 lines (64 loc) · 2.38 KB
/
run-linux.sh
File metadata and controls
executable file
·84 lines (64 loc) · 2.38 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
#!/usr/bin/env bash
set -e
echo "::group::Launching container"
echo "Checking if there is a working CVMFS mount"
if [ ! -d "/cvmfs/sft.cern.ch/lcg/" ]; then
echo "The directory /cvmfs/sft.cern.ch/lcg/ cannot be accessed!"
echo "Make sure you are using the most recent cvmfs-contrib/github-action-cvmfs version"
exit 1
fi
if [ ! -d "/cvmfs/sft-nightlies.cern.ch/lcg/" ]; then
echo "The directory /cvmfs/sft-nightlies.cern.ch/lcg/ cannot be accessed!"
echo "Make sure you are using the most recent cvmfs-contrib/github-action-cvmfs version"
exit 1
fi
if [ ! -d "/cvmfs/geant4.cern.ch/share/" ]; then
echo "The directory /cvmfs/geant4.cern.ch/share/ cannot be accessed!"
echo "Make sure you are using the most recent cvmfs-contrib/github-action-cvmfs version"
exit 1
fi
echo "CVMFS mount present"
if [ -z "${VIEW_PATH}" ]; then
VIEW_PATH="/cvmfs/sft.cern.ch/lcg/views/${LCG_RELEASE_PLATFORM}"
if [[ "${LCG_RELEASE}" == *"dev"* ]]; then
VIEW_PATH="/cvmfs/sft-nightlies.cern.ch/lcg/views/${LCG_RELEASE}/latest/${LCG_PLATFORM}"
fi
fi
echo "Full view path is ${VIEW_PATH}"
if [ ! -d "${VIEW_PATH}" ]; then
echo "Did not find a view under this path!"
exit 1
fi
echo "#!/usr/bin/env bash
export LC_ALL=C
set -e
source ${VIEW_PATH}/${SETUP_SCRIPT}
export CCACHE_DIR=/root/.cache/ccache
export CCACHE_SLOPPINESS=include_file_ctime,include_file_mtime
ccache --set-config=max_size=500M
ccache -z
${RUN}
echo ::group::ccache statistics
ccache -s
echo ::endgroup::
" > ${GITHUB_WORKSPACE}/action_payload.sh
chmod a+x ${GITHUB_WORKSPACE}/action_payload.sh
mkdir -p ${HOME}/.cache/ccache
declare -A container_args=(
[podman]="-d -i"
[docker]="-it -d"
)
echo "Starting docker image for ${SYSTEM} via ${CONTAINER_RUNTIME}"
${CONTAINER_RUNTIME} run ${container_args[$CONTAINER_RUNTIME]} \
--name view_worker \
-v "${GITHUB_WORKSPACE}":"${GITHUB_WORKSPACE}" \
-v /cvmfs:/cvmfs:shared \
-v "${HOME}"/.cache/ccache:/root/.cache/ccache \
ghcr.io/aidasoft/"${SYSTEM}":latest \
/bin/bash
echo "Docker image ready for ${SYSTEM}"
echo "::endgroup::" # Launch container
echo "####################################################################"
echo "###################### Executing user payload ######################"
echo "VVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVV"
${CONTAINER_RUNTIME} exec view_worker /bin/bash -c "cd ${GITHUB_WORKSPACE} && ./action_payload.sh"