summaryrefslogtreecommitdiffstats
path: root/.github/workflows/vol_cache.yml
blob: 1a8c40cfdf25da2be7db96c3725598b8545a4ff4 (plain)
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
name: Test HDF5 cache VOL

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

permissions:
  contents: read

jobs:
  build_and_test:
    strategy:
      matrix:
        name:
          - "Test HDF5 cache VOL connector"
          - "Test HDF5 cache VOL connector atop async VOL connector"
        async: [false, true]
        exclude:
          - name: "Test HDF5 cache VOL connector"
            async: true

          - name: "Test HDF5 cache VOL connector atop async VOL connector"
            async: false


    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: Set environment variables for configuration (cache VOL only)
        run: |
          echo "HDF5_VOL_CACHE_TEST_NAME=cache_ext config=$GITHUB_WORKSPACE/config1.cfg\;under_vol=0\;under_info={}\;" >> $GITHUB_ENV
        if: ${{ ! matrix.async }}

      - name: Set environment variables for configuration (cache VOL atop async VOL)
        run: |
          echo "HDF5_VOL_CACHE_TEST_NAME=cache_ext config=$GITHUB_WORKSPACE/config1.cfg\;under_vol=512\;under_info={under_vol=0\;under_info={}}\;" >> $GITHUB_ENV
        if: ${{ matrix.async }}

      # Define ASYNC_INCLUDE_DIR, ASYNC_INCLUDE_DIRS and ASYNC_LIBRARIES to
      # patch around having the cache VOL find the async VOL when they're built
      # at the same time. Once the Async and Cache VOLs create CMake .config
      # files, this should no longer be needed with CMake 3.24 and newer (see
      # FetchContent's OVERRIDE_FIND_PACKAGE)
      - name: Configure HDF5 with cache 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 \
            -DHDF5_VOL_URL02:STRING="https://github.com/HDFGroup/vol-cache.git" \
            -DHDF5_VOL_VOL-CACHE_BRANCH:STRING="develop" \
            -DHDF5_VOL_VOL-CACHE_NAME:STRING="$HDF5_VOL_CACHE_TEST_NAME" \
            -DHDF5_VOL_VOL-CACHE_TEST_PARALLEL:BOOL=ON \
            -DASYNC_INCLUDE_DIR=${{ github.workspace }}/hdf5/build/_deps/vol-async-src/src \
            -DASYNC_INCLUDE_DIRS=${{ github.workspace }}/hdf5/build/_deps/vol-async-src/src \
            -DASYNC_LIBRARIES=${{ github.workspace }}/hdf5/build/bin/libasynchdf5.a\;${{ github.workspace }}/hdf5/build/bin/libh5async.so \
            ${{ github.workspace }}/hdf5
          cat src/libhdf5.settings

      - name: Build HDF5 and cache 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

      - name: Create cache VOL connector configuration file for testing
        shell: bash
        run: |
          mkdir -p $GITHUB_WORKSPACE/scratch
          touch $GITHUB_WORKSPACE/config1.cfg
          echo "HDF5_CACHE_STORAGE_SCOPE: LOCAL" >> $GITHUB_WORKSPACE/config1.cfg
          echo "HDF5_CACHE_STORAGE_PATH: $GITHUB_WORKSPACE/scratch" >> $GITHUB_WORKSPACE/config1.cfg
          echo "HDF5_CACHE_STORAGE_SIZE: 4294967296" >> $GITHUB_WORKSPACE/config1.cfg
          echo "HDF5_CACHE_STORAGE_TYPE: SSD" >> $GITHUB_WORKSPACE/config1.cfg
          echo "HDF5_CACHE_REPLACEMENT_POLICY: LRU" >> $GITHUB_WORKSPACE/config1.cfg

      # Workaround for cache VOL CMake issue
      - name: Copy testing files
        working-directory: ${{ github.workspace }}/hdf5/build
        run: |
          cp bin/test_file.exe ./_deps/vol-cache-build/tests
          cp bin/test_group.exe ./_deps/vol-cache-build/tests
          cp bin/test_dataset.exe ./_deps/vol-cache-build/tests
          cp bin/test_dataset_async_api.exe ./_deps/vol-cache-build/tests
          cp bin/test_write_multi.exe ./_deps/vol-cache-build/tests
          cp bin/test_multdset.exe ./_deps/vol-cache-build/tests

      - name: Set environment variables for external tests (cache VOL only)
        run: |
          echo "HDF5_PLUGIN_PATH=${{ github.workspace }}/hdf5/build/bin/" >> $GITHUB_ENV
          echo "HDF5_VOL_CONNECTOR=cache_ext config=$GITHUB_WORKSPACE/config1.cfg;under_vol=0;under_info={};" >> $GITHUB_ENV
        if: ${{ ! matrix.async }}

      - name: Set environment variables for external tests (cache VOL atop async VOL)
        run: |
          echo "HDF5_PLUGIN_PATH=${{ github.workspace }}/hdf5/build/bin/" >> $GITHUB_ENV
          echo "HDF5_VOL_CONNECTOR=cache_ext config=$GITHUB_WORKSPACE/config1.cfg;under_vol=512;under_info={under_vol=0;under_info={}};" >> $GITHUB_ENV
        if: ${{ matrix.async }}

      # Until cache VOL tests are namespaced properly, run them directly
      - name: Test HDF5 cache VOL connector with external tests
        working-directory: ${{ github.workspace }}/hdf5/build
        run: |
          ctest --build-config ${{ inputs.build_mode }} -VV -R "^test_file$" .
          ctest --build-config ${{ inputs.build_mode }} -VV -R "^test_group$" .
          ctest --build-config ${{ inputs.build_mode }} -VV -R "^test_dataset$" .
          ctest --build-config ${{ inputs.build_mode }} -VV -R "^test_dataset_async_api$" .
          ctest --build-config ${{ inputs.build_mode }} -VV -R "^test_write_multi$" .
          ctest --build-config ${{ inputs.build_mode }} -VV -R "^test_multdset$" .

      - name: Test HDF5 cache VOL connector with HDF5 API tests
        working-directory: ${{ github.workspace }}/hdf5/build
        # Don't test the Cache VOL connector with the HDF5 API tests yet
        # when it's stacked on top of the Async connector, as it doesn't
        # currently pass all the tests due to the Async connector not passing
        # all the tests. Leave the step in, but skip it to leave an indication
        # that this should be re-enabled in the future.
        if: ${{ ! matrix.async }}
        run: |
          ctest --build-config ${{ inputs.build_mode }} -VV -R "HDF5_VOL_vol-cache" .