Skip to content

Stop CI setup from hanging in the mamba sharded-repodata fetch - #1180

Open
timlichtenberg wants to merge 7 commits into
mainfrom
tl/ci-mamba-shards-off
Open

timlichtenberg wants to merge 7 commits into
mainfrom
tl/ci-mamba-shards-off

Conversation

@timlichtenberg

Copy link
Copy Markdown
Member

Description

Some nightly jobs sat in the setup-proteus step for hours. mamba 2.9.0 fetches sharded repodata by default, and on macOS runners that fetch can stall until the job limit cancels it. Example: the macOS misc slow-tier job https://github.com/FormingWorlds/PROTEUS/actions/runs/47078479247/job/144228327531 logs Fetch Shard Index for conda-forge/noarch at 12:53:17 and is cancelled by its 210 min job limit at 16:21:40 with mamba still running.

Changes:

  • .github/actions/setup-proteus/action.yml: MAMBA_USE_SHARDED_REPODATA: 'false' on the 3 steps that solve an environment (the miniconda setup with its mamba create, and the mamba install step for Linux and for macOS). mamba 2.9.0 reads this name for its use_sharded_repodata setting (libmamba/src/api/configuration.cpp at tag 2.9.0: the MAMBA_ prefix plus the upper-case name).
  • Every workflow step that calls setup-proteus gets timeout-minutes: 30 with full-data: 'false', 50 with full-data: 'true' (that flavour can download missing FWL_DATA). Each limit is below the cap of its job. A stalled setup now fails within the limit instead of holding a runner for hours.
  • tests/tools/test_ci_setup_proteus.py parses the action and all workflows: every solve step must set the variable to 'false', and every caller step must have the timeout of its full-data flavour, below the job cap (matrix job_minutes included).

Scope: only setup-proteus. install.sh and the conda-route install job use conda, not mamba, and do not change.

Validation of changes

Run Variable Job logs "Fetch Shard" "Using Flat Repodata"
jobs 144228327531, 143938345333 (main nightly), 144246660658 (main) not set 3 12 0
https://github.com/FormingWorlds/PROTEUS/actions/runs/47182583615 and https://github.com/FormingWorlds/PROTEUS/actions/runs/47189880928 (this branch) 'false' 48 0 320
  • A step timeout on a step that uses: a composite action is enforced: a probe with timeout-minutes: 1 stopped after 72 s with "The action has timed out." and the job failed (https://github.com/FormingWorlds/PROTEUS/actions/runs/47182226165; the probe workflow is removed again in this branch).
  • Longest setup-proteus step, from the step times of the runs (gh run view <run> --json jobs). The 'true' setups of this branch are longer than in the older main runs; I did not isolate whether flat repodata or the data download causes that:
Runs full-data: 'false' full-data: 'true'
this branch, 47182583615 and 47189880928 10.1 min (limit 30) 16.6 min (limit 50)
last 4 green main nightlies (46258066767, 46139845957, 45993715644, 45815231607) 10.6 min 11.7 min
  • pytest tests/tools/test_ci_setup_proteus.py tests/tools/test_ci_tier_coverage.py: 12 passed (macOS arm64, Python 3.12)
  • No line under src/ changes, so the coverage of the package does not change.

Lines and size, pr-breakdown a28930bc c3f3c272:

Category Files Lines added / removed Size on disk (KiB) Compressed (KiB)
tests 1 +91 / -0 +3.6 +1.6
other (workflows, action) 6 +15 / -0 +0.5 +0.1
total 7 +106 / -0 +4.1 +1.7

Checklist

  • I have followed the contributing guidelines
  • My code follows the style guidelines of this project
  • I have performed a self-review of my code
  • My changes generate no new warnings or errors
  • I have checked that the tests still pass on my computer
  • I have updated the docs, as appropriate
  • I have added tests for these changes, as appropriate
  • I have checked that all dependencies have been updated, as required

The mamba solves of setup-proteus must run with sharded repodata off, and every workflow step that calls the action must carry a timeout of at most 30 minutes, since a step inside a composite action cannot have its own.
On macOS runners the mamba 2.9 shard fetch can stall with no timeout, in setup-miniconda's env creation and in the conda install step, until the job limit. The three mamba solves of setup-proteus now set MAMBA_USE_SHARDED_REPODATA=false and read the full repodata.

A step inside a composite action cannot have a timeout, so each workflow step that calls setup-proteus sets timeout-minutes: 30, about twice the longest normal setup.
A setup with full-data can download FWL_DATA, so its step timeout is 50 min; a setup without it keeps 30 min. The caller check also finds a call written with a trailing slash or a ref, and counts the calls in the workflow text, so a caller cannot drop out of the check. The solve pattern now also finds conda, micromamba and env solves anywhere in a line.
A setup with full-data downloads the missing FWL_DATA inside the action, and the slowest one in the last 100 nightlies took 28 min. A 30 min limit would cancel such a setup before its caches are saved, so the next run starts cold again. 50 min stays below the job limit of each of these jobs and still stops a hung mamba solve long before the job limit.
A job limit given as an expression, as in the slow tier, is now read as the smallest of its default and the matrix job_minutes values, so a matrix entry below the setup timeout fails the test. An unquoted full-data: true maps to the same limit as the string, and the sharded repodata check runs per step.
@timlichtenberg
timlichtenberg requested a review from a team as a code owner December 4, 2026 04:23
@codecov

codecov Bot commented Dec 4, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 95.88%. Comparing base (a28930b) to head (c3f3c27).

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1180      +/-   ##
==========================================
- Coverage   96.27%   95.88%   -0.39%     
==========================================
  Files         168      168              
  Lines       28951    28951              
  Branches     4778     4778              
==========================================
- Hits        27872    27760     -112     
- Misses        770      778       +8     
- Partials      309      413     +104     
Flag Coverage Δ
nightly 95.87% <ø> (+0.11%) ⬆️
unit-tests 95.15% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant