Class: AWSCDK::CodeBuild::LinuxGpuBuildImage

Inherits:
Jsii::Object
  • Object
show all
Includes:
IBindableBuildImage
Defined in:
code_build/linux_gpu_build_image.rb

Overview

A CodeBuild GPU image running Linux.

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

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(*args) ⇒ LinuxGpuBuildImage

Returns a new instance of LinuxGpuBuildImage.

Raises:

  • (NoMethodError)


13
14
15
# File 'code_build/linux_gpu_build_image.rb', line 13

def initialize(*args)
  raise NoMethodError, "aws-cdk-lib.aws_codebuild.LinuxGpuBuildImage does not have a visible constructor; use the provided factory methods"
end

Class Method Details

.aws_deep_learning_containers_image(repository_name, tag, account = nil) ⇒ AWSCDK::CodeBuild::IBuildImage

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

Parameters:

  • repository_name (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, nil) (defaults to: nil)

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

Returns:

See Also:



36
37
38
39
40
41
# File 'code_build/linux_gpu_build_image.rb', line 36

def self.aws_deep_learning_containers_image(repository_name, tag,  = nil)
  Jsii::Type.check_type(repository_name, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "repositoryName")
  Jsii::Type.check_type(tag, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "tag")
  Jsii::Type.check_type(, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "account") unless .nil?
  Jsii::Kernel.instance.call_static("aws-cdk-lib.aws_codebuild.LinuxGpuBuildImage", "awsDeepLearningContainersImage", [repository_name, tag, ])
end

.DLC_MXNET_1_4_1AWSCDK::CodeBuild::IBuildImage

MXNet 1.4.1 GPU image from AWS Deep Learning Containers.



61
62
63
# File 'code_build/linux_gpu_build_image.rb', line 61

def self.DLC_MXNET_1_4_1()
  Jsii::Kernel.instance.get_static("aws-cdk-lib.aws_codebuild.LinuxGpuBuildImage", "DLC_MXNET_1_4_1")
end

.DLC_MXNET_1_6_0AWSCDK::CodeBuild::IBuildImage

MXNet 1.6.0 GPU image from AWS Deep Learning Containers.



68
69
70
# File 'code_build/linux_gpu_build_image.rb', line 68

def self.DLC_MXNET_1_6_0()
  Jsii::Kernel.instance.get_static("aws-cdk-lib.aws_codebuild.LinuxGpuBuildImage", "DLC_MXNET_1_6_0")
end

.DLC_PYTORCH_1_2_0AWSCDK::CodeBuild::IBuildImage

PyTorch 1.2.0 GPU image from AWS Deep Learning Containers.



75
76
77
# File 'code_build/linux_gpu_build_image.rb', line 75

def self.DLC_PYTORCH_1_2_0()
  Jsii::Kernel.instance.get_static("aws-cdk-lib.aws_codebuild.LinuxGpuBuildImage", "DLC_PYTORCH_1_2_0")
end

.DLC_PYTORCH_1_3_1AWSCDK::CodeBuild::IBuildImage

PyTorch 1.3.1 GPU image from AWS Deep Learning Containers.



82
83
84
# File 'code_build/linux_gpu_build_image.rb', line 82

def self.DLC_PYTORCH_1_3_1()
  Jsii::Kernel.instance.get_static("aws-cdk-lib.aws_codebuild.LinuxGpuBuildImage", "DLC_PYTORCH_1_3_1")
end

.DLC_PYTORCH_1_4_0_INFERENCEAWSCDK::CodeBuild::IBuildImage

PyTorch 1.4.0 GPU inference image from AWS Deep Learning Containers.



89
90
91
# File 'code_build/linux_gpu_build_image.rb', line 89

def self.DLC_PYTORCH_1_4_0_INFERENCE()
  Jsii::Kernel.instance.get_static("aws-cdk-lib.aws_codebuild.LinuxGpuBuildImage", "DLC_PYTORCH_1_4_0_INFERENCE")
end

.DLC_PYTORCH_1_4_0_TRAININGAWSCDK::CodeBuild::IBuildImage

PyTorch 1.4.0 GPU training image from AWS Deep Learning Containers.



96
97
98
# File 'code_build/linux_gpu_build_image.rb', line 96

def self.DLC_PYTORCH_1_4_0_TRAINING()
  Jsii::Kernel.instance.get_static("aws-cdk-lib.aws_codebuild.LinuxGpuBuildImage", "DLC_PYTORCH_1_4_0_TRAINING")
end

.DLC_PYTORCH_1_5_0_INFERENCEAWSCDK::CodeBuild::IBuildImage

PyTorch 1.5.0 GPU inference image from AWS Deep Learning Containers.



103
104
105
# File 'code_build/linux_gpu_build_image.rb', line 103

def self.DLC_PYTORCH_1_5_0_INFERENCE()
  Jsii::Kernel.instance.get_static("aws-cdk-lib.aws_codebuild.LinuxGpuBuildImage", "DLC_PYTORCH_1_5_0_INFERENCE")
