Skip to content

Commit a3e79c5

Browse files
AWS Batch for SageMaker Training jobs feature support. Includes new APIs for service job submission (e.g., SubmitServiceJob) and managing service environments (e.g., CreateServiceEnvironment) that enable queueing SageMaker Training jobs.
1 parent d053187 commit a3e79c5

File tree

79 files changed

+10420
-9
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

79 files changed

+10420
-9
lines changed

generator/ServiceModels/batch/batch-2016-08-10.api.json

Lines changed: 481 additions & 3 deletions
Large diffs are not rendered by default.

generator/ServiceModels/batch/batch-2016-08-10.docs.json

Lines changed: 299 additions & 2 deletions
Large diffs are not rendered by default.

generator/ServiceModels/batch/batch-2016-08-10.normal.json

Lines changed: 794 additions & 3 deletions
Large diffs are not rendered by default.

generator/ServiceModels/batch/batch-2016-08-10.paginators.json

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,12 @@
1818
"limit_key": "maxResults",
1919
"result_key": "jobQueues"
2020
},
21+
"DescribeServiceEnvironments": {
22+
"input_token": "nextToken",
23+
"output_token": "nextToken",
24+
"limit_key": "maxResults",
25+
"result_key": "serviceEnvironments"
26+
},
2127
"ListConsumableResources": {
2228
"input_token": "nextToken",
2329
"output_token": "nextToken",
@@ -41,6 +47,12 @@
4147
"output_token": "nextToken",
4248
"limit_key": "maxResults",
4349
"result_key": "schedulingPolicies"
50+
},
51+
"ListServiceJobs": {
52+
"input_token": "nextToken",
53+
"output_token": "nextToken",
54+
"limit_key": "maxResults",
55+
"result_key": "jobSummaryList"
4456
}
4557
}
4658
}

sdk/code-analysis/ServiceAnalysis/Batch/Generated/PropertyValueRules.xml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,10 @@
11
<?xml version="1.0" encoding="utf-16"?>
22
<property-value-rules>
3+
<property-value-rule>
4+
<property>Amazon.Batch.Model.SubmitServiceJobRequest.ClientToken</property>
5+
<min>1</min>
6+
<max>64</max>
7+
</property-value-rule>
38
<property-value-rule>
49
<property>Amazon.Batch.Model.UpdateConsumableResourceRequest.ClientToken</property>
510
<min>1</min>
Lines changed: 87 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,87 @@
1+
/*
2+
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License").
5+
* You may not use this file except in compliance with the License.
6+
* A copy of the License is located at
7+
*
8+
* http://aws.amazon.com/apache2.0
9+
*
10+
* or in the "license" file accompanying this file. This file is distributed
11+
* on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
12+
* express or implied. See the License for the specific language governing
13+
* permissions and limitations under the License.
14+
*/
15+
16+
/*
17+
* Do not modify this file. This file is generated from the batch-2016-08-10.normal.json service model.
18+
*/
19+
using System;
20+
using System.Collections.Generic;
21+
using System.Xml.Serialization;
22+
using System.Text;
23+
using System.IO;
24+
using System.Net;
25+
26+
using Amazon.Runtime;
27+
using Amazon.Runtime.Internal;
28+
29+
#pragma warning disable CS0612,CS0618,CS1570
30+
namespace Amazon.Batch.Model
31+
{
32+
/// <summary>
33+
/// Defines the capacity limit for a service environment. This structure specifies the
34+
/// maximum amount of resources that can be used by service jobs in the environment.
35+
/// </summary>
36+
public partial class CapacityLimit
37+
{
38+
private string _capacityUnit;
39+
private int? _maxCapacity;
40+
41+
/// <summary>
42+
/// Gets and sets the property CapacityUnit.
43+
/// <para>
44+
/// The unit of measure for the capacity limit. This defines how the maxCapacity value
45+
/// should be interpreted. For <c>SAGEMAKER_TRAINING</c> jobs, use <c>NUM_INSTANCES</c>.
46+
/// </para>
47+
/// </summary>
48+
public string CapacityUnit
49+
{
50+
get { return this._capacityUnit; }
51+
set { this._capacityUnit = value; }
52+
}
53+
54+
// Check to see if CapacityUnit property is set
55+
internal bool IsSetCapacityUnit()
56+
{
57+
return this._capacityUnit != null;
58+
}
59+
60+
/// <summary>
61+
/// Gets and sets the property MaxCapacity.
62+
/// <para>
63+
/// The maximum capacity available for the service environment. This value represents
64+
/// the maximum amount of resources that can be allocated to service jobs.
65+
/// </para>
66+
///
67+
/// <para>
68+
/// For example, <c>maxCapacity=50</c>, <c>capacityUnit=NUM_INSTANCES</c>. This indicates
69+
/// that the maximum number of instances that can be run on this service environment is
70+
/// 50. You could then run 5 SageMaker Training jobs that each use 10 instances. However,
71+
/// if you submit another job that requires 10 instances, it will wait in the queue.
72+
/// </para>
73+
/// </summary>
74+
public int? MaxCapacity
75+
{
76+
get { return this._maxCapacity; }
77+
set { this._maxCapacity = value; }
78+
}
79+
80+
// Check to see if MaxCapacity property is set
81+
internal bool IsSetMaxCapacity()
82+
{
83+
return this._maxCapacity.HasValue;
84+
}
85+
86+
}
87+
}

