forked from singularityhub/singularity-hpc
-
Notifications
You must be signed in to change notification settings - Fork 0
177 lines (145 loc) · 5.24 KB
/
test.yml
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
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
name: shpc test modules
on:
pull_request: []
jobs:
test:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
module: [[lmod, 8.4.27], [tcl, 4.7.1], [tcl, 5.0.1]]
container_tech: [podman, singularity, docker]
steps:
- name: Install Dependencies
run: |
sudo apt-get install lua5.2 liblua5.2-dev lua-filesystem lua-posix tcl tcl-dev tcsh
- name: Install Environment Modules
if: ${{ matrix.module[0] == 'tcl' }}
env:
PKG_VERSION: ${{ matrix.module[1] }}
run: |
curl -LJO https://github.com/cea-hpc/modules/releases/download/v${PKG_VERSION}/modules-${PKG_VERSION}.tar.gz
tar xfz modules-${PKG_VERSION}.tar.gz
ls
cd modules-${PKG_VERSION}
./configure
make
sudo make install
- name: Install Lmod
if: ${{ matrix.module[0] == 'lmod' }}
env:
PKG_VERSION: ${{ matrix.module[1] }}
run: |
PKG_URL="https://github.com/TACC/Lmod/archive/${PKG_VERSION}.tar.gz"
wget $PKG_URL
tar xfz ${PKG_VERSION}.tar.gz
cd Lmod-${PKG_VERSION}
./configure --prefix=/usr/share && make && make install
- uses: eWaterCycle/setup-singularity@v7
if: ${{ matrix.container_tech == 'singularity' }}
name: Install Singularity
with:
singularity-version: 3.7.1
- name: Create conda environment
run: conda create --quiet -c conda-forge --name shpc spython
- uses: actions/checkout@v4
- name: Install shpc
run: |
export PATH="/usr/share/miniconda/bin:$PATH"
source activate shpc
pip install -e .
- name: Run python module tests (bash)
shell: bash
env:
module_sys: ${{ matrix.module[0] }}
container_tech: ${{ matrix.container_tech }}
run: |
case "${module_sys}" in
lmod)
. /usr/share/lmod/lmod/init/bash
;;
tcl)
. /usr/local/Modules/init/bash
shopt expand_aliases || true
shopt -s expand_aliases
;;
esac
export PATH="/usr/share/miniconda/bin:$PATH"
source activate shpc
shpc config set container_tech:${{ matrix.container_tech }}
shpc config set module_sys:${module_sys}
shpc config set enable_tty:false
printf "\n\shpc test ============================================\n"
shpc test python:3.9.5-alpine
shpc install python:3.9.5-alpine
module use ./modules
module load python/3.9.5-alpine
alias
printf "\n\nmodule show ============================================\n"
module show python/3.9.5-alpine
printf "\n\nmodule whatis ==========================================\n"
module whatis python/3.9.5-alpine
printf "\n\nmodule help ============================================\n"
module help python/3.9.5-alpine
script_path=$(which python-exec)
cat $script_path
set -x
python-exec echo donuts >test_output
cat test_output
grep --quiet donuts test_output
python-container > container_output
cat container_output
python-run python --version >test_output
cat test_output
grep --quiet 'Python 3.9.5' test_output
rm test_output
mkdir -p tmp-modules
shpc config set views_base:tmp-modules
shpc view create noodles
shpc view install noodles python:3.9.5-alpine
shpc uninstall --force python:3.9.5-alpine
shpc view --force delete noodles
- name: Run python module tests (tcsh)
shell: tcsh -e {0}
env:
module_sys: ${{ matrix.module[0] }}
container_tech: ${{ matrix.container_tech }}
run: |
switch ("${module_sys}")
case lmod:
source /usr/share/lmod/lmod/init/tcsh
breaksw
case tcl:
source /usr/local/Modules/init/tcsh
breaksw
endsw
source /usr/share/miniconda/etc/profile.d/conda.csh
conda activate shpc
shpc config set container_tech:${{ matrix.container_tech }}
shpc config set module_sys:${module_sys}
shpc config set enable_tty:false
shpc install python:3.9.5-alpine
module use ./modules
module load python/3.9.5-alpine
alias
printf "\n\nmodule show ============================================\n"
module show python/3.9.5-alpine
printf "\n\nmodule whatis ==========================================\n"
module whatis python/3.9.5-alpine
printf "\n\nmodule help ============================================\n"
module help python/3.9.5-alpine
python-container > container_output
cat container_output
python-exec echo donuts >test_output
cat test_output
grep --quiet donuts test_output
python-run python --version >test_output
cat test_output
grep --quiet 'Python 3.9.5' test_output
rm test_output
mkdir -p tmp-modules
shpc config set views_base:tmp-modules
shpc view create noodles
shpc view install noodles python:3.9.5-alpine
shpc uninstall --force python:3.9.5-alpine
shpc view --force delete noodles