Class SageMaker.Builder

  • Enclosing class:
    SageMaker

    public static final class SageMaker.Builder
    extends java.lang.Object
    A Builder to construct a 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 executionRole is 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 containerImage is 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 endpointConfigName is 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 endpointName is 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 modelName is 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 instanceType is 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 the SageMakerClient.
        Parameters:
        sageMakerClient - the SageMakerClient
        Returns:
        the builder
      • optSageMakerRuntimeClient

        public SageMaker.Builder optSageMakerRuntimeClient​(software.amazon.awssdk.services.sagemakerruntime.SageMakerRuntimeClient sageMakerRuntimeClient)
        Sets the SageMakerRuntimeClient.
        Parameters:
        sageMakerRuntimeClient - the SageMakerRuntimeClient
        Returns:
        the builder
      • optS3Client

        public SageMaker.Builder optS3Client​(software.amazon.awssdk.services.s3.S3Client s3Client)
        Sets the S3Client.
        Parameters:
        s3Client - the S3Client
        Returns:
        the builder
      • optIamClient

        public SageMaker.Builder optIamClient​(software.amazon.awssdk.services.iam.IamClient iamClient)
        Sets the IamClient.
        Parameters:
        iamClient - the IamClient
        Returns:
        the builder