sdk/src/Services/Batch/Generated/Model/CreateJobQueueRequest.cs

Lines changed: 47 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,9 +47,11 @@ public partial class CreateJobQueueRequest : AmazonBatchRequest
4747
{
4848
private List<ComputeEnvironmentOrder> _computeEnvironmentOrder = AWSConfigs.InitializeCollections ? new List<ComputeEnvironmentOrder>() : null;
4949
private string _jobQueueName;
50+
private JobQueueType _jobQueueType;
5051
private List<JobStateTimeLimitAction> _jobStateTimeLimitActions = AWSConfigs.InitializeCollections ? new List<JobStateTimeLimitAction>() : null;
5152
private int? _priority;
5253
private string _schedulingPolicyArn;
54+
private List<ServiceEnvironmentOrder> _serviceEnvironmentOrder = AWSConfigs.InitializeCollections ? new List<ServiceEnvironmentOrder>() : null;
5355
private JQState _state;
5456
private Dictionary<string, string> _tags = AWSConfigs.InitializeCollections ? new Dictionary<string, string>() : null;
5557

@@ -77,7 +79,6 @@ public partial class CreateJobQueueRequest : AmazonBatchRequest
7779
/// to distinguish between a property not set or a property being empty to clear out a value. To retain the previous
7880
/// SDK behavior set the AWSConfigs.InitializeCollections static property to true.
7981
/// </summary>
80-
[AWSProperty(Required=true)]
8182
public List<ComputeEnvironmentOrder> ComputeEnvironmentOrder
8283
{
8384
get { return this._computeEnvironmentOrder; }
@@ -110,6 +111,26 @@ internal bool IsSetJobQueueName()
110111
return this._jobQueueName != null;
111112
}
112113

114+
/// <summary>
115+
/// Gets and sets the property JobQueueType.
116+
/// <para>
117+
/// The type of job queue. For service jobs that run on SageMaker Training, this value
118+
/// is <c>SAGEMAKER_TRAINING</c>. For regular container jobs, this value is <c>EKS</c>,
119+
/// <c>ECS</c>, or <c>ECS_FARGATE</c> depending on the compute environment.
120+
/// </para>
121+
/// </summary>
122+
public JobQueueType JobQueueType
123+
{
124+
get { return this._jobQueueType; }
125+
set { this._jobQueueType = value; }
126+
}
127+
128+
// Check to see if JobQueueType property is set
129+
internal bool IsSetJobQueueType()
130+
{
131+
return this._jobQueueType != null;
132+
}
133+
113134
/// <summary>
114135
/// Gets and sets the property JobStateTimeLimitActions.
115136
/// <para>
@@ -198,6 +219,31 @@ internal bool IsSetSchedulingPolicyArn()
198219
return this._schedulingPolicyArn != null;
199220
}
200221

