Skip to content

Commit 82f89c3

Browse files
authored
Fix dataset creation failure on Ubuntu 24 (#131)
* Remove vol-tests submodule * Show HSDS log on CI failure * Fix warnings * Add Ubuntu 22/24 to CI * Fix bad length in snprintf
1 parent 56703e8 commit 82f89c3

File tree

12 files changed

+97
-214
lines changed

12 files changed

+97
-214
lines changed

.github/workflows/main.yml

Lines changed: 69 additions & 144 deletions
Original file line numberDiff line numberDiff line change
@@ -27,13 +27,18 @@ env:
2727
BUCKET_NAME: hsdstest
2828

2929
jobs:
30-
build_and_test_with_autotools:
30+
build_and_test:
3131
strategy:
3232
fail-fast: false
3333
matrix:
34-
os: [ubuntu-latest]
34+
os: [ubuntu-22.04, ubuntu-latest]
35+
build_system: ["autotools", "cmake"]
3536
python-version: ["3.10"]
36-
hdf5-branch: ["hdf5_1_14"]
37+
hdf5-branch: ["hdf5_1_14", "develop"]
38+
exclude:
39+
# hdf5 2.0.0+ does not support autotools
40+
- hdf5-branch: "develop"
41+
build_system: "autotools"
3742

3843
runs-on: ${{matrix.os}}
3944
steps:
@@ -50,6 +55,7 @@ jobs:
5055
sudo apt-get install libyajl-dev
5156
5257
- name: Get Autotools Dependencies
58+
if: matrix.build_system == 'autotools'
5359
run: |
5460
sudo apt update
5561
sudo apt install automake autoconf libtool libtool-bin
@@ -59,7 +65,25 @@ jobs:
5965
with:
6066
path: ${{github.workspace}}/vol-rest
6167

62-
- name: Autotools Configure + Build HDF5
68+
- name: CMake Configure + Build HDF5
69+
if: matrix.build_system == 'cmake'
70+
run: |
71+
mkdir ${{github.workspace}}/hdf5/build
72+
cd ./build
73+
cmake \
74+
-DHDF5_BUILD_HL_LIB=ON \
75+
-DBUILD_SHARED_LIBS=ON \
76+
-DHDF5_TEST_API=ON \
77+
-DCMAKE_BUILD_TYPE=Release \
78+
-DCMAKE_INSTALL_PREFIX=${{github.workspace}}/hdf5install \
79+
..
80+
make
81+
make install
82+
shell: bash
83+
working-directory: ${{github.workspace}}/hdf5
84+
85+
- name: Autotools Configure + Build HDF5
86+
if: matrix.build_system == 'autotools'
6387
run: |
6488
./autogen.sh
6589
./configure --prefix=${{github.workspace}}/hdf5install \
@@ -70,21 +94,44 @@ jobs:
7094
shell: bash
7195
working-directory: ${{github.workspace}}/hdf5
7296

97+
- name: CMake Configure REST VOL
98+
if: matrix.build_system == 'cmake'
99+
run: |
100+
mkdir ./build
101+
cd ./build
102+
CFLAGS="-D_POSIX_C_SOURCE=200809L" cmake -G "Unix Makefiles" -DHDF5_ROOT=${{github.workspace}}/hdf5install \
103+
-DCMAKE_INSTALL_PREFIX=${{github.workspace}}/vol-rest/install \
104+
..
105+
shell: bash
106+
working-directory: ${{github.workspace}}/vol-rest
107+
73108
- name: Autotools Configure REST VOL
109+
if: matrix.build_system == 'autotools'
74110
run: |
75111
./autogen.sh
76112
mkdir ${{github.workspace}}/vol-rest/install
77-
CFLAGS="-D_POSIX_C_SOURCE=200809L" ./configure --prefix=${{github.workspace}}/vol-rest/install --with-hdf5=${{github.workspace}}/hdf5install
113+
CFLAGS="-D_POSIX_C_SOURCE=200809L" ./configure \
114+
--prefix=${{github.workspace}}/vol-rest/install \
115+
--with-hdf5=${{github.workspace}}/hdf5install
78116
shell: bash
79117
working-directory: ${{github.workspace}}/vol-rest
80118

81-
- name: Build + Install REST VOL
119+
- name: Build + Install REST VOL (Autotools)
120+
if: matrix.build_system == 'autotools'
82121
run: |
83-
make
122+
make -j
84123
make install
85124
shell: bash
86125
working-directory: ${{github.workspace}}/vol-rest/
87126

127+
- name: Build + Install REST VOL (CMake)
128+
if: matrix.build_system == 'cmake'
129+
run: |
130+
make -j
131+
make install
132+
shell: bash
133+
working-directory: ${{github.workspace}}/vol-rest/build/
134+
88135
- uses: actions/checkout@v4
89136
with:
90137
repository: HDFGroup/hsds
@@ -114,19 +161,12 @@ jobs:
114161
cd ${{github.workspace}}/hsds
115162
pytest
116163
117-
- name: Install valgrind
118-
run: |
119-
sudo apt update
120-
sudo apt install valgrind
121-
working-directory: ${{ github.workspace }}
122-
123164
# Requests 2.32.0 breaks requests-unixsocket, used by HSDS for socket connections
124165
- name: Fix requests version
125166
run: |
126167
pip install requests==2.31.0
127168
128169
- name: Start HSDS
129-
if: ${{ matrix.endpoint != 'http://127.0.0.1:5101'}}
130170
run: |
131171
cd ${{github.workspace}}/hsds
132172
mkdir ${{github.workspace}}/hsdsdata &&
@@ -140,149 +180,34 @@ jobs:
140180
working-directory: ${{github.workspace}}/hsds
141181

142182
- name: Test HSDS
143-
if: ${{matrix.endpoint != 'http://127.0.0.1:5101'}}
144183
run: |
145184
python tests/integ/setup_test.py
146185
working-directory: ${{github.workspace}}/hsds
147186

148-
- name: Test REST VOL
187+
- name: Test REST VOL (Autotools)
188+
if: matrix.build_system == 'autotools'
149189
working-directory: ${{github.workspace}}/vol-rest/
190+
env:
191+
HDF5_PLUGIN_PATH: ${{github.workspace}}/vol-rest/install/lib
150192
run: |
151-
HDF5_PLUGIN_PATH=${{github.workspace}}/vol-rest/install/lib HDF5_VOL_CONNECTOR=REST ./test/test_rest_vol
152-
153-
build_and_test_with_cmake:
154-
strategy:
155-
fail-fast: false
156-
matrix:
157-
os: [ubuntu-latest]
158-
python-version: ["3.10"]
159-
hdf5-branch: ["hdf5_1_14", "develop"]
160-
161-
runs-on: ${{matrix.os}}
162-
steps:
163-
- uses: actions/checkout@v4
164-
with:
165-
repository: HDFGroup/hdf5
166-
ref: ${{matrix.hdf5-branch}}
167-
path: ${{github.workspace}}/hdf5
168-
169-
- name: Get REST VOL dependencies
170-
run: |
171-
sudo apt-get update
172-
sudo apt-get install libcurl4-openssl-dev
173-
sudo apt-get install libyajl-dev
174-
175-
- name: Get REST VOL
176-
uses: actions/checkout@v4
177-
with:
178-
path: ${{github.workspace}}/vol-rest
193+
./test/test_rest_vol
179194
180-
- name: CMake Configure + Build HDF5
181-
run: |
182-
mkdir ${{github.workspace}}/hdf5/build
183-
cd ./build
184-
cmake \
185-
-DHDF5_BUILD_HL_LIB=ON \
186-
-DBUILD_SHARED_LIBS=ON -DHDF5_ENABLE_SZIP_SUPPORT=OFF \
187-
-DHDF5_TEST_API=ON \
188-
-DHDF5_ENABLE_Z_LIB_SUPPORT=OFF \
189-
-DCMAKE_BUILD_TYPE=RelWithDebInfo -DHDF5_ENABLE_THREADSAFE=OFF \
190-
-DCMAKE_INSTALL_PREFIX=${{github.workspace}}/hdf5install \
191-
..
192-
make
193-
make install
194-
shell: bash
195-
working-directory: ${{github.workspace}}/hdf5
196-
197-
- name: CMake Configure REST VOL
198-
run: |
199-
mkdir ./build
200-
cd ./build
201-
CFLAGS="-D_POSIX_C_SOURCE=200809L" cmake -G "Unix Makefiles" -DHDF5_ROOT=${{github.workspace}}/hdf5install \
202-
-DCMAKE_INSTALL_PREFIX=${{github.workspace}}/vol-rest/install \
203-
..
204-
shell: bash
205-
working-directory: ${{github.workspace}}/vol-rest
206-
207-
- name: Build + Install REST VOL
208-
run: |
209-
make
210-
make install
211-
shell: bash
212-
working-directory: ${{github.workspace}}/vol-rest/build
213-
214-
- uses: actions/checkout@v4
215-
with:
216-
repository: HDFGroup/hsds
217-
path: ${{github.workspace}}/hsds
218-
219-
- name: Set up Python ${{ matrix.python-version }}
220-
uses: actions/setup-python@v5
221-
with:
222-
python-version: ${{ matrix.python-version }}
223-
224-
- name: Install HSDS dependencies
225-
shell: bash
226-
run: |
227-
python -m pip install --upgrade pip
228-
python -m pip install pytest
229-
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
230-
231-
- name: Install HSDS package
232-
shell: bash
233-
run: |
234-
cd ${{github.workspace}}/hsds
235-
pip install -e .
236-
237-
- name: Run HSDS unit tests
238-
shell: bash
239-
run: |
240-
cd ${{github.workspace}}/hsds
241-
pytest
242-
243-
- name: Install valgrind
244-
run: |
245-
sudo apt update
246-
sudo apt install valgrind
247-
working-directory: ${{ github.workspace }}
248-
249-
# Requests 2.32.0 breaks requests-unixsocket, used by HSDS for socket connections
250-
- name: Fix requests version
195+
- name: Test REST VOL (CMake)
196+
if: matrix.build_system == 'cmake'
197+
working-directory: ${{github.workspace}}/vol-rest/build/
198+
env:
199+
HDF5_PLUGIN_PATH: ${{github.workspace}}/vol-rest/install/lib
251200
run: |
252-
pip install requests==2.31.0
201+
ctest -R "test_rest_vol" -VV
253202
254-
- name: Start HSDS
255-
if: ${{ matrix.endpoint != 'http://127.0.0.1:5101'}}
256-
run: |
257-
cd ${{github.workspace}}/hsds
258-
mkdir ${{github.workspace}}/hsdsdata &&
259-
mkdir ${{github.workspace}}/hsdsdata/hsdstest &&
260-
cp admin/config/groups.default admin/config/groups.txt &&
261-
cp admin/config/passwd.default admin/config/passwd.txt &&
262-
cp admin/config/groups.default admin/config/groups.txt &&
263-
cp admin/config/passwd.default admin/config/passwd.txt
264-
ROOT_DIR=${{github.workspace}}/hsdadata ./runall.sh --no-docker 1 &
265-
sleep 10
203+
- name: Show HSDS Logs on Fail
204+
if: ${{failure()}}
266205
working-directory: ${{github.workspace}}/hsds
267-
268-
- name: Test HSDS
269-
if: ${{matrix.endpoint != 'http://127.0.0.1:5101'}}
270-
run: |
271-
python tests/integ/setup_test.py
272-
working-directory: ${{github.workspace}}/hsds
273-
274-
- name: Set HDF5 Plugin path
275-
run: |
276-
echo "HDF5_PLUGIN_PATH=${{github.workspace}}/vol-rest/build/bin/" >> $GITHUB_ENV
277-
echo "HDF5_VOL_CONNECTOR=REST" >> $GITHUB_ENV
278-
279-
- name: Test REST VOL
280-
working-directory: ${{github.workspace}}/vol-rest/build/
281206
run: |
282-
valgrind --leak-check=full -s ctest -R "test_rest_vol" -VV
207+
cat hs.log
283208
284209
# TODO: Attribute, dataset, link, and testhdf5 tests currently fail
285210
# - name: Test REST VOL with API
286211
# run: |
287-
# valgrind --leak-check=full -s ctest -R "vol-rest" -VV
212+
# ctest -R "vol-rest" -VV
288213
# working-directory: ${{github.workspace}}/hdf5/build/

.gitmodules

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +0,0 @@
1-
[submodule "test/vol-tests"]
2-
path = test/vol-tests
3-
url = https://github.com/HDFGroup/vol-tests

build_vol_autotools.sh

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -163,12 +163,6 @@ if [ "$NPROCS" -eq "0" ]; then
163163
fi
164164
fi
165165

166-
# Ensure that the HDF5 and VOL tests submodules get checked out
167-
if [ -z "$(ls -A ${SCRIPT_DIR}/${HDF5_DIR})" ]; then
168-
git submodule init
169-
git submodule update
170-
fi
171-
172166
# If the user hasn't already, first build HDF5
173167
if [ "$build_hdf5" = true ]; then
174168
echo "*****************"

build_vol_cmake.sh

Lines changed: 0 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -175,12 +175,6 @@ if [ "$NPROCS" -eq "0" ]; then
175175
fi
176176
fi
177177

178-
# Ensure that the vol-tests submodule gets checked out
179-
if [ -z "$(ls -A ${SCRIPT_DIR}/test/vol-tests)" ]; then
180-
git submodule init
181-
git submodule update
182-
fi
183-
184178
# Build the REST VOL connector against HDF5.
185179
echo "*******************************************"
186180
echo "* Building REST VOL connector and test suite *"
@@ -206,20 +200,4 @@ fi
206200

207201
echo "REST VOL built"
208202

209-
# Clean out the old CMake cache
210-
rm -f "${BUILD_DIR}/CMakeCache.txt"
211-
212-
# Configure vol-tests
213-
214-
mkdir -p "${BUILD_DIR}/tests/vol-tests"
215-
cd "${BUILD_DIR}/tests/vol-tests"
216-
217-
CFLAGS="-D_POSIX_C_SOURCE=200809L" cmake -G "${CMAKE_GENERATOR}" "-DHDF5_DIR=${HDF5_INSTALL_DIR}" -DCMAKE_INSTALL_PREFIX="${INSTALL_DIR}" "${CONNECTOR_DEBUG_OPT}" "${CURL_DEBUG_OPT}" "${MEM_TRACK_OPT}" "${THREAD_SAFE_OPT}" "${SCRIPT_DIR}/test/vol-tests"
218-
219-
echo "Build files generated for vol-tests"
220-
221-
make || exit 1
222-
223-
echo "VOL tests built"
224-
225203
exit 0

0 commit comments

Comments
 (0)