Skip to content

Commit

Permalink
feat(client-sagemaker): This release adds support for rolling deploym…
Browse files Browse the repository at this point in the history
…ent in SageMaker Inference.
  • Loading branch information
awstools committed Jun 30, 2023
1 parent 73ae32e commit 83d2ff0
Show file tree
Hide file tree
Showing 14 changed files with 276 additions and 140 deletions.
12 changes: 12 additions & 0 deletions clients/client-sagemaker/src/commands/CreateEndpointCommand.ts
Expand Up @@ -147,6 +147,18 @@ export interface CreateEndpointCommandOutput extends CreateEndpointOutput, __Met
* },
* ],
* },
* RollingUpdatePolicy: { // RollingUpdatePolicy
* MaximumBatchSize: {
* Type: "INSTANCE_COUNT" || "CAPACITY_PERCENT", // required
* Value: Number("int"), // required
* },
* WaitIntervalInSeconds: Number("int"), // required
* MaximumExecutionTimeoutInSeconds: Number("int"),
* RollbackMaximumBatchSize: {
* Type: "INSTANCE_COUNT" || "CAPACITY_PERCENT", // required
* Value: Number("int"), // required
* },
* },
* },
* Tags: [ // TagList
* { // Tag
Expand Down
3 changes: 1 addition & 2 deletions clients/client-sagemaker/src/commands/DeleteImageCommand.ts
Expand Up @@ -13,8 +13,7 @@ import {
SerdeContext as __SerdeContext,
} from "@smithy/types";

import { DeleteImageRequest } from "../models/models_1";
import { DeleteImageResponse } from "../models/models_2";
import { DeleteImageRequest, DeleteImageResponse } from "../models/models_2";
import { de_DeleteImageCommand, se_DeleteImageCommand } from "../protocols/Aws_json1_1";
import { SageMakerClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from "../SageMakerClient";

Expand Down
14 changes: 13 additions & 1 deletion clients/client-sagemaker/src/commands/DescribeEndpointCommand.ts
Expand Up @@ -92,7 +92,7 @@ export interface DescribeEndpointCommandOutput extends DescribeEndpointOutput, _
* // DestinationS3Uri: "STRING_VALUE", // required
* // KmsKeyId: "STRING_VALUE", // required
* // },
* // EndpointStatus: "OutOfService" || "Creating" || "Updating" || "SystemUpdating" || "RollingBack" || "InService" || "Deleting" || "Failed", // required
* // EndpointStatus: "OutOfService" || "Creating" || "Updating" || "SystemUpdating" || "RollingBack" || "InService" || "Deleting" || "Failed" || "UpdateRollbackFailed", // required
* // FailureReason: "STRING_VALUE",
* // CreationTime: new Date("TIMESTAMP"), // required
* // LastModifiedTime: new Date("TIMESTAMP"), // required
Expand Down Expand Up @@ -120,6 +120,18 @@ export interface DescribeEndpointCommandOutput extends DescribeEndpointOutput, _
* // },
* // ],
* // },
* // RollingUpdatePolicy: { // RollingUpdatePolicy
* // MaximumBatchSize: {
* // Type: "INSTANCE_COUNT" || "CAPACITY_PERCENT", // required
* // Value: Number("int"), // required
* // },
* // WaitIntervalInSeconds: Number("int"), // required
* // MaximumExecutionTimeoutInSeconds: Number("int"),
* // RollbackMaximumBatchSize: {
* // Type: "INSTANCE_COUNT" || "CAPACITY_PERCENT", // required
* // Value: Number("int"), // required
* // },
* // },
* // },
* // AsyncInferenceConfig: { // AsyncInferenceConfig
* // ClientConfig: { // AsyncInferenceClientConfig
Expand Down
Expand Up @@ -68,7 +68,7 @@ export interface DescribeInferenceExperimentCommandOutput
* // EndpointMetadata: { // EndpointMetadata
* // EndpointName: "STRING_VALUE", // required
* // EndpointConfigName: "STRING_VALUE",
* // EndpointStatus: "OutOfService" || "Creating" || "Updating" || "SystemUpdating" || "RollingBack" || "InService" || "Deleting" || "Failed",
* // EndpointStatus: "OutOfService" || "Creating" || "Updating" || "SystemUpdating" || "RollingBack" || "InService" || "Deleting" || "Failed" || "UpdateRollbackFailed",
* // FailureReason: "STRING_VALUE",
* // },
* // ModelVariants: [ // ModelVariantConfigSummaryList // required
Expand Down
4 changes: 2 additions & 2 deletions clients/client-sagemaker/src/commands/ListEndpointsCommand.ts
Expand Up @@ -53,7 +53,7 @@ export interface ListEndpointsCommandOutput extends ListEndpointsOutput, __Metad
* CreationTimeAfter: new Date("TIMESTAMP"),
* LastModifiedTimeBefore: new Date("TIMESTAMP"),
* LastModifiedTimeAfter: new Date("TIMESTAMP"),
* StatusEquals: "OutOfService" || "Creating" || "Updating" || "SystemUpdating" || "RollingBack" || "InService" || "Deleting" || "Failed",
* StatusEquals: "OutOfService" || "Creating" || "Updating" || "SystemUpdating" || "RollingBack" || "InService" || "Deleting" || "Failed" || "UpdateRollbackFailed",
* };
* const command = new ListEndpointsCommand(input);
* const response = await client.send(command);
Expand All @@ -64,7 +64,7 @@ export interface ListEndpointsCommandOutput extends ListEndpointsOutput, __Metad
* // EndpointArn: "STRING_VALUE", // required
* // CreationTime: new Date("TIMESTAMP"), // required
* // LastModifiedTime: new Date("TIMESTAMP"), // required
* // EndpointStatus: "OutOfService" || "Creating" || "Updating" || "SystemUpdating" || "RollingBack" || "InService" || "Deleting" || "Failed", // required
* // EndpointStatus: "OutOfService" || "Creating" || "Updating" || "SystemUpdating" || "RollingBack" || "InService" || "Deleting" || "Failed" || "UpdateRollbackFailed", // required
* // },
* // ],
* // NextToken: "STRING_VALUE",
Expand Down
4 changes: 2 additions & 2 deletions clients/client-sagemaker/src/commands/SearchCommand.ts
Expand Up @@ -870,7 +870,7 @@ export interface SearchCommandOutput extends SearchResponse, __MetadataBearer {}
* // DestinationS3Uri: "STRING_VALUE", // required
* // KmsKeyId: "STRING_VALUE", // required
* // },
* // EndpointStatus: "OutOfService" || "Creating" || "Updating" || "SystemUpdating" || "RollingBack" || "InService" || "Deleting" || "Failed", // required
* // EndpointStatus: "OutOfService" || "Creating" || "Updating" || "SystemUpdating" || "RollingBack" || "InService" || "Deleting" || "Failed" || "UpdateRollbackFailed", // required
* // FailureReason: "STRING_VALUE",
* // CreationTime: new Date("TIMESTAMP"), // required
* // LastModifiedTime: new Date("TIMESTAMP"), // required
Expand Down Expand Up @@ -1772,7 +1772,7 @@ export interface SearchCommandOutput extends SearchResponse, __MetadataBearer {}
* // EndpointArn: "STRING_VALUE", // required
* // CreationTime: new Date("TIMESTAMP"), // required
* // LastModifiedTime: new Date("TIMESTAMP"), // required
* // EndpointStatus: "OutOfService" || "Creating" || "Updating" || "SystemUpdating" || "RollingBack" || "InService" || "Deleting" || "Failed", // required
* // EndpointStatus: "OutOfService" || "Creating" || "Updating" || "SystemUpdating" || "RollingBack" || "InService" || "Deleting" || "Failed" || "UpdateRollbackFailed", // required
* // },
* // ],
* // LastBatchTransformJob: {
Expand Down
12 changes: 12 additions & 0 deletions clients/client-sagemaker/src/commands/UpdateEndpointCommand.ts
Expand Up @@ -92,6 +92,18 @@ export interface UpdateEndpointCommandOutput extends UpdateEndpointOutput, __Met
* },
* ],
* },
* RollingUpdatePolicy: { // RollingUpdatePolicy
* MaximumBatchSize: {
* Type: "INSTANCE_COUNT" || "CAPACITY_PERCENT", // required
* Value: Number("int"), // required
* },
* WaitIntervalInSeconds: Number("int"), // required
* MaximumExecutionTimeoutInSeconds: Number("int"),
* RollbackMaximumBatchSize: {
* Type: "INSTANCE_COUNT" || "CAPACITY_PERCENT", // required
* Value: Number("int"), // required
* },
* },
* },
* RetainDeploymentConfig: true || false,
* };
Expand Down
5 changes: 4 additions & 1 deletion clients/client-sagemaker/src/models/models_0.ts
Expand Up @@ -6585,7 +6585,10 @@ export type CapacitySizeType = (typeof CapacitySizeType)[keyof typeof CapacitySi

/**
* @public
* <p>Specifies the endpoint capacity to activate for production.</p>
* <p>Specifies the type and size of the endpoint capacity to activate for a blue/green deployment, a rolling deployment, or a rollback strategy.
* You can specify your batches as either instance count or the overall percentage or your fleet.</p>
* <p>For a rollback strategy, if you don't specify the fields in this object, or if you set the <code>Value</code> to 100%, then SageMaker
* uses a blue/green rollback strategy and rolls all traffic back to the blue fleet.</p>
*/
export interface CapacitySize {
/**
Expand Down
49 changes: 38 additions & 11 deletions clients/client-sagemaker/src/models/models_1.ts
Expand Up @@ -24,6 +24,7 @@ import {
Bias,
BlueGreenUpdatePolicy,
CanvasAppSettings,
CapacitySize,
CaptureContentTypeHeader,
CaptureOption,
CaptureStatus,
Expand Down Expand Up @@ -598,6 +599,37 @@ export interface CreateEdgePackagingJobRequest {
Tags?: Tag[];
}

/**
* @public
* <p>Specifies a rolling deployment strategy for updating a SageMaker endpoint.</p>
*/
export interface RollingUpdatePolicy {
/**
* <p>Batch size for each rolling step to provision capacity and turn on traffic on the new
* endpoint fleet, and terminate capacity on the old endpoint fleet. Value must be between
* 5% to 50% of the variant's total instance count.</p>
*/
MaximumBatchSize: CapacitySize | undefined;

/**
* <p>The length of the baking period, during which SageMaker monitors alarms for each batch on the new fleet.</p>
*/
WaitIntervalInSeconds: number | undefined;

/**
* <p>The time limit for the total deployment. Exceeding this limit causes a timeout.</p>
*/
MaximumExecutionTimeoutInSeconds?: number;

/**
* <p>Batch size for rollback to the old endpoint fleet. Each rolling step to provision
* capacity and turn on traffic on the old endpoint fleet, and terminate capacity on the new
* endpoint fleet. If this field is absent, the default value will be set to 100% of total
* capacity which means to bring up the whole capacity of the old fleet at once during rollback.</p>
*/
RollbackMaximumBatchSize?: CapacitySize;
}

/**
* @public
* <p>The deployment configuration for an endpoint, which contains the desired deployment
Expand All @@ -612,13 +644,18 @@ export interface DeploymentConfig {
* specified, SageMaker uses a blue/green deployment strategy with all at once traffic shifting
* by default.</p>
*/
BlueGreenUpdatePolicy: BlueGreenUpdatePolicy | undefined;
BlueGreenUpdatePolicy?: BlueGreenUpdatePolicy;

/**
* <p>Automatic rollback configuration for handling endpoint deployment failures and
* recovery.</p>
*/
AutoRollbackConfiguration?: AutoRollbackConfig;

/**
* <p>Specifies a rolling deployment strategy for updating a SageMaker endpoint.</p>
*/
RollingUpdatePolicy?: RollingUpdatePolicy;
}

/**
Expand Down Expand Up @@ -10754,16 +10791,6 @@ export interface DeleteHumanTaskUiRequest {
*/
export interface DeleteHumanTaskUiResponse {}

/**
* @public
*/
export interface DeleteImageRequest {
/**
* <p>The name of the image to delete.</p>
*/
ImageName: string | undefined;
}

/**
* @internal
*/
Expand Down
24 changes: 11 additions & 13 deletions clients/client-sagemaker/src/models/models_2.ts
Expand Up @@ -177,6 +177,16 @@ import {
VendorGuidance,
} from "./models_1";

/**
* @public
*/
export interface DeleteImageRequest {
/**
* <p>The name of the image to delete.</p>
*/
ImageName: string | undefined;
}

/**
* @public
*/
Expand Down Expand Up @@ -2256,6 +2266,7 @@ export const EndpointStatus = {
OUT_OF_SERVICE: "OutOfService",
ROLLING_BACK: "RollingBack",
SYSTEM_UPDATING: "SystemUpdating",
UPDATE_ROLLBACK_FAILED: "UpdateRollbackFailed",
UPDATING: "Updating",
} as const;

Expand Down Expand Up @@ -10094,19 +10105,6 @@ export interface PropertyNameQuery {
PropertyNameHint: string | undefined;
}

/**
* @public
* <p>Specified in the <a href="https://docs.aws.amazon.com/sagemaker/latest/APIReference/API_GetSearchSuggestions.html">GetSearchSuggestions</a> request.
* Limits the property names that are included in the response.</p>
*/
export interface SuggestionQuery {
/**
* <p>Defines a property name hint. Only property
* names that begin with the specified hint are included in the response.</p>
*/
PropertyNameQuery?: PropertyNameQuery;
}

/**
* @internal
*/
Expand Down

0 comments on commit 83d2ff0

Please sign in to comment.