diff --git a/.github/workflows/benchmark.yaml b/.github/workflows/benchmark.yaml index 93df226..63e5334 100644 --- a/.github/workflows/benchmark.yaml +++ b/.github/workflows/benchmark.yaml @@ -4,6 +4,10 @@ on: push: branches: - main + pull_request: + branches: + - '*' + workflow_dispatch: # allows to trigger manually schedule: - cron: "0 5 * * 4" # Once a week at 0500 on Thursday @@ -37,7 +41,11 @@ jobs: with: repository: deshaw/versioned-hdf5 path: ./versioned-hdf5/ - fetch-depth: 0 # Needed for asv to be able to run benchmarks on old commits + fetch-depth: 0 # Needed for asv to be able to run benchmarks on old commits + + - name: Get commit hash + working-directory: ./versioned-hdf5 + run: echo "PROJECT_SHA=$(git rev-parse HEAD)" >> $GITHUB_ENV - uses: actions/checkout@v4 with: @@ -52,10 +60,18 @@ jobs: - name: Install versioned-hdf5 working-directory: ./versioned-hdf5 run: | - echo "PROJECT_SHA=$(git rev-parse HEAD)" >> $GITHUB_ENV conda install -n test pip hdf5 openmpi h5py ndindex -c conda-forge -y conda run -n test pip install '.[bench]' + - name: Dump conda environment + run: conda list -n test + + - name: Print hdf5 configuration + working-directory: ./versioned-hdf5-benchmarks + run: | + conda run -n test python -c 'import utils; utils.debug_libhdf5_so()' + conda run -n test h5cc -showconfig + - name: Run benchmarks working-directory: ./versioned-hdf5 run: | @@ -83,8 +99,7 @@ jobs: - name: Generate html working-directory: ./versioned-hdf5 - run: | - conda run -n test asv publish -o ./html + run: conda run -n test asv publish -o ./html - name: Setup Pages uses: actions/configure-pages@v5 @@ -92,8 +107,10 @@ jobs: - name: Upload artifact uses: actions/upload-pages-artifact@v3 with: - path: './versioned-hdf5/html' + path: ./versioned-hdf5/html + retention-days: 30 - name: Deploy to GitHub Pages + if: github.event_name != 'pull_request' id: deployment uses: actions/deploy-pages@v4 diff --git a/utils.py b/utils.py new file mode 100644 index 0000000..67f96d0 --- /dev/null +++ b/utils.py @@ -0,0 +1,16 @@ +import os +import subprocess + + +def debug_libhdf5_so(): + """Print out which .so file is actually loaded at runtime for libhdf5""" + import h5py + + for row in ( + subprocess.check_output(["lsof", "-p", str(os.getpid())]) + .decode("utf-8") + .splitlines() + ): + row = row.strip() + if "libhdf5" in row: + print(row)