From 9f44f3c611bdced7ac5115f696b47a1af301763e Mon Sep 17 00:00:00 2001 From: lmoresi Date: Mon, 4 May 2026 21:35:43 +1000 Subject: [PATCH] CI: replace micromamba + environment.yaml with pixi (PR-merge unblocker) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Since 2026-04-30 every push to development and every PR has been failing CI with the runner timing out: Resolving Environment ⧖ Starting # 02:51:02 ##[error]The runner has received a shutdown signal. # 03:57:25 That's 66 minutes spent in micromamba's conda-forge solve before the test step starts, after which GitHub kills the runner. environment.yaml has loose constraints (python <= 3.11, an exact pin on petsc=3.21.5 that's now a year-old in conda-forge, and several unpinned packages including pykdtree which UW3 doesn't actually use any more) — that combination, plus recent conda-forge package state shifts, has put the solver into deep backtracking. The pixi.lock committed in the repo already captures the exact same dependency set we use locally for development. Using prefix-dev/setup-pixi with frozen: true (refuses to re-solve) gives a deterministic, fast install matching local dev state. Bonus: the build step now uses `pixi run -e dev build` (= `pip install . --no-build-isolation` from pixi.toml), avoiding the editable install the previous CI was doing in violation of project policy (CLAUDE.md "NEVER use pip install -e ."). Replaces the workflow file in place; keeping environment.yaml in the repo for now because PR #133 (Gadi Singularity container) consumes it, and removing it would create a cross-PR ordering hazard. Test plan: this commit's own CI run is the test plan — if it goes green in <10 min instead of red in 90 min, we have our answer. Underworld development team with AI support from Claude Code --- .github/workflows/build_uw3_and_test.yaml | 41 +++++++++++++---------- 1 file changed, 23 insertions(+), 18 deletions(-) diff --git a/.github/workflows/build_uw3_and_test.yaml b/.github/workflows/build_uw3_and_test.yaml index dbcbaa10..3918c0f3 100644 --- a/.github/workflows/build_uw3_and_test.yaml +++ b/.github/workflows/build_uw3_and_test.yaml @@ -1,7 +1,12 @@ name: test_uw3 -# We should trigger this from an upload event. Note that pdoc requires us to import the -# built code, so this is a building test as well as documentation deployment +# Build + test on every PR / push to main / development. +# +# Uses pixi (with the committed pixi.lock) for a deterministic, fast install +# rather than micromamba + environment.yaml, which had been backtracking for +# 60+ minutes on conda-forge solves and timing the runner out before tests +# could start. The pixi.lock matches what local development uses, so CI now +# runs against the same dependency state developers see. on: push: @@ -17,27 +22,27 @@ on: jobs: test: runs-on: ubuntu-latest + timeout-minutes: 60 + steps: - uses: actions/checkout@v4 - - name: Install Conda environment with Micromamba - uses: mamba-org/setup-micromamba@v2 + - name: Install pixi from lockfile + uses: prefix-dev/setup-pixi@v0.9.4 with: - environment-file: ./environment.yaml - cache-downloads: true - cache-environment: true + # Use the env that matches local development for tests. + # `dev` = conda-petsc + runtime + dev features (pytest, jupyter, etc.) + environments: dev + # Hard-fail if pixi.lock disagrees with pixi.toml — never re-solve + # silently in CI; that's exactly the failure mode we're escaping. + frozen: true + cache: true - name: Build UW3 - shell: bash -l {0} - run: | - export PETSC_DIR="/home/runner/micromamba/envs/uw3_test/lib" - VERSION=`python3 setup.py --version` - echo "UW - version " ${VERSION} - - ## TODO. Use scripts/compile.sh once it is in development - pip install -e . --no-build-isolation + # `pixi run -e dev build` invokes the build task from pixi.toml, + # which is `pip install . --no-build-isolation` (non-editable — + # editable installs are project policy violation, see CLAUDE.md). + run: pixi run -e dev build - name: Run tests - shell: bash -l {0} - run: | - ./scripts/test.sh --p 2 + run: pixi run -e dev ./scripts/test.sh --p 2