aws-cdk-lib
Version 2 of the AWS Cloud Development Kit library
LinuxGpuBuildImage
- Implements: IBindableBuildImage
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();
Name | Description |
---|---|
bind | Function that allows the build image access to the construct tree. |
runScriptBuildspec | Make a buildspec to run the indicated script. |
validate | Allows the image a chance to validate whether the passed configuration is correct. |
public BuildImageConfig bind(Construct scope, IProject project, BuildImageBindOptions _options)
Function that allows the build image access to the construct tree.
- Type: Construct
- Type: IProject
- Type: BuildImageBindOptions
public BuildSpec runScriptBuildspec(java.lang.String entrypoint)
Make a buildspec to run the indicated script.
- Type: java.lang.String
public java.util.List<java.lang.String> validate(BuildEnvironment buildEnvironment)
Allows the image a chance to validate whether the passed configuration is correct.
- Type: BuildEnvironment
Name | Description |
---|---|
awsDeepLearningContainersImage | Returns a Linux GPU build image from AWS Deep Learning Containers. |
fromEcrRepository | Returns a GPU image running Linux from an ECR repository. |
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
- Type: java.lang.String
the name of the repository, for example "pytorch-inference".
- Type: java.lang.String
the tag of the image, for example "1.5.0-gpu-py36-cu101-ubuntu16.04".
- 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
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
- Type: IRepository
The ECR repository.
- Type: java.lang.String
Image tag (default "latest").
Name | Type | Description |
---|---|---|
defaultComputeType | ComputeType | The default ComputeType to use with this image, if one was not specified in BuildEnvironment#computeType explicitly. |
imageId | java.lang.String | The Docker image identifier that the build environment uses. |
type | java.lang.String | The type of build environment. |
imagePullPrincipalType | ImagePullPrincipalType | The type of principal that CodeBuild will use to pull this build Docker image. |
public ComputeType getDefaultComputeType();
- Type: ComputeType
The default ComputeType
to use with this image, if one was not specified in BuildEnvironment#computeType
explicitly.
public java.lang.String getImageId();
- Type: java.lang.String
The Docker image identifier that the build environment uses.
public java.lang.String getType();
- Type: java.lang.String
The type of build environment.
public ImagePullPrincipalType getImagePullPrincipalType();
- Type: ImagePullPrincipalType
The type of principal that CodeBuild will use to pull this build Docker image.
Name | Type | Description |
---|---|---|
DLC_MXNET_1_4_1 | IBuildImage | MXNet 1.4.1 GPU image from AWS Deep Learning Containers. |
DLC_MXNET_1_6_0 | IBuildImage | MXNet 1.6.0 GPU image from AWS Deep Learning Containers. |
DLC_PYTORCH_1_2_0 | IBuildImage | PyTorch 1.2.0 GPU image from AWS Deep Learning Containers. |
DLC_PYTORCH_1_3_1 | IBuildImage | PyTorch 1.3.1 GPU image from AWS Deep Learning Containers. |
DLC_PYTORCH_1_4_0_INFERENCE | IBuildImage | PyTorch 1.4.0 GPU inference image from AWS Deep Learning Containers. |
DLC_PYTORCH_1_4_0_TRAINING | IBuildImage | PyTorch 1.4.0 GPU training image from AWS Deep Learning Containers. |
DLC_PYTORCH_1_5_0_INFERENCE | IBuildImage | PyTorch 1.5.0 GPU inference image from AWS Deep Learning Containers. |
DLC_PYTORCH_1_5_0_TRAINING | IBuildImage | PyTorch 1.5.0 GPU training image from AWS Deep Learning Containers. |
DLC_TENSORFLOW_1_14_0 | IBuildImage | Tensorflow 1.14.0 GPU image from AWS Deep Learning Containers. |
DLC_TENSORFLOW_1_15_0 | IBuildImage | Tensorflow 1.15.0 GPU image from AWS Deep Learning Containers. |
DLC_TENSORFLOW_1_15_2_INFERENCE | IBuildImage | Tensorflow 1.15.2 GPU inference image from AWS Deep Learning Containers. |
DLC_TENSORFLOW_1_15_2_TRAINING | IBuildImage | Tensorflow 1.15.2 GPU training image from AWS Deep Learning Containers. |
DLC_TENSORFLOW_2_0_0 | IBuildImage | Tensorflow 2.0.0 GPU image from AWS Deep Learning Containers. |
DLC_TENSORFLOW_2_0_1 | IBuildImage | Tensorflow 2.0.1 GPU image from AWS Deep Learning Containers. |
DLC_TENSORFLOW_2_1_0_INFERENCE | IBuildImage | Tensorflow 2.1.0 GPU inference image from AWS Deep Learning Containers. |
DLC_TENSORFLOW_2_1_0_TRAINING | IBuildImage | Tensorflow 2.1.0 GPU training image from AWS Deep Learning Containers. |
DLC_TENSORFLOW_2_2_0_TRAINING | IBuildImage | Tensorflow 2.2.0 GPU training image from AWS Deep Learning Containers. |
public IBuildImage getDlcMxnet141();
- Type: IBuildImage
MXNet 1.4.1 GPU image from AWS Deep Learning Containers.
public IBuildImage getDlcMxnet160();
- Type: IBuildImage
MXNet 1.6.0 GPU image from AWS Deep Learning Containers.
public IBuildImage getDlcPytorch120();
- Type: IBuildImage
PyTorch 1.2.0 GPU image from AWS Deep Learning Containers.
public IBuildImage getDlcPytorch131();
- Type: IBuildImage
PyTorch 1.3.1 GPU image from AWS Deep Learning Containers.
public IBuildImage getDlcPytorch140Inference();
- Type: IBuildImage
PyTorch 1.4.0 GPU inference image from AWS Deep Learning Containers.
public IBuildImage getDlcPytorch140Training();
- Type: IBuildImage
PyTorch 1.4.0 GPU training image from AWS Deep Learning Containers.
public IBuildImage getDlcPytorch150Inference();
- Type: IBuildImage
PyTorch 1.5.0 GPU inference image from AWS Deep Learning Containers.
public IBuildImage getDlcPytorch150Training();
- Type: IBuildImage
PyTorch 1.5.0 GPU training image from AWS Deep Learning Containers.
public IBuildImage getDlcTensorflow1140();
- Type: IBuildImage
Tensorflow 1.14.0 GPU image from AWS Deep Learning Containers.
public IBuildImage getDlcTensorflow1150();
- Type: IBuildImage
Tensorflow 1.15.0 GPU image from AWS Deep Learning Containers.
public IBuildImage getDlcTensorflow1152Inference();
- Type: IBuildImage
Tensorflow 1.15.2 GPU inference image from AWS Deep Learning Containers.
public IBuildImage getDlcTensorflow1152Training();
- Type: IBuildImage
Tensorflow 1.15.2 GPU training image from AWS Deep Learning Containers.
public IBuildImage getDlcTensorflow200();
- Type: IBuildImage
Tensorflow 2.0.0 GPU image from AWS Deep Learning Containers.
public IBuildImage getDlcTensorflow201();
- Type: IBuildImage
Tensorflow 2.0.1 GPU image from AWS Deep Learning Containers.
public IBuildImage getDlcTensorflow210Inference();
- Type: IBuildImage
Tensorflow 2.1.0 GPU inference image from AWS Deep Learning Containers.
public IBuildImage getDlcTensorflow210Training();
- Type: IBuildImage
Tensorflow 2.1.0 GPU training image from AWS Deep Learning Containers.
public IBuildImage getDlcTensorflow220Training();
- Type: IBuildImage
Tensorflow 2.2.0 GPU training image from AWS Deep Learning Containers.
Use the snippets below in your Git repositories or elsewhere to add a button that links to this package. The button will automatically update to light mode or dark mode based on whether the user's client has requested a light or dark theme.
[](https://constructs.dev/packages/aws-cdk-lib)
<a href="https://constructs.dev/packages/aws-cdk-lib"><img src="https://constructs.dev/badge?package=aws-cdk-lib" alt="View on Construct Hub"/></a>