Repository navigation
fix(cloud): retry another zone when ec2 has no capacity (0.13) - #39904
Conversation
…36600) * fix(cloud): pin the release over https when this machine has no git A packaged install on a machine with no trusted git (most Windows desktops, a Mac without the developer tools, a minimal Linux image) launched its cloud crew from main: release_tag_exists answered False as soon as no trusted git was found, the same answer as "the tag is missing", so resolve_public_ref kept the template default and the crew ran a build the laptop's version gate may refuse to pair with. With no trusted git and the default public repository, the tag is now confirmed with one unauthenticated HTTPS GET of GitHub's exact-ref API endpoint, in the new cloud/github_tag_probe.py. It spawns nothing, and any error is a WARNING and a miss. The git ls-remote probe still runs first whenever git is found, and a fork without git is answered as before, with no network call. The final miss warning now says in plain words that the cloud crew will install the development build from main, which this Kiro Crew may refuse to pair with. The cloud spec describes the fallback. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * fix(cloud): mark the fixed-url tag probe for semgrep --------- Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com> Co-authored-by: EC2 Default User <ec2-user@ip-172-31-10-71.ec2.internal> (cherry picked from commit 5c9bf25)
…39621) EC2 can refuse an instance size in one Availability Zone for lack of capacity. Automatic network discovery always picked the first suitable subnet, so every retry from the dashboard landed in the same zone and failed the same way, with only the raw CloudFormation error. A new stack on an automatically picked subnet now deletes the refused stack and launches again in a subnet of a zone not tried yet, until one works or the zones run out. The final error says in plain words that the size has no capacity, names the zones tried, and suggests the same-size tier on the other architecture or another Region. A pinned subnet, a reused stack and --keep-on-failure do not move. The deploy failure text moves to cloud/ec2_failure.py, which keeps ec2.py under the file line cap. Refs #36376 (cherry picked from commit 9b46c70)
UX Review (Opus 5.5) — ⏭️ skippedRevision |
Design Review (Opus 5.5) — ✅ PASSDesign-level review of Design-Verdict: PASS Nothing blocks: these are cherry-picks of main's #36600, #39621 and #39915, and the only adapted lines are the Notes
[DESIGN-REVIEWED] 11ca807 Description read[DESCRIPTION-READ] aa5cddd53dd410e1117d0864357bccd72ecef3df328866e32c7ba74da07922ff That sha256 names everything this verdict read: the PR description, plus the 1 evidence file(s) the workflow collected from it and handed this review. It covers that evidence because the media strip replaces every attachment URL with the same placeholder, so an edit swapping one attachment for another would leave the description's captured text identical while what this review judged changed. Recompute it with |
First Principles Review (Opus 5.5) — ✅ PASSPremise-level review of First-Principles-Verdict: PASS This backports three fixes already merged on main (#36600, #39621, #39915), each linked to an issue. Every item fixes a launch failure 0.13 users hit, and nothing rides along. What this change shipsInventory (6 items) — 6 justifiedIntent: Let a person launching a Remote Crew from 0.13 get a running crew when a zone has no capacity or the machine has no git. This is a FIX.
[FIRST-PRINCIPLES-REVIEWED] 11ca807 Description read[DESCRIPTION-READ] 0a365e85050c4d35a373d143a96ed006ef99da28c8c5fee684712d431aba161f That sha256 names the PR description this verdict read. Recompute it with |
Opus 5.5 Review — ✅ no blocking findingsReviewed Verdict parsed from the review's SHA-scoped output markers for commit False positive or not applicable? A repository writer can comment: |
GPT 6.1 Review — ✅ no blocking findingsGPT 6.1 completed its review of This comment is updated in place on each push. Review detailsNo findings. False positive or not applicable? A repository writer can comment: |
A dashboard cancel during provisioning was read only after engine.provision returned. With the capacity retry, ec2.deploy could delete the refused stack and launch a new, billed stack in every untried zone after the owner had already cancelled. ec2.deploy now takes a cancelled callback, asked before it deletes a refused stack and again after the delete; once it answers True no new stack is created and the refusal is raised. The EC2 engine forwards it, and the launch job passes its cancel event and reads a provision failure that follows a cancel as the cancel, so the job ends cancelled and its rollback removes what is left. (cherry picked from commit 6aada4f)
Problem / Motivation
Goal: Ship the Remote Crew launch fixes for "no EC2 capacity in this zone" and "a launch without git installs the main build" in 0.13.
Backport to
release/0.13.0. Every commit in this PR is a pick from main (cherry-pick -x), in main's order. Please merge with Rebase and merge so each pick keeps its own commit.5c9bf25f3eeec2.pyimports andcloud.mdfile table, so #39621 conflicts without it. It is itself a launch fix 0.13 users hit.9b46c7064e26aada4f9c3eTwo Remote Crew launch failures 0.13 still has:
git(most Windows desktops, a Mac without the developer tools) cannot confirm its release tag. Its cloud crew then installs the build from main, which this Kiro Crew may refuse to pair with.Why it matters
Both hit a person launching a Remote Crew from 0.13. The first is common for popular sizes in busy zones. The second hits most Windows and Mac users who have no developer tools.
Not a goal
RemoteCrewPanelSetupCards.tsx), which arrived with feat(shared-crew): fix the teammate experience for a shared Crew #38803 (a shared-crew feature) and about ten later panel commits. This branch still has the older tabbed panel, so the rows and form those two PRs change do not exist here. Pulling them would mean picking that feature chain, not a fix.What changed (motivation → approach → change)
Same changes as the main PRs:
fix(cloud): pin the release over https when this machine has no git #36600: with no trusted
gitand the default public repository, the release tag is confirmed with one HTTPS GET of GitHub's exact-ref API (cloud/github_tag_probe.py).git ls-remotestill runs first whenevergitis found. A miss now says plainly that the crew will install the build from main.fix(cloud): retry a launch in another zone when ec2 has no capacity #39621: when CloudFormation fails on
InsufficientInstanceCapacity,ec2.deploydeletes the failed stack and launches again in a subnet in another zone. It does this only on a new stack whose subnet it picked itself, never with a chosen subnet, a reused stack or--keep-on-failure. When every zone refuses, the error leads with the plain cause, names the zones tried, and suggests the x86 size or another Region (cloud/ec2_failure.py).fix(cloud): stop the zone retry when the owner cancels a launch #39915:
ec2.deployasks acancelledcallback before it deletes a refused stack for a retry and again after the delete; once it answers True no new stack is created. The launch job passes its cancel event and reads a provision failure that follows a cancel as the cancel, so the job ends cancelled and its rollback removes what is left.Prerequisites: #36600, as listed above. #36600 and #39621 applied cleanly. #39915 conflicted on context only: this branch's
RealLaunchEngine.provisionandrun_launchdo not have main'sinstance_type/on_progressarguments (#39658 and a later progress change, neither picked), so the pick adds only thecancelledlines to the release versions of those two functions. No other line differs from main.Backwards compatibility
Compatible: a launch with capacity, a chosen subnet, or a machine with
gitworks as before; the new paths run only on a capacity refusal or whengitis missing.Removes nothing: the picks add a retry and a second way to confirm a tag.
Tests
On this branch:
test/test_cloud_ec2_capacity_retry.pyandtest/test_launch_engine_ref.py(42 passed), and everytest/test_cloud*,test/test_ec2*andtest/test_launch*file (2453 passed, 10 skipped with #39915 picked). isort, flake8 and black are clean on the changed Python files.Proof: not provable -- other: backport of #36600, #39621 and #39915, whose proofs were recorded on main
Manual verification
N/A — backport of fixes already verified and merged on main.
Real-machine verification
N/A -- backport of #39621 and #36600; same code as main. #39621's capacity path cannot be forced on demand, and its tests fake the AWS calls.
Related Issues
Part of #36376 and #32319 (both closed by the main PRs).
Sibling sweep
Siblings: none -- the swept sites are the same as in #39621 and #36600 and unchanged on this branch
Pattern harvest
Not generalizable: a backport of #36600, #39621 and #39915; their harvest applies.
Checklist
feat|fix|docs|style|refactor|perf|test|chore|ci|build|revert: ...); PR Hygiene does not count commitsContribution License Agreement
Contributed under the project's Apache-2.0 license.