Add ephemeral EC2 Harbor backend - #1131
Open
andre-fu wants to merge 34 commits into
Open
Conversation
Contributor
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Contributor
Oddish previewCommit:
Vercel deployment URL: https://oddish-gyij2rojz.oddish.app Plan:
This comment is updated by the PR Preview workflow. |
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes using high effort and found 1 potential issue.
There are 2 total unresolved issues (including 1 from previous review).
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit 5a5620f. 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.

What changed
environment=ec2execution with one public-IP, key-only SSH EC2 instance per Harbor trial.0600temporary files for the duration of the owning operation, then removes them.ec2://<account>/<region>/<instance>handle immediately after launch and ownership-checks every teardown.No ECS cluster, Auto Scaling group, database migration, or AWS infrastructure provisioning is introduced.
Why
Harbor needs a complete Docker/Compose or native k3s/Helm host. One disposable EC2 VM per trial provides that isolation while Modal remains only the worker dispatcher.
Safety and cleanup
Validation
257 passed: EC2 backend, credentials, routing, policy, Harbor lifecycle patch, normal/override parity, ephemeral bridge, cleanup, and orphan decisions.25 passed: hosted policy, Modal secret topology, and delegated teardown.F401,F841clean andgit diff --checkclean.AWS canary
The SRE-world distractor-volume oracle task completed end-to-end on the pinned default Harbor runtime:
m7i-flex.2xlarge1.0Performance follow-up
The measured 8m49s
environment_setupaggregates EC2 health waits, SSH/cloud-init, tool bootstrap, k3s startup, image pulls, Helm install, and pod readiness. Harbor does not yet emit subphase timings, so this aggregate does not establish which step dominates. Daytona uses the same serial k3s/Helm lifecycle after provisioning a tools-equipped sandbox; the EC2/Daytona delta therefore needs a same-task instrumented comparison. A prior 33 GB workload-image AMI was measurably slower because new EBS volumes still lazily initialized cached snapshot blocks.Recommended follow-up order:
instance_runningand canary bounded parallel kubelet image pulls.Daytona remains the default CPU backend after merge. EC2 is used only when explicitly selected.
Note
High Risk
Touches AWS instance launch/terminate, credential isolation, and cancellation paths; misconfiguration or tag/ledger mismatches could leak instances or refuse safe teardown, though the design is conservative and heavily tested.
Overview
Introduces an opt-in CPU Harbor backend (
--env ec2) that runs one ephemeral public-IP EC2 instance per trial. Daytona remains the hosted CPU default; EC2 is registered only whenODDISH_EC2_ENABLEDis set and is not auto-selected.Modal deploy & secrets: Production, staging, and PR preview workflows turn on EC2 with platform launch coordinates; AWS control creds and the SSH key live in separate Modal secrets baked into an immutable deploy plan. API and dispatcher containers never receive those secrets—only
ec2_trialworkers get both, reconciler/teardown get control only. API cancellation calls a dedicatedteardown_ec2_sandboxModal function via a provider teardown delegate.Workers & dispatch:
worker_jobsgains anexecution_lane(defaultvsec2_trial) in the claim index and spawn routing. A dedicatedprocess_single_ec2_trial_jobpath acquiressandbox_capacity_leasesagainstODDISH_EC2_MAX_CONCURRENT_INSTANCESbefore claiming queue slots. Dispatch units are now(queue_key, harbor_variant_id, execution_lane)across Docker/K8s/in-process backends.Lifecycle & safety: New
sandbox_runsledger (per attempt, launch token, tagged ownership) and DB trigger to request termination when jobs leaveRUNNING.Ec2Backendmaterializes mode-0600 AWS profile/SSH files, merges protected Harbor kwargs/tags, and refuses teardown without a matching ledger + tag tuple. Orphan reconciliation uses a pure policy (30m grace, 14h hard max).Other: Pins Harbor to rev
a7caa58(EC2 support), addsboto3/openssh-clientto worker images,ODDISH_EC2_*settings validation, cloud policy tests, and docs/CLI for explicit EC2 runs.Reviewed by Cursor Bugbot for commit b16e479. Bugbot is set up for automated code reviews on this repo. Configure here.