You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: articles/batch/batch-job-prep-release.md
+3-3Lines changed: 3 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -2,7 +2,7 @@
2
2
title: Job preparation and release tasks on Batch compute nodes
3
3
description: Use job-level preparation tasks to minimize data transfer to Azure Batch compute nodes, and release tasks for node cleanup at job completion.
An Azure Batch job often requires setup before its tasks are executed, and post-job maintenance when its tasks are completed. For example, you might need to download common task input data to your compute nodes, or upload task output data to Azure Storage after the job completes. You can use *job preparation* and *job release* tasks for these operations.
13
13
14
14
- A job preparation task runs before a job's tasks, on all compute nodes scheduled to run at least one task.
15
-
- A job release task runs once the job is completed, on each node in the pool that executed at least one task.
15
+
- A job release task runs once the job is completed, on each node in the pool that ran a job preparation task.
16
16
17
17
As with other Batch tasks, you can specify a command line to invoke when a job preparation or release task runs. Job preparation and release tasks offer familiar Batch task features such as:
18
18
@@ -53,7 +53,7 @@ The job preparation task runs only on nodes that are scheduled to run a task. Th
53
53
54
54
## Job release task
55
55
56
-
Once you mark a job as completed, the job release task runs on each node in the pool that ran at least one task. You mark a job as completed by issuing a terminate request. This request sets the job state to *terminating*, terminates any active or running tasks associated with the job, and runs the job release task. The job then moves to the *completed* state.
56
+
Once you mark a job as completed, the job release task runs on each node in the pool that ran a job preparation task. You mark a job as completed by issuing a terminate request. This request sets the job state to *terminating*, terminates any active or running tasks associated with the job, and runs the job release task. The job then moves to the *completed* state.
57
57
58
58
> [!NOTE]
59
59
> Deleting a job also executes the job release task. However, if a job is already terminated, the release task doesn't run a second time if the job is later deleted.
Copy file name to clipboardExpand all lines: articles/batch/batch-job-task-error-checking.md
+8-8Lines changed: 8 additions & 8 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -7,15 +7,15 @@ ms.date: 04/11/2023
7
7
8
8
# Azure Batch job and task errors
9
9
10
-
Various errors can happen when you add Azure Batch jobs and tasks or when you schedule and run jobs and tasks. It's usually straightforward to detect errors that occur when you add jobs and tasks, because the API, command line, or user interface returns any failures immediately. This article covers how to check for and handle errors that occur after jobs and tasks are submitted.
10
+
Various errors can happen when you add Azure Batch jobs and tasks or when you schedule and run jobs and tasks. It's usually straightforward to detect errors that occur when you add jobs and tasks. The API, command line, or user interface returns any failures immediately. This article covers how to check for and handle errors that occur after jobs and tasks are submitted.
11
11
12
12
## Job failures
13
13
14
14
A job is a group of one or more tasks, which specify command lines to run. You can specify the following optional parameters when you add a job. These parameters influence how the job can fail.
15
15
16
-
-[JobConstraints](/rest/api/batchservice/job/add#jobconstraints). You can optionally use the `maxWallClockTime` property to set the maximum amount of time a job can be active or running. If the job exceeds the `maxWallClockTime`, the job terminates with the `terminateReason` property set in the [JobExecutionInformation](/rest/api/batchservice/job/get#jobexecutioninformation).
16
+
-[JobConstraints](/rest/api/batchservice/job/add#jobconstraints). You can optionally use the `maxWallClockTime` property to set the maximum amount of time a job can be active or running. If the job exceeds the `maxWallClockTime`, the job terminates with the `terminateReason` property set to `MaxWallClockTimeExpiry`in the [JobExecutionInformation](/rest/api/batchservice/job/get#jobexecutioninformation).
17
17
18
-
-[JobPreparationTask](/rest/api/batchservice/job/add#jobpreparationtask). You can optionally specify a job preparation task to run on a node the first time it runs a task for the job. If the job preparation task fails, the task doesn't run and the job doesn't complete.
18
+
-[JobPreparationTask](/rest/api/batchservice/job/add#jobpreparationtask). You can optionally specify a job preparation task to run on each compute node scheduled to run a job task. The node runs the job preparation task before the first time it runs a task for the job. If the job preparation task fails, the task doesn't run and the job doesn't complete.
19
19
20
20
-[JobReleaseTask](/rest/api/batchservice/job/add#jobreleasetask). You can optionally specify a job release task for jobs that have a job preparation task. When a job is being terminated, the job release task runs on each pool node that ran a job preparation task. If a job release task fails, the job still moves to a `completed` state.
21
21
@@ -31,7 +31,7 @@ Check the following job properties in the [JobExecutionInformation](/rest/api/ba
31
31
32
32
### Job preparation tasks
33
33
34
-
An instance of a [job preparation task](batch-job-prep-release.md#job-preparation-task) runs on a node the first time the node runs a task for the job. You can think of the job preparation task as a task template, with multiple instances being run, up to the number of nodes in a pool. Check the job preparation task instances to determine if there were errors.
34
+
An instance of a [job preparation task](batch-job-prep-release.md#job-preparation-task) runs on each compute node the first time the node runs a task for the job. You can think of the job preparation task as a task template, with multiple instances being run, up to the number of nodes in a pool. Check the job preparation task instances to determine if there were errors.
35
35
36
36
You can use the [Job - List Preparation and Release Task Status](/rest/api/batchservice/job/listpreparationandreleasetaskstatus) API to list the execution status of all instances of job preparation and release tasks for a specified job. As with other tasks, [JobPreparationTaskExecutionInformation](/rest/api/batchservice/job/listpreparationandreleasetaskstatus#jobpreparationtaskexecutioninformation) is available with properties such as `failureInfo`, `exitCode`, and `result`.
37
37
@@ -71,21 +71,21 @@ Consider the impact of task failures on the job and on any task dependencies. Yo
71
71
72
72
Task command lines don't run under a shell on compute nodes, so they can't natively use shell features such as environment variable expansion. To take advantage of such features, you must invoke the shell in the command line. For more information, see [Command-line expansion of environment variables](batch-compute-node-environment-variables.md#command-line-expansion-of-environment-variables).
73
73
74
-
Task command line output writes to *stderr.txt* and *stdout.txt*. Your application might also write to application-specific log files. Make sure to implement comprehensive error checking for your application to promptly detect and diagnose issues.
74
+
Task command line output writes to *stderr.txt* and *stdout.txt* files. Your application might also write to application-specific log files. Make sure to implement comprehensive error checking for your application to promptly detect and diagnose issues.
75
75
76
76
If the pool node that ran a task still exists, you can get and view the log files. Several APIs allow listing and getting task files, such as [File - Get From Task](/rest/api/batchservice/file/getfromtask). You can also list and view log files for a task or pool node by using the Azure portal.
77
77
78
78
1. At the top of the **Overview** page for a node, select **Upload batch logs**.
79
79
80
-

80
+

81
81
82
82
1. On the **Upload Batch logs** page, select **Pick storage container**, select an Azure Storage container to upload to, and then select **Start upload**.
83
83
84
-

84
+

85
85
86
86
1. On the storage container page, you can view, open, or download the logs.
87
87
88
-

88
+

89
89
90
90
Because Batch pools and pool nodes are often ephemeral, with nodes being continuously added and deleted, it's best to save the log files from job runs. You can use task output files for a convenient way to save log files to Azure Storage. For more information, see [Persist task data to Azure Storage with the Batch service API](batch-task-output-files.md).
0 commit comments