LinuxGpuBuildImage

class aws_cdk.aws_codebuild.LinuxGpuBuildImage(*args, **kwargs)

Bases: object

A CodeBuild GPU image running Linux.

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

See

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

Methods

bind(scope, project)

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

Parameters
Return type

BuildImageConfig

run_script_buildspec(entrypoint)

Make a buildspec to run the indicated script.

Parameters

entrypoint (str) –

Return type

BuildSpec

validate(*, build_image=None, compute_type=None, environment_variables=None, privileged=None)

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

Parameters
  • build_image (Optional[IBuildImage]) – The image used for the builds. Default: LinuxBuildImage.STANDARD_1_0

  • compute_type (Optional[ComputeType]) – The type of compute to use for this build. See the {@link ComputeType} enum for the possible values. Default: taken from {@link #buildImage#defaultComputeType}

  • environment_variables (Optional[Mapping[str, BuildEnvironmentVariable]]) – The environment variables that your builds can use.

  • privileged (Optional[bool]) – Indicates how the project builds Docker images. Specify true to enable running the Docker daemon inside a Docker container. This value must be set to true only if this build project will be used to build Docker images, and the specified build environment image is not one provided by AWS CodeBuild with Docker support. Otherwise, all associated builds that attempt to interact with the Docker daemon will fail. Default: false

Return type

List[str]

Attributes

DLC_MXNET_1_4_1 = <aws_cdk.aws_codebuild.LinuxGpuBuildImage object>
DLC_MXNET_1_6_0 = <aws_cdk.aws_codebuild.LinuxGpuBuildImage object>
DLC_PYTORCH_1_2_0 = <aws_cdk.aws_codebuild.LinuxGpuBuildImage object>
DLC_PYTORCH_1_3_1 = <aws_cdk.aws_codebuild.LinuxGpuBuildImage object>
DLC_PYTORCH_1_4_0_INFERENCE = <aws_cdk.aws_codebuild.LinuxGpuBuildImage object>
DLC_PYTORCH_1_4_0_TRAINING = <aws_cdk.aws_codebuild.LinuxGpuBuildImage object>
DLC_PYTORCH_1_5_0_INFERENCE = <aws_cdk.aws_codebuild.LinuxGpuBuildImage object>
DLC_PYTORCH_1_5_0_TRAINING = <aws_cdk.aws_codebuild.LinuxGpuBuildImage object>
DLC_TENSORFLOW_1_14_0 = <aws_cdk.aws_codebuild.LinuxGpuBuildImage object>
DLC_TENSORFLOW_1_15_0 = <aws_cdk.aws_codebuild.LinuxGpuBuildImage object>
DLC_TENSORFLOW_1_15_2_INFERENCE = <aws_cdk.aws_codebuild.LinuxGpuBuildImage object>
DLC_TENSORFLOW_1_15_2_TRAINING = <aws_cdk.aws_codebuild.LinuxGpuBuildImage object>
DLC_TENSORFLOW_2_0_0 = <aws_cdk.aws_codebuild.LinuxGpuBuildImage object>
DLC_TENSORFLOW_2_0_1 = <aws_cdk.aws_codebuild.LinuxGpuBuildImage object>
DLC_TENSORFLOW_2_1_0_INFERENCE = <aws_cdk.aws_codebuild.LinuxGpuBuildImage object>
DLC_TENSORFLOW_2_1_0_TRAINING = <aws_cdk.aws_codebuild.LinuxGpuBuildImage object>
DLC_TENSORFLOW_2_2_0_TRAINING = <aws_cdk.aws_codebuild.LinuxGpuBuildImage object>
default_compute_type

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

Return type

ComputeType

image_id

The Docker image identifier that the build environment uses.

Return type

str

image_pull_principal_type

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

Return type

Optional[ImagePullPrincipalType]

type

The type of build environment.

Return type

str

Static Methods

classmethod aws_deep_learning_containers_image(repository_name, tag, account=None)

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

Parameters
  • repository_name (str) – the name of the repository, for example “pytorch-inference”.

  • tag (str) – the tag of the image, for example “1.5.0-gpu-py36-cu101-ubuntu16.04”.

  • account (Optional[str]) – 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

See

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

Return type

IBuildImage