Skip to content

Commit

Permalink
Add GitHub actions for testing VOL connectors (#3849)
Browse files Browse the repository at this point in the history
* Fix issue with HDF5_VOL_ALLOW_EXTERNAL CMake variable

* Add initial API test workflow

* Initialize parallel testing with MPI_THREAD_MULTIPLE when testing API

* Add CMake variable to allow specifying a VOL connector's package name

* Remove call to MPI_Init in serial API tests

While previously necessary, it now interferes with VOL connectors that
may need to be initialized with MPI_THREAD_MULTIPLE
  • Loading branch information
jhendersonHDF authored Nov 15, 2023
1 parent e807dee commit c779464
Show file tree
Hide file tree
Showing 19 changed files with 1,087 additions and 122 deletions.
48 changes: 48 additions & 0 deletions .github/workflows/vol.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
name: hdf5 VOL connectors CI

# Run VOL connector CI daily at 06:00 CDT (11:00 UTC)
on:
workflow_dispatch:
schedule:
- cron: "0 11 * * *"

permissions:
contents: read

jobs:
# Build and test individual VOL connectors by using HDF5's
# CMake FetchContent functionality.
#hdf5_vol_daos_fetchcontent:
# uses: ./.github/workflows/vol_daos.yml
# with:
# build_mode: "Release"

hdf5_vol_rest_fetchcontent:
uses: ./.github/workflows/vol_rest.yml
with:
build_mode: "Release"

hdf5_vol_ext_passthru_fetchcontent:
uses: ./.github/workflows/vol_ext_passthru.yml
with:
build_mode: "Release"

hdf5_vol_async_fetchcontent:
uses: ./.github/workflows/vol_async.yml
with:
build_mode: "Release"

hdf5_vol_cache_fetchcontent:
uses: ./.github/workflows/vol_cache.yml
with:
build_mode: "Release"

hdf5_vol_adios2:
uses: ./.github/workflows/vol_adios2.yml
with:
build_mode: "Release"

hdf5_vol_log:
uses: ./.github/workflows/vol_log.yml
with:
build_mode: "Release"
119 changes: 119 additions & 0 deletions .github/workflows/vol_adios2.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,119 @@
name: Test HDF5 ADIOS2 VOL

on:
workflow_call:
inputs:
build_mode:
description: "CMake Build type"
required: true
type: string

permissions:
contents: read

env:
ADIOS2_COMMIT: 3adf20a929b69c23312a6b5f3cccc49376df77e8
ADIOS2_COMMIT_SHORT: 3adf20a

jobs:
build_and_test:
name: Test HDF5 ADIOS2 VOL connector
runs-on: ubuntu-latest
steps:
- name: Install dependencies
run: |
sudo apt update
sudo apt-get install automake autoconf libtool libtool-bin libopenmpi-dev
- name: Checkout HDF5
uses: actions/checkout@v4
with:
repository: HDFGroup/hdf5
path: hdf5

- name: Configure HDF5
shell: bash
run: |
mkdir ${{ github.workspace }}/hdf5/build
cd ${{ github.workspace }}/hdf5/build
cmake -DCMAKE_BUILD_TYPE=${{ inputs.build_mode }} \
-DCMAKE_INSTALL_PREFIX=${{ runner.workspace }}/hdf5_build \
-DBUILD_STATIC_LIBS=OFF \
-DHDF5_TEST_API:BOOL=ON \
-DHDF5_TEST_API_ENABLE_ASYNC:BOOL=ON \
-DHDF5_ENABLE_PARALLEL:BOOL=ON \
-DHDF5_ENABLE_THREADSAFE:BOOL=ON \
-DALLOW_UNSUPPORTED:BOOL=ON \
-DHDF5_ENABLE_SZIP_SUPPORT:BOOL=OFF \
${{ github.workspace }}/hdf5
cat src/libhdf5.settings
- name: Build and install HDF5
shell: bash
working-directory: ${{ github.workspace }}/hdf5/build
run: |
cmake --build . --parallel 3 --config ${{ inputs.build_mode }}
cmake --install .
echo "LD_LIBRARY_PATH=${{ github.workspace }}/hdf5/build/bin" >> $GITHUB_ENV
echo "PATH=${{ runner.workspace }}/hdf5_build/bin:${PATH}" >> $GITHUB_ENV
# Since the HDF5 ADIOS2 VOL connector is part of the ADIOS2 repository,
# it is difficult to use CMake's FetchContent functionality to fetch
# and build the ADIOS2 connector. Also, since building of ADIOS2 takes
# a while, it isn't ideal to have to rebuild it every time we want to
# test against changes in HDF5 or the VOL connector. Therefore, just
# use a fixed commit for the build of ADIOS2 so we can cache that and
# still test the connector against changes in HDF5.
- name: Restore ADIOS2 (${{ env.ADIOS2_COMMIT_SHORT }}) installation cache
id: cache-adios2
uses: actions/cache@v3
with:
path: ${{ runner.workspace }}/adios2-${{ env.ADIOS2_COMMIT_SHORT }}-install
key: ${{ runner.os }}-${{ runner.arch }}-adios2-${{ env.ADIOS2_COMMIT }}-${{ inputs.build_mode }}-cache

- if: ${{ steps.cache-adios2.outputs.cache-hit != 'true' }}
name: Checkout ADIOS2 (${{ env.ADIOS2_COMMIT_SHORT }})
uses: actions/checkout@v4
with:
repository: ornladios/ADIOS2
ref: ${{ env.ADIOS2_COMMIT }}
path: adios2

- if: ${{ steps.cache-adios2.outputs.cache-hit != 'true' }}
name: Install ADIOS2 (${{ env.ADIOS2_COMMIT_SHORT }})
env:
CXX: mpic++
CC: mpicc
run: |
mkdir adios2/build
cd adios2/build
cmake -DCMAKE_BUILD_TYPE=${{ inputs.build_mode }} \
-DCMAKE_INSTALL_PREFIX=${{ runner.workspace }}/adios2-${{ env.ADIOS2_COMMIT_SHORT }}-install \
-DADIOS2_USE_HDF5:BOOL=ON \
-DHDF5_ROOT=${{ runner.workspace }}/hdf5_build/ \
..
make -j2
make -j2 install
- name: Cache ADIOS2 (${{ env.ADIOS2_COMMIT_SHORT }}) installation
uses: actions/cache/save@v3
if: ${{ steps.cache-adios2.outputs.cache-hit != 'true' }}
with:
path: ${{ runner.workspace }}/adios2-${{ env.ADIOS2_COMMIT_SHORT }}-install
key: ${{ runner.os }}-${{ runner.arch }}-adios2-${{ env.ADIOS2_COMMIT }}-${{ inputs.build_mode }}-cache

- name: Set environment variables for tests
run: |
echo "HDF5_PLUGIN_PATH=${{ runner.workspace }}/adios2-${{ env.ADIOS2_COMMIT_SHORT }}-install/lib" >> $GITHUB_ENV
echo "HDF5_VOL_CONNECTOR=ADIOS2_VOL" >> $GITHUB_ENV
# Skip parallel testing for now as it appears to hang
- name: Test HDF5 ADIOS2 VOL connector with HDF5 API tests
working-directory: ${{ github.workspace }}/hdf5/build
# Don't test the ADIOS2 VOL connector with the HDF5 API tests yet,
# as it doesn't currently pass all the tests. Leave the step in,
# but skip it to leave an indication that this should be re-enabled
# in the future.
if: false
run: |
ctest --build-config ${{ inputs.build_mode }} -VV -R "h5_api" -E "parallel" .
94 changes: 94 additions & 0 deletions .github/workflows/vol_async.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,94 @@
name: Test HDF5 async VOL

on:
workflow_call:
inputs:
build_mode:
description: "CMake Build type"
required: true
type: string

permissions:
contents: read

jobs:
build_and_test:
name: Test HDF5 asynchronous I/O VOL connector
runs-on: ubuntu-latest
steps:
- name: Install dependencies
run: |
sudo apt update
sudo apt-get install automake autoconf libtool libtool-bin libopenmpi-dev
- name: Checkout HDF5
uses: actions/checkout@v4
with:
repository: HDFGroup/hdf5
path: hdf5

- name: Checkout Argobots
uses: actions/checkout@v4
with:
repository: pmodels/argobots
path: abt

# Argobots builds and installs fairly quickly,
# so no caching is currently performed here
- name: Install Argobots
working-directory: ${{ github.workspace }}/abt
run: |
./autogen.sh
./configure --prefix=/usr/local
make -j2
sudo make -j2 install
- name: Configure HDF5 with asynchronous I/O VOL connector
shell: bash
run: |
mkdir ${{ github.workspace }}/hdf5/build
cd ${{ github.workspace }}/hdf5/build
cmake -DCMAKE_BUILD_TYPE=${{ inputs.build_mode }} \
-DCMAKE_INSTALL_PREFIX=${{ runner.workspace }}/hdf5_build \
-DBUILD_STATIC_LIBS=OFF \
-DHDF5_TEST_API:BOOL=ON \
-DHDF5_TEST_API_ENABLE_ASYNC:BOOL=ON \
-DHDF5_ENABLE_PARALLEL:BOOL=ON \
-DHDF5_ENABLE_THREADSAFE:BOOL=ON \
-DALLOW_UNSUPPORTED:BOOL=ON \
-DHDF5_ENABLE_SZIP_SUPPORT:BOOL=OFF \
-DHDF5_VOL_ALLOW_EXTERNAL:STRING="GIT" \
-DHDF5_VOL_URL01:STRING="https://github.com/hpc-io/vol-async.git" \
-DHDF5_VOL_VOL-ASYNC_BRANCH:STRING="develop" \
-DHDF5_VOL_VOL-ASYNC_NAME:STRING="async under_vol=0\;under_info={}" \
-DHDF5_VOL_VOL-ASYNC_TEST_PARALLEL:BOOL=ON \
${{ github.workspace }}/hdf5
cat src/libhdf5.settings
- name: Build HDF5 and asynchronous I/O VOL connector
shell: bash
working-directory: ${{ github.workspace }}/hdf5/build
run: |
cmake --build . --parallel 3 --config ${{ inputs.build_mode }}
echo "LD_LIBRARY_PATH=/usr/local/lib:${{ github.workspace }}/hdf5/build/bin" >> $GITHUB_ENV
# Workaround for asynchronous I/O VOL CMake issue
- name: Copy testing files
working-directory: ${{ github.workspace }}/hdf5/build
run: |
cp bin/async_test* ./_deps/vol-async-build/test
- name: Test HDF5 asynchronous I/O VOL connector with external tests
working-directory: ${{ github.workspace }}/hdf5/build
run: |
ctest --build-config ${{ inputs.build_mode }} -VV -R "async_test" .
- name: Test HDF5 asynchronous I/O VOL connector with HDF5 API tests
working-directory: ${{ github.workspace }}/hdf5/build
# Don't test the Async VOL connector with the HDF5 API tests yet,
# as it doesn't currently pass all the tests. Leave the step in,
# but skip it to leave an indication that this should be re-enabled
# in the future.
if: false
run: |
ctest --build-config ${{ inputs.build_mode }} -VV -R "HDF5_VOL_vol-async" .
Loading

0 comments on commit c779464

Please sign in to comment.