Amazon SageMaker Service

2019/03/08 - Amazon SageMaker Service - 7 updated api methods

Changes  Update sagemaker client to latest version

CreateCompilationJob (updated) Link ¶
Changes (request)
{'OutputConfig': {'TargetDevice': {'rk3288', 'rk3399'}}}

Starts a model compilation job. After the model has been compiled, Amazon SageMaker saves the resulting model artifacts to an Amazon Simple Storage Service (Amazon S3) bucket that you specify.

If you choose to host your model using Amazon SageMaker hosting services, you can use the resulting model artifacts as part of the model. You can also use the artifacts with AWS IoT Greengrass. In that case, deploy them as an ML resource.

In the request body, you provide the following:

  • A name for the compilation job

  • Information about the input model artifacts

  • The output location for the compiled model and the device (target) that the model runs on

  • The Amazon Resource Name (ARN) of the IAM role that Amazon SageMaker assumes to perform the model compilation job

You can also provide a Tag to track the model compilation job's resource use and costs. The response body contains the CompilationJobArn for the compiled job.

To stop a model compilation job, use StopCompilationJob. To get information about a particular model compilation job, use DescribeCompilationJob. To get information about multiple model compilation jobs, use ListCompilationJobs.

See also: AWS API Documentation

Request Syntax

client.create_compilation_job(
    CompilationJobName='string',
    RoleArn='string',
    InputConfig={
        'S3Uri': 'string',
        'DataInputConfig': 'string',
        'Framework': 'TENSORFLOW'|'MXNET'|'ONNX'|'PYTORCH'|'XGBOOST'
    },
    OutputConfig={
        'S3OutputLocation': 'string',
        'TargetDevice': 'ml_m4'|'ml_m5'|'ml_c4'|'ml_c5'|'ml_p2'|'ml_p3'|'jetson_tx1'|'jetson_tx2'|'rasp3b'|'deeplens'|'rk3399'|'rk3288'
    },
    StoppingCondition={
        'MaxRuntimeInSeconds': 123
    }
)
type CompilationJobName

string

param CompilationJobName

[REQUIRED]

A name for the model compilation job. The name must be unique within the AWS Region and within your AWS account.

type RoleArn

string

param RoleArn

[REQUIRED]

The Amazon Resource Name (ARN) of an IIAMAM role that enables Amazon SageMaker to perform tasks on your behalf.

During model compilation, Amazon SageMaker needs your permission to:

  • Read input data from an S3 bucket

  • Write model artifacts to an S3 bucket

  • Write logs to Amazon CloudWatch Logs

  • Publish metrics to Amazon CloudWatch

You grant permissions for all of these tasks to an IAM role. To pass this role to Amazon SageMaker, the caller of this API must have the iam:PassRole permission. For more information, see Amazon SageMaker Roles.

type InputConfig

dict

param InputConfig

[REQUIRED]

