Skip to content

Commit c4dcada

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 5908795 commit c4dcada

File tree

81 files changed

+11250
-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.

81 files changed

+11250
-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.GetValueOrDefault(); }
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: 42 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

@@ -72,7 +74,6 @@ public partial class CreateJobQueueRequest : AmazonBatchRequest
7274
/// </para>
7375
/// </note>
7476
/// </summary>
75-
[AWSProperty(Required=true)]
7677
public List<ComputeEnvironmentOrder> ComputeEnvironmentOrder
7778
{
7879
get { return this._computeEnvironmentOrder; }
@@ -105,6 +106,26 @@ internal bool IsSetJobQueueName()
105106
return this._jobQueueName != null;
106107
}
107108

109+
/// <summary>
110+
/// Gets and sets the property JobQueueType.
111+
/// <para>
112+
/// The type of job queue. For service jobs that run on SageMaker Training, this value
113+
/// is <c>SAGEMAKER_TRAINING</c>. For regular container jobs, this value is <c>EKS</c>,
114+
/// <c>ECS</c>, or <c>ECS_FARGATE</c> depending on the compute environment.
115+
/// </para>
116+
/// </summary>
117+
public JobQueueType JobQueueType
118+
{
119+
get { return this._jobQueueType; }
120+
set { this._jobQueueType = value; }
121+
}
122+
123+
// Check to see if JobQueueType property is set
124+
internal bool IsSetJobQueueType()
125+
{
126+
return this._jobQueueType != null;
127+
}
128+
108129
/// <summary>
109130
/// Gets and sets the property JobStateTimeLimitActions.
110131
/// <para>
@@ -188,6 +209,26 @@ internal bool IsSetSchedulingPolicyArn()
188209
return this._schedulingPolicyArn != null;
189210
}
190211

212+
/// <summary>
213+
/// Gets and sets the property ServiceEnvironmentOrder.
214+
/// <para>
215+
/// A list of service environments that this job queue can use to allocate jobs. All serviceEnvironments
216+
/// must have the same type. A job queue can't have both a serviceEnvironmentOrder and
217+
/// a computeEnvironmentOrder field.
218+
/// </para>
219+
/// </summary>
220+
public List<ServiceEnvironmentOrder> ServiceEnvironmentOrder
221+
{
222+
get { return this._serviceEnvironmentOrder; }
223+
set { this._serviceEnvironmentOrder = value; }
224+
}
225+
226+
// Check to see if ServiceEnvironmentOrder property is set
227+
internal bool IsSetServiceEnvironmentOrder()
228+
{
229+
return this._serviceEnvironmentOrder != null && (this._serviceEnvironmentOrder.Count > 0 || !AWSConfigs.InitializeCollections);
230+
}
231+
191232
/// <summary>
192233
/// Gets and sets the property State.
193234
/// <para>
Lines changed: 147 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,147 @@
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+
/// </summary>
53+
[AWSProperty(Required=true)]
54+
public List<CapacityLimit> CapacityLimits
55+
{
56+
get { return this._capacityLimits; }
57+
set { this._capacityLimits = value; }
58+
}
59+
60+
// Check to see if CapacityLimits property is set
61+
internal bool IsSetCapacityLimits()
62+
{
63+
return this._capacityLimits != null && (this._capacityLimits.Count > 0 || !AWSConfigs.InitializeCollections);
64+
}
65+
66+
/// <summary>
67+
/// Gets and sets the property ServiceEnvironmentName.
68+
/// <para>
69+
/// The name for the service environment. It can be up to 128 characters long and can
70+
/// contain letters, numbers, hyphens (-), and underscores (_).
71+
/// </para>
72+
/// </summary>
73+
[AWSProperty(Required=true)]
74+
public string ServiceEnvironmentName
75+
{
76+
get { return this._serviceEnvironmentName; }
77+
set { this._serviceEnvironmentName = value; }
78+
}
79+
80+
// Check to see if ServiceEnvironmentName property is set
81+
internal bool IsSetServiceEnvironmentName()
82+
{
83+
return this._serviceEnvironmentName != null;
84+
}
85+
86+
/// <summary>
87+
/// Gets and sets the property ServiceEnvironmentType.
88+
/// <para>
89+
/// The type of service environment. For SageMaker Training jobs, specify <c>SAGEMAKER_TRAINING</c>.
90+
/// </para>
91+
/// </summary>
92+
[AWSProperty(Required=true)]
93+
public ServiceEnvironmentType ServiceEnvironmentType
94+
{
95+
get { return this._serviceEnvironmentType; }
96+
set { this._serviceEnvironmentType = value; }
97+
}
98+
99+
// Check to see if ServiceEnvironmentType property is set
100+
internal bool IsSetServiceEnvironmentType()
101+
{
102+
return this._serviceEnvironmentType != null;
103+
}
104+
105+
/// <summary>
106+
/// Gets and sets the property State.
107+
/// <para>
108+
/// The state of the service environment. Valid values are <c>ENABLED</c> and <c>DISABLED</c>.
109+
/// The default value is <c>ENABLED</c>.
110+
/// </para>
111+
/// </summary>
112+
public ServiceEnvironmentState State
113+
{
114+
get { return this._state; }
115+
set { this._state = value; }
116+
}
117+
118+
// Check to see if State property is set
119+
internal bool IsSetState()
120+
{
121+
return this._state != null;
122+
}
123+
124+
/// <summary>
125+
/// Gets and sets the property Tags.
126+
/// <para>
127+
/// The tags that you apply to the service environment to help you categorize and organize
128+
/// your resources. Each tag consists of a key and an optional value. For more information,
129+
/// see <a href="https://docs.aws.amazon.com/batch/latest/userguide/using-tags.html">Tagging
130+
/// your Batch resources</a>.
131+
/// </para>
132+
/// </summary>
133+
[AWSProperty(Min=1, Max=50)]
134+
public Dictionary<string, string> Tags
135+
{
136+
get { return this._tags; }
137+
set { this._tags = value; }
138+
}
139+
140+
// Check to see if Tags property is set
141+
internal bool IsSetTags()
142+
{
143+
return this._tags != null && (this._tags.Count > 0 || !AWSConfigs.InitializeCollections);
144+
}
145+
146+
}
147+
}

0 commit comments

Comments
 (0)