end

.DLC_PYTORCH_1_5_0_TRAININGAWSCDK::CodeBuild::IBuildImage

PyTorch 1.5.0 GPU training image from AWS Deep Learning Containers.



110
111
112
# File 'code_build/linux_gpu_build_image.rb', line 110

def self.DLC_PYTORCH_1_5_0_TRAINING()
  Jsii::Kernel.instance.get_static("aws-cdk-lib.aws_codebuild.LinuxGpuBuildImage", "DLC_PYTORCH_1_5_0_TRAINING")
end

.DLC_TENSORFLOW_1_14_0AWSCDK::CodeBuild::IBuildImage

Tensorflow 1.14.0 GPU image from AWS Deep Learning Containers.



117
118
119
# File 'code_build/linux_gpu_build_image.rb', line 117

def self.DLC_TENSORFLOW_1_14_0()
  Jsii::Kernel.instance.get_static("aws-cdk-lib.aws_codebuild.LinuxGpuBuildImage", "DLC_TENSORFLOW_1_14_0")
end

.DLC_TENSORFLOW_1_15_0AWSCDK::CodeBuild::IBuildImage

Tensorflow 1.15.0 GPU image from AWS Deep Learning Containers.



124
125
126
# File 'code_build/linux_gpu_build_image.rb', line 124

def self.DLC_TENSORFLOW_1_15_0()
  Jsii::Kernel.instance.get_static("aws-cdk-lib.aws_codebuild.LinuxGpuBuildImage", "DLC_TENSORFLOW_1_15_0")
end

.DLC_TENSORFLOW_1_15_2_INFERENCEAWSCDK::CodeBuild::IBuildImage

Tensorflow 1.15.2 GPU inference image from AWS Deep Learning Containers.



131
132
133
# File 'code_build/linux_gpu_build_image.rb', line 131

def self.DLC_TENSORFLOW_1_15_2_INFERENCE()
  Jsii::Kernel.instance.get_static("aws-cdk-lib.aws_codebuild.LinuxGpuBuildImage", "DLC_TENSORFLOW_1_15_2_INFERENCE")
end

.DLC_TENSORFLOW_1_15_2_TRAININGAWSCDK::CodeBuild::IBuildImage

Tensorflow 1.15.2 GPU training image from AWS Deep Learning Containers.



138
139
140
# File 'code_build/linux_gpu_build_image.rb', line 138

def self.DLC_TENSORFLOW_1_15_2_TRAINING()
  Jsii::Kernel.instance.get_static("aws-cdk-lib.aws_codebuild.LinuxGpuBuildImage", "DLC_TENSORFLOW_1_15_2_TRAINING")
end

.DLC_TENSORFLOW_2_0_0AWSCDK::CodeBuild::IBuildImage

Tensorflow 2.0.0 GPU image from AWS Deep Learning Containers.



145
146
147
# File 'code_build/linux_gpu_build_image.rb', line 145

def self.DLC_TENSORFLOW_2_0_0()
  Jsii::Kernel.instance.get_static("aws-cdk-lib.aws_codebuild.LinuxGpuBuildImage", "DLC_TENSORFLOW_2_0_0")
end

.DLC_TENSORFLOW_2_0_1AWSCDK::CodeBuild::IBuildImage

Tensorflow 2.0.1 GPU image from AWS Deep Learning Containers.



152
153
154
# File 'code_build/linux_gpu_build_image.rb', line 152

def self.DLC_TENSORFLOW_2_0_1()
  Jsii::Kernel.instance.get_static("aws-cdk-lib.aws_codebuild.LinuxGpuBuildImage", "DLC_TENSORFLOW_2_0_1")
end

.DLC_TENSORFLOW_2_1_0_INFERENCEAWSCDK::CodeBuild::IBuildImage

Tensorflow 2.1.0 GPU inference image from AWS Deep Learning Containers.



159
160
161
# File 'code_build/linux_gpu_build_image.rb', line 159

def self.DLC_TENSORFLOW_2_1_0_INFERENCE()
  Jsii::Kernel.instance.get_static("aws-cdk-lib.aws_codebuild.LinuxGpuBuildImage", "DLC_TENSORFLOW_2_1_0_INFERENCE")
end

.DLC_TENSORFLOW_2_1_0_TRAININGAWSCDK::CodeBuild::IBuildImage

Tensorflow 2.1.0 GPU training image from AWS Deep Learning Containers.



166
167
168
# File 'code_build/linux_gpu_build_image.rb', line 166

def self.DLC_TENSORFLOW_2_1_0_TRAINING()
  Jsii::Kernel.instance.get_static("aws-cdk-lib.aws_codebuild.LinuxGpuBuildImage", "DLC_TENSORFLOW_2_1_0_TRAINING")
end

.DLC_TENSORFLOW_2_2_0_TRAININGAWSCDK::CodeBuild::IBuildImage

