aws-cdk-lib.aws_codebuild.LinuxGpuBuildImage

class LinuxGpuBuildImage

LanguageType name
.NETAmazon.CDK.AWS.CodeBuild.LinuxGpuBuildImage
Gogithub.com/aws/aws-cdk-go/awscdk/v2/awscodebuild#LinuxGpuBuildImage
Javasoftware.amazon.awscdk.services.codebuild.LinuxGpuBuildImage
Pythonaws_cdk.aws_codebuild.LinuxGpuBuildImage
TypeScript (source)aws-cdk-lib » aws_codebuild » LinuxGpuBuildImage

Implements IBindableBuildImage, IBuildImage

A CodeBuild GPU image running Linux.

This class has public constants that represent the most popular GPU images from AWS Deep Learning Containers.

See also: https://aws.amazon.com/releasenotes/available-deep-learning-containers-images

Example

new codebuild.Project(this, 'Project', {
  environment: {
    buildImage: codebuild.LinuxGpuBuildImage.DLC_TENSORFLOW_2_1_0_INFERENCE,
  },
  // ...
})

Properties

NameTypeDescription
defaultComputeTypeComputeTypeThe default ComputeType to use with this image, if one was not specified in BuildEnvironment#computeType explicitly.
imageIdstringThe Docker image identifier that the build environment uses.
typestringThe type of build environment.
imagePullPrincipalType?ImagePullPrincipalTypeThe type of principal that CodeBuild will use to pull this build Docker image.
static DLC_MXNET_1_4_1IBuildImageMXNet 1.4.1 GPU image from AWS Deep Learning Containers.
static DLC_MXNET_1_6_0IBuildImageMXNet 1.6.0 GPU image from AWS Deep Learning Containers.
static DLC_PYTORCH_1_2_0IBuildImagePyTorch 1.2.0 GPU image from AWS Deep Learning Containers.
static DLC_PYTORCH_1_3_1IBuildImagePyTorch 1.3.1 GPU image from AWS Deep Learning Containers.
static DLC_PYTORCH_1_4_0_INFERENCEIBuildImagePyTorch 1.4.0 GPU inference image from AWS Deep Learning Containers.
static DLC_PYTORCH_1_4_0_TRAININGIBuildImagePyTorch 1.4.0 GPU training image from AWS Deep Learning Containers.
static DLC_PYTORCH_1_5_0_INFERENCEIBuildImagePyTorch 1.5.0 GPU inference image from AWS Deep Learning Containers.
static DLC_PYTORCH_1_5_0_TRAININGIBuildImagePyTorch 1.5.0 GPU training image from AWS Deep Learning Containers.
static DLC_TENSORFLOW_1_14_0IBuildImageTensorflow 1.14.0 GPU image from AWS Deep Learning Containers.
static DLC_TENSORFLOW_1_15_0IBuildImageTensorflow 1.15.0 GPU image from AWS Deep Learning Containers.
static DLC_TENSORFLOW_1_15_2_INFERENCEIBuildImageTensorflow 1.15.2 GPU inference image from AWS Deep Learning Containers.
static DLC_TENSORFLOW_1_15_2_TRAININGIBuildImageTensorflow 1.15.2 GPU training image from AWS Deep Learning Containers.
static DLC_TENSORFLOW_2_0_0IBuildImageTensorflow 2.0.0 GPU image from AWS Deep Learning Containers.
static DLC_TENSORFLOW_2_0_1IBuildImageTensorflow 2.0.1 GPU image from AWS Deep Learning Containers.
static DLC_TENSORFLOW_2_1_0_INFERENCEIBuildImageTensorflow 2.1.0 GPU inference image from AWS Deep Learning Containers.
static DLC_TENSORFLOW_2_1_0_TRAININGIBuildImageTensorflow 2.1.0 GPU training image from AWS Deep Learning Containers.
static DLC_TENSORFLOW_2_2_0_TRAININGIBuildImageTensorflow 2.2.0 GPU training image from AWS Deep Learning Containers.

defaultComputeType

Type: ComputeType

The default ComputeType to use with this image, if one was not specified in BuildEnvironment#computeType explicitly.


imageId

Type: string

The Docker image identifier that the build environment uses.


type

Type: string

The type of build environment.


imagePullPrincipalType?

Type: ImagePullPrincipalType (optional)

The type of principal that CodeBuild will use to pull this build Docker image.


static DLC_MXNET_1_4_1

Type: IBuildImage

MXNet 1.4.1 GPU image from AWS Deep Learning Containers.


static DLC_MXNET_1_6_0

Type: IBuildImage

MXNet 1.6.0 GPU image from AWS Deep Learning Containers.


static DLC_PYTORCH_1_2_0

Type: IBuildImage

