Select your cookie preferences

We use essential cookies and similar tools that are necessary to provide our site and services. We use performance cookies to collect anonymous statistics, so we can understand how customers use our site and make improvements. Essential cookies cannot be deactivated, but you can choose “Customize” or “Decline” to decline performance cookies.

If you agree, AWS and approved third parties will also use cookies to provide useful site features, remember your preferences, and display relevant content, including relevant advertising. To accept or decline all non-essential cookies, choose “Accept” or “Decline.” To make more detailed choices, choose “Customize.”

aws-cdk-lib

Version 2 of the AWS Cloud Development Kit library


AWS icon

AWS

1,865,269 Weekly downloads

Author Amazon Web Services

Published

Repository github.com

License Apache-2.0

Registry www.npmjs.com


LinuxGpuBuildImage

A CodeBuild GPU image running Linux.

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

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

Example

Project.Builder.create(this, "Project")
.environment(BuildEnvironment.builder()
.buildImage(LinuxGpuBuildImage.DLC_TENSORFLOW_2_1_0_INFERENCE)
.build())
.build();

Methods

NameDescription
bindFunction that allows the build image access to the construct tree.
runScriptBuildspecMake a buildspec to run the indicated script.
validateAllows the image a chance to validate whether the passed configuration is correct.
bind
public BuildImageConfig bind(Construct scope, IProject project, BuildImageBindOptions _options)

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

scopeRequired
projectRequired
_optionsRequired
runScriptBuildspec
public BuildSpec runScriptBuildspec(java.lang.String entrypoint)

Make a buildspec to run the indicated script.

entrypointRequired
  • Type: java.lang.String
validate
public java.util.List<java.lang.String> validate(BuildEnvironment buildEnvironment)

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

buildEnvironmentRequired

Static Functions

NameDescription
awsDeepLearningContainersImageReturns a Linux GPU build image from AWS Deep Learning Containers.
fromEcrRepositoryReturns a GPU image running Linux from an ECR repository.
awsDeepLearningContainersImage
import software.amazon.awscdk.services.codebuild.LinuxGpuBuildImage;
LinuxGpuBuildImage.awsDeepLearningContainersImage(java.lang.String repositoryName, java.lang.String tag),LinuxGpuBuildImage.awsDeepLearningContainersImage(java.lang.String repositoryName, java.lang.String tag, java.lang.String account)

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

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

repositoryNameRequired
  • Type: java.lang.String

the name of the repository, for example "pytorch-inference".

tagRequired
  • Type: java.lang.String

the tag of the image, for example "1.5.0-gpu-py36-cu101-ubuntu16.04".

accountOptional
  • Type: java.lang.String

the AWS account ID where the DLC repository for this region is hosted in.

In many cases, the CDK can infer that for you, but for some newer region our information might be out of date; in that case, you can specify the region explicitly using this optional parameter

fromEcrRepository
import software.amazon.awscdk.services.codebuild.LinuxGpuBuildImage;
LinuxGpuBuildImage.fromEcrRepository(IRepository repository),LinuxGpuBuildImage.fromEcrRepository(IRepository repository, java.lang.String tag)

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.

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

repositoryRequired

The ECR repository.

tagOptional
  • Type: java.lang.String

Image tag (default "latest").

Properties

NameTypeDescription
defaultComputeTypeComputeTypeThe default ComputeType to use with this image, if one was not specified in BuildEnvironment#computeType explicitly.
imageIdjava.lang.StringThe Docker image identifier that the build environment uses.
typejava.lang.StringThe type of build environment.
imagePullPrincipalTypeImagePullPrincipalTypeThe type of principal that CodeBuild will use to pull this build Docker image.
defaultComputeTypeRequired
public ComputeType getDefaultComputeType();

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

imageIdRequired
public java.lang.String getImageId();
  • Type: java.lang.String

The Docker image identifier that the build environment uses.

typeRequired
public java.lang.String getType();
  • Type: java.lang.String

The type of build environment.

imagePullPrincipalTypeOptional
public ImagePullPrincipalType getImagePullPrincipalType();

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

Constants

