Skip to content

Commit

Permalink
fix continuous benchmarking
Browse files Browse the repository at this point in the history
  • Loading branch information
C.A.P. Linssen committed Nov 6, 2024
1 parent 01af597 commit 1bfa136
Show file tree
Hide file tree
Showing 2 changed files with 82 additions and 84 deletions.
82 changes: 82 additions & 0 deletions .github/workflows/continuous_benchmarking_master_branch.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,82 @@
on:
push:
branches: master

jobs:
benchmark_base_branch:
name: Continuous Benchmarking Fork PRs with Bencher
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
repository: ${{ github.event.pull_request.head.repo.full_name }}
ref: ${{ github.event.pull_request.head.sha }}
persist-credentials: false

- uses: bencherdev/bencher@main

# Setup Python version
- name: Setup Python 3.8
uses: actions/setup-python@v5
with:
python-version: 3.8

# Install dependencies
- name: Install apt dependencies
run: |
sudo apt-get update
sudo apt-get install libltdl7-dev libgsl0-dev libncurses5-dev libreadline6-dev pkg-config
sudo apt-get install python3-all-dev python3-matplotlib python3-numpy python3-scipy ipython3
# Install Python dependencies
- name: Python dependencies
run: |
python -m pip install --upgrade pip pytest jupyterlab matplotlib pycodestyle scipy pandas pytest-benchmark
python -m pip install -r requirements.txt
# Install NEST simulator
- name: NEST simulator
run: |
python -m pip install cython
echo "GITHUB_WORKSPACE = $GITHUB_WORKSPACE"
NEST_SIMULATOR=$(pwd)/nest-simulator
NEST_INSTALL=$(pwd)/nest_install
echo "NEST_SIMULATOR = $NEST_SIMULATOR"
echo "NEST_INSTALL = $NEST_INSTALL"
git clone --depth=1 https://github.com/nest/nest-simulator
mkdir nest_install
echo "NEST_INSTALL=$NEST_INSTALL" >> $GITHUB_ENV
cd nest_install
cmake -DCMAKE_INSTALL_PREFIX=$NEST_INSTALL $NEST_SIMULATOR
make && make install
cd ..
# Install NESTML (repeated)
- name: Install NESTML
run: |
export PYTHONPATH=${{ env.PYTHONPATH }}:${{ env.NEST_INSTALL }}/lib/python3.8/site-packages
#echo PYTHONPATH=`pwd` >> $GITHUB_ENV
echo "PYTHONPATH=$PYTHONPATH" >> $GITHUB_ENV
python setup.py install
- name: Track Fork PR Benchmarks with Bencher
env:
LD_LIBRARY_PATH: ${{ env.NEST_INSTALL }}/lib/nest
run: |
echo "NEST_INSTALL = $NEST_INSTALL"
LD_LIBRARY_PATH=$LD_LIBRARY_PATH:${{ env.NEST_INSTALL }}/lib/nest bencher run \
--project nestml \
--token '${{ secrets.BENCHER_API_TOKEN }}' \
--branch master \
--threshold-measure latency \
--threshold-test t_test \
--threshold-max-sample-size 64 \
--threshold-upper-boundary 0.99 \
--thresholds-reset \
--github-actions "${{ secrets.GITHUB_TOKEN }}" \
--testbed ubuntu-latest \
--adapter python_pytest \
--file results.json \
--err \
'LD_LIBRARY_PATH=$LD_LIBRARY_PATH:${{ env.NEST_INSTALL }}/lib/nest python3 -m pytest --benchmark-json results.json -s $GITHUB_WORKSPACE/tests/nest_continuous_benchmarking/test_nest_continuous_benchmarking.py'
Original file line number Diff line number Diff line change
Expand Up @@ -85,87 +85,3 @@ jobs:
--file results.json \
--err \
'LD_LIBRARY_PATH=$LD_LIBRARY_PATH:${{ env.NEST_INSTALL }}/lib/nest python3 -m pytest --benchmark-json results.json -s $GITHUB_WORKSPACE/tests/nest_continuous_benchmarking/test_nest_continuous_benchmarking.py'
on:
push:
branches: master

jobs:
benchmark_base_branch:
name: Continuous Benchmarking Fork PRs with Bencher
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
repository: ${{ github.event.pull_request.head.repo.full_name }}
ref: ${{ github.event.pull_request.head.sha }}
persist-credentials: false

- uses: bencherdev/bencher@main

# Setup Python version
- name: Setup Python 3.8
uses: actions/setup-python@v5
with:
python-version: 3.8

# Install dependencies
- name: Install apt dependencies
run: |
sudo apt-get update
sudo apt-get install libltdl7-dev libgsl0-dev libncurses5-dev libreadline6-dev pkg-config
sudo apt-get install python3-all-dev python3-matplotlib python3-numpy python3-scipy ipython3
# Install Python dependencies
- name: Python dependencies
run: |
python -m pip install --upgrade pip pytest jupyterlab matplotlib pycodestyle scipy pandas pytest-benchmark
python -m pip install -r requirements.txt
# Install NEST simulator
- name: NEST simulator
run: |
python -m pip install cython
echo "GITHUB_WORKSPACE = $GITHUB_WORKSPACE"
NEST_SIMULATOR=$(pwd)/nest-simulator
NEST_INSTALL=$(pwd)/nest_install
echo "NEST_SIMULATOR = $NEST_SIMULATOR"
echo "NEST_INSTALL = $NEST_INSTALL"
git clone --depth=1 https://github.com/nest/nest-simulator
mkdir nest_install
echo "NEST_INSTALL=$NEST_INSTALL" >> $GITHUB_ENV
cd nest_install
cmake -DCMAKE_INSTALL_PREFIX=$NEST_INSTALL $NEST_SIMULATOR
make && make install
cd ..
# Install NESTML (repeated)
- name: Install NESTML
run: |
export PYTHONPATH=${{ env.PYTHONPATH }}:${{ env.NEST_INSTALL }}/lib/python3.8/site-packages
#echo PYTHONPATH=`pwd` >> $GITHUB_ENV
echo "PYTHONPATH=$PYTHONPATH" >> $GITHUB_ENV
python setup.py install
- name: Track Fork PR Benchmarks with Bencher
env:
LD_LIBRARY_PATH: ${{ env.NEST_INSTALL }}/lib/nest
run: |
echo "NEST_INSTALL = $NEST_INSTALL"
LD_LIBRARY_PATH=$LD_LIBRARY_PATH:${{ env.NEST_INSTALL }}/lib/nest bencher run \
--project nestml \
--token '${{ secrets.BENCHER_API_TOKEN }}' \
--branch master \
--threshold-measure latency \
--threshold-test t_test \
--threshold-max-sample-size 64 \
--threshold-upper-boundary 0.99 \
--thresholds-reset \
--github-actions "${{ secrets.GITHUB_TOKEN }}" \
--testbed ubuntu-latest \
--adapter python_pytest \
--file results.json \
--err \
'LD_LIBRARY_PATH=$LD_LIBRARY_PATH:${{ env.NEST_INSTALL }}/lib/nest python3 -m pytest --benchmark-json results.json -s $GITHUB_WORKSPACE/tests/nest_continuous_benchmarking/test_nest_continuous_benchmarking.py'

0 comments on commit 1bfa136

Please sign in to comment.