@@ -7,36 +7,45 @@ import * as s3 from '@aws-cdk/aws-s3';
7
7
import * as sfn from '@aws-cdk/aws-stepfunctions' ;
8
8
import { Construct , Duration } from '@aws-cdk/core' ;
9
9
10
+ /**
11
+ * Task to train a machine learning model using Amazon SageMaker
12
+ * @experimental
13
+ */
10
14
export interface ISageMakerTask extends sfn . IStepFunctionsTask , iam . IGrantable { }
11
15
12
- //
13
- // Create Training Job types
14
- //
15
-
16
16
/**
17
+ * Specify the training algorithm and algorithm-specific metadata
17
18
* @experimental
18
19
*/
19
20
export interface AlgorithmSpecification {
20
21
21
22
/**
22
23
* Name of the algorithm resource to use for the training job.
24
+ * This must be an algorithm resource that you created or subscribe to on AWS Marketplace.
25
+ * If you specify a value for this parameter, you can't specify a value for TrainingImage.
26
+ *
27
+ * @default - No algorithm is specified
23
28
*/
24
29
readonly algorithmName ?: string ;
25
30
26
31
/**
27
32
* List of metric definition objects. Each object specifies the metric name and regular expressions used to parse algorithm logs.
33
+ *
34
+ * @default - No metrics
28
35
*/
29
36
readonly metricDefinitions ?: MetricDefinition [ ] ;
30
37
31
38
/**
32
39
* Registry path of the Docker image that contains the training algorithm.
40
+ *
41
+ * @default - No Docker image is specified
33
42
*/
34
43
readonly trainingImage ?: DockerImage ;
35
44
36
45
/**
37
46
* Input mode that the algorithm supports.
38
47
*
39
- * @default is 'File' mode
48
+ * @default 'File' mode
40
49
*/
41
50
readonly trainingInputMode ?: InputMode ;
42
51
}
@@ -55,31 +64,43 @@ export interface Channel {
55
64
56
65
/**
57
66
* Compression type if training data is compressed
67
+ *
68
+ * @default - None
58
69
*/
59
70
readonly compressionType ?: CompressionType ;
60
71
61
72
/**
62
- * Content type
73
+ * The MIME type of the data.
74
+ *
75
+ * @default - None
63
76
*/
64
77
readonly contentType ?: string ;
65
78
66
79
/**
67
- * Location of the data channel
80
+ * Location of the channel data.
68
81
*/
69
82
readonly dataSource : DataSource ;
70
83
71
84
/**
72
85
* Input mode to use for the data channel in a training job.
86
+ *
87
+ * @default - None
73
88
*/
74
89
readonly inputMode ?: InputMode ;
75
90
76
91
/**
77
- * Record wrapper type
92
+ * Specify RecordIO as the value when input data is in raw format but the training algorithm requires the RecordIO format.
93
+ * In this case, Amazon SageMaker wraps each individual S3 object in a RecordIO record.
94
+ * If the input data is already in RecordIO format, you don't need to set this attribute.
95
+ *
96
+ * @default - None
78
97
*/
79
98
readonly recordWrapperType ?: RecordWrapperType ;
80
99
81
100
/**
82
101
* Shuffle config option for input data in a channel.
102
+ *
103
+ * @default - None
83
104
*/
84
105
readonly shuffleConfig ?: ShuffleConfig ;
85
106
}
@@ -111,21 +132,29 @@ export interface DataSource {
111
132
/**
112
133
* S3 location of the channel data.
113
134
*
135
+ * @see https://docs.aws.amazon.com/sagemaker/latest/APIReference/API_S3DataSource.html
136
+ *
114
137
* @experimental
115
138
*/
116
139
export interface S3DataSource {
117
140
/**
118
141
* List of one or more attribute names to use that are found in a specified augmented manifest file.
142
+ *
143
+ * @default - No attribute names
119
144
*/
120
145
readonly attributeNames ?: string [ ] ;
121
146
122
147
/**
123
148
* S3 Data Distribution Type
149
+ *
150
+ * @default - None
124
151
*/
125
152
readonly s3DataDistributionType ?: S3DataDistributionType ;
126
153
127
154
/**
128
155
* S3 Data Type
156
+ *
157
+ * @default S3_PREFIX
129
158
*/
130
159
readonly s3DataType ?: S3DataType ;
131
160
@@ -136,11 +165,14 @@ export interface S3DataSource {
136
165
}
137
166
138
167
/**
168
+ * Configures the S3 bucket where SageMaker will save the result of model training
139
169
* @experimental
140
170
*/
141
171
export interface OutputDataConfig {
142
172
/**
143
173
* Optional KMS encryption key that Amazon SageMaker uses to encrypt the model artifacts at rest using Amazon S3 server-side encryption.
174
+ *
175
+ * @default - Amazon SageMaker uses the default KMS key for Amazon S3 for your role's account
144
176
*/
145
177
readonly encryptionKey ?: kms . IKey ;
146
178
@@ -151,16 +183,23 @@ export interface OutputDataConfig {
151
183
}
152
184
153
185
/**
186
+ * Specifies a limit to how long a model training job can run.
187
+ * When the job reaches the time limit, Amazon SageMaker ends the training job.
188
+ *
154
189
* @experimental
155
190
*/
156
191
export interface StoppingCondition {
157
192
/**
158
193
* The maximum length of time, in seconds, that the training or compilation job can run.
194
+ *
195
+ * @default - 1 hour
159
196
*/
160
197
readonly maxRuntime ?: Duration ;
161
198
}
162
199
163
200
/**
201
+ * Specifies the resources, ML compute instances, and ML storage volumes to deploy for model training.
202
+ *
164
203
* @experimental
165
204
*/
166
205
export interface ResourceConfig {
@@ -181,6 +220,8 @@ export interface ResourceConfig {
181
220
182
221
/**
183
222
* KMS key that Amazon SageMaker uses to encrypt data on the storage volume attached to the ML compute instance(s) that run the training job.
223
+ *
224
+ * @default - Amazon SageMaker uses the default KMS key for Amazon S3 for your role's account
184
225
*/
185
226
readonly volumeEncryptionKey ?: kms . IKey ;
186
227
@@ -193,17 +234,20 @@ export interface ResourceConfig {
193
234
}
194
235
195
236
/**
237
+ * Specifies the VPC that you want your Amazon SageMaker training job to connect to.
196
238
*
197
239
* @experimental
198
240
*/
199
241
export interface VpcConfig {
200
242
/**
201
- * VPC id
243
+ * VPC
202
244
*/
203
245
readonly vpc : ec2 . IVpc ;
204
246
205
247
/**
206
248
* VPC subnets.
249
+ *
250
+ * @default - Private Subnets are selected
207
251
*/
208
252
readonly subnets ?: ec2 . SubnetSelection ;
209
253
}
@@ -227,9 +271,15 @@ export interface MetricDefinition {
227
271
}
228
272
229
273
/**
274
+ * Stores information about the location of an object in Amazon S3
275
+ *
230
276
* @experimental
231
277
*/
232
278
export interface S3LocationConfig {
279
+
280
+ /**
281
+ * Uniquely identifies the resource in Amazon S3
282
+ */
233
283
readonly uri : string ;
234
284
}
235
285
@@ -458,11 +508,15 @@ export interface TransformInput {
458
508
459
509
/**
460
510
* The compression type of the transform data.
511
+ *
512
+ * @default NONE
461
513
*/
462
514
readonly compressionType ?: CompressionType ;
463
515
464
516
/**
465
517
* Multipurpose internet mail extension (MIME) type of the data.
518
+ *
519
+ * @default - None
466
520
*/
467
521
readonly contentType ?: string ;
468
522
@@ -473,6 +527,8 @@ export interface TransformInput {
473
527
474
528
/**
475
529
* Method to use to split the transform job's data files into smaller batches.
530
+ *
531
+ * @default NONE
476
532
*/
477
533
readonly splitType ?: SplitType ;
478
534
}
@@ -519,16 +575,22 @@ export interface TransformOutput {
519
575
520
576
/**
521
577
* MIME type used to specify the output data.
578
+ *
579
+ * @default - None
522
580
*/
523
581
readonly accept ?: string ;
524
582
525
583
/**
526
584
* Defines how to assemble the results of the transform job as a single S3 object.
585
+ *
586
+ * @default - None
527
587
*/
528
588
readonly assembleWith ?: AssembleWith ;
529
589
530
590
/**
531
591
* AWS KMS key that Amazon SageMaker uses to encrypt the model artifacts at rest using Amazon S3 server-side encryption.
592
+ *
593
+ * @default - default KMS key for Amazon S3 for your role's account.
532
594
*/
533
595
readonly encryptionKey ?: kms . Key ;
534
596
@@ -546,7 +608,7 @@ export interface TransformOutput {
546
608
export interface TransformResources {
547
609
548
610
/**
549
- * Nmber of ML compute instances to use in the transform job
611
+ * Number of ML compute instances to use in the transform job
550
612
*/
551
613
readonly instanceCount : number ;
552
614
@@ -557,6 +619,8 @@ export interface TransformResources {
557
619
558
620
/**
559
621
* AWS KMS key that Amazon SageMaker uses to encrypt data on the storage volume attached to the ML compute instance(s).
622
+ *
623
+ * @default - None
560
624
*/
561
625
readonly volumeKmsKeyId ?: kms . Key ;
562
626
}
0 commit comments