Skip to content

task image: install the modules benchmark discovery lacks and retry discovery - #53

Merged
ArjunS07 merged 1 commit into
survey/phase1-template-20261008from
fix/build-missing-deps
Oct 8, 2026
Merged

ArjunS07 merged 1 commit into
survey/phase1-template-20261008from
fix/build-missing-deps

Conversation

@ArjunS07

@ArjunS07 ArjunS07 commented Oct 8, 2026

Copy link
Copy Markdown
Contributor

Purpose

58 survey tasks end base_edited: the task image already has edits in a file that the oracle patch changes. All 58 edits come from the per-task build scripts that are stored with the base image (docker_build_pkg.sh for 57, docker_build_run.sh for wmayner/pyphi#127). For 38 tasks the script makes a speed change in the code the task targets. In 25 of them most added lines are equal to the oracle's lines, so the starting tree is already partly solved. This change lets a task image start from the base commit for those files, without a rebuild of the Docker Hub base image.

How it works

flowchart LR
  A[formulacode/repo:pr<br/>tree edited by the stored build script] --> B[task Dockerfile:<br/>git checkout HEAD -- listed files]
  B --> C[rebuild.sh<br/>same command as rebuild-repo]
  C --> D{listed files<br/>still edited?}
  D -- yes --> E[build fails]
  D -- no --> F[LSV baseline, scrub_git, ...]
Loading

base_restore.json maps a task id to the repo files to restore. regen render reads it by default. A task that is not in the file renders the same Dockerfile and the same environment files as before (checked byte for byte), so no other task image changes.

Changes

  1. template/environment/restore_base.sh (new). Runs git checkout HEAD -- <paths>, adds a pkg_resources module from pip's vendored copy when the env has none, runs rebuild.sh, and fails if a listed path is still edited.
    • Effect: the listed files are at the base commit, and the installed package is built from them.
    • Before: no step changed the base image's tree.
  2. template/environment/Dockerfile. A step that runs restore_base.sh before the LSV baseline, only when the task has restore paths.
    • Effect: the baseline and the coverage check see the base-commit files.
    • Before: the baseline was timed on the edited files.
  3. adapter.py, utils.py. generate_task(restore_paths=...) and render_dockerfile(restore_paths=...); paths are shell-quoted. restore_base.sh and rebuild.sh are copied into environment/ only for those tasks.
    • Effect: other tasks keep their environment digest.
    • Before: no such option.
  4. regen.py. --restore-paths FILE (default base_restore.json; '' turns it off).
  5. base_restore.json (new). 50 tasks: 38 with a speed change (25 own oracle, 12 speed changes written by the build agent or backported, 1 change from another PR: optuna#5496) and 12 with a compatibility edit that touches an oracle hunk or makes the oracle patch fail.

Verification

  • pytest tests/docker/test_restore_base.py tests/docker/test_harbor_adapter_render.py tests/docker/test_scrub_git.py: 11 passed. The new tests check that the render without paths is unchanged, the step comes before the baseline, regen reads the file, and the script restores only listed files and fails when the rebuild fails or edits a file again.
  • In the real base images (docker run, no image build):
image restored restore time oracle patch after restore
formulacode/deshaw-versioned-hdf5:330 versioned_hdf5/backend.py 2 s applies, no .rej
formulacode/numpy-numpy:9470 numpy/lib/arraysetops.py 2 s applies, no .rej
formulacode/tiledb-inc-tiledb-py:842 tiledb/core.cc fails rebuild.sh cannot find tiledb/tiledb.h

The TileDB-Py#842 result is correct behavior for this step: the agent's rebuild-repo command fails the same way in that image, so the task cannot be rebuilt and stays out.

Notes

  • How each edit was traced: the build-script layers and the files in each image layer were read from Docker Hub (no image pulled). The per-task table is in /overflow/arjun/survey/salvage/base_edited_plan.tsv.
  • None of the 58 edits comes from outside the stored scripts, and none is in a generated file (_version.py, versioneer, Cython output).
  • Only files that the oracle patch changes are restored. Other edits by the same scripts stay (for example NiMARE's nilearn import fixes).
  • The root cause stays: the stored scripts still hold these edits, and a new base image build brings them back. The list must be kept until the base images are rebuilt from cleaned scripts.
  • The pipeline side (a narrower base_edited rule) is formula-code/formulacode-verified-rl#130.

… install it and retry

Discovery errors name the module (No module named X, pandas optional deps, geopandas spatial index). Up to 3 rounds;
installs pin every installed version and prefer releases from before the base commit date. Folders in the repo that
ship the module (MDAnalysis testsuite) are installed editable. What was added is written to added_deps.json and
lsv_init_results.json.
@ArjunS07
ArjunS07 merged commit 2ff4722 into survey/phase1-template-20261008 Oct 8, 2026
0 of 3 checks passed
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