Skip to content

Commit c688161

Browse files
committed
Dump info about installed packages
1 parent 7727131 commit c688161

File tree

3 files changed

+60
-11
lines changed

3 files changed

+60
-11
lines changed

.github/workflows/benchmark.yaml

Lines changed: 34 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,10 @@ on:
44
push:
55
branches:
66
- main
7+
pull_request:
8+
branches:
9+
- '*'
10+
workflow_dispatch: # allows to trigger manually
711
schedule:
812
- cron: "0 5 * * 4" # Once a week at 0500 on Thursday
913

@@ -37,7 +41,11 @@ jobs:
3741
with:
3842
repository: deshaw/versioned-hdf5
3943
path: ./versioned-hdf5/
40-
fetch-depth: 0 # Needed for asv to be able to run benchmarks on old commits
44+
fetch-depth: 0 # Needed for asv to be able to run benchmarks on old commits
45+
46+
- name: Get commit hash
47+
working-directory: ./versioned-hdf5
48+
run: echo "PROJECT_SHA=$(git rev-parse HEAD)" >> $GITHUB_ENV
4149

4250
- uses: actions/checkout@v4
4351
with:
@@ -46,17 +54,30 @@ jobs:
4654
- name: Setup python with miniconda
4755
uses: conda-incubator/setup-miniconda@v3
4856
with:
49-
python-version: 3.11
50-
channels: conda-forge
57+
miniforge-variant: Mambaforge
58+
miniforge-version: latest
59+
use-mamba: true
60+
environment-file: versioned-hdf5-benchmarks/environment.yml
61+
activate-environment: versioned-hdf5-benchmarks
5162

5263
- name: Install versioned-hdf5
64+
shell: bash -el {0}
5365
working-directory: ./versioned-hdf5
66+
run: python -m pip install '.[bench]'
67+
68+
- name: Dump conda environment
69+
shell: bash -el {0}
70+
run: conda list
71+
72+
- name: Print hdf5 configuration
73+
shell: bash -el {0}
74+
working-directory: ./versioned-hdf5-benchmarks
5475
run: |
55-
echo "PROJECT_SHA=$(git rev-parse HEAD)" >> $GITHUB_ENV
56-
conda install -n test pip hdf5 openmpi h5py ndindex -c conda-forge -y
57-
conda run -n test pip install '.[bench]'
76+
python -c 'import utils; utils.debug_libhdf5_so()'
77+
h5cc -showconfig
5878
5979
- name: Run benchmarks
80+
shell: bash -el {0}
6081
working-directory: ./versioned-hdf5
6182
run: |
6283
# Copy the old asv results back into ./versioned-hdf5 to avoid
@@ -65,11 +86,11 @@ jobs:
6586
6687
# set the machine name; otherwise this is unique to each run
6788
echo "Setting machine name to $MACHINE_NAME"
68-
conda run -n test asv machine --machine $MACHINE_NAME --yes -v
89+
asv machine --machine $MACHINE_NAME --yes -v
6990
cat ~/.asv-machine.json
7091
7192
# Don't return exit code 1 if results are slower
72-
conda run -n test asv run --skip-existing --machine $MACHINE_NAME 1.7.0.. || true;
93+
asv run --skip-existing --machine $MACHINE_NAME 1.7.0.. || true;
7394
7495
# Copy the new benchmark results to the benchmarks repo to commit them
7596
rsync -r .asv ../versioned-hdf5-benchmarks/
@@ -82,18 +103,20 @@ jobs:
82103
message: "Update benchmarks for commit ${{ env.PROJECT_SHA }}"
83104

84105
- name: Generate html
106+
shell: bash -el {0}
85107
working-directory: ./versioned-hdf5
86-
run: |
87-
conda run -n test asv publish -o ./html
108+
run: asv publish -o ./html
88109

89110
- name: Setup Pages
90111
uses: actions/configure-pages@v5
91112

92113
- name: Upload artifact
93114
uses: actions/upload-pages-artifact@v3
94115
with:
95-
path: './versioned-hdf5/html'
116+
path: ./versioned-hdf5/html
117+
retention-days: 30
96118

97119
- name: Deploy to GitHub Pages
120+
if: github.event_name != 'pull_request'
98121
id: deployment
99122
uses: actions/deploy-pages@v4

environment.yml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
name: versioned-hdf5-benchmarks
2+
channels:
3+
- conda-forge
4+
dependencies:
5+
- python =3.11
6+
- pip
7+
- hdf5
8+
- openmpi
9+
- h5py
10+
- ndindex

utils.py

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
import os
2+
import subprocess
3+
4+
5+
def debug_libhdf5_so():
6+
"""Print out which .so file is actually loaded at runtime for libhdf5"""
7+
import h5py
8+
9+
for row in (
10+
subprocess.check_output(["lsof", "-p", str(os.getpid())])
11+
.decode("utf-8")
12+
.splitlines()
13+
):
14+
row = row.strip()
15+
if "libhdf5" in row:
16+
print(row)

0 commit comments

Comments
 (0)