-
Notifications
You must be signed in to change notification settings - Fork 250
/
Copy pathazure.batch.models.BatchJobPreparationTask.yml
425 lines (317 loc) · 15 KB
/
azure.batch.models.BatchJobPreparationTask.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
### YamlMime:PythonClass
uid: azure.batch.models.BatchJobPreparationTask
name: BatchJobPreparationTask
fullName: azure.batch.models.BatchJobPreparationTask
module: azure.batch.models
summary: 'A Job Preparation Task to run before any Tasks of the Job on any given Compute
Node.
You can use Job Preparation to prepare a Node to run Tasks for the Job.
Activities commonly performed in Job Preparation include: Downloading common
resource files used by all the Tasks in the Job. The Job Preparation Task can
download these common resource files to the shared location on the Node.
(AZ_BATCH_NODE_ROOT_DIRshared), or starting a local service on the Node so
that all Tasks of that Job can communicate with it. If the Job Preparation Task
fails (that is, exhausts its retry count before exiting with exit code 0),
Batch will not run Tasks of this Job on the Node. The Compute Node remains
ineligible to run Tasks of this Job until it is reimaged. The Compute Node
remains active and can be used for other Jobs. The Job Preparation Task can run
multiple times on the same Node. Therefore, you should write the Job
Preparation Task to handle re-execution. If the Node is rebooted, the Job
Preparation Task is run again on the Compute Node before scheduling any other
Task of the Job, if rerunOnNodeRebootAfterSuccess is true or if the Job
Preparation Task did not previously complete. If the Node is reimaged, the Job
Preparation Task is run again before scheduling any Task of the Job. Batch will
retry Tasks when a recovery operation is triggered on a Node. Examples of
recovery operations include (but are not limited to) when an unhealthy Node is
rebooted or a Compute Node disappeared due to host failure. Retries due to
recovery operations are independent of and are not counted against the
maxTaskRetryCount. Even if the maxTaskRetryCount is 0, an internal retry due to
a recovery operation may occur. Because of this, all Tasks should be
idempotent. This means Tasks need to tolerate being interrupted and restarted
without causing any corruption or duplicate data. The best practice for long
running Tasks is to use some form of checkpointing.
All required parameters must be populated in order to send to server.'
constructor:
syntax: 'BatchJobPreparationTask(*args: Any, **kwargs: Any)'
variables:
- description: 'A string that uniquely identifies the Job Preparation Task within
the Job. The ID can
contain any combination of alphanumeric characters including hyphens and underscores
and cannot
contain more than 64 characters. If you do not specify this property, the Batch
service assigns
a default value of ''jobpreparation''. No other Task in the Job can have the same
ID as the Job
Preparation Task. If you try to submit a Task with the same id, the Batch service
rejects the
request with error code TaskIdSameAsJobPreparationTask; if you are calling the
REST API
directly, the HTTP status code is 409 (Conflict).'
name: id
types:
- <xref:str>
- description: 'The command line of the Job Preparation Task. The command line does
not run
under a shell, and therefore cannot take advantage of shell features such as environment
variable expansion. If you want to take advantage of such features, you should
invoke the shell
in the command line, for example using "cmd /c MyCommand" in Windows or "/bin/sh
-c MyCommand"
in Linux. If the command line refers to file paths, it should use a relative path
(relative to
the Task working directory), or use the Batch provided environment variable
([https://docs.microsoft.com/en-us/azure/batch/batch-compute-node-environment-variables](https://docs.microsoft.com/en-us/azure/batch/batch-compute-node-environment-variables)).
Required.'
name: command_line
types:
- <xref:str>
- description: 'The settings for the container under which the Job Preparation Task
runs. When this is specified, all directories recursively below the AZ_BATCH_NODE_ROOT_DIR
(the
root of Azure Batch directories on the node) are mapped into the container, all
Task
environment variables are mapped into the container, and the Task command line
is executed in
the container. Files produced in the container outside of AZ_BATCH_NODE_ROOT_DIR
might not be
reflected to the host disk, meaning that Batch file APIs will not be able to access
those
files.'
name: container_settings
types:
- <xref:azure.batch.models.BatchTaskContainerSettings>
- description: 'A list of files that the Batch service will download to the Compute
Node
before running the command line. Files listed under this element are located in
the Task''s
working directory. There is a maximum size for the list of resource files. When
the max size
is exceeded, the request will fail and the response error code will be RequestEntityTooLarge.
If this occurs, the collection of ResourceFiles must be reduced in size. This
can be achieved
using .zip files, Application Packages, or Docker Containers.'
name: resource_files
types:
- <xref:list>[<xref:azure.batch.models.ResourceFile>]
- description: 'A list of environment variable settings for the Job Preparation
Task.'
name: environment_settings
types:
- <xref:list>[<xref:azure.batch.models.EnvironmentSetting>]
- description: Constraints that apply to the Job Preparation Task.
name: constraints
types:
- <xref:azure.batch.models.BatchTaskConstraints>
- description: 'Whether the Batch service should wait for the Job Preparation Task
to
complete successfully before scheduling any other Tasks of the Job on the Compute
Node. A Job
Preparation Task has completed successfully if it exits with exit code 0. If true
and the Job
Preparation Task fails on a Node, the Batch service retries the Job Preparation
Task up to its
maximum retry count (as specified in the constraints element). If the Task has
still not
completed successfully after all retries, then the Batch service will not schedule
Tasks of the
Job to the Node. The Node remains active and eligible to run Tasks of other Jobs.
If false, the
Batch service will not wait for the Job Preparation Task to complete. In this
case, other Tasks
of the Job can start executing on the Compute Node while the Job Preparation Task
is still
running; and even if the Job Preparation Task fails, new Tasks will continue to
be scheduled on
the Compute Node. The default value is true.'
name: wait_for_success
types:
- <xref:bool>
- description: 'The user identity under which the Job Preparation Task runs. If omitted,
the Task runs as a non-administrative user unique to the Task on Windows Compute
Nodes, or a
non-administrative user unique to the Pool on Linux Compute Nodes.'
name: user_identity
types:
- <xref:azure.batch.models.UserIdentity>
- description: 'Whether the Batch service should rerun the Job
Preparation Task after a Compute Node reboots. The Job Preparation Task is always
rerun if a
Compute Node is reimaged, or if the Job Preparation Task did not complete (e.g.
because the
reboot occurred while the Task was running). Therefore, you should always write
a Job
Preparation Task to be idempotent and to behave correctly if run multiple times.
The default
value is true.'
name: rerun_on_node_reboot_after_success
types:
- <xref:bool>
methods:
- uid: azure.batch.models.BatchJobPreparationTask.as_dict
name: as_dict
summary: Return a dict that can be JSONify using json.dump.
signature: 'as_dict(*, exclude_readonly: bool = False) -> Dict[str, Any]'
keywordOnlyParameters:
- name: exclude_readonly
description: Whether to remove the readonly properties.
types:
- <xref:bool>
return:
description: A dict JSON compatible object
types:
- <xref:dict>
- uid: azure.batch.models.BatchJobPreparationTask.clear
name: clear
signature: clear() -> None
- uid: azure.batch.models.BatchJobPreparationTask.copy
name: copy
signature: copy() -> Model
- uid: azure.batch.models.BatchJobPreparationTask.get
name: get
signature: 'get(key: str, default: Any = None) -> Any'
parameters:
- name: key
isRequired: true
- name: default
defaultValue: None
- uid: azure.batch.models.BatchJobPreparationTask.items
name: items
signature: items() -> ItemsView[str, Any]
- uid: azure.batch.models.BatchJobPreparationTask.keys
name: keys
signature: keys() -> KeysView[str]
- uid: azure.batch.models.BatchJobPreparationTask.pop
name: pop
signature: 'pop(key: str, default: ~typing.Any = <object object>) -> Any'
parameters:
- name: key
isRequired: true
- name: default
- uid: azure.batch.models.BatchJobPreparationTask.popitem
name: popitem
signature: popitem() -> Tuple[str, Any]
- uid: azure.batch.models.BatchJobPreparationTask.setdefault
name: setdefault
signature: 'setdefault(key: str, default: ~typing.Any = <object object>) -> Any'
parameters:
- name: key
isRequired: true
- name: default
- uid: azure.batch.models.BatchJobPreparationTask.update
name: update
signature: 'update(*args: Any, **kwargs: Any) -> None'
- uid: azure.batch.models.BatchJobPreparationTask.values
name: values
signature: values() -> ValuesView[Any]
attributes:
- uid: azure.batch.models.BatchJobPreparationTask.command_line
name: command_line
summary: 'The command line of the Job Preparation Task. The command line does not
run under a shell, and
therefore cannot take advantage of shell features such as environment variable
expansion. If
you want to take advantage of such features, you should invoke the shell in the
command line,
for example using "cmd /c MyCommand" in Windows or "/bin/sh -c MyCommand" in Linux.
If the
command line refers to file paths, it should use a relative path (relative to
the Task working
directory), or use the Batch provided environment variable
([https://docs.microsoft.com/en-us/azure/batch/batch-compute-node-environment-variables](https://docs.microsoft.com/en-us/azure/batch/batch-compute-node-environment-variables)).
Required.'
signature: 'command_line: str'
- uid: azure.batch.models.BatchJobPreparationTask.constraints
name: constraints
summary: Constraints that apply to the Job Preparation Task.
signature: 'constraints: _models.BatchTaskConstraints | None'
- uid: azure.batch.models.BatchJobPreparationTask.container_settings
name: container_settings
summary: 'The settings for the container under which the Job Preparation Task runs.
When this is
specified, all directories recursively below the AZ_BATCH_NODE_ROOT_DIR (the root
of Azure
Batch directories on the node) are mapped into the container, all Task environment
variables
are mapped into the container, and the Task command line is executed in the container.
Files
produced in the container outside of AZ_BATCH_NODE_ROOT_DIR might not be reflected
to the host
disk, meaning that Batch file APIs will not be able to access those files.'
signature: 'container_settings: _models.BatchTaskContainerSettings | None'
- uid: azure.batch.models.BatchJobPreparationTask.environment_settings
name: environment_settings
summary: A list of environment variable settings for the Job Preparation Task.
signature: 'environment_settings: List[_models.EnvironmentSetting] | None'
- uid: azure.batch.models.BatchJobPreparationTask.id
name: id
summary: 'A string that uniquely identifies the Job Preparation Task within the
Job. The ID can contain
any combination of alphanumeric characters including hyphens and underscores and
cannot contain
more than 64 characters. If you do not specify this property, the Batch service
assigns a
default value of ''jobpreparation''. No other Task in the Job can have the same
ID as the Job
Preparation Task. If you try to submit a Task with the same id, the Batch service
rejects the
request with error code TaskIdSameAsJobPreparationTask; if you are calling the
REST API
directly, the HTTP status code is 409 (Conflict).'
signature: 'id: str | None'
- uid: azure.batch.models.BatchJobPreparationTask.rerun_on_node_reboot_after_success
name: rerun_on_node_reboot_after_success
summary: 'Whether the Batch service should rerun the Job Preparation Task after
a Compute Node reboots.
The Job Preparation Task is always rerun if a Compute Node is reimaged, or if
the Job
Preparation Task did not complete (e.g. because the reboot occurred while the
Task was
running). Therefore, you should always write a Job Preparation Task to be idempotent
and to
behave correctly if run multiple times. The default value is true.'
signature: 'rerun_on_node_reboot_after_success: bool | None'
- uid: azure.batch.models.BatchJobPreparationTask.resource_files
name: resource_files
summary: 'A list of files that the Batch service will download to the Compute Node
before running the
command line. Files listed under this element are located in the Task''s working
directory.
There is a maximum size for the list of resource files. When the max size is
exceeded, the
request will fail and the response error code will be RequestEntityTooLarge. If
this occurs,
the collection of ResourceFiles must be reduced in size. This can be achieved
using .zip files,
Application Packages, or Docker Containers.'
signature: 'resource_files: List[_models.ResourceFile] | None'
- uid: azure.batch.models.BatchJobPreparationTask.user_identity
name: user_identity
summary: 'The user identity under which the Job Preparation Task runs. If omitted,
the Task runs as a
non-administrative user unique to the Task on Windows Compute Nodes, or a non-administrative
user unique to the Pool on Linux Compute Nodes.'
signature: 'user_identity: _models.UserIdentity | None'
- uid: azure.batch.models.BatchJobPreparationTask.wait_for_success
name: wait_for_success
summary: 'Whether the Batch service should wait for the Job Preparation Task to
complete successfully
before scheduling any other Tasks of the Job on the Compute Node. A Job Preparation
Task has
completed successfully if it exits with exit code 0. If true and the Job Preparation
Task fails
on a Node, the Batch service retries the Job Preparation Task up to its maximum
retry count (as
specified in the constraints element). If the Task has still not completed successfully
after
all retries, then the Batch service will not schedule Tasks of the Job to the
Node. The Node
remains active and eligible to run Tasks of other Jobs. If false, the Batch service
will not
wait for the Job Preparation Task to complete. In this case, other Tasks of the
Job can start
executing on the Compute Node while the Job Preparation Task is still running;
and even if the
Job Preparation Task fails, new Tasks will continue to be scheduled on the Compute
Node. The
default value is true.'
signature: 'wait_for_success: bool | None'