feat(ts#mcp-server): use CDK buildContexts for Docker image assets#517
Open
nx-plugin-for-aws wants to merge 2 commits intomainfrom
Open
feat(ts#mcp-server): use CDK buildContexts for Docker image assets#517nx-plugin-for-aws wants to merge 2 commits intomainfrom
nx-plugin-for-aws wants to merge 2 commits intomainfrom
Conversation
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #517 +/- ##
==========================================
- Coverage 91.04% 90.87% -0.18%
==========================================
Files 90 90
Lines 3240 3211 -29
Branches 711 706 -5
==========================================
- Hits 2950 2918 -32
- Misses 118 122 +4
+ Partials 172 171 -1 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Contributor
|
📚 Documentation translations have been updated and committed (9f6fba2) to this PR. |
Contributor
|
📚 Documentation translations have been updated and committed (6201745) to this PR. |
Contributor
|
📚 Documentation translations have been updated and committed (087391d) to this PR. |
087391d to
d96fc60
Compare
Contributor
|
📚 Documentation translations have been updated and committed (ee61796) to this PR. |
Simplify Docker setup for agents/MCP servers using CDK buildContexts
(aws-cdk-lib 2.245.0) instead of a dummy Dockerfile workaround.
- Remove dummy Dockerfile from CDK construct directory
- Use buildContexts: { workspace: workspaceRoot } in CDK construct
- Use FileSystem.fingerprint on bundle output for extraHash
- Move findWorkspaceRoot to shared core/utils.ts in common/constructs
- For CDK, remove docker from build dependencies
- Keep docker target for Terraform and local testing
- Bump aws-cdk-lib to 2.245.0
ee61796 to
6314bf7
Compare
Contributor
|
📚 Documentation translations have been updated and committed (0d5a54e) to this PR. |
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.
Reason for this change
CDK's latest release (2.245.0) now supports
buildContextsforDockerImageAsset, enabling Docker's--build-contextflag during image builds. This allows us to simplify the Docker setup for agents and MCP servers by removing the workaround that required two Dockerfiles per project.Previously, each agent/MCP server needed:
COPY --from=workspace)FROM <tag>) that referenced the pre-built imageThe dummy Dockerfile existed solely because CDK's
DockerImageAssetdidn't support named build contexts (--build-context).Description of changes
agent-core-constructs/files/cdk/AgentRuntimeArtifact.fromAsset()with:buildContexts: { workspace: workspaceRoot }— CDK passes--build-context workspace=<root>to docker buildhashDirectory()on the bundle output — ensures changes to bundled code trigger redeploymentfindWorkspaceRoot()— locates the Nx workspace root by searching fornx.jsondockerfileDirandbundleOutputDirto the infrastructure functionsdockerfrombuilddependencies (CDK builds the image itself viafromAsset)dockerinbuilddependencies (Terraform still needs the pre-built image)aws-cdk-libto2.245.0,@aws-cdk/aws-bedrock-agentcore-alphato2.245.0-alpha.0Description of how you validated changes
pnpm nx run-many --target build --all)buildContextsandhashDirectorybuild.dependsOnno longer includesdockerfor CDKChecklist
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license