aws / aws/aws-cdk

aws-codebuild: Can't use standard images on GPU instance

Open
#29,094 11 comments 2 reactions 0 assignees View on GitHub
@aws-cdk/aws-codebuild bug effort/medium p2
Dominant language
TypeScript
Stars
12.9k
Forks
4.6k
Avg merge
2d 3h
Merged PRs (30d)
83

Description

### Describe the bug

Creating codebuild project via console, I can create using standard images e.g. `aws/codebuild/standard:7.0`.
However, using CDK, in order to create a GPU project AFAICT I need to use LinuxGpuBuildImage - so I can only create using DLC images - see https://github.com/aws/aws-cdk/blob/main/packages/aws-cdk-lib/aws-codebuild/lib/linux-gpu-build-image.ts#L22 . Not only that, but the DLC images available as constants are 4 years old
Why not allow to create via image id here as well?

### Expected Behavior

Create GPU project using standard image, from image id, or from LinuxGpuBuildImage constant.
_Or_, have separate way to specify that the build uses GPU, regardless of BuildImage type (similar to console).

### Current Behavior

In order to use GPU, must use LinuxGpuBuildImage. Selection of LinuxGpuBuildImage is limited compared to console, and doesn't offer standard images.

### Reproduction Steps

LinuxGpuBuildImage.fromCodeBuildImageId - doesn't exist
LinuxGpuBuildImage.STANDARD_7_0 - doesn't exist
LinuxBuildImage.STANDARD_7_0 - no other way to specify to use GPU on this image

### Possible Solution

1. Add separate Project field specifying GPU-enabled build
2. Add ability to select Standard LinuxGpuBuildImage by image id

### Additional Information/Context

_No response_

### CDK CLI Version

2.127.0

### Framework Version

_No response_

### Node.js Version

18

### OS

AL2

### Language

TypeScript

### Language Version

_No response_

### Other information

_No response_

Contributor guide

Open the contributing guide

Research direction

Start with packages/aws-cdk-lib/aws-codebuild/lib/linux-gpu-build-image.ts and compare the LinuxGpuBuildImage and LinuxBuildImage entry points named in the issue. Trace how the CDK project configuration represents GPU builds and determine whether image IDs or a separate GPU setting fits the existing API. Done means a GPU project can use the requested standard image path, with coverage for the supported configuration.

Written by the indexing model from the issue text.

Assessment

Tech stack
aws, typescript
Domain
cloud, infrastructure
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.