Package ai.djl.aws.sagemaker
Class SageMaker.Builder
- java.lang.Object
-
- ai.djl.aws.sagemaker.SageMaker.Builder
-
- Enclosing class:
- SageMaker
public static final class SageMaker.Builder extends java.lang.ObjectA Builder to construct aSageMaker.
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description SageMakerbuild()Builds theSageMakerwith the provided data.SageMaker.BuilderoptBucketName(java.lang.String bucketName)Sets the optional S3 bucket name to store the model.SageMaker.BuilderoptBucketPath(java.lang.String bucketPath)Sets the optional s3 path prefix where the model to be stored.SageMaker.BuilderoptContainerImage(java.lang.String containerImage)Sets the optional ECR image to deploy on SageMaker endpoint.SageMaker.BuilderoptEndpointConfigName(java.lang.String endpointConfigName)Sets the optional endpoint configuration name to create.SageMaker.BuilderoptEndpointName(java.lang.String endpointName)Sets the optional endpoint name to create.SageMaker.BuilderoptExecutionRole(java.lang.String executionRole)Sets the optional role to execute the SageMaker endpoint.SageMaker.BuilderoptIamClient(software.amazon.awssdk.services.iam.IamClient iamClient)Sets theIamClient.SageMaker.BuilderoptInstanceCount(int instanceCount)Sets the number of instance to launch, default is 1.SageMaker.BuilderoptInstanceType(java.lang.String instanceType)Sets the optional instance type to launch the endpoint.SageMaker.BuilderoptModelName(java.lang.String modelName)Sets the optional model name to create.SageMaker.BuilderoptS3Client(software.amazon.awssdk.services.s3.S3Client s3Client)Sets theS3Client.SageMaker.BuilderoptSageMakerClient(software.amazon.awssdk.services.sagemaker.SageMakerClient sageMakerClient)Sets theSageMakerClient.SageMaker.BuilderoptSageMakerRuntimeClient(software.amazon.awssdk.services.sagemakerruntime.SageMakerRuntimeClient sageMakerRuntimeClient)Sets theSageMakerRuntimeClient.SageMaker.BuildersetModel(ai.djl.Model model)Sets the model to be deployed on Amazon SageMaker.
-
-
-
Method Detail
-
setModel
public SageMaker.Builder setModel(ai.djl.Model model)
Sets the model to be deployed on Amazon SageMaker.- Parameters:
model- the model to be deployed on Amazon SageMaker- Returns:
- the builder
-
optBucketName
public SageMaker.Builder optBucketName(java.lang.String bucketName)
Sets the optional S3 bucket name to store the model.If S3 bucket name is not provided, a random bucket with "djl-sm-" prefix will be created
- Parameters:
bucketName- the S3 bucket name to store the model- Returns:
- the builder
-
optBucketPath
public SageMaker.Builder optBucketPath(java.lang.String bucketPath)
Sets the optional s3 path prefix where the model to be stored.- Parameters:
bucketPath- the s3 path prefix- Returns:
- the builder
-
optExecutionRole
public SageMaker.Builder optExecutionRole(java.lang.String executionRole)
Sets the optional role to execute the SageMaker endpoint.If
executionRoleis not set, current aws role will be used. If no current role found, a runtime exception will thrown.- Parameters:
executionRole- the role to execute the SageMaker endpoint- Returns:
- the builder
-
optContainerImage
public SageMaker.Builder optContainerImage(java.lang.String containerImage)
Sets the optional ECR image to deploy on SageMaker endpoint.If
containerImageis not set, current container image will be used. If the code is not executed in an container, a runtime exception will thrown.- Parameters:
containerImage- ECR image to deploy on SageMaker endpoint- Returns:
- the builder
-
optEndpointConfigName
public SageMaker.Builder optEndpointConfigName(java.lang.String endpointConfigName)
Sets the optional endpoint configuration name to create.If
endpointConfigNameis not set, model name will be used as configuration name.- Parameters:
endpointConfigName- the endpoint configuration name to create- Returns:
- the builder
-
optEndpointName
public SageMaker.Builder optEndpointName(java.lang.String endpointName)
Sets the optional endpoint name to create.If
endpointNameis not set, model name will be used as endpoint name.- Parameters:
endpointName- the endpoint name to create- Returns:
- the builder
-
optModelName
public SageMaker.Builder optModelName(java.lang.String modelName)
Sets the optional model name to create.If
modelNameis not set, model name will be used as model name.- Parameters:
modelName- the model name to create- Returns:
- the builder
-
optInstanceType
public SageMaker.Builder optInstanceType(java.lang.String instanceType)
Sets the optional instance type to launch the endpoint.If
instanceTypeis not set, "ml.m4.xlarge" will be used.- Parameters:
instanceType- the instance type to launch the endpoint- Returns:
- the builder
-
optInstanceCount
public SageMaker.Builder optInstanceCount(int instanceCount)
Sets the number of instance to launch, default is 1.- Parameters:
instanceCount- the number of instance to launch, default is 1- Returns:
- the builder
-
optSageMakerClient
public SageMaker.Builder optSageMakerClient(software.amazon.awssdk.services.sagemaker.SageMakerClient sageMakerClient)
Sets theSageMakerClient.- Parameters:
sageMakerClient- theSageMakerClient- Returns:
- the builder
-
optSageMakerRuntimeClient
public SageMaker.Builder optSageMakerRuntimeClient(software.amazon.awssdk.services.sagemakerruntime.SageMakerRuntimeClient sageMakerRuntimeClient)
Sets theSageMakerRuntimeClient.- Parameters:
sageMakerRuntimeClient- theSageMakerRuntimeClient- Returns:
- the builder
-
optS3Client
public SageMaker.Builder optS3Client(software.amazon.awssdk.services.s3.S3Client s3Client)
Sets theS3Client.- Parameters:
s3Client- theS3Client- Returns:
- the builder
-
optIamClient
public SageMaker.Builder optIamClient(software.amazon.awssdk.services.iam.IamClient iamClient)
Sets theIamClient.- Parameters:
iamClient- theIamClient- Returns:
- the builder
-
-