-
Notifications
You must be signed in to change notification settings - Fork 0
324 lines (322 loc) · 11.9 KB
/
basic_test.yaml
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
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
name: Compilation and Basic Run Testing for A4MD
on:
push:
branches: [ master ]
pull_request:
branches: [ master ]
jobs:
build-and-test-a4md:
strategy:
fail-fast: true
matrix:
flux: [ 0.52.0 ]
os: [ ubuntu-20.04 ]
compiler: [ gcc ]
gcc_version: [ 10 ]
mercury_connection_str: [ "na+sm" ]
name: ${{ matrix.os }}-${{ matrix.compiler }}-${{ matrix.gcc_version }}-${{ matrix.flux }}
runs-on: ${{ matrix.os }}
env:
FLUX_VERSION: ${{ matrix.flux }}
CC: gcc-${{ matrix.gcc_version }}
CXX: g++-${{ matrix.gcc_version }}
MERCURY_CONNECTION_STRING: ${{ matrix.mercury_connection_str }}
PYTHON_PREFIX_PATH: "/opt/hostedtoolcache/Python/3.10.12/x64"
SPACK_DIR: "/home/runner/work/spack"
DSPACES_SPACK_REPO_DIR: "/home/runner/work/dspaces-spack"
A4MD_INSTALL_PREFIX: "/home/runner/work/a4md/install"
steps:
- name: Checkout push
if: github.event_name == 'push'
uses: actions/checkout@v3
- name: Checkout PR
if: github.event_name == 'pull_request'
uses: actions/checkout@v3
with:
ref: ${{ github.event.pull_request.head.sha }}
- name: Setup GCC
uses: egor-tensin/setup-gcc@v1
with:
version: ${{ matrix.gcc_version }}
- name: Install system dependencies
run: |
sudo apt-get update
sudo apt-get install -y --no-install-recommends \
gcc g++ gfortran \
cmake \
autoconf \
automake \
libtool \
libtool-bin \
openmpi-bin \
libopenmpi-dev \
libarchive-dev \
ncurses-bin \
hwloc \
lua5.3 liblua5.3-dev \
libczmq-dev \
lua-posix-dev \
lz4 \
pkgconf \
libzmq5 \
sqlite
# sudo chmod 777 /usr -R
# sudo chmod 777 ${PYTHON_PREFIX_PATH} -R
- name: Setup Python 3.10
uses: actions/setup-python@v5
with:
python-version: '3.10.12'
- name: Install Python dependencies
run: |
python3 -m pip install jsonschema==4.17.3 cffi==1.15.1 ply==3.11 pyyaml==6.0.1 numpy
- name: Check Python packages
run: |
python3 -m pip list
ls ${PYTHON_PREFIX_PATH}/lib
ls ${PYTHON_PREFIX_PATH}/include/python3.10
- name: Install Spack
run: |
git clone https://github.com/spack/spack.git ${SPACK_DIR}
- name: Register system dependencies with Spack
run: |
. ${SPACK_DIR}/share/spack/setup-env.sh
mkdir -p /home/runner/.spack
GCC_VERSION="9.3.0"
if [[ $CC == 'gcc-10' ]]; then
GCC_VERSION="10.3.0"
fi
cat > /home/runner/.spack/packages.yaml <<EOF
packages:
all:
target: [x86_64]
providers:
mpi: [openmpi]
python:
buildable: False
externals:
- spec: "[email protected]"
prefix: ${PYTHON_PREFIX_PATH}
py-cffi:
buildable: False
externals:
- spec: "[email protected]"
prefix: ${PYTHON_PREFIX_PATH}
py-jsonschema:
buildable: False
externals:
- spec: "[email protected]"
prefix: ${PYTHON_PREFIX_PATH}
py-ply:
buildable: False
externals:
- spec: "[email protected]"
prefix: ${PYTHON_PREFIX_PATH}
py-pyyaml:
buildable: False
externals:
- spec: "[email protected]"
prefix: ${PYTHON_PREFIX_PATH}
czmq:
buildable: False
externals:
- spec: "[email protected]"
prefix: /usr
sqlite:
buildable: False
externals:
- spec: "[email protected]"
prefix: /usr
libzmq:
buildable: False
externals:
- spec: "[email protected]"
prefix: /usr
lua:
buildable: False
externals:
- spec: "[email protected]"
prefix: /usr
lua-luaposix:
buildable: False
externals:
- spec: "[email protected]"
prefix: /usr
lz4:
buildable: False
externals:
- spec: "[email protected]"
prefix: /usr
ncurses:
buildable: False
externals:
- spec: "[email protected]"
prefix: /usr
pkgconf:
buildable: False
externals:
- spec: "[email protected]"
prefix: /usr
hwloc:
buildable: False
externals:
- spec: "[email protected]"
prefix: /usr
libarchive:
buildable: False
externals:
- spec: "[email protected]"
prefix: /usr
autoconf:
buildable: False
externals:
- spec: "[email protected]"
prefix: /usr
automake:
buildable: False
externals:
- spec: "[email protected]"
prefix: /usr
libtool:
buildable: False
externals:
- spec: "[email protected]"
prefix: /usr
m4:
buildable: False
externals:
- spec: "[email protected]"
prefix: /usr
openmpi:
buildable: False
externals:
- spec: "[email protected]"
prefix: /usr
openssl:
buildable: False
externals:
- spec: "[email protected]"
prefix: /usr
pkg-config:
buildable: False
externals:
- spec: "[email protected]"
prefix: /usr
gcc:
externals:
- spec: gcc@${GCC_VERSION} languages=c,c++
prefix: /usr
extra_attributes:
compilers:
c: ${CC}
cxx: ${CXX}
buildable: False
EOF
echo "-------------------------------"
cat /home/runner/.spack/packages.yaml
echo "-------------------------------"
spack compiler find --scope=user
if [[ $CC == 'gcc-10' ]]; then
spack config add "packages:all:compiler:[[email protected]]"
else
spack config add "packages:all:compiler:[[email protected]]"
fi
spack external find
spack spec flux-core@${FLUX_VERSION}
# spack spec [email protected]
# spack spec [email protected] fabrics=sockets,tcp,udp,shm
# spack spec mercury+mpi+ofi+sm+ucx ^[email protected] ^[email protected] fabrics=sockets,tcp,udp,shm
- name: Setup DataSpaces' Spack repo
run: |
git clone https://github.com/Analytics4MD/dspaces-spack.git ${DSPACES_SPACK_REPO_DIR}
curr_dir=$(pwd)
cd ${DSPACES_SPACK_REPO_DIR}
git checkout dspaces_2.2.0_upgrade
cd $curr_dir
. ${SPACK_DIR}/share/spack/setup-env.sh
spack repo add ${DSPACES_SPACK_REPO_DIR}
# Have to use master here because the actual DataSpaces 2 releases are not yet in the repo
spack spec [email protected]~pybind \
^mercury+mpi+ofi+sm+ucx \
^[email protected] fabrics=sockets,tcp,udp,shm \
^boost+iostreams+serialization
- name: Install dependencies
run: |
mkdir -p ${A4MD_INSTALL_PREFIX}
python3 -m venv ${A4MD_INSTALL_PREFIX}
. ${SPACK_DIR}/share/spack/setup-env.sh
spack install -j4 flux-core@${FLUX_VERSION}
# spack install -j4 [email protected]
# spack install -j4 [email protected] fabrics=sockets,tcp,udp,shm
# spack install -j4 mercury+mpi+ofi+sm+ucx ^[email protected] ^[email protected] fabrics=sockets,tcp,udp,shm
spack install -j4 [email protected]~pybind \
^mercury+mpi+ofi+sm+ucx \
^[email protected] fabrics=sockets,tcp,udp,shm \
^boost+iostreams+serialization
spack view --verbose symlink ${A4MD_INSTALL_PREFIX} \
flux-core@${FLUX_VERSION} \
[email protected] fabrics=sockets,tcp,udp,shm \
boost+iostreams+serialization \
mercury+mpi+ofi+sm+ucx \
[email protected]~pybind ^mercury+mpi+ofi+sm+ucx ^[email protected] ^[email protected] fabrics=sockets,tcp,udp,shm ^boost+iostreams+serialization
- name: Compile A4MD
run: |
echo "Activating Spack"
. ${SPACK_DIR}/share/spack/setup-env.sh
echo "Build and Install A4MD"
cd ${GITHUB_WORKSPACE}
ls && pwd
mkdir build
cd build
export PKG_CONFIG_PATH=$PKG_CONFIG_PATH:${A4MD_INSTALL_PREFIX}/lib/pkgconfig
cmake --version
cmake \
-DCMAKE_INSTALL_PREFIX=${A4MD_INSTALL_PREFIX} \
-DCMAKE_PREFIX_PATH=${A4MD_INSTALL_PREFIX} \
-DCMAKE_BUILD_TYPE=Debug \
-DPython3_ROOT_DIR=${PYTHON_PREFIX_PATH}/bin \
-Ddtl_dspaces=ON \
-Ddtl_dimes=OFF \
-Ddtl_decaf=OFF \
-Dbuild_examples=ON \
-Dbuild_tests=OFF \
-Dbuild_wrap=OFF \
..
make VERBOSE=1 install -j
- name: Build A4MD Test
run: |
. ${SPACK_DIR}/share/spack/setup-env.sh
cd ${GITHUB_WORKSPACE}/.github/basic_test
mkdir -p build
mkdir -p test_install
cd build
cmake \
-DCMAKE_INSTALL_PREFIX=${GITHUB_WORKSPACE}/.github/basic_test/test_install \
-DCMAKE_PREFIX_PATH=${A4MD_INSTALL_PREFIX} \
-DCMAKE_BUILD_TYPE=Debug \
-DPython3_ROOT_DIR=${PYTHON_PREFIX_PATH}/bin \
..
make VERBOSE=1 install -j
- name: Test A4MD
run: |
. ${SPACK_DIR}/share/spack/setup-env.sh
export PATH=${PATH}:${A4MD_INSTALL_PREFIX}/bin:${A4MD_INSTALL_PREFIX}/sbin
export LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:${A4MD_INSTALL_PREFIX}/lib:${A4MD_INSTALL_PREFIX}/lib64
echo "Launching basic prod-cons test"
cd ${GITHUB_WORKSPACE}/.github/basic_test/test_install
flux start --test-size=1 /bin/bash ./flux_prod_cons.sh "${A4MD_INSTALL_PREFIX}" "${A4MD_INSTALL_PREFIX}" "${MERCURY_CONNECTION_STRING}"
# cd ${GITHUB_WORKSPACE}/.github/basic_test
# flux start --test-size=1 /bin/bash ./flux_prod_cons.sh "${A4MD_INSTALL_PREFIX}" "${A4MD_INSTALL_PREFIX}" "${MERCURY_CONNECTION_STRING}"
- name: Upload log files as artifact for inspection
uses: actions/upload-artifact@v4
with:
name: ${{ matrix.os }}_${{ matrix.compiler }}_${{ matrix.gcc_version }}_${{ matrix.flux }}_outputs
compression-level: 9
if-no-files-found: error
path: |
${GITHUB_WORKSPACE}/.github/basic_test/*.err
${GITHUB_WORKSPACE}/.github/basic_test/*.out
${GITHUB_WORKSPACE}/.github/basic_test/dataspaces.conf
${GITHUB_WORKSPACE}/.github/basic_test/conf.ds