Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 21 additions & 0 deletions .github/workflows/casestudy-django-github.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
name: casestudy-django-github

# Runs the django case study on a GitHub-hosted runner. Identical to casestudy-django-tempus.yml
# apart from the `runner` input. workflow_dispatch only, to match the tempus caller.
on:
workflow_dispatch:

permissions:
contents: read

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:
casestudy:
uses: ./.github/workflows/casestudy-django.yml
permissions:
contents: read
with:
runner: ubuntu-latest
22 changes: 22 additions & 0 deletions .github/workflows/casestudy-django-tempus.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
name: casestudy-django-tempus

# Runs the django case study on a tempus.build runner. Identical to casestudy-django-github.yml
# apart from the `runner` input. workflow_dispatch only: case studies are run deliberately (>=3x,
# recorded with the upstream ref and date), and a fork PR must never run on a self-hosted runner.
on:
workflow_dispatch:

permissions:
contents: read

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:
casestudy:
uses: ./.github/workflows/casestudy-django.yml
permissions:
contents: read
with:
runner: tempus-ubuntu-24.04-4core
40 changes: 40 additions & 0 deletions .github/workflows/casestudy-django.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
name: casestudy-django

# Real-OSS case study: django/django's own test command, run on both runners. django is fetched at
# pipeline time at a pinned commit — its code is NOT stored in this repo. The job is reduced to one
# comparable Linux leg (Python 3.14, SQLite, --parallel). The two thin callers
# (casestudy-django-{tempus,github}.yml) differ only in the `runner` input, so the only variable
# is the runner. See case-studies/README.md.
on:
workflow_call:
inputs:
runner:
description: "runs-on label to benchmark"
required: true
type: string

permissions:
contents: read

jobs:
django:
name: django tests (${{ inputs.runner }})
runs-on: ${{ inputs.runner }}
timeout-minutes: 30
steps:
- name: Check out django at the pinned commit
uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
with:
repository: django/django
ref: c14b756185c88f7f2eb745ff061f3c221fea9de7 # v5.2.9
persist-credentials: false
- uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0
with:
python-version: "3.14"
# django's own test command at this pin. Uses pip (not uv) as django ships no uv lockfile.
# SQLite default — no DB service, no secrets. --parallel exercises all 4 vCPU.
# No action-level cache: this is the honest cold path (warm = a primed colocated proxy).
- name: Install django and test dependencies
run: python -m pip install -e . -r tests/requirements/py3.txt
- name: Run django's test suite
run: python tests/runtests.py --parallel
21 changes: 0 additions & 21 deletions .github/workflows/casestudy-flask-github.yml

This file was deleted.

22 changes: 0 additions & 22 deletions .github/workflows/casestudy-flask-tempus.yml

This file was deleted.

37 changes: 0 additions & 37 deletions .github/workflows/casestudy-flask.yml

This file was deleted.

9 changes: 5 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ not the spec.

| Upstream | Pinned ref | Test command |
| -------- | ---------- | ------------ |
| [pallets/flask](https://github.com/pallets/flask) | v3.1.3 (`22d9247`) | `uv run --locked tox run -e py3.14` |
| [django/django](https://github.com/django/django) | v5.2.9 (`c14b756`) | `python tests/runtests.py --parallel` |

Pin records and runner details live in [`case-studies/projects/`](case-studies/projects/). To add
a project, see [`case-studies/README.md`](case-studies/README.md).
Expand All @@ -44,9 +44,10 @@ a project, see [`case-studies/README.md`](case-studies/README.md).
# run both caller workflows via workflow_dispatch (>=3x per runner), then:
python scripts/case_study_collect.py \
--repo tempusbuild/benchmark \
--ref 22d924701a6ae2e4cd01e9a15bbaf3946094af65 \
--tempus-workflow casestudy-flask-tempus.yml \
--github-workflow casestudy-flask-github.yml
--upstream django/django \
--ref c14b756185c88f7f2eb745ff061f3c221fea9de7 \
--tempus-workflow casestudy-django-tempus.yml \
--github-workflow casestudy-django-github.yml
```

## Methodology and results
Expand Down
22 changes: 12 additions & 10 deletions case-studies/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,28 +9,30 @@ workflows differ **only** in `runs-on:`. The upstream project's steps are unchan
The upstream project's code is **not stored in this repo**. Each case-study run checks the project
out at a **pinned commit** at pipeline time and runs its own test command. What we commit is only:

- two thin caller workflows + one reusable workflow (e.g. `casestudy-flask*.yml`), and
- two thin caller workflows + one reusable workflow (e.g. `casestudy-django*.yml`), and
- a pin record under [`projects/`](projects/) (upstream repo, commit, licence, command).

So there is no mirror repo and no third-party code in our git — only a workflow that says "check
out `pallets/flask@<sha>` and run `uv run --locked tox run -e py3.14`".
out `django/django@<sha>` and run `python tests/runtests.py --parallel`".

## How it works (flask example)
## How it works (django example)

```text
.github/workflows/casestudy-flask.yml reusable: checkout flask @pinned sha → its test cmd
├── casestudy-flask-tempus.yml runner: tempus-ubuntu-24.04-4core
└── casestudy-flask-github.yml runner: ubuntu-latest
.github/workflows/casestudy-django.yml reusable: checkout django @pinned sha → its test cmd
├── casestudy-django-tempus.yml runner: tempus-ubuntu-24.04-4core
└── casestudy-django-github.yml runner: ubuntu-latest

run both (workflow_dispatch) >=3x per runner
▼ scripts/case_study_collect.py --repo <this-benchmark-repo> --ref <flask-sha> \
--tempus-workflow casestudy-flask-tempus.yml --github-workflow casestudy-flask-github.yml
▼ scripts/case_study_collect.py --repo tempusbuild/benchmark --upstream django/django \
--ref <django-sha> \
--tempus-workflow casestudy-django-tempus.yml --github-workflow casestudy-django-github.yml
▼ median wall-clock per runner (from the GitHub API) → comparison row
```

`--repo` is the repo whose Actions runs are read (this benchmark repo, where the case-study
workflows live); `--ref` is the pinned **upstream** flask commit those runs measured.
workflows live); `--upstream` is the real project the case study exercises (shown in the table);
`--ref` is the pinned upstream django commit those runs measured.

## What stays honest

Expand Down Expand Up @@ -63,5 +65,5 @@ upstream project.

Good candidates have a permissive licence, a test command that runs on `ubuntu-latest` without
secrets or external services, and a suite that completes in minutes on a single 4 vCPU leg. Copy
the three `casestudy-flask*.yml` workflows and [`projects/flask.yaml`](projects/flask.yaml), set
the three `casestudy-django*.yml` workflows and [`projects/django.yaml`](projects/django.yaml), set
the upstream repo, the pinned commit, and the project's own one-leg test command.
19 changes: 19 additions & 0 deletions case-studies/projects/django.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# Pin record for the django case study (documentation + attribution; the workflow files are the
# source of truth). The case study fetches django at the pinned commit AT PIPELINE TIME and runs
# its own test command — django's code is never stored in this repo.

upstream:
repo: django/django
# Pinned commit: the case study is reproducible at this exact upstream state. Bump deliberately;
# every published number records this ref and the date it was run.
ref: c14b756185c88f7f2eb745ff061f3c221fea9de7 # v5.2.9
license: BSD-3-Clause

# django's own test command: one comparable Linux leg (Python 3.14, SQLite, --parallel).
# pip is used (django ships no uv lockfile). --parallel exercises all 4 vCPU.
run: python tests/runtests.py --parallel

workflows:
reusable: .github/workflows/casestudy-django.yml
tempus: .github/workflows/casestudy-django-tempus.yml
github: .github/workflows/casestudy-django-github.yml
18 changes: 0 additions & 18 deletions case-studies/projects/flask.yaml

This file was deleted.

9 changes: 5 additions & 4 deletions docs/results/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,10 @@ separately, upstream project pinned to a specific commit).
```bash
python scripts/case_study_collect.py \
--repo tempusbuild/benchmark \
--upstream django/django \
--ref <upstream-commit-sha> \
--tempus-workflow casestudy-flask-tempus.yml \
--github-workflow casestudy-flask-github.yml
--tempus-workflow casestudy-django-tempus.yml \
--github-workflow casestudy-django-github.yml
```

This prints the Markdown rows that replace the table below.
Expand All @@ -31,8 +32,8 @@ measured medians, never estimates. There is one row per (upstream project, runne

| Upstream | Ref | Runner | Runs | Median wall-clock | Cache | Date |
| -------- | --- | ------ | ---- | ----------------- | ----- | ---- |
| `pallets/flask` | — | `ubuntu-latest` | — | — | cold | — |
| `pallets/flask` | — | `tempus-ubuntu-24.04-4core` | — | — | cold | — |
| `django/django` | — | `ubuntu-latest` | — | — | cold | — |
| `django/django` | — | `tempus-ubuntu-24.04-4core` | — | — | cold | — |

(Warm-cache rows are added the same way, with `warm` in the Cache column. Cold and warm are never
blended in a single row.)
Expand Down
13 changes: 7 additions & 6 deletions justfile
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,13 @@ lint:
test:
uv run pytest scripts/

# Reduce the flask case study's runs into a comparison row, e.g.:
# just results-flask pallets/flask 22d924701a6ae2e4cd01e9a15bbaf3946094af65
# Reduce the django case study's runs into a comparison row, e.g.:
# just results-django c14b756185c88f7f2eb745ff061f3c221fea9de7
# One recipe per case study (the workflow filenames are study-specific).
results-flask repo ref:
results-django ref:
uv run python scripts/case_study_collect.py \
--repo {{ repo }} \
--repo tempusbuild/benchmark \
--upstream django/django \
--ref {{ ref }} \
--tempus-workflow casestudy-flask-tempus.yml \
--github-workflow casestudy-flask-github.yml
--tempus-workflow casestudy-django-tempus.yml \
--github-workflow casestudy-django-github.yml
Loading