Skip to content

Commit 4978352

Browse files
author
awstools
committed
feat(client-sagemaker): This change allows customers to provide a custom entrypoint script for the docker container to be run while executing training jobs, and provide custom arguments to the entrypoint script.
1 parent 2d06b27 commit 4978352

File tree

7 files changed

+258
-134
lines changed

7 files changed

+258
-134
lines changed

clients/client-sagemaker/src/SageMaker.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2313,10 +2313,10 @@ export class SageMaker extends SageMakerClient {
23132313
* Amazon SageMaker Studio. For more information, see <a href="https://docs.aws.amazon.com/sagemaker/latest/dg/experiments-view-compare.html#experiments-view">View
23142314
* Experiments, Trials, and Trial Components</a>.</p>
23152315
* <important>
2316-
* <p>Do not include any security-sensitive information including account access
2317-
* IDs, secrets or tokens in any hyperparameter field. If the use of
2318-
* security-sensitive credentials are detected, SageMaker will reject your training
2319-
* job request and return an exception error.</p>
2316+
* <p>Do not include any security-sensitive information including account access IDs,
2317+
* secrets or tokens in any hyperparameter field. If the use of security-sensitive
2318+
* credentials are detected, SageMaker will reject your training job request and return an
2319+
* exception error.</p>
23202320
* </important>
23212321
*/
23222322
public createHyperParameterTuningJob(
@@ -3143,7 +3143,7 @@ export class SageMaker extends SageMakerClient {
31433143
* </li>
31443144
* <li>
31453145
* <p>
3146-
* <code>InputDataConfig</code> - Describes the training dataset and the Amazon S3,
3146+
* <code>InputDataConfig</code> - Describes the input required by the training job and the Amazon S3,
31473147
* EFS, or FSx location where it is stored.</p>
31483148
* </li>
31493149
* <li>

clients/client-sagemaker/src/commands/CreateHyperParameterTuningJobCommand.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -41,10 +41,10 @@ export interface CreateHyperParameterTuningJobCommandOutput
4141
* Amazon SageMaker Studio. For more information, see <a href="https://docs.aws.amazon.com/sagemaker/latest/dg/experiments-view-compare.html#experiments-view">View
4242
* Experiments, Trials, and Trial Components</a>.</p>
4343
* <important>
44-
* <p>Do not include any security-sensitive information including account access
45-
* IDs, secrets or tokens in any hyperparameter field. If the use of
46-
* security-sensitive credentials are detected, SageMaker will reject your training
47-
* job request and return an exception error.</p>
44+
* <p>Do not include any security-sensitive information including account access IDs,
45+
* secrets or tokens in any hyperparameter field. If the use of security-sensitive
46+
* credentials are detected, SageMaker will reject your training job request and return an
47+
* exception error.</p>
4848
* </important>
4949
* @example
5050
* Use a bare-bones client and the command you need to make an API call.

clients/client-sagemaker/src/commands/CreateTrainingJobCommand.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ export interface CreateTrainingJobCommandOutput extends CreateTrainingJobRespons
5959
* </li>
6060
* <li>
6161
* <p>
62-
* <code>InputDataConfig</code> - Describes the training dataset and the Amazon S3,
62+
* <code>InputDataConfig</code> - Describes the input required by the training job and the Amazon S3,
6363
* EFS, or FSx location where it is stored.</p>
6464
* </li>
6565
* <li>

clients/client-sagemaker/src/models/models_0.ts

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -705,6 +705,20 @@ export interface AlgorithmSpecification {
705705
* </ul>
706706
*/
707707
EnableSageMakerMetricsTimeSeries?: boolean;
708+
709+
/**
710+
* <p>The <a href="https://docs.docker.com/engine/reference/builder/">entrypoint script
711+
* for a Docker container</a> used to run a training job. This script takes
712+
* precedence over the default train processing instructions. See <a href="https://docs.aws.amazon.com/sagemaker/latest/dg/your-algorithms-training-algo-dockerfile.html">How Amazon SageMaker
713+
* Runs Your Training Image</a> for more information.</p>
714+
*/
715+
ContainerEntrypoint?: string[];
716+
717+
/**
718+
* <p>The arguments for a container used to run a training job. See <a href="https://docs.aws.amazon.com/sagemaker/latest/dg/your-algorithms-training-algo-dockerfile.html">How Amazon SageMaker
719+
* Runs Your Training Image</a> for additional information.</p>
720+
*/
721+
ContainerArguments?: string[];
708722
}
709723

710724
export enum AlgorithmStatus {

clients/client-sagemaker/src/models/models_1.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6855,8 +6855,8 @@ export interface CreateTrainingJobRequest {
68556855
* <important>
68566856
* <p>Do not include any security-sensitive information including account access IDs,
68576857
* secrets or tokens in any hyperparameter field. If the use of security-sensitive
6858-
* credentials are detected, SageMaker will reject your training job request and return
6859-
* an exception error.</p>
6858+
* credentials are detected, SageMaker will reject your training job request and return an
6859+
* exception error.</p>
68606860
* </important>
68616861
*/
68626862
HyperParameters?: Record<string, string>;

clients/client-sagemaker/src/protocols/Aws_json1_1.ts

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15499,6 +15499,12 @@ const serializeAws_json1_1AlarmList = (input: Alarm[], context: __SerdeContext):
1549915499
const serializeAws_json1_1AlgorithmSpecification = (input: AlgorithmSpecification, context: __SerdeContext): any => {
1550015500
return {
1550115501
...(input.AlgorithmName != null && { AlgorithmName: input.AlgorithmName }),
15502+
...(input.ContainerArguments != null && {
15503+
ContainerArguments: serializeAws_json1_1TrainingContainerArguments(input.ContainerArguments, context),
15504+
}),
15505+
...(input.ContainerEntrypoint != null && {
15506+
ContainerEntrypoint: serializeAws_json1_1TrainingContainerEntrypoint(input.ContainerEntrypoint, context),
15507+
}),
1550215508
...(input.EnableSageMakerMetricsTimeSeries != null && {
1550315509
EnableSageMakerMetricsTimeSeries: input.EnableSageMakerMetricsTimeSeries,
1550415510
}),
@@ -22432,6 +22438,22 @@ const serializeAws_json1_1TrafficRoutingConfig = (input: TrafficRoutingConfig, c
2243222438
};
2243322439
};
2243422440

22441+
const serializeAws_json1_1TrainingContainerArguments = (input: string[], context: __SerdeContext): any => {
22442+
return input
22443+
.filter((e: any) => e != null)
22444+
.map((entry) => {
22445+
return entry;
22446+
});
22447+
};
22448+
22449+
const serializeAws_json1_1TrainingContainerEntrypoint = (input: string[], context: __SerdeContext): any => {
22450+
return input
22451+
.filter((e: any) => e != null)
22452+
.map((entry) => {
22453+
return entry;
22454+
});
22455+
};
22456+
2243522457
const serializeAws_json1_1TrainingEnvironmentMap = (input: Record<string, string>, context: __SerdeContext): any => {
2243622458
return Object.entries(input).reduce((acc: Record<string, any>, [key, value]: [string, any]) => {
2243722459
if (value === null) {
@@ -23344,6 +23366,14 @@ const deserializeAws_json1_1AlarmList = (output: any, context: __SerdeContext):
2334423366
const deserializeAws_json1_1AlgorithmSpecification = (output: any, context: __SerdeContext): AlgorithmSpecification => {
2334523367
return {
2334623368
AlgorithmName: __expectString(output.AlgorithmName),
23369+
ContainerArguments:
23370+
output.ContainerArguments != null
23371+
? deserializeAws_json1_1TrainingContainerArguments(output.ContainerArguments, context)
23372+
: undefined,
23373+
ContainerEntrypoint:
23374+
output.ContainerEntrypoint != null
23375+
? deserializeAws_json1_1TrainingContainerEntrypoint(output.ContainerEntrypoint, context)
23376+
: undefined,
2334723377
EnableSageMakerMetricsTimeSeries: __expectBoolean(output.EnableSageMakerMetricsTimeSeries),
2334823378
MetricDefinitions:
2334923379
output.MetricDefinitions != null
@@ -33427,6 +33457,30 @@ const deserializeAws_json1_1TrafficRoutingConfig = (output: any, context: __Serd
3342733457
} as any;
3342833458
};
3342933459

33460+
const deserializeAws_json1_1TrainingContainerArguments = (output: any, context: __SerdeContext): string[] => {
33461+
const retVal = (output || [])
33462+
.filter((e: any) => e != null)
33463+
.map((entry: any) => {
33464+
if (entry === null) {
33465+
return null as any;
33466+
}
33467+
return __expectString(entry) as any;
33468+
});
33469+
return retVal;
33470+
};
33471+
33472+
const deserializeAws_json1_1TrainingContainerEntrypoint = (output: any, context: __SerdeContext): string[] => {
33473+
const retVal = (output || [])
33474+
.filter((e: any) => e != null)
33475+
.map((entry: any) => {
33476+
if (entry === null) {
33477+
return null as any;
33478+
}
33479+
return __expectString(entry) as any;
33480+
});
33481+
return retVal;
33482+
};
33483+
3343033484
const deserializeAws_json1_1TrainingEnvironmentMap = (output: any, context: __SerdeContext): Record<string, string> => {
3343133485
return Object.entries(output).reduce((acc: Record<string, string>, [key, value]: [string, any]) => {
3343233486
if (value === null) {

0 commit comments

Comments
 (0)