Skip to content

Commit 6908bf2

Browse files
author
awstools
committed
feat(client-sagemaker): SageMaker HyperPod adds scale-down at instance level via BatchDeleteClusterNodes API and group level via UpdateCluster API. SageMaker Training exposes secondary job status in TrainingJobSummary from ListTrainingJobs API. SageMaker now supports G6, G6e, P5e instances for HyperPod and Training.
1 parent 87ff3b9 commit 6908bf2

35 files changed

+1520
-771
lines changed

clients/client-sagemaker/README.md

+8
Original file line numberDiff line numberDiff line change
@@ -241,6 +241,14 @@ AssociateTrialComponent
241241

242242
[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/sagemaker/command/AssociateTrialComponentCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-sagemaker/Interface/AssociateTrialComponentCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-sagemaker/Interface/AssociateTrialComponentCommandOutput/)
243243

244+
</details>
245+
<details>
246+
<summary>
247+
BatchDeleteClusterNodes
248+
</summary>
249+
250+
[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/sagemaker/command/BatchDeleteClusterNodesCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-sagemaker/Interface/BatchDeleteClusterNodesCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-sagemaker/Interface/BatchDeleteClusterNodesCommandOutput/)
251+
244252
</details>
245253
<details>
246254
<summary>

clients/client-sagemaker/src/SageMaker.ts

