Skip to content

Commit

Permalink
feat(client-sagemaker): Add Stairs TrafficPattern and FlatInvocations…
Browse files Browse the repository at this point in the history
… to RecommendationJobStoppingConditions
  • Loading branch information
awstools committed Aug 1, 2023
1 parent dac6d12 commit aae6569
Show file tree
Hide file tree
Showing 12 changed files with 178 additions and 97 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -60,14 +60,19 @@ export interface CreateInferenceRecommendationsJobCommandOutput
* ModelPackageVersionArn: "STRING_VALUE",
* JobDurationInSeconds: Number("int"),
* TrafficPattern: { // TrafficPattern
* TrafficType: "PHASES",
* TrafficType: "PHASES" || "STAIRS",
* Phases: [ // Phases
* { // Phase
* InitialNumberOfUsers: Number("int"),
* SpawnRate: Number("int"),
* DurationInSeconds: Number("int"),
* },
* ],
* Stairs: { // Stairs
* DurationInSeconds: Number("int"),
* NumberOfSteps: Number("int"),
* UsersPerStep: Number("int"),
* },
* },
* ResourceLimit: { // RecommendationJobResourceLimit
* MaxNumberOfTests: Number("int"),
Expand Down Expand Up @@ -137,6 +142,7 @@ export interface CreateInferenceRecommendationsJobCommandOutput
* ValueInMilliseconds: Number("int"),
* },
* ],
* FlatInvocations: "Continue" || "Stop",
* },
* OutputConfig: { // RecommendationJobOutputConfig
* KmsKeyId: "STRING_VALUE",
Expand Down
2 changes: 1 addition & 1 deletion clients/client-sagemaker/src/commands/DeleteHubCommand.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import {
SerdeContext as __SerdeContext,
} from "@smithy/types";

import { DeleteHubRequest } from "../models/models_1";
import { DeleteHubRequest } from "../models/models_2";
import { de_DeleteHubCommand, se_DeleteHubCommand } from "../protocols/Aws_json1_1";
import { SageMakerClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from "../SageMakerClient";

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -72,14 +72,19 @@ export interface DescribeInferenceRecommendationsJobCommandOutput
* // ModelPackageVersionArn: "STRING_VALUE",
* // JobDurationInSeconds: Number("int"),
* // TrafficPattern: { // TrafficPattern
* // TrafficType: "PHASES",
* // TrafficType: "PHASES" || "STAIRS",
* // Phases: [ // Phases
* // { // Phase
* // InitialNumberOfUsers: Number("int"),
* // SpawnRate: Number("int"),
* // DurationInSeconds: Number("int"),
* // },
* // ],
* // Stairs: { // Stairs
* // DurationInSeconds: Number("int"),
* // NumberOfSteps: Number("int"),
* // UsersPerStep: Number("int"),
* // },
* // },
* // ResourceLimit: { // RecommendationJobResourceLimit
* // MaxNumberOfTests: Number("int"),
Expand Down Expand Up @@ -148,6 +153,7 @@ export interface DescribeInferenceRecommendationsJobCommandOutput
* // ValueInMilliseconds: Number("int"),
* // },
* // ],
* // FlatInvocations: "Continue" || "Stop",
* // },
* // InferenceRecommendations: [ // InferenceRecommendations
* // { // InferenceRecommendation
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,10 @@ import {
SerdeContext as __SerdeContext,
} from "@smithy/types";

import { GetSagemakerServicecatalogPortfolioStatusInput } from "../models/models_2";
import { GetSagemakerServicecatalogPortfolioStatusOutput } from "../models/models_3";
import {
GetSagemakerServicecatalogPortfolioStatusInput,
GetSagemakerServicecatalogPortfolioStatusOutput,
} from "../models/models_3";
import {
de_GetSagemakerServicecatalogPortfolioStatusCommand,
se_GetSagemakerServicecatalogPortfolioStatusCommand,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,8 @@ import {
SerdeContext as __SerdeContext,
} from "@smithy/types";

import { RenderUiTemplateRequest, RenderUiTemplateResponse } from "../models/models_3";
import { RenderUiTemplateRequest } from "../models/models_3";
import { RenderUiTemplateResponse } from "../models/models_4";
import { de_RenderUiTemplateCommand, se_RenderUiTemplateCommand } from "../protocols/Aws_json1_1";
import { SageMakerClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from "../SageMakerClient";

Expand Down
2 changes: 1 addition & 1 deletion clients/client-sagemaker/src/endpoint/ruleset.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,5 +29,5 @@ p={"url":"https://api-fips.sagemaker.{Region}.amazonaws.com","properties":{},"he
q=[j],
r=[k],
s=[{[w]:"Region"}];
const _data={version:"1.0",parameters:{Region:g,UseDualStack:h,UseFIPS:h,Endpoint:g},rules:[{conditions:[{[u]:a,[v]:[i]}],type:b,rules:[{conditions:q,error:"Invalid Configuration: FIPS and custom endpoint are not supported",type:c},{type:b,rules:[{conditions:r,error:"Invalid Configuration: Dualstack and custom endpoint are not supported",type:c},{endpoint:{url:i,properties:l,headers:l},type:d}]}]},{type:b,rules:[{conditions:[{[u]:a,[v]:s}],type:b,rules:[{conditions:[{[u]:"aws.partition",[v]:s,assign:e}],type:b,rules:[{conditions:[j,k],type:b,rules:[{conditions:[m,n],type:b,rules:[{type:b,rules:[{endpoint:{url:"https://api.sagemaker-fips.{Region}.{PartitionResult#dualStackDnsSuffix}",properties:l,headers:l},type:d}]}]},{error:"FIPS and DualStack are enabled, but this partition does not support one or both",type:c}]},{conditions:q,type:b,rules:[{conditions:[m],type:b,rules:[{type:b,rules:[{conditions:[{[u]:f,[v]:["aws",o]}],endpoint:p,type:d},{conditions:[{[u]:f,[v]:["aws-us-gov",o]}],endpoint:p,type:d},{endpoint:{url:"https://api.sagemaker-fips.{Region}.{PartitionResult#dnsSuffix}",properties:l,headers:l},type:d}]}]},{error:"FIPS is enabled but this partition does not support FIPS",type:c}]},{conditions:r,type:b,rules:[{conditions:[n],type:b,rules:[{type:b,rules:[{endpoint:{url:"https://api.sagemaker.{Region}.{PartitionResult#dualStackDnsSuffix}",properties:l,headers:l},type:d}]}]},{error:"DualStack is enabled but this partition does not support DualStack",type:c}]},{type:b,rules:[{endpoint:{url:"https://api.sagemaker.{Region}.{PartitionResult#dnsSuffix}",properties:l,headers:l},type:d}]}]}]},{error:"Invalid Configuration: Missing Region",type:c}]}]};
const _data={version:"1.0",parameters:{Region:g,UseDualStack:h,UseFIPS:h,Endpoint:g},rules:[{conditions:[{[u]:a,[v]:[i]}],type:b,rules:[{conditions:q,error:"Invalid Configuration: FIPS and custom endpoint are not supported",type:c},{conditions:r,error:"Invalid Configuration: Dualstack and custom endpoint are not supported",type:c},{endpoint:{url:i,properties:l,headers:l},type:d}]},{conditions:[{[u]:a,[v]:s}],type:b,rules:[{conditions:[{[u]:"aws.partition",[v]:s,assign:e}],type:b,rules:[{conditions:[j,k],type:b,rules:[{conditions:[m,n],type:b,rules:[{endpoint:{url:"https://api.sagemaker-fips.{Region}.{PartitionResult#dualStackDnsSuffix}",properties:l,headers:l},type:d}]},{error:"FIPS and DualStack are enabled, but this partition does not support one or both",type:c}]},{conditions:q,type:b,rules:[{conditions:[m],type:b,rules:[{conditions:[{[u]:f,[v]:["aws",o]}],endpoint:p,type:d},{conditions:[{[u]:f,[v]:["aws-us-gov",o]}],endpoint:p,type:d},{endpoint:{url:"https://api.sagemaker-fips.{Region}.{PartitionResult#dnsSuffix}",properties:l,headers:l},type:d}]},{error:"FIPS is enabled but this partition does not support FIPS",type:c}]},{conditions:r,type:b,rules:[{conditions:[n],type:b,rules:[{endpoint:{url:"https://api.sagemaker.{Region}.{PartitionResult#dualStackDnsSuffix}",properties:l,headers:l},type:d}]},{error:"DualStack is enabled but this partition does not support DualStack",type:c}]},{endpoint:{url:"https://api.sagemaker.{Region}.{PartitionResult#dnsSuffix}",properties:l,headers:l},type:d}]}]},{error:"Invalid Configuration: Missing Region",type:c}]};
export const ruleSet: RuleSetObject = _data;
2 changes: 1 addition & 1 deletion clients/client-sagemaker/src/models/models_0.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6864,7 +6864,7 @@ export interface BatchTransformInput {

/**
* @public
* <p>If specified, monitoring jobs substract this time from the end time. For information
* <p>If specified, monitoring jobs subtract this time from the end time. For information
* about using offsets for scheduling monitoring jobs, see <a href="https://docs.aws.amazon.com/sagemaker/latest/dg/model-monitor-model-quality-schedule.html">Schedule Model
* Quality Monitoring Jobs</a>.</p>
*/
Expand Down
91 changes: 61 additions & 30 deletions clients/client-sagemaker/src/models/models_1.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4476,7 +4476,7 @@ export interface RecommendationJobResourceLimit {
export interface Phase {
/**
* @public
* <p>Specifies how many concurrent users to start with.</p>
* <p>Specifies how many concurrent users to start with. The value should be between 1 and 3.</p>
*/
InitialNumberOfUsers?: number;

Expand All @@ -4488,17 +4488,45 @@ export interface Phase {

/**
* @public
* <p>Specifies how long traffic phase should be.</p>
* <p>Specifies how long a traffic phase should be. For custom load tests, the value should be between 120 and 3600.
* This value should not exceed <code>JobDurationInSeconds</code>.</p>
*/
DurationInSeconds?: number;
}

/**
* @public
* <p>Defines the stairs traffic pattern for an Inference Recommender load test. This pattern
* type consists of multiple steps where the number of users increases at each step.</p>
* <p>Specify either the stairs or phases traffic pattern.</p>
*/
export interface Stairs {
/**
* @public
* <p>Defines how long each traffic step should be.</p>
*/
DurationInSeconds?: number;

/**
* @public
* <p>Specifies how many steps to perform during traffic.</p>
*/
NumberOfSteps?: number;

/**
* @public
* <p>Specifies how many new users to spawn in each step.</p>
*/
UsersPerStep?: number;
}

/**
* @public
* @enum
*/
export const TrafficType = {
PHASES: "PHASES",
STAIRS: "STAIRS",
} as const;

/**
Expand All @@ -4513,7 +4541,7 @@ export type TrafficType = (typeof TrafficType)[keyof typeof TrafficType];
export interface TrafficPattern {
/**
* @public
* <p>Defines the traffic patterns.</p>
* <p>Defines the traffic patterns. Choose either <code>PHASES</code> or <code>STAIRS</code>.</p>
*/
TrafficType?: TrafficType | string;

Expand All @@ -4522,6 +4550,12 @@ export interface TrafficPattern {
* <p>Defines the phases traffic specification.</p>
*/
Phases?: Phase[];

/**
* @public
* <p>Defines the stairs traffic pattern.</p>
*/
Stairs?: Stairs;
}

/**
Expand Down Expand Up @@ -4556,7 +4590,7 @@ export interface RecommendationJobInputConfig {

/**
* @public
* <p>Specifies the maximum duration of the job, in seconds.></p>
* <p>Specifies the maximum duration of the job, in seconds. The maximum value is 7200.</p>
*/
JobDurationInSeconds?: number;

Expand Down Expand Up @@ -4725,14 +4759,28 @@ export interface RecommendationJobOutputConfig {
CompiledOutputConfig?: RecommendationJobCompiledOutputConfig;
}

/**
* @public
* @enum
*/
export const FlatInvocations = {
CONTINUE: "Continue",
STOP: "Stop",
} as const;

/**
* @public
*/
export type FlatInvocations = (typeof FlatInvocations)[keyof typeof FlatInvocations];

/**
* @public
* <p>The model latency threshold.</p>
*/
export interface ModelLatencyThreshold {
/**
* @public
* <p>The model latency percentile threshold.</p>
* <p>The model latency percentile threshold. For custom load tests, specify the value as <code>P95</code>.</p>
*/
Percentile?: string;

Expand Down Expand Up @@ -4763,6 +4811,14 @@ export interface RecommendationJobStoppingConditions {
* complete the inference in the container.</p>
*/
ModelLatencyThresholds?: ModelLatencyThreshold[];

/**
* @public
* <p>Stops a load test when the number of invocations (TPS) peaks and flattens,
* which means that the instance has reached capacity. The default value is <code>Stop</code>.
* If you want the load test to continue after invocations have flattened, set the value to <code>Continue</code>.</p>
*/
FlatInvocations?: FlatInvocations | string;
}

/**
Expand Down Expand Up @@ -11645,31 +11701,6 @@ export interface DeleteFlowDefinitionRequest {
*/
export interface DeleteFlowDefinitionResponse {}

/**
* @public
*/
export interface DeleteHubRequest {
/**
* @public
* <p>The name of the hub to delete.</p>
*/
HubName: string | undefined;
}

/**
* @public
* @enum
*/
export const HubContentType = {
MODEL: "Model",
NOTEBOOK: "Notebook",
} as const;

/**
* @public
*/
export type HubContentType = (typeof HubContentType)[keyof typeof HubContentType];

/**
* @internal
*/
Expand Down
53 changes: 32 additions & 21 deletions clients/client-sagemaker/src/models/models_2.ts
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,6 @@ import {
FeatureDefinition,
FeatureType,
FlowDefinitionOutputConfig,
HubContentType,
HubS3StorageConfig,
HumanLoopActivationConfig,
HumanLoopConfig,
Expand Down Expand Up @@ -177,6 +176,31 @@ import {
VendorGuidance,
} from "./models_1";

/**
* @public
*/
export interface DeleteHubRequest {
/**
* @public
* <p>The name of the hub to delete.</p>
*/
HubName: string | undefined;
}

/**
* @public
* @enum
*/
export const HubContentType = {
MODEL: "Model",
NOTEBOOK: "Notebook",
} as const;

/**
* @public
*/
export type HubContentType = (typeof HubContentType)[keyof typeof HubContentType];

/**
* @public
*/
Expand Down Expand Up @@ -2956,6 +2980,13 @@ export interface DescribeEndpointOutput {
* the <code>FailureReason</code> value returned by <a href="https://docs.aws.amazon.com/sagemaker/latest/APIReference/API_DescribeEndpoint.html">DescribeEndpoint</a> for information about the failure. <a href="https://docs.aws.amazon.com/sagemaker/latest/APIReference/API_DeleteEndpoint.html">DeleteEndpoint</a> is the only operation that can be performed on a
* failed endpoint.</p>
* </li>
* <li>
* <p>
* <code>UpdateRollbackFailed</code>: Both the rolling deployment and auto-rollback failed. Your endpoint
* is in service with a mix of the old and new endpoint configurations. For information about how to remedy
* this issue and restore the endpoint's status to <code>InService</code>, see
* <a href="https://docs.aws.amazon.com/sagemaker/latest/dg/deployment-guardrails-rolling.html">Rolling Deployments</a>.</p>
* </li>
* </ul>
*/
EndpointStatus: EndpointStatus | string | undefined;
Expand Down Expand Up @@ -11340,26 +11371,6 @@ export interface GetModelPackageGroupPolicyOutput {
ResourcePolicy: string | undefined;
}

/**
* @public
*/
export interface GetSagemakerServicecatalogPortfolioStatusInput {}

/**
* @public
* @enum
*/
export const SagemakerServicecatalogStatus = {
DISABLED: "Disabled",
ENABLED: "Enabled",
} as const;

/**
* @public
*/
export type SagemakerServicecatalogStatus =
(typeof SagemakerServicecatalogStatus)[keyof typeof SagemakerServicecatalogStatus];

/**
* @internal
*/
Expand Down
Loading

0 comments on commit aae6569

Please sign in to comment.