Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

aws-ecr-assets: TarballImageAsset hardcodes container runtime. #31317

Open
1 task
commiterate opened this issue Sep 4, 2024 · 1 comment
Open
1 task

aws-ecr-assets: TarballImageAsset hardcodes container runtime. #31317

commiterate opened this issue Sep 4, 2024 · 1 comment
Labels
@aws-cdk/aws-ecr-assets Related to AWS CDK Docker Image Assets bug This issue is a bug. effort/medium Medium work item – several days of effort p3

Comments

@commiterate
Copy link

commiterate commented Sep 4, 2024

Describe the bug

aws-ecr-assets.TarballImageAsset currently hardcodes the container runtime for the image load command.

https://github.com/aws/aws-cdk/blob/v2.155.0/packages/aws-cdk-lib/aws-ecr-assets/lib/tarball-asset.ts#L80

Regression Issue

  • Select this option if this issue appears to be a regression.

Last Known Working CDK Version

None.

Expected Behavior

aws-ecr-assets.TarballImageAsset should use the undocumented (#25657) CDK_DOCKER environment variable introduced by #23855.

Alternatively, use the proposed container runtime configuration in cdk.json (#31319).

Current Behavior

aws-ecr-assets.TarballImageAsset hardcodes docker.

Reproduction Steps

Using aws-ecr-assets.TarballImageAsset as documented produces the following {stack}.assets.json:

{
  // ...
  "dockerImages": {
    "{asset hash}": {
      "source": {
        "executable": [
          "sh",
          "-c",
          "docker load -i asset.{asset hash}.tar.gz | tail -n 1 | sed \"s/Loaded image: //g\""
        ]
      },
      // ...
    }
  }
}

CDK CLI Version

2.155.0

Framework Version

2.155.0

Node.js Version

20.16.0

OS

macOS 14 (Sonoma)

Language

TypeScript

Language Version

5.5.4

@commiterate commiterate added bug This issue is a bug. needs-triage This issue or PR still needs to be triaged. labels Sep 4, 2024
@github-actions github-actions bot added the @aws-cdk/aws-ecr-assets Related to AWS CDK Docker Image Assets label Sep 4, 2024
@khushail khushail added investigating This issue is being investigated and/or work is in progress to resolve the issue. p2 and removed needs-triage This issue or PR still needs to be triaged. labels Sep 4, 2024
@ashishdhingra
Copy link
Contributor

ashishdhingra commented Sep 5, 2024

The PR #23855 added support for CDK_DOCKER for using alternative container implementations for docker. Taking example from PR,

CDK_DOCKER=finch ./scripts/foreach.sh "yarn build"
CDK_DOCKER=finch ./scripts/foreach.sh "yarn test"

Finch is one of the docker alternatives.

CDK_DOCKER is an undocumented feature.

Looking at aws-s3-assets, it appears to support CDK_DOCKER environment variable. Perhaps we need to support similar behavior for aws-ecr-assets.

Needs discussion with the team.

@ashishdhingra ashishdhingra added effort/medium Medium work item – several days of effort p3 and removed investigating This issue is being investigated and/or work is in progress to resolve the issue. p2 labels Sep 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
@aws-cdk/aws-ecr-assets Related to AWS CDK Docker Image Assets bug This issue is a bug. effort/medium Medium work item – several days of effort p3
Projects
None yet
Development

No branches or pull requests

3 participants