+23
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,11 @@ import {
1313
AssociateTrialComponentCommandInput,
1414
AssociateTrialComponentCommandOutput,
1515
} from "./commands/AssociateTrialComponentCommand";
16+
import {
17+
BatchDeleteClusterNodesCommand,
18+
BatchDeleteClusterNodesCommandInput,
19+
BatchDeleteClusterNodesCommandOutput,
20+
} from "./commands/BatchDeleteClusterNodesCommand";
1621
import {
1722
BatchDescribeModelPackageCommand,
1823
BatchDescribeModelPackageCommandInput,
@@ -1555,6 +1560,7 @@ const commands = {
15551560
AddAssociationCommand,
15561561
AddTagsCommand,
15571562
AssociateTrialComponentCommand,
1563+
BatchDeleteClusterNodesCommand,
15581564
BatchDescribeModelPackageCommand,
15591565
CreateActionCommand,
15601566
CreateAlgorithmCommand,
@@ -1932,6 +1938,23 @@ export interface SageMaker {
19321938
cb: (err: any, data?: AssociateTrialComponentCommandOutput) => void
19331939
): void;
19341940

1941+
/**
1942+
* @see {@link BatchDeleteClusterNodesCommand}
1943+
*/
1944+
batchDeleteClusterNodes(
1945+
args: BatchDeleteClusterNodesCommandInput,
1946+
options?: __HttpHandlerOptions
1947+
): Promise<BatchDeleteClusterNodesCommandOutput>;
1948+
batchDeleteClusterNodes(
1949+
args: BatchDeleteClusterNodesCommandInput,
1950+
cb: (err: any, data?: BatchDeleteClusterNodesCommandOutput) => void
1951+
): void;
1952+
batchDeleteClusterNodes(
1953+
args: BatchDeleteClusterNodesCommandInput,
1954+
options: __HttpHandlerOptions,
1955+
cb: (err: any, data?: BatchDeleteClusterNodesCommandOutput) => void
1956+
): void;
1957+
19351958
/**
19361959
* @see {@link BatchDescribeModelPackageCommand}
19371960
*/

clients/client-sagemaker/src/SageMakerClient.ts

+6
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,10 @@ import {
5959
AssociateTrialComponentCommandInput,
6060
AssociateTrialComponentCommandOutput,
6161
} from "./commands/AssociateTrialComponentCommand";
62+
import {
63+
BatchDeleteClusterNodesCommandInput,
64+
BatchDeleteClusterNodesCommandOutput,
65+
} from "./commands/BatchDeleteClusterNodesCommand";
6266
import {
6367
BatchDescribeModelPackageCommandInput,
6468
BatchDescribeModelPackageCommandOutput,
@@ -943,6 +947,7 @@ export type ServiceInputTypes =
943947
| AddAssociationCommandInput
944948
| AddTagsCommandInput
945949
| AssociateTrialComponentCommandInput
950+
| BatchDeleteClusterNodesCommandInput
946951
| BatchDescribeModelPackageCommandInput
947952
| CreateActionCommandInput
948953
| CreateAlgorithmCommandInput
@@ -1283,6 +1288,7 @@ export type ServiceOutputTypes =
12831288
| AddAssociationCommandOutput
12841289
| AddTagsCommandOutput
12851290
| AssociateTrialComponentCommandOutput
1291+
| BatchDeleteClusterNodesCommandOutput
12861292
| BatchDescribeModelPackageCommandOutput
12871293
| CreateActionCommandOutput
12881294
| CreateAlgorithmCommandOutput
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,123 @@
1+
// smithy-typescript generated code
2+
import { getEndpointPlugin } from "@smithy/middleware-endpoint";
3+
import { getSerdePlugin } from "@smithy/middleware-serde";
4+
import { Command as $Command } from "@smithy/smithy-client";
5+
import { MetadataBearer as __MetadataBearer } from "@smithy/types";
6+
7+
import { commonParams } from "../endpoint/EndpointParameters";
8+
import { BatchDeleteClusterNodesRequest, BatchDeleteClusterNodesResponse } from "../models/models_0";
9+
import { de_BatchDeleteClusterNodesCommand, se_BatchDeleteClusterNodesCommand } from "../protocols/Aws_json1_1";
10+
import { SageMakerClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from "../SageMakerClient";
11+
12+
/**
13+
* @public
14+
*/
15+
export type { __MetadataBearer };
16+
export { $Command };
17+
/**
18+
* @public
19+
*
20+
* The input for {@link BatchDeleteClusterNodesCommand}.
21+
*/
22+
export interface BatchDeleteClusterNodesCommandInput extends BatchDeleteClusterNodesRequest {}
23+
/**
24+
* @public
25+
*
26+
* The output of {@link BatchDeleteClusterNodesCommand}.
27+
*/
28+
export interface BatchDeleteClusterNodesCommandOutput extends BatchDeleteClusterNodesResponse, __MetadataBearer {}
29+
30+
/**
31+
* <p>Deletes specific nodes within a SageMaker HyperPod cluster. <code>BatchDeleteClusterNodes</code>
32+
* accepts a cluster name and a list of node IDs.</p>
33+
* <important>
34+
* <ul>
35+
* <li>
36+
* <p>To safeguard your work, back up your data to Amazon S3 or an FSx for
37+
* Lustre file system before invoking the API on a worker node group. This will help
38+
* prevent any potential data loss from the instance root volume. For more
39+
* information about backup, see <a href="https://docs.aws.amazon.com/sagemaker/latest/dg/sagemaker-hyperpod-operate-cli-command.html#sagemaker-hyperpod-operate-cli-command-update-cluster-software-backup">Use the backup script provided by SageMaker HyperPod</a>. </p>
40+
* </li>
41+
* <li>
42+
* <p>If you want to invoke this API on an existing cluster, you'll first need to
43+
* patch the cluster by running the <a href="https://docs.aws.amazon.com/sagemaker/latest/APIReference/API_UpdateClusterSoftware.html">UpdateClusterSoftware API</a>. For more information about patching a
44+
* cluster, see <a href="https://docs.aws.amazon.com/sagemaker/latest/dg/sagemaker-hyperpod-operate-cli-command.html#sagemaker-hyperpod-operate-cli-command-update-cluster-software">Update the SageMaker HyperPod platform software of a cluster</a>.</p>
45+
* </li>
46+
* </ul>
47+
* </important>
48+
* @example
49+
* Use a bare-bones client and the command you need to make an API call.
50+
* ```javascript
51+
* import { SageMakerClient, BatchDeleteClusterNodesCommand } from "@aws-sdk/client-sagemaker"; // ES Modules import
52+
* // const { SageMakerClient, BatchDeleteClusterNodesCommand } = require("@aws-sdk/client-sagemaker"); // CommonJS import
53+
* const client = new SageMakerClient(config);
54+
* const input = { // BatchDeleteClusterNodesRequest
55+
* ClusterName: "STRING_VALUE", // required
56+
* NodeIds: [ // ClusterNodeIds // required
57+
* "STRING_VALUE",
58+
* ],
59+
* };
60+
* const command = new BatchDeleteClusterNodesCommand(input);
61+
* const response = await client.send(command);
62+
* // { // BatchDeleteClusterNodesResponse
63+
* // Failed: [ // BatchDeleteClusterNodesErrorList
64+
* // { // BatchDeleteClusterNodesError
65+
* // Code: "NodeIdNotFound" || "InvalidNodeStatus" || "NodeIdInUse", // required
66+
* // Message: "STRING_VALUE", // required
67+
* // NodeId: "STRING_VALUE", // required
68+
* // },
69+
* // ],
70+
* // Successful: [ // ClusterNodeIds
71+
* // "STRING_VALUE",
72+
* // ],
73+
* // };
74+
*
75+
* ```
76+
*
77+
* @param BatchDeleteClusterNodesCommandInput - {@link BatchDeleteClusterNodesCommandInput}
78+
* @returns {@link BatchDeleteClusterNodesCommandOutput}
79+
* @see {@link BatchDeleteClusterNodesCommandInput} for command's `input` shape.
80+
* @see {@link BatchDeleteClusterNodesCommandOutput} for command's `response` shape.
81+
* @see {@link SageMakerClientResolvedConfig | config} for SageMakerClient's `config` shape.
82+
*
83+
* @throws {@link ResourceNotFound} (client fault)
84+
* <p>Resource being access is not found.</p>
85+
*
86+
* @throws {@link SageMakerServiceException}
87+
* <p>Base exception class for all service exceptions from SageMaker service.</p>
88+
*
89+
* @public
90+
*/
91+
export class BatchDeleteClusterNodesCommand extends $Command
92+
.classBuilder<
93+
BatchDeleteClusterNodesCommandInput,
94+
BatchDeleteClusterNodesCommandOutput,
95+
SageMakerClientResolvedConfig,
96+
ServiceInputTypes,
97+
ServiceOutputTypes
98+
>()
99+
.ep(commonParams)
100+
.m(function (this: any, Command: any, cs: any, config: SageMakerClientResolvedConfig, o: any) {
101+
return [
102+
getSerdePlugin(config, this.serialize, this.deserialize),
103+
getEndpointPlugin(config, Command.getEndpointParameterInstructions()),
104+
];
105+
})
106+
.s("SageMaker", "BatchDeleteClusterNodes", {})
107+
.n("SageMakerClient", "BatchDeleteClusterNodesCommand")
108+
.f(void 0, void 0)
109+
.ser(se_BatchDeleteClusterNodesCommand)
110+
.de(de_BatchDeleteClusterNodesCommand)
111+
.build() {
112+
/** @internal type navigation helper, not in runtime. */
113+
protected declare static __types: {
114+
api: {
115+
input: BatchDeleteClusterNodesRequest;
116+
output: BatchDeleteClusterNodesResponse;
117+
};
118+
sdk: {
119+
input: BatchDeleteClusterNodesCommandInput;
120+
output: BatchDeleteClusterNodesCommandOutput;
121+
};
122+
};
123+
}

0 commit comments

Comments
 (0)