Files
uv/.github/workflows/bench.yml
T
konsti 1aa89dfa39 Downgrade ubuntu runner to align with codspeed (#18011)
Follow-up to https://github.com/astral-sh/uv/pull/17995 to fix benchmark
running, codspeed-macro is based on an older glibc version not
compatible with Ubuntu 24.04.
2026-02-13 16:37:18 +00:00

137 lines
4.5 KiB
YAML

on:
workflow_call:
inputs:
save-rust-cache:
required: false
type: string
default: "true"
permissions: {}
env:
CARGO_INCREMENTAL: 0
CARGO_NET_RETRY: 10
CARGO_TERM_COLOR: always
RUSTUP_MAX_RETRIES: 10
jobs:
benchmarks-walltime-build:
name: "walltime build"
# codspeed-macro doesn't support Ubuntu 24.04 yet
runs-on: depot-ubuntu-22.04-arm-4
if: ${{ github.repository == 'astral-sh/uv' }}
timeout-minutes: 20
steps:
- name: "Checkout Branch"
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
persist-credentials: false
- uses: Swatinem/rust-cache@779680da715d629ac1d338a641029a2f4372abb5 # v2.8.2
with:
save-if: ${{ inputs.save-rust-cache == 'true' }}
- name: "Install Rust toolchain"
run: rustup show
- name: "Install codspeed"
uses: taiki-e/install-action@542cebaaed782771e619bd5609d97659d109c492 # v2.66.7
with:
tool: cargo-codspeed
- name: "Install requirements and prime cache"
run: |
sudo apt-get update
sudo apt-get install -y libsasl2-dev libldap2-dev libkrb5-dev
cargo run --bin uv -- venv --cache-dir .cache
cargo run --bin uv -- pip compile test/requirements/jupyter.in --universal --exclude-newer 2024-08-08 --cache-dir .cache
cargo run --bin uv -- pip compile test/requirements/airflow.in --universal --exclude-newer 2024-08-08 --cache-dir .cache
- name: "Build benchmarks"
run: cargo codspeed build -m walltime --profile profiling -p uv-bench
- name: "Create artifact archive"
run: tar -cvf benchmarks-walltime.tar target/codspeed target/debug/uv .cache
- name: "Upload benchmark artifacts"
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
with:
name: benchmarks-walltime
path: benchmarks-walltime.tar
retention-days: 1
benchmarks-walltime-run:
name: "walltime on aarch64 linux"
runs-on: codspeed-macro
needs: benchmarks-walltime-build
timeout-minutes: 20
steps:
- name: "Checkout Branch"
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
persist-credentials: false
- name: "Install codspeed"
uses: taiki-e/install-action@542cebaaed782771e619bd5609d97659d109c492 # v2.66.7
with:
tool: cargo-codspeed
- name: "Download benchmark artifacts"
uses: actions/download-artifact@fa0a91b85d4f404e444e00e005971372dc801d16 # v4.1.8
with:
name: benchmarks-walltime
- name: "Extract artifact archive"
run: tar -xvf benchmarks-walltime.tar
- name: "Create venv"
run: ./target/debug/uv venv --cache-dir .cache
- name: "Run benchmarks"
uses: CodSpeedHQ/action@fa0c9b1770f933c1bc025c83a9b42946b102f4e6 # v4.10.4
with:
run: cargo codspeed run
mode: walltime
token: ${{ secrets.CODSPEED_TOKEN }}
benchmarks-simulated:
name: "simulated"
runs-on: ubuntu-latest
if: ${{ github.repository == 'astral-sh/uv' }}
timeout-minutes: 20
steps:
- name: "Checkout Branch"
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
persist-credentials: false
- uses: Swatinem/rust-cache@779680da715d629ac1d338a641029a2f4372abb5 # v2.8.2
with:
save-if: ${{ inputs.save-rust-cache == 'true' }}
- name: "Install Rust toolchain"
run: rustup show
- name: "Install codspeed"
uses: taiki-e/install-action@542cebaaed782771e619bd5609d97659d109c492 # v2.66.7
with:
tool: cargo-codspeed
- name: "Install requirements and prime cache"
run: |
sudo apt-get update
sudo apt-get install -y libsasl2-dev libldap2-dev libkrb5-dev
cargo run --bin uv -- venv --cache-dir .cache
cargo run --bin uv -- pip compile test/requirements/jupyter.in --universal --exclude-newer 2024-08-08 --cache-dir .cache
cargo run --bin uv -- pip compile test/requirements/airflow.in --universal --exclude-newer 2024-08-08 --cache-dir .cache
- name: "Build benchmarks"
run: cargo codspeed build --profile profiling -p uv-bench
- name: "Run benchmarks"
uses: CodSpeedHQ/action@fa0c9b1770f933c1bc025c83a9b42946b102f4e6 # v4.10.4
with:
run: cargo codspeed run
mode: simulation
token: ${{ secrets.CODSPEED_TOKEN }}