Skip to content

add bulk image push CLI#728

Open
rasdani wants to merge 2 commits into
mainfrom
codex/bulk-image-push
Open

add bulk image push CLI#728
rasdani wants to merge 2 commits into
mainfrom
codex/bulk-image-push

Conversation

@rasdani

@rasdani rasdani commented Jun 7, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • Add prime images push-batch as a first CLI draft for bulk image builds.
  • Default input mode reads JSONL rows with id/task_id plus raw dockerfile text, generates deterministic short tags, and assembles a batch manifest/payload.
  • Add Harbor scanner mode for immediate task directories using each task's environment/ directory as the build context while excluding tests/ and solution/ from uploaded contexts.
  • Share build-context packaging/upload helpers with the existing single-image prime images push path.

Backend assumptions

This CLI targets a proposed future backend resource: POST /images/build-batches, optional per-item context uploads from the response, then POST /images/build-batches/{batch_id}/start. The current platform endpoint is assumed/not yet implemented, so this PR focuses on client-side validation, manifest generation, request payload assembly, and mocked tests.

Deferred

Docker compose task support is intentionally deferred. Harbor mode detects compose files (docker-compose.yaml, docker-compose.yml, compose.yaml, compose.yml) and fails clearly by default, with --skip-unsupported-compose available to continue with Dockerfile-only tasks.

Validation

  • uv run pytest packages/prime/tests/test_images_push.py -q
  • uv run ruff check packages/prime/src/prime_cli/commands/images.py packages/prime/tests/test_images_push.py
  • uv run ruff format --check packages/prime/src/prime_cli/commands/images.py packages/prime/tests/test_images_push.py
  • uv run ty check packages/prime/src/prime_cli/commands/images.py packages/prime/tests/test_images_push.py
  • uv run prime images push-batch --help
  • git diff --check

Note

Medium Risk
Large new CLI surface and refactored single-image push packaging/upload paths; batch API is not implemented yet, so behavior depends on future backend contract and Harbor context uploads.

Overview
Adds prime images push-batch so many registry images can be built from one command, targeting a proposed POST /images/build-batches flow (create batch → optional per-item context uploads → start batch).

Dockerfile mode (default) reads JSONL with id/task_id and inline dockerfile text, builds deterministic tags via --tag-template, and can write a client manifest or --dry-run without calling the API. Harbor mode scans task folders (task.toml, instruction.md, environment/Dockerfile), packages each environment/ context (excluding tests/ and solution/), and rejects or skips docker-compose tasks.

Single-image prime images push is refactored to share context packaging, .dockerignore handling, upload, and visibility helpers with the batch path. Tests cover dockerfile batch payloads, dry-run manifests, Harbor tar contents, and compose rejection.

Reviewed by Cursor Bugbot for commit 7ac0cab. Bugbot is set up for automated code reviews on this repo. Configure here.

@rasdani rasdani changed the title [codex] add draft bulk image push CLI sketch: add draft bulk image push CLI Jun 7, 2026
@rasdani rasdani changed the title sketch: add draft bulk image push CLI protoype add draft bulk image push CLI Jun 7, 2026
@rasdani rasdani changed the title protoype add draft bulk image push CLI protoype: add draft bulk image push CLI Jun 7, 2026
@rasdani rasdani changed the title protoype: add draft bulk image push CLI do-not-merge: add draft bulk image push CLI Jun 7, 2026
@kcoopermiller kcoopermiller changed the title do-not-merge: add draft bulk image push CLI add bulk image push CLI Jun 9, 2026
@kcoopermiller kcoopermiller marked this pull request as ready for review June 9, 2026 06:27
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