|
1 | 1 | ---
|
2 |
| -title: Schedule your jobs |
3 |
| -description: Use job scheduling to manage your tasks. |
| 2 | +title: Schedule Batch jobs for efficiency |
| 3 | +description: Learn how to schedule Batch jobs to manage your tasks, prioritize jobs to run first, and minimize resource usage. |
4 | 4 | ms.topic: how-to
|
5 |
| -ms.date: 07/16/2021 |
| 5 | +ms.date: 04/10/2023 |
6 | 6 | ms.custom: seodec18
|
7 | 7 | ---
|
8 | 8 |
|
9 |
| -# Schedule jobs for efficiency |
| 9 | +# Schedule Batch jobs for efficiency |
10 | 10 |
|
11 |
| -Scheduling Batch jobs enables you to prioritize the jobs you want to run first, while taking into account [tasks that have dependencies on other tasks](batch-task-dependencies.md). By scheduling your jobs, you can make sure you use the least amount of resources. Nodes can be decommissioned when not needed, and tasks that are dependent on other tasks are spun up just in time optimizing the workflows. You can also set jobs to autocomplete, since only one job at a time runs, and a new one won't start until the previous one completes. |
| 11 | +Scheduling Batch jobs lets you prioritize the jobs you want to run first, while taking into account [task dependencies](batch-task-dependencies.md). You can also make sure to use the least amount of resources. Nodes can be decommissioned when not needed, and tasks that are dependent on other tasks are spun up just in time to optimize the workflows. Since only one job at a time runs, jobs can be set to autocomplete, and a new one doesn't start until the previous one completes. |
12 | 12 |
|
13 |
| -The tasks you schedule using the job manager task are associated with a job. The job manager task will create tasks for the job. To do so, the job manager task needs to authenticate with the Batch account. Use the the AZ_BATCH_AUTHENTICATION_TOKEN access token. The token will allow access to the rest of the job. |
| 13 | +The tasks you schedule using the job manager task are associated with a job. The job manager task will create tasks for the job. To do so, the job manager task needs to authenticate with the Batch account. Use the *AZ_BATCH_AUTHENTICATION_TOKEN* access token. The token allows access to the rest of the job. |
14 | 14 |
|
15 | 15 | To manage a job using the Azure CLI, see [az batch job-schedule](/cli/azure/batch/job-schedule). You can also create job schedules in the Azure portal.
|
16 | 16 |
|
17 | 17 | ## Schedule a job in the Azure portal
|
18 | 18 |
|
19 |
| -1. Sign in to the [Azure portal](https://portal.azure.com/). |
| 19 | +1. Sign in to the [Azure portal](https://portal.azure.com). |
20 | 20 | 1. Select the Batch account you want to schedule jobs in.
|
21 | 21 | 1. In the left navigation pane, select **Job schedules**.
|
22 | 22 | 1. Select **Add** to create a new job schedule.
|
23 |
| -1. In the **Basic form**, enter the following information: |
| 23 | + |
| 24 | + :::image type="content" source="media/batch-job-schedule/add-job-schedule.png" alt-text="Screenshot of the Add button for job schedules."::: |
| 25 | + |
| 26 | +1. Under **Basic form**, enter the following information: |
24 | 27 | - **Job schedule ID**: A unique identifier for this job schedule.
|
25 | 28 | - **Display name**: This name is optional and doesn't have to be unique. It has a maximum length of 1024 characters.
|
| 29 | + |
| 30 | + :::image type="content" source="media/batch-job-schedule/add-job-schedule-01.png" alt-text="Screenshot of the Basic form section of the job schedule options."::: |
| 31 | + |
| 32 | +1. In the **Schedule** section, enter the following information: |
26 | 33 | - **Do not run until**: Specifies the earliest time the job will run. If you don't set this, the schedule becomes ready to run jobs immediately.
|
27 |
| - - **Do not run after**: No jobs will run after the time you enter here. If you don't specify a time, then you are creating a recurring job schedule, which remains active until you explicitly terminate it. |
28 |
| - - **Recurrence interval**: Select **Enabled** if you want to specify the amount of time between jobs. You can have only one job at a time scheduled, so if it is time to create a new job under a job schedule, but the previous job is still running, the Batch service won't create the new job until the previous job finishes. |
| 34 | + - **Do not run after**: No jobs will run after the time you enter here. If you don't specify a time, then you're creating a recurring job schedule, which remains active until you explicitly terminate it. |
| 35 | + - **Recurrence interval**: Select **Enabled** if you want to specify the amount of time between jobs. You can have only one job at a time scheduled, so if it's time to create a new job under a job schedule but the previous job is still running, the Batch service won't create the new job until the previous job finishes. |
29 | 36 | - **Start window**: Select **Custom** if you'd like to specify the time interval within which a job must be created. If a job isn't created within this window, no new job will be created until the next recurrence of the schedule.
|
30 | 37 |
|
31 |
| - :::image type="content" source="media/batch-job-schedule/add-job-schedule-02.png" alt-text="Screenshot of the Add job schedule options in the Azure portal."::: |
| 38 | + :::image type="content" source="media/batch-job-schedule/add-job-schedule-02.png" alt-text="Screenshot of the Schedule section of the job schedule options."::: |
| 39 | + |
| 40 | +1. In the **Job Specification** section, enter the following information: |
| 41 | + - **Pool ID**: Select the pool where you want the job to run. To choose from a list of pools in your Batch account, select **Update**. |
| 42 | + - **Job configuration task**: Select **Update** to name and configure the job manager task, as well as the job preparation task and job release tasks, if you're using them. |
| 43 | + |
| 44 | + :::image type="content" source="media/batch-job-schedule/add-job-schedule-03.png" alt-text="Screenshot of the job specification options for a new job schedule."::: |
32 | 45 |
|
33 |
| -1. At the bottom of the basic form, specify the pool on which you want the job to run. To choose from a list of pools in your Batch account, select **Update**. |
34 |
| -1. Along with the **Pool ID**, enter the following information: |
35 |
| - - **Job configuration task**: Select **Update** to name and configure the job manager task, as well as the job preparation task and job release tasks, if you are using them. |
| 46 | +1. In the **Advanced settings** section, enter the following information: |
36 | 47 | - **Display name**: This name is optional and doesn't have to be unique. It has a maximum length of 1024 characters.
|
37 | 48 | - **Priority**: Use the slider to set a priority for the job, or enter a value in the box.
|
38 | 49 | - **Max wall clock time**: Select **Custom** if you want to set a maximum amount of time for the job to run. If you do so, Batch will terminate the job if it doesn't complete within that time frame.
|
39 |
| - - **Max task retry count**: Select **Custom** if you want to specify the number of times a task can be retried, or **Unlimited** if you want the task to be tried for as many times as is needed. This is not the same as the number of retries an API call might have. |
40 |
| - - **When all tasks complete**: The default is NoAction, but you can select **TerminateJob** if you prefer to terminate the job when all tasks have been completed (or if there are no tasks in the job). |
41 |
| - - **When a task fails**: A task fails if the retry count is exhausted or there was an error when starting the task. The default is NoAction, but you can select **PerformExitOptionsJobAction** if you prefer to take the action associated with the task's exit condition if it fails. |
| 50 | + - **Max task retry count**: Select **Custom** if you want to specify the number of times a task can be retried, or **Unlimited** if you want the task to be tried for as many times as is needed. This isn't the same as the number of retries an API call might have. |
| 51 | + - **When all tasks complete**: The default is *NoAction*, but you can select *TerminateJob* if you prefer to terminate the job when all tasks have been completed (or if there are no tasks in the job). |
| 52 | + - **When a task fails**: A task fails if the retry count is exhausted or there's an error when starting the task. The default is *NoAction*, but you can select *PerformExitOptionsJobAction* if you prefer to take the action associated with the task's exit condition if it fails. |
42 | 53 |
|
43 |
| - :::image type="content" source="media/batch-job-schedule/add-job-schedule-03.png" alt-text="Screenshot of the job specification options for a new job schedule in the Azure portal."::: |
| 54 | + :::image type="content" source="media/batch-job-schedule/add-job-schedule-04.png" alt-text="Screenshot of the Advanced settings for a new job schedule."::: |
44 | 55 |
|
45 | 56 | 1. Select **Save** to create your job schedule.
|
46 | 57 |
|
|
0 commit comments