Provides information about the location of input model artifacts, the name and shape of the expected data inputs, and the framework in which the model was trained.

  • S3Uri (string) -- [REQUIRED]

    The S3 path where the model artifacts, which result from model training, are stored. This path must point to a single gzip compressed tar archive (.tar.gz suffix).

  • DataInputConfig (string) -- [REQUIRED]

    Specifies the name and shape of the expected data inputs for your trained model with a JSON dictionary form. The data inputs are InputConfig$Framework specific.

    • TensorFlow : You must specify the name and shape (NHWC format) of the expected data inputs using a dictionary format for your trained model. The dictionary formats required for the console and CLI are different.

      • Examples for one input:

        • If using the console, {"input":[1,1024,1024,3]}

        • If using the CLI, {\"input\":[1,1024,1024,3]}

      • Examples for two inputs:

        • If using the console, {"data1": [1,28,28,1], "data2":[1,28,28,1]}

        • If using the CLI, {\"data1\": [1,28,28,1], \"data2\":[1,28,28,1]}

    • MXNET/ONNX : You must specify the name and shape (NCHW format) of the expected data inputs in order using a dictionary format for your trained model. The dictionary formats required for the console and CLI are different.

      • Examples for one input:

        • If using the console, {"data":[1,3,1024,1024]}

        • If using the CLI, {\"data\":[1,3,1024,1024]}

      • Examples for two inputs:

        • If using the console, {"var1": [1,1,28,28], "var2":[1,1,28,28]}

        • If using the CLI, {\"var1\": [1,1,28,28], \"var2\":[1,1,28,28]}

    • PyTorch : You can either specify the name and shape (NCHW format) of expected data inputs in order using a dictionary format for your trained model or you can specify the shape only using a list format. The dictionary formats required for the console and CLI are different. The list formats for the console and CLI are the same.

      • Examples for one input in dictionary format:

        • If using the console, {"input0":[1,3,224,224]}

        • If using the CLI, {\"input0\":[1,3,224,224]}

      • Example for one input in list format: [[1,3,224,224]]

      • Examples for two inputs in dictionary format:

        • If using the console, {"input0":[1,3,224,224], "input1":[1,3,224,224]}

        • If using the CLI, {\"input0\":[1,3,224,224], \"input1\":[1,3,224,224]}

      • Example for two inputs in list format: [[1,3,224,224], [1,3,224,224]]

    • XGBOOST : input data name and shape are not needed.

  • Framework (string) -- [REQUIRED]

    Identifies the framework in which the model was trained. For example: TENSORFLOW.

type OutputConfig

dict

param OutputConfig

[REQUIRED]

Provides information about the output location for the compiled model and the target device the model runs on.

  • S3OutputLocation (string) -- [REQUIRED]

    Identifies the S3 path where you want Amazon SageMaker to store the model artifacts. For example, s3://bucket-name/key-name-prefix.

  • TargetDevice (string) -- [REQUIRED]

    Identifies the device that you want to run your model on after it has been compiled. For example: ml_c5.

type StoppingCondition

dict

param StoppingCondition

[REQUIRED]

The duration allowed for model compilation.

  • MaxRuntimeInSeconds (integer) --

    The maximum length of time, in seconds, that the training job can run. If model training does not complete during this time, Amazon SageMaker ends the job. If value is not specified, default value is 1 day. Maximum value is 28 days.

rtype

dict

returns

Response Syntax

{
    'CompilationJobArn': 'string'
}

Response Structure

  • (dict) --

    • CompilationJobArn (string) --

      If the action is successful, the service sends back an HTTP 200 response. Amazon SageMaker returns the following data in JSON format:

      • CompilationJobArn : The Amazon Resource Name (ARN) of the compiled job.

CreateNotebookInstance (updated) Link ¶
Changes (request)
{'RootAccess': 'Enabled | Disabled'}

Creates an Amazon SageMaker notebook instance. A notebook instance is a machine learning (ML) compute instance running on a Jupyter notebook.

In a CreateNotebookInstance request, specify the type of ML compute instance that you want to run. Amazon SageMaker launches the instance, installs common libraries that you can use to explore datasets for model training, and attaches an ML storage volume to the notebook instance.

Amazon SageMaker also provides a set of example notebooks. Each notebook demonstrates how to use Amazon SageMaker with a specific algorithm or with a machine learning framework.

After receiving the request, Amazon SageMaker does the following:

  • Creates a network interface in the Amazon SageMaker VPC.

  • (Option) If you specified SubnetId , Amazon SageMaker creates a network interface in your own VPC, which is inferred from the subnet ID that you provide in the input. When creating this network interface, Amazon SageMaker attaches the security group that you specified in the request to the network interface that it creates in your VPC.

  • Launches an EC2 instance of the type specified in the request in the Amazon SageMaker VPC. If you specified SubnetId of your VPC, Amazon SageMaker specifies both network interfaces when launching this instance. This enables inbound traffic from your own VPC to the notebook instance, assuming that the security groups allow it.

After creating the notebook instance, Amazon SageMaker returns its Amazon Resource Name (ARN).

After Amazon SageMaker creates the notebook instance, you can connect to the Jupyter server and work in Jupyter notebooks. For example, you can write code to explore a dataset that you can use for model training, train a model, host models by creating Amazon SageMaker endpoints, and validate hosted models.

For more information, see How It Works.

See also: AWS API Documentation

Request Syntax

client.create_notebook_instance(
    NotebookInstanceName='string',
    InstanceType='ml.t2.medium'|'ml.t2.large'|'ml.t2.xlarge'|'ml.t2.2xlarge'|'ml.t3.medium'|'ml.t3.large'|'ml.t3.xlarge'|'ml.t3.2xlarge'|'ml.m4.xlarge'|'ml.m4.2xlarge'|'ml.m4.4xlarge'|'ml.m4.10xlarge'|'ml.m4.16xlarge'|'ml.m5.xlarge'|'ml.m5.2xlarge'|'ml.m5.4xlarge'|'ml.m5.12xlarge'|'ml.m5.24xlarge'|'ml.c4.xlarge'|'ml.c4.2xlarge'|'ml.c4.4xlarge'|'ml.c4.8xlarge'|'ml.c5.xlarge'|'ml.c5.2xlarge'|'ml.c5.4xlarge'|'ml.c5.9xlarge'|'ml.c5.18xlarge'|'ml.c5d.xlarge'|'ml.c5d.2xlarge'|'ml.c5d.4xlarge'|'ml.c5d.9xlarge'|'ml.c5d.18xlarge'|'ml.p2.xlarge'|'ml.p2.8xlarge'|'ml.p2.16xlarge'|'ml.p3.2xlarge'|'ml.p3.8xlarge'|'ml.p3.16xlarge',
    SubnetId='string',
    SecurityGroupIds=[
        'string',
    ],
    RoleArn='string',
    KmsKeyId='string',
    Tags=[
        {
            'Key': 'string',
            'Value': 'string'
        },
    ],
    LifecycleConfigName='string',
    DirectInternetAccess='Enabled'|'Disabled',
    VolumeSizeInGB=123,
    AcceleratorTypes=[
        'ml.eia1.medium'|'ml.eia1.large'|'ml.eia1.xlarge',
    ],
    DefaultCodeRepository='string',
    AdditionalCodeRepositories=[
        'string',
    ],
    RootAccess='Enabled'|'Disabled'
)
type NotebookInstanceName

string

param NotebookInstanceName

[REQUIRED]

The name of the new notebook instance.

type InstanceType

string

param InstanceType

[REQUIRED]

The type of ML compute instance to launch for the notebook instance.

type SubnetId

string

param SubnetId

The ID of the subnet in a VPC to which you would like to have a connectivity from your ML compute instance.

type SecurityGroupIds

list

param SecurityGroupIds

The VPC security group IDs, in the form sg-xxxxxxxx. The security groups must be for the same VPC as specified in the subnet.

  • (string) --

type RoleArn

string

param RoleArn

[REQUIRED]

When you send any requests to AWS resources from the notebook instance, Amazon SageMaker assumes this role to perform tasks on your behalf. You must grant this role necessary permissions so Amazon SageMaker can perform these tasks. The policy must allow the Amazon SageMaker service principal (sagemaker.amazonaws.com) permissions to assume this role. For more information, see Amazon SageMaker Roles.

Note

To be able to pass this role to Amazon SageMaker, the caller of this API must have the iam:PassRole permission.

type KmsKeyId

string

param KmsKeyId

If you provide a AWS KMS key ID, Amazon SageMaker uses it to encrypt data at rest on the ML storage volume that is attached to your notebook instance. The KMS key you provide must be enabled. For information, see Enabling and Disabling Keys in the AWS Key Management Service Developer Guide .

type Tags

list

param Tags

A list of tags to associate with the notebook instance. You can add tags later by using the CreateTags API.

  • (dict) --

    Describes a tag.

    • Key (string) -- [REQUIRED]

      The tag key.

    • Value (string) -- [REQUIRED]

      The tag value.

type LifecycleConfigName

string

param LifecycleConfigName

The name of a lifecycle configuration to associate with the notebook instance. For information about lifestyle configurations, see Step 2.1: (Optional) Customize a Notebook Instance.

type DirectInternetAccess

string

param DirectInternetAccess

Sets whether Amazon SageMaker provides internet access to the notebook instance. If you set this to Disabled this notebook instance will be able to access resources only in your VPC, and will not be able to connect to Amazon SageMaker training and endpoint services unless your configure a NAT Gateway in your VPC.

For more information, see Notebook Instances Are Internet-Enabled by Default. You can set the value of this parameter to Disabled only if you set a value for the SubnetId parameter.

type VolumeSizeInGB

integer

param VolumeSizeInGB

The size, in GB, of the ML storage volume to attach to the notebook instance. The default value is 5 GB.

type AcceleratorTypes

list

param AcceleratorTypes

A list of Elastic Inference (EI) instance types to associate with this notebook instance. Currently, only one instance type can be associated with a notebook instance. For more information, see Using Elastic Inference in Amazon SageMaker.

  • (string) --

type DefaultCodeRepository

string

param DefaultCodeRepository

A Git repository to associate with the notebook instance as its default code repository. This can be either the name of a Git repository stored as a resource in your account, or the URL of a Git repository in AWS CodeCommit or in any other Git repository. When you open a notebook instance, it opens in the directory that contains this repository. For more information, see Associating Git Repositories with Amazon SageMaker Notebook Instances.

type AdditionalCodeRepositories

list

param AdditionalCodeRepositories

An array of up to three Git repositories to associate with the notebook instance. These can be either the names of Git repositories stored as resources in your account, or the URL of Git repositories in AWS CodeCommit or in any other Git repository. These repositories are cloned at the same level as the default repository of your notebook instance. For more information, see Associating Git Repositories with Amazon SageMaker Notebook Instances.

  • (string) --

type RootAccess

string

param RootAccess

Whether root access is enabled or disabled for users of the notebook instance. The default value is Enabled .

Note

Lifecycle configurations need root access to be able to set up a notebook instance. Because of this, lifecycle configurations associated with a notebook instance always run with root access even if you disable root access for users.

rtype

dict

returns

Response Syntax

{
    'NotebookInstanceArn': 'string'
}

Response Structure

  • (dict) --

    • NotebookInstanceArn (string) --

      The Amazon Resource Name (ARN) of the notebook instance.

DescribeCompilationJob (updated) Link ¶
Changes (response)
{'OutputConfig': {'TargetDevice': {'rk3288', 'rk3399'}}}

Returns information about a model compilation job.

To create a model compilation job, use CreateCompilationJob. To get information about multiple model compilation jobs, use ListCompilationJobs.

See also: AWS API Documentation

Request Syntax

client.describe_compilation_job(
    CompilationJobName='string'
)
type CompilationJobName

string

param CompilationJobName

[REQUIRED]

The name of the model compilation job that you want information about.

rtype

dict

returns

Response Syntax

{
    'CompilationJobName': 'string',
    'CompilationJobArn': 'string',
    'CompilationJobStatus': 'INPROGRESS'|'COMPLETED'|'FAILED'|'STARTING'|'STOPPING'|'STOPPED',
    'CompilationStartTime': datetime(2015, 1, 1),
    'CompilationEndTime': datetime(2015, 1, 1),
    'StoppingCondition': {
        'MaxRuntimeInSeconds': 123
    },
    'CreationTime': datetime(2015, 1, 1),
    'LastModifiedTime': datetime(2015, 1, 1),
    'FailureReason': 'string',
    'ModelArtifacts': {
        'S3ModelArtifacts': 'string'
    },
    'RoleArn': 'string',
    'InputConfig': {
        'S3Uri': 'string',
        'DataInputConfig': 'string',
        'Framework': 'TENSORFLOW'|'MXNET'|'ONNX'|'PYTORCH'|'XGBOOST'
    },
    'OutputConfig': {
        'S3OutputLocation': 'string',
        'TargetDevice': 'ml_m4'|'ml_m5'|'ml_c4'|'ml_c5'|'ml_p2'|'ml_p3'|'jetson_tx1'|'jetson_tx2'|'rasp3b'|'deeplens'|'rk3399'|'rk3288'
    }
}

Response Structure

  • (dict) --

    • CompilationJobName (string) --

      The name of the model compilation job.

    • CompilationJobArn (string) --

      The Amazon Resource Name (ARN) of an IAM role that Amazon SageMaker assumes to perform the model compilation job.

    • CompilationJobStatus (string) --

      The status of the model compilation job.

    • CompilationStartTime (datetime) --

      The time when the model compilation job started the CompilationJob instances.

      You are billed for the time between this timestamp and the timestamp in the DescribeCompilationJobResponse$CompilationEndTime field. In Amazon CloudWatch Logs, the start time might be later than this time. That's because it takes time to download the compilation job, which depends on the size of the compilation job container.

    • CompilationEndTime (datetime) --

      The time when the model compilation job on a compilation job instance ended. For a successful or stopped job, this is when the job's model artifacts have finished uploading. For a failed job, this is when Amazon SageMaker detected that the job failed.

    • StoppingCondition (dict) --

      The duration allowed for model compilation.

      • MaxRuntimeInSeconds (integer) --

        The maximum length of time, in seconds, that the training job can run. If model training does not complete during this time, Amazon SageMaker ends the job. If value is not specified, default value is 1 day. Maximum value is 28 days.

    • CreationTime (datetime) --

      The time that the model compilation job was created.

    • LastModifiedTime (datetime) --

      The time that the status of the model compilation job was last modified.

    • FailureReason (string) --

      If a model compilation job failed, the reason it failed.

    • ModelArtifacts (dict) --

      Information about the location in Amazon S3 that has been configured for storing the model artifacts used in the compilation job.

      • S3ModelArtifacts (string) --

        The path of the S3 object that contains the model artifacts. For example, s3://bucket-name/keynameprefix/model.tar.gz .

    • RoleArn (string) --

      The Amazon Resource Name (ARN) of the model compilation job.

    • InputConfig (dict) --

      Information about the location in Amazon S3 of the input model artifacts, the name and shape of the expected data inputs, and the framework in which the model was trained.

      • S3Uri (string) --

        The S3 path where the model artifacts, which result from model training, are stored. This path must point to a single gzip compressed tar archive (.tar.gz suffix).

      • DataInputConfig (string) --

        Specifies the name and shape of the expected data inputs for your trained model with a JSON dictionary form. The data inputs are InputConfig$Framework specific.

        • TensorFlow : You must specify the name and shape (NHWC format) of the expected data inputs using a dictionary format for your trained model. The dictionary formats required for the console and CLI are different.

          • Examples for one input:

            • If using the console, {"input":[1,1024,1024,3]}

            • If using the CLI, {\"input\":[1,1024,1024,3]}

          • Examples for two inputs:

            • If using the console, {"data1": [1,28,28,1], "data2":[1,28,28,1]}

            • If using the CLI, {\"data1\": [1,28,28,1], \"data2\":[1,28,28,1]}

        • MXNET/ONNX : You must specify the name and shape (NCHW format) of the expected data inputs in order using a dictionary format for your trained model. The dictionary formats required for the console and CLI are different.

          • Examples for one input:

            • If using the console, {"data":[1,3,1024,1024]}

            • If using the CLI, {\"data\":[1,3,1024,1024]}

          • Examples for two inputs:

            • If using the console, {"var1": [1,1,28,28], "var2":[1,1,28,28]}

            • If using the CLI, {\"var1\": [1,1,28,28], \"var2\":[1,1,28,28]}

        • PyTorch : You can either specify the name and shape (NCHW format) of expected data inputs in order using a dictionary format for your trained model or you can specify the shape only using a list format. The dictionary formats required for the console and CLI are different. The list formats for the console and CLI are the same.

          • Examples for one input in dictionary format:

            • If using the console, {"input0":[1,3,224,224]}

            • If using the CLI, {\"input0\":[1,3,224,224]}

          • Example for one input in list format: [[1,3,224,224]]

          • Examples for two inputs in dictionary format:

            • If using the console, {"input0":[1,3,224,224], "input1":[1,3,224,224]}

            • If using the CLI, {\"input0\":[1,3,224,224], \"input1\":[1,3,224,224]}

          • Example for two inputs in list format: [[1,3,224,224], [1,3,224,224]]

        • XGBOOST : input data name and shape are not needed.

      • Framework (string) --

        Identifies the framework in which the model was trained. For example: TENSORFLOW.

    • OutputConfig (dict) --

      Information about the output location for the compiled model and the target device that the model runs on.

      • S3OutputLocation (string) --

        Identifies the S3 path where you want Amazon SageMaker to store the model artifacts. For example, s3://bucket-name/key-name-prefix.

      • TargetDevice (string) --

        Identifies the device that you want to run your model on after it has been compiled. For example: ml_c5.

DescribeNotebookInstance (updated) Link ¶
Changes (response)
{'RootAccess': 'Enabled | Disabled'}

Returns information about a notebook instance.

See also: AWS API Documentation

Request Syntax

client.describe_notebook_instance(
    NotebookInstanceName='string'
)
type NotebookInstanceName

string

param NotebookInstanceName

[REQUIRED]

The name of the notebook instance that you want information about.

rtype

dict

returns

Response Syntax

{
    'NotebookInstanceArn': 'string',
    'NotebookInstanceName': 'string',
    'NotebookInstanceStatus': 'Pending'|'InService'|'Stopping'|'Stopped'|'Failed'|'Deleting'|'Updating',
    'FailureReason': 'string',
    'Url': 'string',
    'InstanceType': 'ml.t2.medium'|'ml.t2.large'|'ml.t2.xlarge'|'ml.t2.2xlarge'|'ml.t3.medium'|'ml.t3.large'|'ml.t3.xlarge'|'ml.t3.2xlarge'|'ml.m4.xlarge'|'ml.m4.2xlarge'|'ml.m4.4xlarge'|'ml.m4.10xlarge'|'ml.m4.16xlarge'|'ml.m5.xlarge'|'ml.m5.2xlarge'|'ml.m5.4xlarge'|'ml.m5.12xlarge'|'ml.m5.24xlarge'|'ml.c4.xlarge'|'ml.c4.2xlarge'|'ml.c4.4xlarge'|'ml.c4.8xlarge'|'ml.c5.xlarge'|'ml.c5.2xlarge'|'ml.c5.4xlarge'|'ml.c5.9xlarge'|'ml.c5.18xlarge'|'ml.c5d.xlarge'|'ml.c5d.2xlarge'|'ml.c5d.4xlarge'|'ml.c5d.9xlarge'|'ml.c5d.18xlarge'|'ml.p2.xlarge'|'ml.p2.8xlarge'|'ml.p2.16xlarge'|'ml.p3.2xlarge'|'ml.p3.8xlarge'|'ml.p3.16xlarge',
    'SubnetId': 'string',
    'SecurityGroups': [
        'string',
    ],
    'RoleArn': 'string',
    'KmsKeyId': 'string',
    'NetworkInterfaceId': 'string',
    'LastModifiedTime': datetime(2015, 1, 1),
    'CreationTime': datetime(2015, 1, 1),
    'NotebookInstanceLifecycleConfigName': 'string',
    'DirectInternetAccess': 'Enabled'|'Disabled',
    'VolumeSizeInGB': 123,
    'AcceleratorTypes': [
        'ml.eia1.medium'|'ml.eia1.large'|'ml.eia1.xlarge',
    ],
    'DefaultCodeRepository': 'string',
    'AdditionalCodeRepositories': [
        'string',
    ],
    'RootAccess': 'Enabled'|'Disabled'
}

Response Structure

  • (dict) --

    • NotebookInstanceArn (string) --

      The Amazon Resource Name (ARN) of the notebook instance.

    • NotebookInstanceName (string) --

      The name of the Amazon SageMaker notebook instance.

    • NotebookInstanceStatus (string) --

      The status of the notebook instance.

    • FailureReason (string) --

      If status is Failed , the reason it failed.

    • Url (string) --

      The URL that you use to connect to the Jupyter notebook that is running in your notebook instance.

    • InstanceType (string) --

      The type of ML compute instance running on the notebook instance.

    • SubnetId (string) --

      The ID of the VPC subnet.

    • SecurityGroups (list) --

      The IDs of the VPC security groups.

      • (string) --

    • RoleArn (string) --

      The Amazon Resource Name (ARN) of the IAM role associated with the instance.

    • KmsKeyId (string) --

      The AWS KMS key ID Amazon SageMaker uses to encrypt data when storing it on the ML storage volume attached to the instance.

    • NetworkInterfaceId (string) --

      The network interface IDs that Amazon SageMaker created at the time of creating the instance.

    • LastModifiedTime (datetime) --

      A timestamp. Use this parameter to retrieve the time when the notebook instance was last modified.

    • CreationTime (datetime) --

      A timestamp. Use this parameter to return the time when the notebook instance was created

    • NotebookInstanceLifecycleConfigName (string) --

      Returns the name of a notebook instance lifecycle configuration.

      For information about notebook instance lifestyle configurations, see Step 2.1: (Optional) Customize a Notebook Instance

    • DirectInternetAccess (string) --

      Describes whether Amazon SageMaker provides internet access to the notebook instance. If this value is set to Disabled , the notebook instance does not have internet access, and cannot connect to Amazon SageMaker training and endpoint services.

      For more information, see Notebook Instances Are Internet-Enabled by Default.

    • VolumeSizeInGB (integer) --

      The size, in GB, of the ML storage volume attached to the notebook instance.

    • AcceleratorTypes (list) --

      A list of the Elastic Inference (EI) instance types associated with this notebook instance. Currently only one EI instance type can be associated with a notebook instance. For more information, see Using Elastic Inference in Amazon SageMaker.

      • (string) --

    • DefaultCodeRepository (string) --

      The Git repository associated with the notebook instance as its default code repository. This can be either the name of a Git repository stored as a resource in your account, or the URL of a Git repository in AWS CodeCommit or in any other Git repository. When you open a notebook instance, it opens in the directory that contains this repository. For more information, see Associating Git Repositories with Amazon SageMaker Notebook Instances.

    • AdditionalCodeRepositories (list) --

      An array of up to three Git repositories associated with the notebook instance. These can be either the names of Git repositories stored as resources in your account, or the URL of Git repositories in AWS CodeCommit or in any other Git repository. These repositories are cloned at the same level as the default repository of your notebook instance. For more information, see Associating Git Repositories with Amazon SageMaker Notebook Instances.

      • (string) --

    • RootAccess (string) --

      Whether root access is enabled or disabled for users of the notebook instance.

      Note

      Lifecycle configurations need root access to be able to set up a notebook instance. Because of this, lifecycle configurations associated with a notebook instance always run with root access even if you disable root access for users.

ListCompilationJobs (updated) Link ¶
Changes (response)
{'CompilationJobSummaries': {'CompilationTargetDevice': {'rk3288', 'rk3399'}}}

Lists model compilation jobs that satisfy various filters.

To create a model compilation job, use CreateCompilationJob. To get information about a particular model compilation job you have created, use DescribeCompilationJob.

See also: AWS API Documentation

Request Syntax

client.list_compilation_jobs(
    NextToken='string',
    MaxResults=123,
    CreationTimeAfter=datetime(2015, 1, 1),
    CreationTimeBefore=datetime(2015, 1, 1),
    LastModifiedTimeAfter=datetime(2015, 1, 1),
    LastModifiedTimeBefore=datetime(2015, 1, 1),
    NameContains='string',
    StatusEquals='INPROGRESS'|'COMPLETED'|'FAILED'|'STARTING'|'STOPPING'|'STOPPED',
    SortBy='Name'|'CreationTime'|'Status',
    SortOrder='Ascending'|'Descending'
)
type NextToken

string

param NextToken

If the result of the previous ListCompilationJobs request was truncated, the response includes a NextToken . To retrieve the next set of model compilation jobs, use the token in the next request.

type MaxResults

integer

param MaxResults

The maximum number of model compilation jobs to return in the response.

type CreationTimeAfter

datetime

param CreationTimeAfter

A filter that returns the model compilation jobs that were created after a specified time.

type CreationTimeBefore

datetime

param CreationTimeBefore

A filter that returns the model compilation jobs that were created before a specified time.

type LastModifiedTimeAfter

datetime

param LastModifiedTimeAfter

A filter that returns the model compilation jobs that were modified after a specified time.

type LastModifiedTimeBefore

datetime

param LastModifiedTimeBefore

A filter that returns the model compilation jobs that were modified before a specified time.

type NameContains

string

param NameContains

A filter that returns the model compilation jobs whose name contains a specified string.

type StatusEquals

string

param StatusEquals

A filter that retrieves model compilation jobs with a specific DescribeCompilationJobResponse$CompilationJobStatus status.

type SortBy

string

param SortBy

The field by which to sort results. The default is CreationTime .

type SortOrder

string

param SortOrder

The sort order for results. The default is Ascending .

rtype

dict

returns

Response Syntax

{
    'CompilationJobSummaries': [
        {
            'CompilationJobName': 'string',
            'CompilationJobArn': 'string',
            'CreationTime': datetime(2015, 1, 1),
            'CompilationStartTime': datetime(2015, 1, 1),
            'CompilationEndTime': datetime(2015, 1, 1),
            'CompilationTargetDevice': 'ml_m4'|'ml_m5'|'ml_c4'|'ml_c5'|'ml_p2'|'ml_p3'|'jetson_tx1'|'jetson_tx2'|'rasp3b'|'deeplens'|'rk3399'|'rk3288',
            'LastModifiedTime': datetime(2015, 1, 1),
            'CompilationJobStatus': 'INPROGRESS'|'COMPLETED'|'FAILED'|'STARTING'|'STOPPING'|'STOPPED'
        },
    ],
    'NextToken': 'string'
}

Response Structure

  • (dict) --

    • CompilationJobSummaries (list) --

      An array of CompilationJobSummary objects, each describing a model compilation job.

      • (dict) --

        A summary of a model compilation job.

        • CompilationJobName (string) --

          The name of the model compilation job that you want a summary for.

        • CompilationJobArn (string) --

          The Amazon Resource Name (ARN) of the model compilation job.

        • CreationTime (datetime) --

          The time when the model compilation job was created.

        • CompilationStartTime (datetime) --

          The time when the model compilation job started.

        • CompilationEndTime (datetime) --

          The time when the model compilation job completed.

        • CompilationTargetDevice (string) --

          The type of device that the model will run on after compilation has completed.

        • LastModifiedTime (datetime) --

          The time when the model compilation job was last modified.

        • CompilationJobStatus (string) --

          The status of the model compilation job.

    • NextToken (string) --

      If the response is truncated, Amazon SageMaker returns this NextToken . To retrieve the next set of model compilation jobs, use this token in the next request.

UpdateNotebookInstance (updated) Link ¶
Changes (request)
{'RootAccess': 'Enabled | Disabled'}

Updates a notebook instance. NotebookInstance updates include upgrading or downgrading the ML compute instance used for your notebook instance to accommodate changes in your workload requirements. You can also update the VPC security groups.

See also: AWS API Documentation

Request Syntax

client.update_notebook_instance(
    NotebookInstanceName='string',
    InstanceType='ml.t2.medium'|'ml.t2.large'|'ml.t2.xlarge'|'ml.t2.2xlarge'|'ml.t3.medium'|'ml.t3.large'|'ml.t3.xlarge'|'ml.t3.2xlarge'|'ml.m4.xlarge'|'ml.m4.2xlarge'|'ml.m4.4xlarge'|'ml.m4.10xlarge'|'ml.m4.16xlarge'|'ml.m5.xlarge'|'ml.m5.2xlarge'|'ml.m5.4xlarge'|'ml.m5.12xlarge'|'ml.m5.24xlarge'|'ml.c4.xlarge'|'ml.c4.2xlarge'|'ml.c4.4xlarge'|'ml.c4.8xlarge'|'ml.c5.xlarge'|'ml.c5.2xlarge'|'ml.c5.4xlarge'|'ml.c5.9xlarge'|'ml.c5.18xlarge'|'ml.c5d.xlarge'|'ml.c5d.2xlarge'|'ml.c5d.4xlarge'|'ml.c5d.9xlarge'|'ml.c5d.18xlarge'|'ml.p2.xlarge'|'ml.p2.8xlarge'|'ml.p2.16xlarge'|'ml.p3.2xlarge'|'ml.p3.8xlarge'|'ml.p3.16xlarge',
    RoleArn='string',
    LifecycleConfigName='string',
    DisassociateLifecycleConfig=True|False,
    VolumeSizeInGB=123,
    DefaultCodeRepository='string',
    AdditionalCodeRepositories=[
        'string',
    ],
    AcceleratorTypes=[
        'ml.eia1.medium'|'ml.eia1.large'|'ml.eia1.xlarge',
    ],
    DisassociateAcceleratorTypes=True|False,
    DisassociateDefaultCodeRepository=True|False,
    DisassociateAdditionalCodeRepositories=True|False,
    RootAccess='Enabled'|'Disabled'
)
type NotebookInstanceName

string

param NotebookInstanceName

[REQUIRED]

The name of the notebook instance to update.

type InstanceType

string

param InstanceType

The Amazon ML compute instance type.

type RoleArn

string

param RoleArn

The Amazon Resource Name (ARN) of the IAM role that Amazon SageMaker can assume to access the notebook instance. For more information, see Amazon SageMaker Roles.

Note

To be able to pass this role to Amazon SageMaker, the caller of this API must have the iam:PassRole permission.

type LifecycleConfigName

string

param LifecycleConfigName

The name of a lifecycle configuration to associate with the notebook instance. For information about lifestyle configurations, see Step 2.1: (Optional) Customize a Notebook Instance.

type DisassociateLifecycleConfig

boolean

param DisassociateLifecycleConfig

Set to true to remove the notebook instance lifecycle configuration currently associated with the notebook instance.

type VolumeSizeInGB

integer

param VolumeSizeInGB

The size, in GB, of the ML storage volume to attach to the notebook instance. The default value is 5 GB.

type DefaultCodeRepository

string

param DefaultCodeRepository

The Git repository to associate with the notebook instance as its default code repository. This can be either the name of a Git repository stored as a resource in your account, or the URL of a Git repository in AWS CodeCommit or in any other Git repository. When you open a notebook instance, it opens in the directory that contains this repository. For more information, see Associating Git Repositories with Amazon SageMaker Notebook Instances.

type AdditionalCodeRepositories

list

param AdditionalCodeRepositories

An array of up to three Git repositories to associate with the notebook instance. These can be either the names of Git repositories stored as resources in your account, or the URL of Git repositories in AWS CodeCommit or in any other Git repository. These repositories are cloned at the same level as the default repository of your notebook instance. For more information, see Associating Git Repositories with Amazon SageMaker Notebook Instances.

  • (string) --

type AcceleratorTypes

list

param AcceleratorTypes

A list of the Elastic Inference (EI) instance types to associate with this notebook instance. Currently only one EI instance type can be associated with a notebook instance. For more information, see Using Elastic Inference in Amazon SageMaker.

  • (string) --

type DisassociateAcceleratorTypes

boolean

param DisassociateAcceleratorTypes

A list of the Elastic Inference (EI) instance types to remove from this notebook instance.

type DisassociateDefaultCodeRepository

boolean

param DisassociateDefaultCodeRepository

The name or URL of the default Git repository to remove from this notebook instance.

type DisassociateAdditionalCodeRepositories

boolean

param DisassociateAdditionalCodeRepositories

A list of names or URLs of the default Git repositories to remove from this notebook instance.

type RootAccess

string

param RootAccess

Whether root access is enabled or disabled for users of the notebook instance. The default value is Enabled .

Note

If you set this to Disabled , users don't have root access on the notebook instance, but lifecycle configuration scripts still run with root permissions.

rtype

dict

returns

Response Syntax

{}

Response Structure

  • (dict) --