Skip to content

create_cluster_extension async

create_cluster_extension(
    *,
    config_overrides: Optional[AsyncSageMakerClientConfig] = None,
    cluster_arn: Optional[ClusterArn] = None,
    extension_name: Optional[ExtensionName] = None,
    extension_version: Optional[ExtensionVersion] = None,
    configuration_values: Optional[ExtensionConfigurationValues] = None,
    tags: Optional[TagList] = None,
    client_token: Optional[String] = None,
) -> CreateClusterExtensionResponse

Installs an extension, such as sagemaker-observability, on a SageMaker HyperPod cluster orchestrated by Slurm. The cluster must have NodeProvisioningMode set to Continuous and can have only one extension with a given name. To track the installation, call DescribeClusterExtension.

Parameters:

  • cluster_arn (Optional[ClusterArn], default: None ) –

    The Amazon Resource Name (ARN) of the SageMaker HyperPod cluster on which to install the extension. The cluster must use Slurm as the orchestrator and have NodeProvisioningMode set to Continuous.

  • extension_name (Optional[ExtensionName], default: None ) –

    The name of the extension to install, for example sagemaker-observability.

  • extension_version (Optional[ExtensionVersion], default: None ) –

    The version of the extension to install, in MAJOR.MINOR.PATCH format, for example 1.0.0. If you don't specify a version, SageMaker HyperPod installs the latest available version of the extension.

  • configuration_values (Optional[ExtensionConfigurationValues], default: None ) –

    The configuration settings for the extension, as a JSON object serialized as a string, for example {"metricsProvider":{"nodeMetrics":{"level":"ADVANCED"}}}. Each extension version defines which settings it accepts. SageMaker HyperPod validates the settings against that definition, and rejects the request if a setting is unknown or has an invalid value. Settings that you omit use the extension's default values. If you omit ConfigurationValues, all settings use their default values.

  • tags (Optional[TagList], default: None ) –

    Custom tags for managing the extension as an Amazon Web Services resource. You can add tags to your extension in the same way you add them in other Amazon Web Services services that support tagging. To learn more about tagging Amazon Web Services resources in general, see Tagging Amazon Web Services Resources User Guide. To use this operation to add tags when you create an extension, you must have the sagemaker:AddTags permission.

  • client_token (Optional[String], default: None ) –

    A unique, case-sensitive identifier that you provide so that the operation completes no more than one time. This token is valid for 8 hours. If you retry the request with the same client token and the same parameters within this time, the API returns the Amazon Resource Name (ARN) of the extension that the original request created, without creating a duplicate. If you use the same client token with different parameters, the request fails.

Raises:

Source code in docs_src/capo_sagemaker/_services/async_sage_maker.py
async def create_cluster_extension(
    self,
    *,
    config_overrides: Optional[AsyncSageMakerClientConfig] = None,
    cluster_arn: Optional["capo_sagemaker.types.cluster_arn.ClusterArn"] = None,
    extension_name: Optional[
        "capo_sagemaker.types.extension_name.ExtensionName"
    ] = None,
    extension_version: Optional[
        "capo_sagemaker.types.extension_version.ExtensionVersion"
    ] = None,
    configuration_values: Optional[
        "capo_sagemaker.types.extension_configuration_values.ExtensionConfigurationValues"
    ] = None,
    tags: Optional["capo_sagemaker.types.tag_list.TagList"] = None,
    client_token: Optional["capo_sagemaker.types.string.String"] = None,
) -> "capo_sagemaker.types.create_cluster_extension_response.CreateClusterExtensionResponse":
    """<p>Installs an extension, such as <code>sagemaker-observability</code>, on a SageMaker HyperPod cluster orchestrated by Slurm. The cluster must have <code>NodeProvisioningMode</code> set to <code>Continuous</code> and can have only one extension with a given name. To track the installation, call <code>DescribeClusterExtension</code>.</p>

    Args:
        cluster_arn: <p>The Amazon Resource Name (ARN) of the SageMaker HyperPod cluster on which to install the extension. The cluster must use Slurm as the orchestrator and have <code>NodeProvisioningMode</code> set to <code>Continuous</code>.</p>
        extension_name: <p>The name of the extension to install, for example <code>sagemaker-observability</code>.</p>
        extension_version: <p>The version of the extension to install, in <code>MAJOR.MINOR.PATCH</code> format, for example <code>1.0.0</code>. If you don't specify a version, SageMaker HyperPod installs the latest available version of the extension.</p>
        configuration_values: <p>The configuration settings for the extension, as a JSON object serialized as a string, for example <code>{"metricsProvider":{"nodeMetrics":{"level":"ADVANCED"}}}</code>. Each extension version defines which settings it accepts. SageMaker HyperPod validates the settings against that definition, and rejects the request if a setting is unknown or has an invalid value. Settings that you omit use the extension's default values. If you omit <code>ConfigurationValues</code>, all settings use their default values.</p>
        tags: <p>Custom tags for managing the extension as an Amazon Web Services resource. You can add tags to your extension in the same way you add them in other Amazon Web Services services that support tagging. To learn more about tagging Amazon Web Services resources in general, see <a href="https://docs.aws.amazon.com/tag-editor/latest/userguide/tagging.html">Tagging Amazon Web Services Resources User Guide</a>. To use this operation to add tags when you create an extension, you must have the <code>sagemaker:AddTags</code> permission.</p>
        client_token: <p>A unique, case-sensitive identifier that you provide so that the operation completes no more than one time. This token is valid for 8 hours. If you retry the request with the same client token and the same parameters within this time, the API returns the Amazon Resource Name (ARN) of the extension that the original request created, without creating a duplicate. If you use the same client token with different parameters, the request fails.</p>

    Raises:
        capo_sagemaker.errors.conflict_exception.ConflictException: <p>There was a conflict when you attempted to modify a SageMaker entity such as an <code>Experiment</code> or <code>Artifact</code>.</p>
        capo_sagemaker.errors.resource_in_use.ResourceInUse: <p>Resource being accessed is in use.</p>
        capo_sagemaker.errors.resource_not_found.ResourceNotFound: <p>Resource being access is not found.</p>
        capo_sagemaker.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    async def _handler(
        req: "AsyncOperationRequest[capo_sagemaker.types.create_cluster_extension_request.CreateClusterExtensionRequest]",
    ) -> AsyncOperationResponse[
        "capo_sagemaker.types.create_cluster_extension_response.CreateClusterExtensionResponse"
    ]:
        import capo_sagemaker._operations.sage_maker.create_cluster_extension

        (
            output,
            http_response,
        ) = await capo_sagemaker._operations.sage_maker.create_cluster_extension.async_create_cluster_extension(
            req.options, req.input
        )
        return AsyncOperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("CreateClusterExtension")
    )
    input_: capo_sagemaker.types.create_cluster_extension_request.CreateClusterExtensionRequest = {}
    if cluster_arn is not None:
        input_["cluster_arn"] = cluster_arn
    if extension_name is not None:
        input_["extension_name"] = extension_name
    if extension_version is not None:
        input_["extension_version"] = extension_version
    if configuration_values is not None:
        input_["configuration_values"] = configuration_values
    if tags is not None:
        input_["tags"] = tags
    if client_token is None:
        client_token = str(uuid.uuid4())
    input_["client_token"] = client_token

    response = await aexecute_pipeline(
        AsyncOperationRequest(input=input_, options=options_),
        handler=_handler,
        interceptors=list(interceptors_),
    )
    await response.response.aclose()
    return response.output