UNPKG

aws-cdk-lib

Version:

Version 2 of the AWS Cloud Development Kit library

2 lines (1 loc) 6.19 kB
"use strict";var _a;Object.defineProperty(exports,"__esModule",{value:!0}),exports.LinuxGpuBuildImage=void 0;var jsiiDeprecationWarnings=()=>{var tmp=require("../../.warnings.jsii.js");return jsiiDeprecationWarnings=()=>tmp,tmp};const JSII_RTTI_SYMBOL_1=Symbol.for("jsii.rtti");var compute_type_1=()=>{var tmp=require("./compute-type");return compute_type_1=()=>tmp,tmp},environment_type_1=()=>{var tmp=require("./environment-type");return environment_type_1=()=>tmp,tmp},run_script_linux_build_spec_1=()=>{var tmp=require("./private/run-script-linux-build-spec");return run_script_linux_build_spec_1=()=>tmp,tmp},project_1=()=>{var tmp=require("./project");return project_1=()=>tmp,tmp},ecr=()=>{var tmp=require("../../aws-ecr");return ecr=()=>tmp,tmp},core=()=>{var tmp=require("../../core");return core=()=>tmp,tmp},region_info_1=()=>{var tmp=require("../../region-info");return region_info_1=()=>tmp,tmp};class LinuxGpuBuildImage{static awsDeepLearningContainersImage(repositoryName,tag,account){return new LinuxGpuBuildImage(repositoryName,tag,account)}static fromEcrRepository(repository,tag="latest"){try{jsiiDeprecationWarnings().aws_cdk_lib_aws_ecr_IRepository(repository)}catch(error){throw process.env.JSII_DEBUG!=="1"&&error.name==="DeprecationError"&&Error.captureStackTrace(error,this.fromEcrRepository),error}return new LinuxGpuBuildImage(repository.repositoryName,tag,repository.env.account)}constructor(repositoryName,tag,account){this.repositoryName=repositoryName,this.account=account,this.type=environment_type_1().EnvironmentType.LINUX_GPU_CONTAINER,this.defaultComputeType=compute_type_1().ComputeType.LARGE,this.imagePullPrincipalType=project_1().ImagePullPrincipalType.SERVICE_ROLE;const imageAccount=account??core().Lazy.string({produce:()=>{if(this._imageAccount===void 0)throw new(core()).UnscopedValidationError("Make sure this 'LinuxGpuBuildImage' is used in a CodeBuild Project construct");return this._imageAccount}});this.imageId=`${imageAccount}.dkr.ecr.${core().Aws.REGION}.${core().Aws.URL_SUFFIX}/${repositoryName}:${tag}`}bind(scope,project,_options){try{jsiiDeprecationWarnings().aws_cdk_lib_aws_codebuild_IProject(project),jsiiDeprecationWarnings().aws_cdk_lib_aws_codebuild_BuildImageBindOptions(_options)}catch(error){throw process.env.JSII_DEBUG!=="1"&&error.name==="DeprecationError"&&Error.captureStackTrace(error,this.bind),error}const account=this.account??core().Stack.of(scope).regionalFact(region_info_1().FactName.DLC_REPOSITORY_ACCOUNT);return ecr().Repository.fromRepositoryAttributes(scope,"AwsDlcRepositoryCodeBuild",{repositoryName:this.repositoryName,repositoryArn:ecr().Repository.arnForLocalRepository(this.repositoryName,scope,account)}).grantPull(project),this._imageAccount=account,{}}validate(buildEnvironment){try{jsiiDeprecationWarnings().aws_cdk_lib_aws_codebuild_BuildEnvironment(buildEnvironment)}catch(error){throw process.env.JSII_DEBUG!=="1"&&error.name==="DeprecationError"&&Error.captureStackTrace(error,this.validate),error}const ret=[];return buildEnvironment.computeType&&buildEnvironment.computeType!==compute_type_1().ComputeType.LARGE&&buildEnvironment.computeType!==compute_type_1().ComputeType.SMALL&&ret.push(`GPU images only support ComputeType '${compute_type_1().ComputeType.LARGE}' and '${compute_type_1().ComputeType.SMALL}' - '${buildEnvironment.computeType}' was given`),ret}runScriptBuildspec(entrypoint){return(0,run_script_linux_build_spec_1().runScriptLinuxBuildSpec)(entrypoint)}}exports.LinuxGpuBuildImage=LinuxGpuBuildImage,_a=JSII_RTTI_SYMBOL_1,LinuxGpuBuildImage[_a]={fqn:"aws-cdk-lib.aws_codebuild.LinuxGpuBuildImage",version:"2.185.0"},LinuxGpuBuildImage.DLC_TENSORFLOW_1_14_0=LinuxGpuBuildImage.awsDeepLearningContainersImage("tensorflow-training","1.14.0-gpu-py36-cu100-ubuntu16.04"),LinuxGpuBuildImage.DLC_TENSORFLOW_1_15_0=LinuxGpuBuildImage.awsDeepLearningContainersImage("tensorflow-training","1.15.0-gpu-py36-cu100-ubuntu18.04"),LinuxGpuBuildImage.DLC_TENSORFLOW_1_15_2_TRAINING=LinuxGpuBuildImage.awsDeepLearningContainersImage("tensorflow-training","1.15.2-gpu-py37-cu100-ubuntu18.04"),LinuxGpuBuildImage.DLC_TENSORFLOW_1_15_2_INFERENCE=LinuxGpuBuildImage.awsDeepLearningContainersImage("tensorflow-inference","1.15.2-gpu-py36-cu100-ubuntu18.04"),LinuxGpuBuildImage.DLC_TENSORFLOW_2_0_0=LinuxGpuBuildImage.awsDeepLearningContainersImage("tensorflow-training","2.0.0-gpu-py36-cu100-ubuntu18.04"),LinuxGpuBuildImage.DLC_TENSORFLOW_2_0_1=LinuxGpuBuildImage.awsDeepLearningContainersImage("tensorflow-training","2.0.1-gpu-py36-cu100-ubuntu18.04"),LinuxGpuBuildImage.DLC_TENSORFLOW_2_1_0_TRAINING=LinuxGpuBuildImage.awsDeepLearningContainersImage("tensorflow-training","2.1.0-gpu-py36-cu101-ubuntu18.04"),LinuxGpuBuildImage.DLC_TENSORFLOW_2_1_0_INFERENCE=LinuxGpuBuildImage.awsDeepLearningContainersImage("tensorflow-inference","2.1.0-gpu-py36-cu101-ubuntu18.04"),LinuxGpuBuildImage.DLC_TENSORFLOW_2_2_0_TRAINING=LinuxGpuBuildImage.awsDeepLearningContainersImage("tensorflow-training","2.2.0-gpu-py37-cu101-ubuntu18.04"),LinuxGpuBuildImage.DLC_PYTORCH_1_2_0=LinuxGpuBuildImage.awsDeepLearningContainersImage("pytorch-training","1.2.0-gpu-py36-cu100-ubuntu16.04"),LinuxGpuBuildImage.DLC_PYTORCH_1_3_1=LinuxGpuBuildImage.awsDeepLearningContainersImage("pytorch-training","1.3.1-gpu-py36-cu101-ubuntu16.04"),LinuxGpuBuildImage.DLC_PYTORCH_1_4_0_TRAINING=LinuxGpuBuildImage.awsDeepLearningContainersImage("pytorch-training","1.4.0-gpu-py36-cu101-ubuntu16.04"),LinuxGpuBuildImage.DLC_PYTORCH_1_4_0_INFERENCE=LinuxGpuBuildImage.awsDeepLearningContainersImage("pytorch-inference","1.4.0-gpu-py36-cu101-ubuntu16.04"),LinuxGpuBuildImage.DLC_PYTORCH_1_5_0_TRAINING=LinuxGpuBuildImage.awsDeepLearningContainersImage("pytorch-training","1.5.0-gpu-py36-cu101-ubuntu16.04"),LinuxGpuBuildImage.DLC_PYTORCH_1_5_0_INFERENCE=LinuxGpuBuildImage.awsDeepLearningContainersImage("pytorch-inference","1.5.0-gpu-py36-cu101-ubuntu16.04"),LinuxGpuBuildImage.DLC_MXNET_1_4_1=LinuxGpuBuildImage.awsDeepLearningContainersImage("mxnet-training","1.4.1-gpu-py36-cu100-ubuntu16.04"),LinuxGpuBuildImage.DLC_MXNET_1_6_0=LinuxGpuBuildImage.awsDeepLearningContainersImage("mxnet-training","1.6.0-gpu-py36-cu101-ubuntu16.04");