Skip to content

feat(runtime): support pre-built ECR container images - #2719

Merged
jariy17 merged 1 commit into
aws:v1.xfrom
notgitika:feat/runtime-prebuilt-container-uri-implementation
Nov 25, 2026
Merged

jariy17 merged 1 commit into
aws:v1.xfrom
notgitika:feat/runtime-prebuilt-container-uri-implementation

Conversation

@notgitika

@notgitika notgitika commented Oct 27, 2026 •

Copy link
Copy Markdown
Contributor

Description

Implements the CLI portion of the pre-built Runtime image design from #2718. Users can add an existing ECR image through the --build-config JSON flag:

agentcore add runtime --name agent \
  --build-config '{"containerUri":"123456789012.dkr.ecr.us-west-2.amazonaws.com/agent:v1"}'
agentcore deploy

The Runtime deploys the supplied private or public ECR image without local source preparation or CodeBuild. Dockerfile deployments continue using CodeBuild by default. Toolkit-managed local builds and private-only invocation remain separate proposals.

Implementation

  • Adds mirrored Runtime containerUri validation, matching Harness. Rejects CodeZip, ContainerLocal, and Dockerfile/build-context/build-argument combinations with containerUri. The URI is validated against the service's image grammar at add time (tag, sha256:/sha512: digest, repository-name length, no whitespace), so bad values fail locally instead of at CloudFormation.
  • Adds containerUri as a key of the strict --build-config JSON on add runtime; build defaults to Container. Unknown keys and invalid combinations fail before project changes.
  • Records the Runtime as build mode ContainerUri: no local image build, Dockerfile sync, or builder/ARM64 check. A deployed Runtime cannot switch between CodeZip and ContainerUri (the service rejects artifact-type changes); ContainerUri and Container can switch.
  • Allows adding a pre-built image without a language or source scaffolding; retains the schema-required entrypoint/code-location placeholders.
  • Skips local manifests, Dockerfiles, source paths, and CodeBuild-specific VPC ID/five-security-group checks for pre-built images. Runtime networking validation still applies.
  • One combined Node probe of the installed CDK package (shared with ContainerLocal) runs before build/deploy and rejects versions that lack containerUri; a package that fails to load is reported with its own error. Works with the npm bundle and the compiled Linux binary without passing Runtime environment secrets to the probe.
  • agentcore dev skips pre-built runtimes (with a status line) and runs the rest; selecting only a pre-built runtime explains how to deploy/invoke it instead of attempting a local build.
  • Rejects switching a deployed Container runtime to a containerUri that points at the CLI-managed repository the deploy removes (the image would be deleted); copy the image to your own repository first.
  • Adds a focused, opt-in live E2E suite that cleans up its own stacks and user documentation.
  • Pins CI's Node runtime to supported Node 22 so the project's CDK app and schema probe run consistently on Windows, macOS, and Linux.

Related work

Delivery dependency

This PR remains draft until the companion CDK change is released. Before merge, src/assets/cdk/package.json must be updated from @aws/agentcore-cdk 1.2.0 to a release containing aws/agentcore-l3-cdk-constructs#440 (and the merged ContainerLocal support). Live tests use a locally packed package built from #440 rebased on the latest v1.x.

Type of Change

  • Bug fix
  • New feature
  • Breaking change
  • Documentation update
  • Other