PyTorch 1.2.0 GPU image from AWS Deep Learning Containers.


static DLC_PYTORCH_1_3_1

Type: IBuildImage

PyTorch 1.3.1 GPU image from AWS Deep Learning Containers.


static DLC_PYTORCH_1_4_0_INFERENCE

Type: IBuildImage

PyTorch 1.4.0 GPU inference image from AWS Deep Learning Containers.


static DLC_PYTORCH_1_4_0_TRAINING

Type: IBuildImage

PyTorch 1.4.0 GPU training image from AWS Deep Learning Containers.


static DLC_PYTORCH_1_5_0_INFERENCE

Type: IBuildImage

PyTorch 1.5.0 GPU inference image from AWS Deep Learning Containers.


static DLC_PYTORCH_1_5_0_TRAINING

Type: IBuildImage

PyTorch 1.5.0 GPU training image from AWS Deep Learning Containers.


static DLC_TENSORFLOW_1_14_0

Type: IBuildImage

Tensorflow 1.14.0 GPU image from AWS Deep Learning Containers.


static DLC_TENSORFLOW_1_15_0

Type: IBuildImage

Tensorflow 1.15.0 GPU image from AWS Deep Learning Containers.


static DLC_TENSORFLOW_1_15_2_INFERENCE

Type: IBuildImage

Tensorflow 1.15.2 GPU inference image from AWS Deep Learning Containers.


static DLC_TENSORFLOW_1_15_2_TRAINING

Type: IBuildImage

Tensorflow 1.15.2 GPU training image from AWS Deep Learning Containers.


static DLC_TENSORFLOW_2_0_0

Type: IBuildImage

Tensorflow 2.0.0 GPU image from AWS Deep Learning Containers.


static DLC_TENSORFLOW_2_0_1

Type: IBuildImage

Tensorflow 2.0.1 GPU image from AWS Deep Learning Containers.


static DLC_TENSORFLOW_2_1_0_INFERENCE

Type: IBuildImage

Tensorflow 2.1.0 GPU inference image from AWS Deep Learning Containers.


static DLC_TENSORFLOW_2_1_0_TRAINING

Type: IBuildImage

Tensorflow 2.1.0 GPU training image from AWS Deep Learning Containers.


static DLC_TENSORFLOW_2_2_0_TRAINING

Type: IBuildImage

Tensorflow 2.2.0 GPU training image from AWS Deep Learning Containers.

Methods

NameDescription
bind(scope, project, _options)Function that allows the build image access to the construct tree.
runScriptBuildspec(entrypoint)Make a buildspec to run the indicated script.
validate(buildEnvironment)Allows the image a chance to validate whether the passed configuration is correct.
static awsDeepLearningContainersImage(repositoryName, tag, account?)Returns a Linux GPU build image from AWS Deep Learning Containers.
static fromEcrRepository(repository, tag?)Returns a GPU image running Linux from an ECR repository.

bind(scope, project, _options)

public bind(scope: Construct, project: IProject, _options: BuildImageBindOptions): BuildImageConfig

Parameters

  • scope Construct
  • project IProject
  • _options BuildImageBindOptions

Returns

  • BuildImageConfig

Function that allows the build image access to the construct tree.


runScriptBuildspec(entrypoint)

public runScriptBuildspec(entrypoint: string): BuildSpec

Parameters

  • entrypoint string

Returns

  • BuildSpec

Make a buildspec to run the indicated script.


validate(buildEnvironment)

public validate(buildEnvironment: BuildEnvironment): string[]

Parameters

  • buildEnvironment BuildEnvironment

Returns

  • string[]

Allows the image a chance to validate whether the passed configuration is correct.


static awsDeepLearningContainersImage(repositoryName, tag, account?)

public static awsDeepLearningContainersImage(repositoryName: string, tag: string, account?: string): IBuildImage

Parameters

  • repositoryName string — the name of the repository, for example "pytorch-inference".
  • tag string — the tag of the image, for example "1.5.0-gpu-py36-cu101-ubuntu16.04".
  • account string — the AWS account ID where the DLC repository for this region is hosted in.

Returns

  • IBuildImage

Returns a Linux GPU build image from AWS Deep Learning Containers.

See also: https://aws.amazon.com/releasenotes/available-deep-learning-containers-images


static fromEcrRepository(repository, tag?)

public static fromEcrRepository(repository: IRepository, tag?: string): IBuildImage

Parameters

  • repository IRepository — The ECR repository.
  • tag string — Image tag (default "latest").

Returns

  • IBuildImage

Returns a GPU image running Linux from an ECR repository.

NOTE: if the repository is external (i.e. imported), then we won't be able to add a resource policy statement for it so CodeBuild can pull the image.

See also: https://docs.aws.amazon.com/codebuild/latest/userguide/sample-ecr.html