add bulk image push CLI#728
Open
rasdani wants to merge 2 commits into
Open
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
prime images push-batchas a first CLI draft for bulk image builds.id/task_idplus rawdockerfiletext, generates deterministic short tags, and assembles a batch manifest/payload.environment/directory as the build context while excludingtests/andsolution/from uploaded contexts.prime images pushpath.Backend assumptions
This CLI targets a proposed future backend resource:
POST /images/build-batches, optional per-item context uploads from the response, thenPOST /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-composeavailable to continue with Dockerfile-only tasks.Validation
uv run pytest packages/prime/tests/test_images_push.py -quv run ruff check packages/prime/src/prime_cli/commands/images.py packages/prime/tests/test_images_push.pyuv run ruff format --check packages/prime/src/prime_cli/commands/images.py packages/prime/tests/test_images_push.pyuv run ty check packages/prime/src/prime_cli/commands/images.py packages/prime/tests/test_images_push.pyuv run prime images push-batch --helpgit diff --checkNote
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-batchso many registry images can be built from one command, targeting a proposedPOST /images/build-batchesflow (create batch → optional per-item context uploads → start batch).Dockerfile mode (default) reads JSONL with
id/task_idand inlinedockerfiletext, builds deterministic tags via--tag-template, and can write a client manifest or--dry-runwithout calling the API. Harbor mode scans task folders (task.toml,instruction.md,environment/Dockerfile), packages eachenvironment/context (excludingtests/andsolution/), and rejects or skips docker-compose tasks.Single-image
prime images pushis refactored to share context packaging,.dockerignorehandling, 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.