add bulk image push CLI#728
Open
rasdani wants to merge 5 commits into
Open
Conversation
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit 99e1add. Configure here.
| # exits promptly instead of draining the rest of the batch. | ||
| cancel_event.set() | ||
| pool.shutdown(wait=False, cancel_futures=True) | ||
| raise |
There was a problem hiding this comment.
Thread pool waits after Ctrl-C
Medium Severity
In _upload_batch_contexts, a KeyboardInterrupt handler calls pool.shutdown(wait=False, cancel_futures=True) so Harbor batch uploads stop quickly, but the surrounding with ThreadPoolExecutor(...) still runs __exit__, which calls shutdown(wait=True) and can block until in-flight httpx.put uploads finish.
Reviewed by Cursor Bugbot for commit 99e1add. Configure here.
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 client surface targets an unimplemented backend API; Harbor uploads and resume paths affect many images per run, though behavior is covered by CLI tests and does not change server auth.
Overview
Adds bulk image build support to the Prime CLI via
prime images push-batch, plusbatch-status,batch-cancel, andbatch-retryagainst the proposed/images/build-batchesAPI.push-batchaccepts either JSONL rows (inline Dockerfile text, deterministic tags from--tag-template) or a Harbor task tree (environment/contexts, excludingtests/andsolution/). Harbor docker-compose tasks fail by default or can be skipped with--skip-unsupported-compose. The flow creates a batch, optionally uploads context archives in parallel (with retries and--resume), then starts the batch;--dry-runand--manifest-outputsupport validation without calling the backend.prime images pushis refactored to share helpers for path validation,.dockerignore-aware context packaging, and context upload (including longer batch API timeouts).Reviewed by Cursor Bugbot for commit 99e1add. Bugbot is set up for automated code reviews on this repo. Configure here.