SageMaker / Client / create_global_inference_gateway

create_global_inference_gateway

SageMaker.Client.create_global_inference_gateway(**kwargs)

Creates a global inference gateway. This operation is asynchronous: the global inference gateway starts in the CREATING status. To check its status, call DescribeGlobalInferenceGateway until the status is ACTIVE or FAILED. The operation fails with ResourceInUse if the name is already in use, or if one of the in-cluster inference gateways in Gateways already belongs to another global inference gateway.

See also: AWS API Documentation

Request Syntax

response = client.create_global_inference_gateway(
    Name='string',
    Routing={
        'Weights': {
            'KVHeadroom': ...,
            'QueueDepth': ...,
            'RegionProximity': ...,
            'ErrorRate': ...
        }
    },
    ExecutionRoleArn='string',
    Gateways=[
        {
            'Name': 'string',
            'Namespace': 'string',
            'ClusterArn': 'string'
        },
    ],
    ClientToken='string',
    Tags=[
        {
            'Key': 'string',
            'Value': 'string'
        },
    ]
)
Parameters:
  • Name (string) –

    [REQUIRED]

    The name of the global inference gateway. The name must be unique in your account in the current Region, and is case-sensitive. The name can’t be exactly 12 lowercase letters or digits, because the global inference gateway ID uses that format.

  • Routing (dict) –

    The routing configuration of the global inference gateway. If you omit it, the global inference gateway uses default routing weights.

    • Weights (dict) – [REQUIRED]

      The weights that the global inference gateway applies to each routing signal when it scores the in-cluster inference gateways for a request.

      • KVHeadroom (float) –

        The weight of the free key-value (KV) cache capacity on the cluster.

      • QueueDepth (float) –

        The weight of the number of requests that are waiting on the cluster.

      • RegionProximity (float) –

        The weight of how close the cluster is to the caller.

      • ErrorRate (float) –

        The weight of the recent error rate of the cluster.

  • ExecutionRoleArn (string) –

    [REQUIRED]

    The Amazon Resource Name (ARN) of the IAM role that the global inference gateway assumes to access your SageMaker HyperPod clusters. The role must be in your account and partition, and you must have iam:PassRole permission for it. You can’t change the role after you create the global inference gateway.

  • Gateways (list) –

    [REQUIRED]

    The 1 to 10 in-cluster inference gateways to add to the global inference gateway. A global inference gateway must always have at least one in-cluster inference gateway, so RemoveInferenceGateway can’t remove the last one.

    • (dict) –

      An in-cluster inference gateway, identified by the SageMaker HyperPod cluster that runs it ( ClusterArn), its Kubernetes namespace ( Namespace), and the name of the InferenceGatewayConfig resource that defines it ( Name).

      • Name (string) – [REQUIRED]

        The name of the InferenceGatewayConfig resource that defines the in-cluster inference gateway.

      • Namespace (string) – [REQUIRED]

        The Kubernetes namespace of the in-cluster inference gateway.

      • ClusterArn (string) – [REQUIRED]

        The Amazon Resource Name (ARN) of the SageMaker HyperPod cluster that runs the in-cluster inference gateway. The cluster must be in the same account and partition as the global inference gateway. It can be in a different Region, but not in an opt-in Region.

  • ClientToken (string) –

    A unique, case-sensitive identifier that you provide to ensure the idempotency of the request. An idempotent operation completes no more than one time. If you don’t specify a client token, the Amazon Web Services SDKs and the Amazon Web Services CLI generate one for you.

    This field is autopopulated if not provided.

  • Tags (list) –

    Custom tags for managing the global inference gateway as an Amazon Web Services resource. You can add tags to your global inference gateway in the same way you add them in other Amazon Web Services services that support tagging. For more information about tagging Amazon Web Services resources, see Tagging your Amazon Web Services resources in the Tagging Amazon Web Services Resources User Guide.

    The global inference gateway doesn’t return tags in its responses. To read the tags, use ListTags.

    • (dict) –

      A tag object that consists of a key and an optional value, used to manage metadata for SageMaker Amazon Web Services resources.

      You can add tags to notebook instances, training jobs, hyperparameter tuning jobs, batch transform jobs, models, labeling jobs, work teams, endpoint configurations, and endpoints. For more information on adding tags to SageMaker resources, see AddTags.

      For more information on adding metadata to your Amazon Web Services resources with tagging, see Tagging Amazon Web Services resources. For advice on best practices for managing Amazon Web Services resources with tagging, see Tagging Best Practices: Implement an Effective Amazon Web Services Resource Tagging Strategy.

      • Key (string) – [REQUIRED]

        The tag key. Tag keys must be unique per resource.

      • Value (string) – [REQUIRED]

        The tag value.

Return type:

dict

Returns:

Response Syntax

{
    'Arn': 'string',
    'Id': 'string',
    'Name': 'string',
    'Status': 'CREATING'|'ACTIVE'|'UPDATING'|'DELETING'|'FAILED',
    'ExecutionRoleArn': 'string',
    'Routing': {
        'Weights': {
            'KVHeadroom': ...,
            'QueueDepth': ...,
            'RegionProximity': ...,
            'ErrorRate': ...
        }
    },
    'Gateways': [
        {
            'Name': 'string',
            'Namespace': 'string',
            'ClusterArn': 'string'
        },
    ]
}

Response Structure

  • (dict) –

    Contains the identifiers and status of the new global inference gateway, and the parameters from the request except Tags. To read the tags, use ListTags.

    • Arn (string) –

      The Amazon Resource Name (ARN) of the global inference gateway.

    • Id (string) –

      The ID of the global inference gateway.

    • Name (string) –

      The name of the global inference gateway.

    • Status (string) –

      The status of the global inference gateway. A new global inference gateway starts in the CREATING status.

    • ExecutionRoleArn (string) –

      The Amazon Resource Name (ARN) of the IAM role that the global inference gateway assumes to access your SageMaker HyperPod clusters.

    • Routing (dict) –

      The routing configuration of the global inference gateway.

      • Weights (dict) –

        The weights that the global inference gateway applies to each routing signal when it scores the in-cluster inference gateways for a request.

        • KVHeadroom (float) –

          The weight of the free key-value (KV) cache capacity on the cluster.

        • QueueDepth (float) –

          The weight of the number of requests that are waiting on the cluster.

        • RegionProximity (float) –

          The weight of how close the cluster is to the caller.

        • ErrorRate (float) –

          The weight of the recent error rate of the cluster.

    • Gateways (list) –

      The in-cluster inference gateways that you specified in the request.

      • (dict) –

        An in-cluster inference gateway, identified by the SageMaker HyperPod cluster that runs it ( ClusterArn), its Kubernetes namespace ( Namespace), and the name of the InferenceGatewayConfig resource that defines it ( Name).

        • Name (string) –

          The name of the InferenceGatewayConfig resource that defines the in-cluster inference gateway.

        • Namespace (string) –

          The Kubernetes namespace of the in-cluster inference gateway.

        • ClusterArn (string) –

          The Amazon Resource Name (ARN) of the SageMaker HyperPod cluster that runs the in-cluster inference gateway. The cluster must be in the same account and partition as the global inference gateway. It can be in a different Region, but not in an opt-in Region.

Exceptions

  • SageMaker.Client.exceptions.ResourceInUse

  • SageMaker.Client.exceptions.ResourceLimitExceeded