diff --git a/.github/workflows/benchmark_on_push.yml b/.github/workflows/benchmark_on_push.yml index 8be4af8741..08f88ef533 100644 --- a/.github/workflows/benchmark_on_push.yml +++ b/.github/workflows/benchmark_on_push.yml @@ -18,16 +18,20 @@ jobs: uses: actions/setup-python@v4 with: python-version: 3.8 + - name: Install Linux system dependencies run: | sudo apt-get update sudo apt install gfortran gcc libopenblas-dev + - name: Install python dependencies - # Pin asv==0.5.1 to fix failing benchmarks. Related to https://github.com/airspeed-velocity/asv/issues/1323 run: | - python -m pip install --upgrade pip wheel setuptools virtualenv asv==0.5.1 wget cmake casadi numpy - - name: Install SuiteSparse and Sundials + python -m pip install --upgrade pip wheel setuptools wget cmake casadi numpy packaging + python -m pip install asv[virtualenv] + + - name: Install SuiteSparse and SUNDIALS run: python scripts/install_KLU_Sundials.py + - name: Fetch base branch run: | # This workflow also runs for merge commits @@ -49,7 +53,8 @@ jobs: HEAD_COMMIT=$(git rev-parse HEAD) echo $BASE_COMMIT | tee commits_to_compare.txt echo $HEAD_COMMIT | tee -a commits_to_compare.txt - asv run HASHFILE:commits_to_compare.txt --m "GitHubRunner" --show-stderr --strict -v + asv run HASHFILE:commits_to_compare.txt --m "GitHubRunner" --show-stderr -v + - name: Compare commits' benchmark results run: | BASE_COMMIT=$(head -1 commits_to_compare.txt) diff --git a/.github/workflows/periodic_benchmarks.yml b/.github/workflows/periodic_benchmarks.yml index ce0ad37cd2..5531339465 100644 --- a/.github/workflows/periodic_benchmarks.yml +++ b/.github/workflows/periodic_benchmarks.yml @@ -20,26 +20,33 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 + - name: Set up Python 3.8 uses: actions/setup-python@v4 with: python-version: 3.8 + - name: Install Linux system dependencies run: | sudo apt-get update sudo apt-get install gfortran gcc libopenblas-dev + - name: Install python dependencies run: | - python -m pip install --upgrade pip wheel setuptools virtualenv asv wget cmake casadi numpy - - name: Install SuiteSparse and Sundials + python -m pip install --upgrade pip wheel setuptools wget cmake casadi numpy packaging + python -m pip install asv[virtualenv] + + - name: Install SuiteSparse and SUNDIALS run: python scripts/install_KLU_Sundials.py + - name: Run benchmarks run: | asv machine --machine "GitHubRunner" - asv run --machine "GitHubRunner" NEW --show-stderr --strict -v + asv run --machine "GitHubRunner" NEW --show-stderr -v env: SUNDIALS_INST: $HOME/.local LD_LIBRARY_PATH: $HOME/.local/lib + - name: Upload results as artifact uses: actions/upload-artifact@v3 with: @@ -55,18 +62,22 @@ jobs: uses: actions/setup-python@v4 with: python-version: 3.8 + - name: Install asv run: pip install asv + - name: Checkout pybamm-bench repo uses: actions/checkout@v4 with: repository: pybamm-team/pybamm-bench token: ${{ secrets.BENCH_PAT }} + - name: Download results artifact uses: actions/download-artifact@v3 with: name: asv_new_results path: new_results + - name: Copy new results and push to pybamm-bench repo env: PUSH_BENCH_EMAIL: ${{ secrets.PUSH_BENCH_EMAIL }} @@ -78,6 +89,7 @@ jobs: git add results git commit -am "Add new results" git push + - name: Publish results run: | asv publish