Tensorflow 2.2.0 GPU training image from AWS Deep Learning Containers.



173
174
175
# File 'code_build/linux_gpu_build_image.rb', line 173

def self.DLC_TENSORFLOW_2_2_0_TRAINING()
  Jsii::Kernel.instance.get_static("aws-cdk-lib.aws_codebuild.LinuxGpuBuildImage", "DLC_TENSORFLOW_2_2_0_TRAINING")
end

.from_ecr_repository(repository, tag = nil) ⇒ AWSCDK::CodeBuild::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.

Parameters:

  • repository (AWSCDK::ECR::IRepository)

    The ECR repository.

  • tag (String, nil) (defaults to: nil)

    Image tag (default "latest").

Returns:

See Also:



52
53
54
55
56
# File 'code_build/linux_gpu_build_image.rb', line 52

def self.from_ecr_repository(repository, tag = nil)
  Jsii::Type.check_type(repository, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfZWNyLklSZXBvc2l0b3J5In0=")), "repository")
  Jsii::Type.check_type(tag, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "tag") unless tag.nil?
  Jsii::Kernel.instance.call_static("aws-cdk-lib.aws_codebuild.LinuxGpuBuildImage", "fromEcrRepository", [repository, tag])
end

.jsii_overridable_methodsObject



17
18
19
20
21
22
23
24
25
26
27
# File 'code_build/linux_gpu_build_image.rb', line 17

def self.jsii_overridable_methods
  {
    :default_compute_type => { kind: :property, name: "defaultComputeType", is_optional: false },
    :image_id => { kind: :property, name: "imageId", is_optional: false },
    :type => { kind: :property, name: "type", is_optional: false },
    :image_pull_principal_type => { kind: :property, name: "imagePullPrincipalType", is_optional: true },
    :bind => { kind: :method, name: "bind", is_optional: false },
    :run_script_buildspec => { kind: :method, name: "runScriptBuildspec", is_optional: false },
    :validate => { kind: :method, name: "validate", is_optional: false },
  }
end

Instance Method Details

#bind(scope, project, _options) ⇒ AWSCDK::CodeBuild::BuildImageConfig

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

Parameters:

Returns:



211
212
213
214
215
216
217
# File 'code_build/linux_gpu_build_image.rb', line 211

def bind(scope, project, _options)
  Jsii::Type.check_type(scope, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJjb25zdHJ1Y3RzLkNvbnN0cnVjdCJ9")), "scope")
  Jsii::Type.check_type(project, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfY29kZWJ1aWxkLklQcm9qZWN0In0=")), "project")
  _options = _options.is_a?(Hash) ? ::AWSCDK::CodeBuild::BuildImageBindOptions.new(**_options.transform_keys(&:to_sym)) : _options
  Jsii::Type.check_type(_options, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfY29kZWJ1aWxkLkJ1aWxkSW1hZ2VCaW5kT3B0aW9ucyJ9")), "_options")
  jsii_call_method("bind", [scope, project, _options])
end

#default_compute_typeAWSCDK::CodeBuild::ComputeType

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



180
181
182
# File 'code_build/linux_gpu_build_image.rb', line 180

def default_compute_type()
  jsii_get_property("defaultComputeType")
end

#image_idString

The Docker image identifier that the build environment uses.

Returns:

  • (String)


187
188
189
# File 'code_build/linux_gpu_build_image.rb', line 187

def image_id()
  jsii_get_property("imageId")
end

#image_pull_principal_typeAWSCDK::CodeBuild::ImagePullPrincipalType?

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



201
202
203
# File 'code_build/linux_gpu_build_image.rb', line 201

def image_pull_principal_type()
  jsii_get_property("imagePullPrincipalType")
end

#run_script_buildspec(entrypoint) ⇒ AWSCDK::CodeBuild::BuildSpec

Make a buildspec to run the indicated script.

Parameters:

  • entrypoint (String)

Returns:



223
224
225
226
# File 'code_build/linux_gpu_build_image.rb', line 223

def run_script_buildspec(entrypoint)
  Jsii::Type.check_type(entrypoint, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "entrypoint")
  jsii_call_method("runScriptBuildspec", [entrypoint])
end

#typeString

The type of build environment.

Returns:

  • (String)


194
195
196
# File 'code_build/linux_gpu_build_image.rb', line 194

def type()
  jsii_get_property("type")
end

#validate(build_environment) ⇒ Array<String>

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

Parameters:

Returns:

  • (Array<String>)


232
233
234
235
236
# File 'code_build/linux_gpu_build_image.rb', line 232

def validate(build_environment)
  build_environment = build_environment.is_a?(Hash) ? ::AWSCDK::CodeBuild::BuildEnvironment.new(**build_environment.transform_keys(&:to_sym)) : build_environment
  Jsii::Type.check_type(build_environment, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfY29kZWJ1aWxkLkJ1aWxkRW52aXJvbm1lbnQifQ==")), "buildEnvironment")
  jsii_call_method("validate", [build_environment])
end