NameTypeDescription
DLC_MXNET_1_4_1IBuildImageMXNet 1.4.1 GPU image from AWS Deep Learning Containers.
DLC_MXNET_1_6_0IBuildImageMXNet 1.6.0 GPU image from AWS Deep Learning Containers.
DLC_PYTORCH_1_2_0IBuildImagePyTorch 1.2.0 GPU image from AWS Deep Learning Containers.
DLC_PYTORCH_1_3_1IBuildImagePyTorch 1.3.1 GPU image from AWS Deep Learning Containers.
DLC_PYTORCH_1_4_0_INFERENCEIBuildImagePyTorch 1.4.0 GPU inference image from AWS Deep Learning Containers.
DLC_PYTORCH_1_4_0_TRAININGIBuildImagePyTorch 1.4.0 GPU training image from AWS Deep Learning Containers.
DLC_PYTORCH_1_5_0_INFERENCEIBuildImagePyTorch 1.5.0 GPU inference image from AWS Deep Learning Containers.
DLC_PYTORCH_1_5_0_TRAININGIBuildImagePyTorch 1.5.0 GPU training image from AWS Deep Learning Containers.
DLC_TENSORFLOW_1_14_0IBuildImageTensorflow 1.14.0 GPU image from AWS Deep Learning Containers.
DLC_TENSORFLOW_1_15_0IBuildImageTensorflow 1.15.0 GPU image from AWS Deep Learning Containers.
DLC_TENSORFLOW_1_15_2_INFERENCEIBuildImageTensorflow 1.15.2 GPU inference image from AWS Deep Learning Containers.
DLC_TENSORFLOW_1_15_2_TRAININGIBuildImageTensorflow 1.15.2 GPU training image from AWS Deep Learning Containers.
DLC_TENSORFLOW_2_0_0IBuildImageTensorflow 2.0.0 GPU image from AWS Deep Learning Containers.
DLC_TENSORFLOW_2_0_1IBuildImageTensorflow 2.0.1 GPU image from AWS Deep Learning Containers.
DLC_TENSORFLOW_2_1_0_INFERENCEIBuildImageTensorflow 2.1.0 GPU inference image from AWS Deep Learning Containers.
DLC_TENSORFLOW_2_1_0_TRAININGIBuildImageTensorflow 2.1.0 GPU training image from AWS Deep Learning Containers.
DLC_TENSORFLOW_2_2_0_TRAININGIBuildImageTensorflow 2.2.0 GPU training image from AWS Deep Learning Containers.
DLC_MXNET_1_4_1Required
public IBuildImage getDlcMxnet141();

MXNet 1.4.1 GPU image from AWS Deep Learning Containers.

DLC_MXNET_1_6_0Required
public IBuildImage getDlcMxnet160();

MXNet 1.6.0 GPU image from AWS Deep Learning Containers.

DLC_PYTORCH_1_2_0Required
public IBuildImage getDlcPytorch120();

PyTorch 1.2.0 GPU image from AWS Deep Learning Containers.

DLC_PYTORCH_1_3_1Required
public IBuildImage getDlcPytorch131();

PyTorch 1.3.1 GPU image from AWS Deep Learning Containers.

DLC_PYTORCH_1_4_0_INFERENCERequired
public IBuildImage getDlcPytorch140Inference();

PyTorch 1.4.0 GPU inference image from AWS Deep Learning Containers.

DLC_PYTORCH_1_4_0_TRAININGRequired
public IBuildImage getDlcPytorch140Training();

PyTorch 1.4.0 GPU training image from AWS Deep Learning Containers.

DLC_PYTORCH_1_5_0_INFERENCERequired
public IBuildImage getDlcPytorch150Inference();

PyTorch 1.5.0 GPU inference image from AWS Deep Learning Containers.

DLC_PYTORCH_1_5_0_TRAININGRequired
public IBuildImage getDlcPytorch150Training();

PyTorch 1.5.0 GPU training image from AWS Deep Learning Containers.

DLC_TENSORFLOW_1_14_0Required
public IBuildImage getDlcTensorflow1140();

Tensorflow 1.14.0 GPU image from AWS Deep Learning Containers.

DLC_TENSORFLOW_1_15_0Required
public IBuildImage getDlcTensorflow1150();

Tensorflow 1.15.0 GPU image from AWS Deep Learning Containers.

DLC_TENSORFLOW_1_15_2_INFERENCERequired
public IBuildImage getDlcTensorflow1152Inference();

Tensorflow 1.15.2 GPU inference image from AWS Deep Learning Containers.

DLC_TENSORFLOW_1_15_2_TRAININGRequired
public IBuildImage getDlcTensorflow1152Training();

Tensorflow 1.15.2 GPU training image from AWS Deep Learning Containers.

DLC_TENSORFLOW_2_0_0Required
public IBuildImage getDlcTensorflow200();

Tensorflow 2.0.0 GPU image from AWS Deep Learning Containers.

DLC_TENSORFLOW_2_0_1Required
public IBuildImage getDlcTensorflow201();

Tensorflow 2.0.1 GPU image from AWS Deep Learning Containers.

DLC_TENSORFLOW_2_1_0_INFERENCERequired
public IBuildImage getDlcTensorflow210Inference();

Tensorflow 2.1.0 GPU inference image from AWS Deep Learning Containers.

DLC_TENSORFLOW_2_1_0_TRAININGRequired
public IBuildImage getDlcTensorflow210Training();

Tensorflow 2.1.0 GPU training image from AWS Deep Learning Containers.

DLC_TENSORFLOW_2_2_0_TRAININGRequired
public IBuildImage getDlcTensorflow220Training();

Tensorflow 2.2.0 GPU training image from AWS Deep Learning Containers.