Skip to content

feat: parallelize bakery ci publish across image targets#641

Open
ianpittwood wants to merge 9 commits into
feat/merge-soci-oras-imagetoolsfrom
feat/parallel-publish
Open

feat: parallelize bakery ci publish across image targets#641
ianpittwood wants to merge 9 commits into
feat/merge-soci-oras-imagetoolsfrom
feat/parallel-publish

Conversation

@ianpittwood

Copy link
Copy Markdown
Contributor

Summary

Stacked on #619 (unmerged) — targets that branch rather than main so this diff only shows the new work.

Parallelizes bakery ci publish's per-target pipeline across image targets, while keeping each target's own operation sequence (wait-for-sources → index-create → soci-convert → index-copy → verify) strictly ordered:

  • Stage 1 (parallel): wait-for-sources + index-create + soci-convert run concurrently, one job per target, via a new ParallelShellExecutor.run_jobs()/ShellJob/CommandRunner (parallel/executor.py) built on the same tracked-spawn/Ctrl-C-safety primitive the existing dgoss run() path uses. One target's failure is isolated — it no longer aborts the whole run.
  • Stage 2 (sequential, ordered): index-copy (the actual registry push) stays serialized in push_sort_key order, so registries that display tags by push time (e.g. Docker Hub) still show the latest version as most recent.
  • Stage 3 (sequential): verify, unchanged — read-only and order-independent.
  • Adds --jobs/-j to bakery ci publish, matching the existing dgoss flag.

Out of scope (deferred to follow-up work, per the design spec): retry-with-backoff plumbing in the parallel module (transient registry errors are already handled independently by posit_bakery/retry.py), and unifying oras merge/soci convert into this same pipeline.

Design spec and implementation plan (local-only, gitignored under docs/superpowers/) drove this; happy to share their content in review if useful.

Test plan

  • uv run pytest test/parallel/ test/plugins/builtin/imagetools/ test/cli/test_ci_publish.py -q — 174 passed
  • uv run ruff check . / uv run ruff format --check . — clean
  • Task-by-task review (spec compliance + code quality) during implementation; whole-branch review across the full diff — no Critical/Important findings

🤖 Generated with Claude Code

ianpittwood and others added 8 commits June 30, 2026 14:24
…sh ordered

Rewrites ImageToolsPlugin.publish() to fan Stage 1 (wait + index-create +
soci-convert) out across targets via the parallel ShellJob executor, while
keeping Stage 2 (index-copy, the real registry push) and Stage 3 (verify)
as sequential push_sort_key-ordered loops -- one target's Stage 1 failure
no longer blocks any other target's publish.

Also fixes test/cli/test_ci.py's merge.feature fixture
(patch_image_target_merge_method), whose MockOrasIndexCreateWorkflow.run()
didn't accept the runner kwarg that publish() now always passes through
_run_publish_stage1.
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
…rrupt handling

Adds three test cases that were in the task brief but missing from the implementation:
- test_job_value_is_callable_return: Verifies job callable return values are captured
- test_on_result_called_once_per_job_on_main_thread: Confirms on_result callback runs once per job on main thread
- test_sigint_terminates_in_flight_children: Verifies interrupt safety for run_jobs() matches run()

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
@ianpittwood ianpittwood requested a review from bschwedler as a code owner July 1, 2026 15:04
@github-actions

github-actions Bot commented Jul 1, 2026

Copy link
Copy Markdown

Test Results

1 959 tests  +31   1 959 ✅ +31   7m 19s ⏱️ -12s
    1 suites ± 0       0 💤 ± 0 
    1 files   ± 0       0 ❌ ± 0 

Results for commit 68fa1db. ± Comparison against base commit 2d7d05c.

♻️ This comment has been updated with latest results.

The Test job runs pytest against imagetools code that shells out to
soci, but never installed it (unlike bakery-build-native.yml), so
SOCI-dependent tests failed with BakeryToolNotFoundError.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
@ianpittwood

Copy link
Copy Markdown
Contributor Author

Tracked by #648.

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.

2 participants