Testing

  • Rebased onto v1.x at v1.2.0 (after feat(build): add ContainerLocal build mode (re-land #2814) #2855, fix(build): address ContainerLocal bug bash findings #2856, feat(project): sync vended CDK dependencies on build and deploy #2861); single commit
  • bun test — 5,191 passed; 6 Windows-only tests skipped
  • bun run typecheck, bun run lint:check, bun run format:check
  • bun run secrets:check, npm bundle build, Linux x64 binary compilation
  • Companion CDK (chore(deps): bump @aws-sdk/client-bedrock-runtime from 3.995.0 to 3.997.0 #440, rebased on v1.x): 1,343 tests passed; build/typecheck/format/lint passed (five existing lint warnings)
  • Real AWS E2E, re-run on the final rebased build (us-east-1; the VPC-with-NAT deployment below was verified on the earlier build): private tag and digest deploy/invoke; no CodeBuild or managed repository; image URI update retaining Runtime IDs; named endpoint pinned to v1 while DEFAULT invokes v2; unchanged redeploy retains the version
  • VPC pre-built image: deployed and invoked successfully from an existing private subnet with NAT, without networkConfig.vpcId or CodeBuild resources
  • Mixed project: ordinary Dockerfile build runs one successful ARM64 CodeBuild build while the pre-built image skips it; both Runtimes invoke successfully
  • Packaged CLI negative validation and old-CDK rejection; Node and native-binary advanced flag/build checks
  • Focused live E2E test includes successful stack teardown
  • GitHub CI on the rebased head b50a0190: pending
  • Linux CI audit: existing transitive minimatch versions in the lint toolchain trigger GHSA-g3hv-75wg-m249; root dependencies and lockfile are unchanged from v1.x. The audit gate remains enabled.
  • Public ECR invocation — needs an existing compatible public fixture or permission to publish the synthetic test image; public schema/synthesis paths are covered by unit tests

Checklist

  • I have read the CONTRIBUTING document
  • I have added necessary tests that prove the feature works
  • My changes generate no new warnings
  • Dependent CDK changes have been merged and published

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

@github-actions github-actions Bot added the size/m PR size: M label Oct 27, 2026
@agentcore-devx-automation agentcore-devx-automation Bot added agentcore-harness-reviewing AgentCore Harness review in progress claude-security-reviewing Claude Code /security-review in progress labels Oct 27, 2026
@github-actions

github-actions Bot commented Oct 27, 2026 •

Copy link
Copy Markdown
Contributor

Package Tarball

aws-agentcore-1.2.0.tgz

How to install

gh release download pr-2719-tarball --repo aws/agentcore-cli --pattern "*.tgz" --dir /tmp/pr-tarball
npm install -g /tmp/pr-tarball/aws-agentcore-1.2.0.tgz

@agentcore-devx-automation

Copy link
Copy Markdown
Contributor

Claude Security Review: no high-confidence findings. (run)

@agentcore-devx-automation agentcore-devx-automation Bot removed the claude-security-reviewing Claude Code /security-review in progress label Oct 27, 2026
@codecov-commenter

codecov-commenter commented Oct 27, 2026 •

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 97.46835% with 8 lines in your changes missing coverage. Please review.
✅ Project coverage is 96.57%. Comparing base (c2c7af1) to head (b50a019).
⚠️ Report is 5 commits behind head on v1.x.

Files with missing lines Patch % Lines
src/core/project/backends/cdk/compatibility.ts 87.50% 8 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             v1.x    #2719      +/-   ##
==========================================
- Coverage   96.57%   96.57%   -0.01%     
==========================================
  Files         734      734              
  Lines       60950    61201     +251     
==========================================
+ Hits        58863    59105     +242     
- Misses       2087     2096       +9     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@agentcore-devx-automation agentcore-devx-automation Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

AgentCore Harness Review

Verdict: Changes requested

Reviewed against base refactor (head 2fbdf13). The schema/sync/prepare changes themselves are clean, well-scoped, and the tests use real temp dirs rather than fs mocks — good. Three things need resolving before this lands.

1. agentcore dev is left undefined for a pre-built runtime

runtimeProblems now returns early for any containerUri runtime (src/core/project/runtimeBuild.ts:589) and prepareRuntimes skips the code-folder check (src/core/project/runtimeBuild.ts:551) for both purposes, including "dev". But runner selection still routes build: "Container" to ContainerDevRunner (src/handlers/project/index.ts:66), which unconditionally builds from a local Dockerfile (src/core/dev/container.ts:78-91). So for a pre-built runtime:

  • with no local source (the normal pre-built case, which this PR explicitly makes legal): agentcore dev now fails with the low-level no container build context directory exists at <path> / no container Dockerfile exists at <path> instead of the README-pointing ProjectStateError the prepare step used to produce;
  • with a leftover Dockerfile in codeLocation: dev silently builds and runs an image that has nothing to do with the containerUri that will be deployed.

Options:

  • gate it like the BMA case — make supportsLocalDev (src/handlers/project/dev/index.ts:71) false for containerUri runtimes and raise the existing NotImplementedError with a clear message;
  • keep the Dockerfile/code-folder checks when purpose === "dev" and only skip them for "deploy", so the existing guidance still fires;
  • teach ContainerDevRunner to docker run the pre-built image instead of building.

Any of these is fine, but the current state is an unhandled path for the config this PR introduces.

2. Confirm the relaxed VPC rules are mirrored in the released CDK

src/projectSchemas/runtime.ts:339 makes both the CodeBuild vpcId requirement and the five-security-group cap conditional on containerUri === undefined. In the currently published @aws/[email protected], AgentEnvSpecSchema still gates both on data.build === 'Container' alone, so a networkMode: "VPC" pre-built runtime without vpcId (or with 6+ SGs) would pass CLI validation and then fail inside readAgentCoreProject at synth. Please confirm aws/agentcore-l3-cdk-constructs#440 relaxes the schema side identically — these are explicitly mirrored schemas, and the design doc requires both to enforce the same rules.

Related consistency point: HarnessSpecSchema still uses isContainerBuild(data) (true when containerUri is set) for the SG cap, so runtime and harness now disagree about whether a pre-built image is subject to CodeBuild limits. Worth aligning or noting why they differ.

3. Bumping src/assets/cdk/package.json is not enough — old pins silently drop containerUri

AgentEnvSpecSchema in the published CDK is a non-strict z.object, so an unknown containerUri on a runtime is stripped, not rejected. The vended agentcore/cdk/package.json is only written at create/migrate time, so an existing project still pinned to @aws/[email protected] that adds containerUri will not error: the CLI now skips the Dockerfile existence check, the CDK ignores the field, and the build falls back to the source-asset → CodeBuild path (failing at build time, or worse, succeeding against a stale local Dockerfile and deploying the wrong image).

There is already a mechanism for this: MINIMUM_COMPATIBLE_CDK_VERSION / cdkCompatibilityWarning in src/core/project/backends/cdk/compatibility.ts (surfaced at src/core/project/backends/cdk.ts:219). Options:

  • bump MINIMUM_COMPATIBLE_CDK_VERSION to the release containing #440 when you bump the vended pin;
  • or add a feature-specific check that hard-fails (not just warns) when any runtime has containerUri and the installed @aws/agentcore-cdk predates support, with an "update agentcore/cdk/package.json" message.

Silent misdeployment is the failure mode here, so I'd lean toward an error rather than a warning.

Minor (non-blocking)

  • runtimeProblems computes folder/folderLabel before the containerUri early return (src/core/project/runtimeBuild.ts:586-589) — dead work.
  • A pre-built runtime with a Dockerfile sitting in codeLocation now gets no feedback that the file is ignored; a sync warning would make the chosen image source obvious (and would also explain the dev behavior if you pick option 3 above for #1).

@agentcore-devx-automation agentcore-devx-automation Bot removed the agentcore-harness-reviewing AgentCore Harness review in progress label Oct 27, 2026
@github-actions github-actions Bot added size/l PR size: L and removed size/m PR size: M labels Nov 3, 2026
@agentcore-devx-automation agentcore-devx-automation Bot added the claude-security-reviewing Claude Code /security-review in progress label Nov 3, 2026
@github-actions github-actions Bot added size/l PR size: L and removed size/l PR size: L labels Nov 3, 2026
@agentcore-devx-automation

Copy link
Copy Markdown
Contributor

Claude Security Review: no high-confidence findings. (run)

@agentcore-devx-automation agentcore-devx-automation Bot removed the claude-security-reviewing Claude Code /security-review in progress label Nov 3, 2026
@github-actions github-actions Bot added size/l PR size: L and removed size/l PR size: L labels Nov 3, 2026
@agentcore-devx-automation agentcore-devx-automation Bot added the claude-security-reviewing Claude Code /security-review in progress label Nov 3, 2026
@agentcore-devx-automation

Copy link
Copy Markdown
Contributor

Claude Security Review: no high-confidence findings. (run)

@agentcore-devx-automation agentcore-devx-automation Bot removed the claude-security-reviewing Claude Code /security-review in progress label Nov 3, 2026
@github-actions github-actions Bot added size/l PR size: L and removed size/l PR size: L labels Nov 3, 2026
@notgitika
notgitika marked this pull request as ready for review November 3, 2026 18:51
@notgitika
notgitika requested a review from a team November 3, 2026 18:51
@github-actions github-actions Bot added size/l PR size: L and removed size/l PR size: L labels Nov 3, 2026
@agentcore-devx-automation agentcore-devx-automation Bot removed the claude-security-reviewing Claude Code /security-review in progress label Nov 17, 2026

@agentcore-devx-automation agentcore-devx-automation Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

AgentCore Harness Review

Verdict: Changes requested

Reviewed against base v1.x (merge base 659176f0, head 2011d39b). The schema split into src/projectSchemas/container.ts, the strict --advanced-configuration parsing with duplicate-flag detection, and the sync/prepare short-circuits look good, and the new tests use real temp dirs and a real spawned node rather than fs/process mocks. Three things need changes; the earlier review's CDK-release dependency is still open.

1. agentcore dev now fails for the whole project when any runtime is pre-built

src/handlers/project/dev/index.ts:231-238 throws as soon as one selected runtime has containerUri. When --agent is omitted, selectedRuntimes is every runtime in the project (:217), so a mixed project — exactly the configuration the PR's own test matrix covers ("ordinary Dockerfile build … while the pre-built image skips it") — can no longer run agentcore dev at all. The BMA case directly below handles this correctly: it filters with supportsLocalDev and only errors when nothing is left (:239-246), and runRuntimeDev prints a per-runtime Skipping runtime '<name>': … status for the excluded ones (:374-383).

Options:

  • filter pre-built runtimes out of the selection the same way (supportsLocalDev returning false for containerUri, or a second filter) and only throw when supportedRuntimes is empty, adding a "Skipping runtime '': it deploys a pre-built image" status for the mixed, no---agent case;
  • keep the hard error but restrict it to the explicit --agent <prebuilt> case.

The added test (src/handlers/project/dev/index.test.ts:273) only exercises --agent image; the no---agent mixed-project path — the one that regresses — is untested. Please cover it.

2. The user-facing error (and the docs) point at a PR users cannot see

src/core/project/backends/cdk/compatibility.ts:51-56 tells the user to "Install a release containing aws/agentcore-l3-cdk-constructs#440". That repo is not publicly readable (GET /repos/aws/agentcore-l3-cdk-constructs/pulls/440 → 404 unauthenticated), so the error names something the reader cannot resolve, and it gives no actionable version. Same for docs/runtime-prebuilt-images.md:53 and e2eTest/README.md:34, which are shipped user documentation.

Please name the minimum @aws/agentcore-cdk version instead and say where to change it (agentcore/cdk/package.json, then npm install). compatibility.test.ts:104 asserts on "#440" and will need updating with the message.

3. The probe reports "CDK does not support pre-built images" for failures that have nothing to do with the CDK version

assertPrebuiltRuntimeSupport treats any non-zero exit or spawn failure as "the installed schema strips containerUri": node not on PATH (only npm is checked, cdk.ts:210), a partially installed node_modules, a throw while require-ing @aws/agentcore-cdk (it loads aws-cdk-lib transitively), or a future rename of AgentEnvSpecSchema all produce the same misleading diagnosis. compatibility.test.ts:99-102 ("fails for missing or broken feature dependencies") codifies that conflation.

Options:

  • have the probe exit with a distinct code for the stripped-field case (e.g. process.exitCode = 3) and only claim "unsupported" for that code, rethrowing/surfacing the underlying error otherwise;
  • requireTool("node", …) before probing, and wrap the require in the probe so a load failure reports itself;
  • once #440 is released, drop the subprocess entirely and gate on the installed version with semver, the way cdkCompatibilityWarning already reads node_modules/@aws/agentcore-cdk/package.json — that also removes the need for the new actions/setup-node steps in verify.yml.

Still open from the earlier review

src/assets/cdk/package.json still pins @aws/agentcore-cdk 1.0.0, which has no runtime containerUri, and the PR is no longer a draft. As it stands, a project created by this CLI documents a feature that fails at agentcore build/deploy with the message from #2. The probe correctly turns the previously-silent misdeploy into a hard failure — good — but the pin bump (and confirmation that the CDK relaxes the CodeBuild vpcId/5-security-group rules identically, per src/projectSchemas/runtime.ts:339,365 and the 6-SG/no-vpcId expectation in add/runtime/index.test.ts) remains a merge gate.

Minor (non-blocking)

  • compatibility.ts:39: "Only the image URI is passed, never the Runtime's environment or credentials" — runProcess passes no env, so the child inherits the CLI's full environment. The comment claims isolation the code does not provide; either pass a minimal env or drop the claim.
  • compatibility.test.ts:126-128 asserts the literal argv prefix ["node", "--input-type=commonjs", "-e"], which restates the implementation rather than a behavior.
  • docs/runtime-prebuilt-images.md is not linked from the docs list in README.md:181-182.

@agentcore-devx-automation agentcore-devx-automation Bot removed the agentcore-harness-reviewing AgentCore Harness review in progress label Nov 17, 2026
@notgitika
notgitika force-pushed the feat/runtime-prebuilt-container-uri-implementation branch from 2011d39 to be3bba4 Compare November 17, 2026 23:31
@github-actions github-actions Bot added size/xl PR size: XL and removed size/l PR size: L labels Nov 17, 2026
@agentcore-devx-automation agentcore-devx-automation Bot added the claude-security-reviewing Claude Code /security-review in progress label Nov 17, 2026
@agentcore-devx-automation

Copy link
Copy Markdown
Contributor

Claude Security Review: no high-confidence findings. (run)

@agentcore-devx-automation agentcore-devx-automation Bot removed the claude-security-reviewing Claude Code /security-review in progress label Nov 17, 2026
@notgitika
notgitika force-pushed the feat/runtime-prebuilt-container-uri-implementation branch from be3bba4 to ecb6020 Compare November 20, 2026 20:14
@github-actions github-actions Bot added size/xl PR size: XL and removed size/xl PR size: XL labels Nov 20, 2026
@agentcore-devx-automation agentcore-devx-automation Bot added the claude-security-reviewing Claude Code /security-review in progress label Nov 20, 2026
@agentcore-devx-automation

Copy link
Copy Markdown
Contributor

Claude Security Review: no high-confidence findings. (run)

@agentcore-devx-automation agentcore-devx-automation Bot removed the claude-security-reviewing Claude Code /security-review in progress label Nov 20, 2026
@notgitika
notgitika force-pushed the feat/runtime-prebuilt-container-uri-implementation branch from ecb6020 to 6e4aedf Compare November 23, 2026 19:57

@tejaskash tejaskash left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for this, the schema, sync and add flow read well and the contract matches the CDK PR. Requesting changes for four items:

  1. src/assets/cdk/package.json still pins @aws/agentcore-cdk 1.2.0, which has no containerUri. add runtime succeeds and the next deploy fails. The pin bump needs to land with this PR.
  2. Bare agentcore dev fails for the whole project once one runtime is pre-built.
  3. Moving a deployed CodeBuild runtime to containerUri with its own image URI deletes the repository that holds the image.
  4. Public ECR URI validation counts the registry alias as part of the repository name.

Details and smaller notes are inline. Not live tested on my side: cross-account pulls, cross-region pulls and public image invocation.

Comment on lines +143 to +146
throw new ProjectStateError(
'This project requires an @aws/agentcore-cdk package that supports "ContainerLocal". ' +
`Update the dependency in ${cdkDirectory} and run npm install.`,
`This project uses ${missing.join(" and ")}, which its @aws/agentcore-cdk package does not ` +
`support. Install a release that includes ${missing.map((feature) => CDK_FEATURE_RELEASES[feature]).join(" and ")} ` +
`in ${cdkDirectory} (npm install), then rebuild or redeploy.`,

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Two problems with this advice:

  • It names a PR in a private repo, so a user has no version to install. Could CDK_FEATURE_RELEASES hold the minimum @aws/agentcore-cdk version instead?
  • The dependency sync rejects a pin newer than the one the CLI vends (dependencies.ts:180), so a user who follows this gets a second error on the next deploy. "Update the CLI" is the advice that works for managed projects.

compatibility.test.ts asserts on #440 and will need the same update.

Comment on lines +233 to +240
const prebuilt = selectedRuntimes.find((runtime) => runtime.containerUri !== undefined);
if (prebuilt) {
throw new InputValidationError(
`Runtime '${prebuilt.name}' uses a pre-built containerUri. ` +
"Deploy it with agentcore deploy, then use agentcore invoke. " +
"For local dev, select a runtime with local source using --agent <name>.",
);
}

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Without --agent, selectedRuntimes is every runtime, so a project with local runtimes a and b and one pre-built runtime can no longer run bare agentcore dev.

Suggestion: have supportsLocalDev return false for containerUri runtimes, print the existing skip status, and throw only when nothing is left, the same way the BMA case below does. That also fixes the reload path at line 506, which filters with supportsLocalDev and today passes a newly added pre-built runtime to the local container runner.

A test for the mixed project without --agent would cover it.

Comment on lines +205 to +209
if (
key.startsWith("runtime/") &&
pair.has("CodeZip") &&
(pair.has("Container") || pair.has("ContainerUri"))
) {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Container to ContainerUri is allowed here. If the user sets containerUri to the image already in the CLI-managed repository (a natural way to stop rebuilding), the CDK drops that repository from the stack, and it is created with RemovalPolicy.DESTROY and emptyOnDelete: true. The runtime then points at a deleted image.

Could we reject a containerUri that refers to a repository this deploy removes, and tell the user to copy the image to their own repository first?

Comment thread src/projectSchemas/constants.ts Outdated
Comment on lines +98 to +103
const [, registry, , , , repository = "", tag, digest] = match;
const maxRepositoryLength =
registry === "public.ecr.aws"
? MAX_PUBLIC_REPOSITORY_NAME_LENGTH
: MAX_PRIVATE_REPOSITORY_NAME_LENGTH;
if (repository.length < MIN_REPOSITORY_NAME_LENGTH || repository.length > maxRepositoryLength) {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For public.ecr.aws the captured group is alias/repository, so:

  • a valid public repository name near 205 characters is rejected because the alias is counted
  • public.ecr.aws/abcdefgh:v1, which has no repository segment, is accepted

Suggestion: split off the alias for public URIs, require a repository segment, and apply the length check to the repository only. The boundary tests currently omit the alias.

Comment thread src/projectSchemas/runtime.ts Outdated
* The rules for a pre-built image (`containerUri`): it is the whole container
* artifact, so it needs `build: "Container"` and excludes every local build
* setting. Shared by agentcore.json and `add runtime --build-config`; the CDK
* package's schema enforces the same rules.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This holds for the cross-field rules only. The CDK ContainerUriSchema applies just the CloudFormation regex, so tag, digest, length and whitespace rules differ. I left a matching comment on the CDK PR. Aligning the two would be best, otherwise please reword this.

Comment thread .github/workflows/verify.yml Outdated
Comment on lines +49 to +51
- uses: actions/setup-node@949feb2413d6458794dcd2491c4babbbce0c15c1 # v7.1.0
with:
node-version: "22"

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The setup-node step for 20.12.0 a few lines below runs after this one and replaces it, so the build and tests still run on Node 20.12.0. Is Node 22 needed here? If not, this step can go. The same applies to the second job.

Comment thread docs/runtime-prebuilt-images.md Outdated
Comment on lines +52 to +57
This feature requires an `@aws/agentcore-cdk` package that includes CDK PR #440. Older packages can
silently strip unknown schema properties, so before building or deploying, the CLI checks that the
project's package supports every feature the project uses (pre-built Runtime images,
`ContainerLocal`) and fails with the missing feature named. A package that is installed but fails
to load is reported with its own load error instead. Release the CDK change and update the
vended package pin before releasing the CLI change.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could this name the minimum @aws/agentcore-cdk version instead of the PR number? The last sentence is a note for maintainers and should not be in user docs. A sentence on the repository policy needed for cross-account images would help here too.

A Runtime can deploy an existing private or public ECR image: set containerUri
in agentcore.json, or with agentcore add runtime --build-config
'{"containerUri":"..."}'. The image is deployed as is: no local source,
Dockerfile, CodeBuild, or managed ECR repository.

- containerUri requires build Container and excludes dockerfile,
  buildContextPath, and customDockerBuildArgs, matching @aws/agentcore-cdk
- add runtime --build-config accepts containerUri, defaults build to
  Container, and needs no --language; with containerUri it skips the
  Dockerfile requirement for Container builds
- a containerUri Runtime resolves to workload build mode ContainerUri, so it
  triggers no local image build, Dockerfile sync, or ARM64 builder check
- dev skips pre-built Runtimes (with a status line) and runs the rest, also on
  reload; selecting only pre-built Runtimes explains how to deploy and invoke
- the switch guard rejects a deployed Runtime changing between CodeZip and
  ContainerUri in either direction (the service rejects artifact-type
  changes); Container or ContainerLocal to ContainerUri stays allowed, except
  Container to an image in the ECR repository the stack created for that
  build, which the deploy deletes
- public.ecr.aws URIs need an alias and a repository; the 2-205 length applies
  to the repository only
- one Node probe checks the CDK package for every feature the project uses
  (ContainerLocal, Runtime containerUri); a missing feature names the minimum
  @aws/agentcore-cdk version and, when the CLI manages the dependencies, asks
  to update the CLI; a package that fails to load is reported with its own
  error
- workload build mode ContainerUri is counted in telemetry
@notgitika
notgitika force-pushed the feat/runtime-prebuilt-container-uri-implementation branch from 6e4aedf to b50a019 Compare November 24, 2026 08:29
@github-actions github-actions Bot added size/xl PR size: XL and removed size/xl PR size: XL labels Nov 24, 2026

@tejaskash tejaskash left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the quick turnaround. All seven comments are addressed, and typecheck and the changed tests pass for me locally.

Two things to close before merge:

  • The vended @aws/agentcore-cdk pin is still 1.2.0. Please bump it once the CDK release is out, and confirm the release number matches the 1.3.0 in CDK_FEATURE_RELEASES.
  • verify / Windows failed on a timeout in toolkit.test.ts, which this PR does not touch. A rerun should tell us if it is a flake.

Small follow-up, not blocking: the new repository guard covers a runtime moving from Container to containerUri. Removing the Container runtime and adding a new one that points at the old repository is not caught.

@agentcore-devx-automation agentcore-devx-automation Bot added the claude-security-reviewing Claude Code /security-review in progress label Nov 24, 2026
@agentcore-devx-automation

Copy link
Copy Markdown
Contributor

Claude Security Review: no high-confidence findings. (run)

@agentcore-devx-automation agentcore-devx-automation Bot removed the claude-security-reviewing Claude Code /security-review in progress label Nov 24, 2026
@jariy17
jariy17 merged commit a6452a4 into aws:v1.x Nov 25, 2026
30 of 33 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size/xl PR size: XL

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants