From a3e1c14b02e107b78e86e6dd1fdcafc875d0fde0 Mon Sep 17 00:00:00 2001 From: Bill Hlavacek Date: Thu, 3 Dec 2026 17:58:43 -0700 Subject: [PATCH] scripts: remove the Linux Docker local-CI script (#1492) scripts/local_ci_linux_docker.sh still assumed the monorepo layout: it built $REPO_ROOT/bngsim one directory above the checkout, so outside a checkout named bngsim it failed or built another checkout, and from ~/Code/bngsim it copied the whole parent directory into the container. Its pinned cibuildwheel 2.22.0 was two majors behind CI and could not build cp314 or cp315. CI's wheels.yml builds and tests the manylinux wheels on every pull request, so the script checked nothing CI does not. Remove it, its manual pre-commit hook local-ci-linux, and the doc lines that pointed to it. scripts/local_ci.py remains the local wheel check. --- .pre-commit-config.yaml | 7 -- changelog.d/1492.removed.md | 1 + docs/development/building.md | 4 +- scripts/LOCAL_CI.md | 15 +--- scripts/local_ci_linux_docker.sh | 126 ------------------------------- 5 files changed, 4 insertions(+), 149 deletions(-) create mode 100644 changelog.d/1492.removed.md delete mode 100755 scripts/local_ci_linux_docker.sh diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 483a9bc62..daa5f280d 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -159,7 +159,6 @@ repos: # # pre-commit run --hook-stage manual local-ci-wheel --all-files # pre-commit run --hook-stage manual local-ci-matrix --all-files - # pre-commit run --hook-stage manual local-ci-linux --all-files - id: local-ci-wheel name: local CI — wheel build + smoke (uv, current Python) entry: uv run python scripts/local_ci.py wheel @@ -172,12 +171,6 @@ repos: language: system pass_filenames: false stages: [manual] - - id: local-ci-linux - name: local CI — manylinux2014 wheel + smoke (Docker) - entry: bash scripts/local_ci_linux_docker.sh - language: system - pass_filenames: false - stages: [manual] # Tripwire: verifies that third_party/nfsim/ matches what # vendor + the patch series under scripts/nfsim_vendor_patches/ # would produce. Catches the silent-direct-edit class of regression. diff --git a/changelog.d/1492.removed.md b/changelog.d/1492.removed.md new file mode 100644 index 000000000..8b385c5be --- /dev/null +++ b/changelog.d/1492.removed.md @@ -0,0 +1 @@ +- **`scripts/local_ci_linux_docker.sh` and its manual pre-commit hook `local-ci-linux` are removed (issue #1492).** The script still assumed the old monorepo layout: outside a checkout named `bngsim` it failed or built another checkout, and from `~/Code/bngsim` it copied the whole parent directory into the container. Its pinned cibuildwheel was two major versions behind CI and could not build the cp314 and cp315 wheels. CI's `wheels.yml` builds and tests the manylinux wheels on every pull request; `scripts/local_ci.py` remains the local wheel check. diff --git a/docs/development/building.md b/docs/development/building.md index e38d099ea..4061469d2 100644 --- a/docs/development/building.md +++ b/docs/development/building.md @@ -94,8 +94,8 @@ at the next refresh. python scripts/local_ci.py wheel --python 3.12 ``` -`scripts/local_ci_smoke.py` is the quicker variant, and -`scripts/local_ci_linux_docker.sh` runs the Linux leg in a container. +`scripts/local_ci_smoke.py` is the quicker variant. The Linux wheels are +built and tested by CI (`wheels.yml`) on every pull request. ## Contributors diff --git a/scripts/LOCAL_CI.md b/scripts/LOCAL_CI.md index 231226d32..e51caedf1 100644 --- a/scripts/LOCAL_CI.md +++ b/scripts/LOCAL_CI.md @@ -9,8 +9,6 @@ identical and the report is comparable. - **uv** — manages Pythons, venvs, and dependencies on every platform. - macOS / Linux: `curl -LsSf https://astral.sh/uv/install.sh | sh` - Windows (PowerShell): `irm https://astral.sh/uv/install.ps1 | iex` -- **Docker** — only for the Linux-via-Docker leg (`local_ci_linux_docker.sh`). - - On macOS: `brew install colima docker && colima start`. Everything else (Python 3.10–3.15, build deps, test deps) is provisioned by uv from inside the script. @@ -21,7 +19,7 @@ uv from inside the script. |---|---|---|---| | macOS x86_64 | Intel mac | the project | `uv run python scripts/local_ci.py matrix` | | macOS arm64 | M4 Max | (Bill / you) | same command | -| Linux x86_64 | Docker on Intel mac | the project | `scripts/local_ci_linux_docker.sh` (or `MATRIX=1 ...` for cp310-cp313; its pinned cibuildwheel predates 3.14, see #1492) | +| Linux x86_64 | GitHub CI (`wheels.yml`) | CI | none locally: CI builds and tests the manylinux wheels on every PR | | Windows AMD64 | efm46's box | efm46 | same command as macOS, run from PowerShell or cmd | ## Subcommands @@ -38,12 +36,6 @@ uv run python scripts/local_ci.py matrix # Smoke-test an already-built wheel. uv run python scripts/local_ci.py smoke --wheel path/to/wheel.whl --python 3.12 - -# Linux leg: build cp312 manylinux_2_28 wheel + host-side smoke. -scripts/local_ci_linux_docker.sh - -# Linux leg with full matrix: -MATRIX=1 scripts/local_ci_linux_docker.sh ``` The matrix subcommand on a single platform takes roughly: @@ -55,8 +47,6 @@ The matrix subcommand on a single platform takes roughly: | Wheel install + smoke, per Python | ~30 sec | | Total per matrix run | ~25–35 min | -The Linux Docker leg adds another ~10–15 min for the manylinux_2_28 image -pull (~600 MB) and pinned SUNDIALS rebuild inside the container. ## Pre-commit integration @@ -69,9 +59,6 @@ pre-commit run --hook-stage manual local-ci-wheel # Equivalent to: uv run python scripts/local_ci.py matrix pre-commit run --hook-stage manual local-ci-matrix - -# Equivalent to: scripts/local_ci_linux_docker.sh -pre-commit run --hook-stage manual local-ci-linux ``` Manual stage = does not auto-run on commit or push, only when invoked. diff --git a/scripts/local_ci_linux_docker.sh b/scripts/local_ci_linux_docker.sh deleted file mode 100755 index 343937ab1..000000000 --- a/scripts/local_ci_linux_docker.sh +++ /dev/null @@ -1,126 +0,0 @@ -#!/usr/bin/env bash -# Linux x86_64 wheel build + smoke locally via Docker (manylinux_2_28). -# -# cibuildwheel itself runs on the host and spawns its own manylinux_2_28_x86_64 -# container via the host's Docker CLI. CIBW_TEST_COMMAND then runs pytest + -# our local_ci_smoke.py *inside* that container against the freshly built -# wheel — mirroring exactly what the GHA `Wheels • ubuntu-latest` job does -# without burning Actions minutes. -# -# Requirements: -# - Docker (Colima, Docker Desktop, OrbStack — anything providing `docker`). -# - `uv` on the host PATH. -# -# Output: -# - wheelhouse-local/bngsim--cp312-cp312-manylinux*_x86_64.whl -# - bngsim/scripts/local_ci_report-linux-x86_64-cp312.md (written by smoke) -# -# By default builds cp312 only (the leg that actually failed in CI). To build -# the cp310-cp313 matrix in-container, set MATRIX=1. It stops at cp313 because -# the cibuildwheel pinned below (2.22.0) predates 3.14; CI builds cp314 and -# cp315 with v4.3.5 (wheels.yml, issue #1491). See #1492. -# MATRIX=1 bngsim/scripts/local_ci_linux_docker.sh - -set -euo pipefail - -cd "$(dirname "$0")/../.." -REPO_ROOT="$(pwd)" -WHEELHOUSE="${REPO_ROOT}/wheelhouse-local" -mkdir -p "$WHEELHOUSE" - -if ! command -v uv >/dev/null 2>&1; then - echo "error: uv not found on host PATH" - echo "Install: curl -LsSf https://astral.sh/uv/install.sh | sh" - exit 2 -fi - -if ! command -v docker >/dev/null 2>&1; then - echo "error: docker not found on host PATH" - echo "Install Colima: brew install colima docker && colima start" - exit 2 -fi - -if ! docker info >/dev/null 2>&1; then - echo "error: Docker daemon not reachable" - echo "Start Colima: colima start" - exit 2 -fi - -# Provision a host-side Python + cibuildwheel via uv. cibuildwheel will then -# pull the manylinux_2_28_x86_64 image itself and build inside it. -echo "==> setting up host-side cibuildwheel environment" -uv python install 3.12 -VENV="${REPO_ROOT}/.venv-cibuildwheel-linux" -rm -rf "$VENV" -uv venv "$VENV" --python 3.12 -uv pip install --python "$VENV/bin/python" cibuildwheel==2.22.0 - -# Which CPython tags to build inside the container. -if [[ "${MATRIX:-0}" = "1" ]]; then - CIBW_BUILD="cp310-* cp311-* cp312-* cp313-*" -else - CIBW_BUILD="cp312-*" -fi - -# CIBW_TEST_COMMAND runs inside the manylinux container against the installed -# wheel. We run pytest (skipping HDF5 / save_load), then the smoke script that -# generates the per-platform Markdown report. `{project}` is replaced by -# cibuildwheel with the path to the bngsim/ source dir inside the container. -read -r -d '' CIBW_TEST_COMMAND <<'PYTEST' || true -python -m pytest {project}/bngsim/python/tests -v --tb=short --import-mode=importlib -k "not hdf5 and not h5py and not save_load" && \ -python {project}/bngsim/scripts/local_ci_smoke.py \ - --data-dir {project}/bngsim/tests/data \ - --antimony-fixture-dir {project}/bngsim/benchmarks/models/antimony/ssys \ - --report {project}/bngsim/scripts/_reports/smoke-linux-x86_64-cp312.json -PYTEST - -echo "==> cibuildwheel: CIBW_BUILD=$CIBW_BUILD (host=$(uname -ms))" -CIBW_BUILD="$CIBW_BUILD" \ -CIBW_SKIP="*-musllinux_* pp*" \ -CIBW_ARCHS_LINUX="x86_64" \ -CIBW_BEFORE_BUILD="pip install cmake ninja" \ -CIBW_TEST_EXTRAS="pandas" \ -CIBW_TEST_REQUIRES="pytest>=8.0 numpy>=1.24 libroadrunner>=2.5" \ -CIBW_TEST_COMMAND="$CIBW_TEST_COMMAND" \ - "$VENV/bin/python" -m cibuildwheel \ - --platform linux \ - --output-dir "$WHEELHOUSE" \ - "$REPO_ROOT/bngsim" - -echo "==> built wheel(s):" -ls -la "$WHEELHOUSE"/*manylinux*.whl 2>/dev/null || true - -# Render a Markdown matrix-style report from the JSON the in-container smoke -# wrote out (the JSON path is shared between host and container via the -# cibuildwheel mount). -REPORT_JSON="$REPO_ROOT/bngsim/scripts/_reports/smoke-linux-x86_64-cp312.json" -REPORT_MD="$REPO_ROOT/bngsim/scripts/local_ci_report-linux-x86_64-cp312.md" -if [[ -f "$REPORT_JSON" ]]; then - WHEEL=$(ls -t "$WHEELHOUSE"/*cp312-cp312-manylinux*_x86_64.whl 2>/dev/null | head -1) - "$VENV/bin/python" - < done; see bngsim/scripts/local_ci_report-linux-x86_64-cp312.md"