222+
/// <summary>
223+
/// Gets and sets the property ServiceEnvironmentOrder.
224+
/// <para>
225+
/// A list of service environments that this job queue can use to allocate jobs. All serviceEnvironments
226+
/// must have the same type. A job queue can't have both a serviceEnvironmentOrder and
227+
/// a computeEnvironmentOrder field.
228+
/// </para>
229+
/// <para />
230+
/// Starting with version 4 of the SDK this property will default to null. If no data for this property is returned
231+
/// from the service the property will also be null. This was changed to improve performance and allow the SDK and caller
232+
/// to distinguish between a property not set or a property being empty to clear out a value. To retain the previous
233+
/// SDK behavior set the AWSConfigs.InitializeCollections static property to true.
234+
/// </summary>
235+
public List<ServiceEnvironmentOrder> ServiceEnvironmentOrder
236+
{
237+
get { return this._serviceEnvironmentOrder; }
238+
set { this._serviceEnvironmentOrder = value; }
239+
}
240+
241+
// Check to see if ServiceEnvironmentOrder property is set
242+
internal bool IsSetServiceEnvironmentOrder()
243+
{
244+
return this._serviceEnvironmentOrder != null && (this._serviceEnvironmentOrder.Count > 0 || !AWSConfigs.InitializeCollections);
245+
}
246+
201247
/// <summary>
202248
/// Gets and sets the property State.
203249
/// <para>
Lines changed: 157 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,157 @@
1+
/*
2+
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License").
5+
* You may not use this file except in compliance with the License.
6+
* A copy of the License is located at
7+
*
8+
* http://aws.amazon.com/apache2.0
9+
*
10+
* or in the "license" file accompanying this file. This file is distributed
11+
* on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
12+
* express or implied. See the License for the specific language governing
13+
* permissions and limitations under the License.
14+
*/
15+
16+
/*
17+
* Do not modify this file. This file is generated from the batch-2016-08-10.normal.json service model.
18+
*/
19+
using System;
20+
using System.Collections.Generic;
21+
using System.Xml.Serialization;
22+
using System.Text;
23+
using System.IO;
24+
using System.Net;
25+
26+
using Amazon.Runtime;
27+
using Amazon.Runtime.Internal;
28+
29+
#pragma warning disable CS0612,CS0618,CS1570
30+
namespace Amazon.Batch.Model
31+
{
32+
/// <summary>
33+
/// Container for the parameters to the CreateServiceEnvironment operation.
34+
/// Creates a service environment for running service jobs. Service environments define
35+
/// capacity limits for specific service types such as SageMaker Training jobs.
36+
/// </summary>
37+
public partial class CreateServiceEnvironmentRequest : AmazonBatchRequest
38+
{
39+
private List<CapacityLimit> _capacityLimits = AWSConfigs.InitializeCollections ? new List<CapacityLimit>() : null;
40+
private string _serviceEnvironmentName;
41+
private ServiceEnvironmentType _serviceEnvironmentType;
42+
private ServiceEnvironmentState _state;
43+
private Dictionary<string, string> _tags = AWSConfigs.InitializeCollections ? new Dictionary<string, string>() : null;
44+
45+
/// <summary>
46+
/// Gets and sets the property CapacityLimits.
47+
/// <para>
48+
/// The capacity limits for the service environment. The number of instances a job consumes
49+
/// is the total number of instances requested in the submit training job request resource
50+
/// configuration.
51+
/// </para>
52+
/// <para />
53+
/// Starting with version 4 of the SDK this property will default to null. If no data for this property is returned
54+
/// from the service the property will also be null. This was changed to improve performance and allow the SDK and caller
55+
/// to distinguish between a property not set or a property being empty to clear out a value. To retain the previous
56+
/// SDK behavior set the AWSConfigs.InitializeCollections static property to true.
57+
/// </summary>
58+
[AWSProperty(Required=true)]
59+
public List<CapacityLimit> CapacityLimits
60+
{
61+
get { return this._capacityLimits; }
62+
set { this._capacityLimits = value; }
63+
}
64+
65+
// Check to see if CapacityLimits property is set
66+
internal bool IsSetCapacityLimits()
67+
{
68+
return this._capacityLimits != null && (this._capacityLimits.Count > 0 || !AWSConfigs.InitializeCollections);
69+
}
70+
71+
/// <summary>
72+
/// Gets and sets the property ServiceEnvironmentName.
73+
/// <para>
74+
/// The name for the service environment. It can be up to 128 characters long and can
75+
/// contain letters, numbers, hyphens (-), and underscores (_).
76+
/// </para>
77+
/// </summary>
78+
[AWSProperty(Required=true)]
79+
public string ServiceEnvironmentName
80+
{
81+
get { return this._serviceEnvironmentName; }
82+
set { this._serviceEnvironmentName = value; }
83+
}
84+
85+
// Check to see if ServiceEnvironmentName property is set
86+
internal bool IsSetServiceEnvironmentName()
87+
{
88+
return this._serviceEnvironmentName != null;
89+
}
90+
91+
/// <summary>
92+
/// Gets and sets the property ServiceEnvironmentType.
93+
/// <para>
94+
/// The type of service environment. For SageMaker Training jobs, specify <c>SAGEMAKER_TRAINING</c>.
95+
/// </para>
96+
/// </summary>
97+
[AWSProperty(Required=true)]
98+
public ServiceEnvironmentType ServiceEnvironmentType
99+
{
100+
get { return this._serviceEnvironmentType; }
101+
set { this._serviceEnvironmentType = value; }
102+
}
103+
104+
// Check to see if ServiceEnvironmentType property is set
105+
internal bool IsSetServiceEnvironmentType()
106+
{
107+
return this._serviceEnvironmentType != null;
108+
}
109+
110+
/// <summary>
111+
/// Gets and sets the property State.
112+
/// <para>
113+
/// The state of the service environment. Valid values are <c>ENABLED</c> and <c>DISABLED</c>.
114+
/// The default value is <c>ENABLED</c>.
115+
/// </para>
116+
/// </summary>
117+
public ServiceEnvironmentState State
118+
{
119+
get { return this._state; }
120+
set { this._state = value; }
121+
}
122+
123+
// Check to see if State property is set
124+
internal bool IsSetState()
125+
{
126+
return this._state != null;
127+
}
128+
129+
/// <summary>
130+
/// Gets and sets the property Tags.
131+
/// <para>
132+
/// The tags that you apply to the service environment to help you categorize and organize
133+
/// your resources. Each tag consists of a key and an optional value. For more information,
134+
/// see <a href="https://docs.aws.amazon.com/batch/latest/userguide/using-tags.html">Tagging
135+
/// your Batch resources</a>.
136+
/// </para>
137+
/// <para />
138+
/// Starting with version 4 of the SDK this property will default to null. If no data for this property is returned
139+
/// from the service the property will also be null. This was changed to improve performance and allow the SDK and caller
140+
/// to distinguish between a property not set or a property being empty to clear out a value. To retain the previous
141+
/// SDK behavior set the AWSConfigs.InitializeCollections static property to true.
142+
/// </summary>
143+
[AWSProperty(Min=1, Max=50)]
144+
public Dictionary<string, string> Tags
145+
{
146+
get { return this._tags; }
147+
set { this._tags = value; }
148+
}
149+
150+
// Check to see if Tags property is set
151+
internal bool IsSetTags()
152+
{
153+
return this._tags != null && (this._tags.Count > 0 || !AWSConfigs.InitializeCollections);
154+
}
155+
156+
}
157+
}

0 commit comments

Comments
 (0)