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-compute-node-environment-variables.md
+44-10Lines changed: 44 additions & 10 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -34,7 +34,6 @@ The command lines executed by tasks on compute nodes don't run under a shell. Th
34
34
> [!NOTE]
35
35
> `AZ_BATCH_AUTHENTICATION_TOKEN` is deprecated and will be retired on September 30, 2024. See the [announcement](https://azure.microsoft.com/updates/azure-batch-task-authentication-token-will-be-retired-on-30-september-2024/) for details and alternative implementation.
36
36
37
-
38
37
| Variable name | Description | Availability | Example |
| AZ_BATCH_ACCOUNT_NAME | The name of the Batch account that the task belongs to. | All tasks. | mybatchaccount |
@@ -45,24 +44,59 @@ The command lines executed by tasks on compute nodes don't run under a shell. Th
45
44
| AZ_BATCH_HOST_LIST | The list of nodes that are allocated to a [multi-instance task](batch-mpi.md) in the format `nodeIP,nodeIP`. | Multi-instance primary and subtasks. |`10.0.0.4,10.0.0.5`|
46
45
| AZ_BATCH_IS_CURRENT_NODE_MASTER | Specifies whether the current node is the master node for a [multi-instance task](batch-mpi.md). Possible values are `true` and `false`.| Multi-instance primary and subtasks. |`true`|
47
46
| AZ_BATCH_JOB_ID | The ID of the job that the task belongs to. | All tasks except start task. | batchjob001 |
48
-
| AZ_BATCH_JOB_PREP_DIR | The full path of the job preparation [task directory](files-and-directories.md) on the node. | All tasks except start task and job preparation task. Only available if the job is configured with a job preparation task. |C:\user\tasks\workitems\jobprepreleasesamplejob\job-1\jobpreparation|
49
-
| AZ_BATCH_JOB_PREP_WORKING_DIR | The full path of the job preparation [task working directory](files-and-directories.md) on the node. | All tasks except start task and job preparation task. Only available if the job is configured with a job preparation task. |C:\user\tasks\workitems\jobprepreleasesamplejob\job-1\jobpreparation\wd|
47
+
| AZ_BATCH_JOB_PREP_DIR | The full path of the job preparation [task directory](files-and-directories.md) on the node. | All tasks except start task and job preparation task. Only available if the job is configured with a job preparation task. |[AZ_BATCH_JOB_PREP_DIR](#task-environment-variables-related-to-directory-location)|
48
+
| AZ_BATCH_JOB_PREP_WORKING_DIR | The full path of the job preparation [task working directory](files-and-directories.md) on the node. | All tasks except start task and job preparation task. Only available if the job is configured with a job preparation task. |[AZ_BATCH_JOB_PREP_WORKING_DIR](#task-environment-variables-related-to-directory-location)|
50
49
| AZ_BATCH_MASTER_NODE | The IP address and port of the compute node on which the primary task of a [multi-instance task](batch-mpi.md) runs. Do not use the port specified here for MPI or NCCL communication - it is reserved for the Azure Batch service. Use the variable MASTER_PORT instead, either by setting it with a value passed in through command line argument (port 6105 is a good default choice), or using the value AML sets if it does so. | Multi-instance primary and subtasks. |`10.0.0.4:6000`|
51
50
| AZ_BATCH_NODE_ID | The ID of the node that the task is assigned to. | All tasks. | tvm-1219235766_3-20160919t172711z |
52
51
| AZ_BATCH_NODE_IS_DEDICATED | If `true`, the current node is a dedicated node. If `false`, it is an [Azure Spot node](batch-spot-vms.md). | All tasks. |`true`|
53
52
| AZ_BATCH_NODE_LIST | The list of nodes that are allocated to a [multi-instance task](batch-mpi.md) in the format `nodeIP;nodeIP`. | Multi-instance primary and subtasks. |`10.0.0.4;10.0.0.5`|
54
-
| AZ_BATCH_NODE_MOUNTS_DIR | The full path of the node level [file system mount](virtual-file-mount.md) location where all mount directories reside. Windows file shares use a drive letter, so for Windows, the mount drive is part of devices and drives. | All tasks including start task have access to the user, given the user is aware of the mount permissions for the mounted directory. |In Ubuntu, for example, the location is: `/mnt/batch/tasks/fsmounts`|
55
-
| AZ_BATCH_NODE_ROOT_DIR | The full path of the root of all [Batch directories](files-and-directories.md) on the node. | All tasks. |C:\user\tasks|
56
-
| AZ_BATCH_NODE_SHARED_DIR | The full path of the [shared directory](files-and-directories.md) on the node. All tasks that execute on a node have read/write access to this directory. Tasks that execute on other nodes do not have remote access to this directory (it is not a "shared" network directory). | All tasks. |C:\user\tasks\shared|
57
-
| AZ_BATCH_NODE_STARTUP_DIR | The full path of the [start task directory](files-and-directories.md) on the node. | All tasks. |C:\user\tasks\startup|
53
+
| AZ_BATCH_NODE_MOUNTS_DIR | The full path of the node level [file system mount](virtual-file-mount.md) location where all mount directories reside. Windows file shares use a drive letter, so for Windows, the mount drive is part of devices and drives. | All tasks including start task have access to the user, given the user is aware of the mount permissions for the mounted directory. |[AZ_BATCH_NODE_MOUNTS_DIR](#environment-variables-related-to-directory-location)|
54
+
| AZ_BATCH_NODE_ROOT_DIR | The full path of the root of all [Batch directories](files-and-directories.md) on the node. | All tasks. |[AZ_BATCH_NODE_ROOT_DIR](files-and-directories.md#batch-root-directory-location)|
55
+
| AZ_BATCH_NODE_SHARED_DIR | The full path of the [shared directory](files-and-directories.md) on the node. All tasks that execute on a node have read/write access to this directory. Tasks that execute on other nodes do not have remote access to this directory (it is not a "shared" network directory). | All tasks. |[AZ_BATCH_NODE_SHARED_DIR](#environment-variables-related-to-directory-location)|
56
+
| AZ_BATCH_NODE_STARTUP_DIR | The full path of the [start task directory](files-and-directories.md) on the node. | All tasks. |[AZ_BATCH_NODE_STARTUP_DIR](#environment-variables-related-to-directory-location)|
58
57
| AZ_BATCH_POOL_ID | The ID of the pool that the task is running on. | All tasks. | batchpool001 |
59
-
| AZ_BATCH_TASK_DIR | The full path of the [task directory](files-and-directories.md) on the node. This directory contains the `stdout.txt` and `stderr.txt` for the task, and the AZ_BATCH_TASK_WORKING_DIR. | All tasks. |C:\user\tasks\workitems\batchjob001\job-1\task001|
58
+
| AZ_BATCH_TASK_DIR | The full path of the [task directory](files-and-directories.md) on the node. This directory contains the `stdout.txt` and `stderr.txt` for the task, and the AZ_BATCH_TASK_WORKING_DIR. | All tasks. |[AZ_BATCH_TASK_DIR](#task-environment-variables-related-to-directory-location)|
60
59
| AZ_BATCH_TASK_ID | The ID of the current task. | All tasks except start task. | task001 |
61
-
| AZ_BATCH_TASK_SHARED_DIR | A directory path that is identical for the primary task and every subtask of a [multi-instance task](batch-mpi.md). The path exists on every node on which the multi-instance task runs, and is read/write accessible to the task commands running on that node (both the [coordination command](batch-mpi.md#coordination-command) and the [application command](batch-mpi.md#application-command). Subtasks or a primary task that execute on other nodes do not have remote access to this directory (it is not a "shared" network directory). | Multi-instance primary and subtasks. |C:\user\tasks\workitems\multiinstancesamplejob\job-1\multiinstancesampletask|
62
-
| AZ_BATCH_TASK_WORKING_DIR | The full path of the [task working directory](files-and-directories.md) on the node. The currently running task has read/write access to this directory. | All tasks. |C:\user\tasks\workitems\batchjob001\job-1\task001\wd|
60
+
| AZ_BATCH_TASK_SHARED_DIR | A directory path that is identical for the primary task and every subtask of a [multi-instance task](batch-mpi.md). The path exists on every node on which the multi-instance task runs, and is read/write accessible to the task commands running on that node (both the [coordination command](batch-mpi.md#coordination-command) and the [application command](batch-mpi.md#application-command). Subtasks or a primary task that execute on other nodes do not have remote access to this directory (it is not a "shared" network directory). | Multi-instance primary and subtasks. |[AZ_BATCH_TASK_SHARED_DIR](#task-environment-variables-related-to-directory-location)|
61
+
| AZ_BATCH_TASK_WORKING_DIR | The full path of the [task working directory](files-and-directories.md) on the node. The currently running task has read/write access to this directory. | All tasks. |[AZ_BATCH_TASK_WORKING_DIR](#task-environment-variables-related-to-directory-location)|
63
62
| AZ_BATCH_TASK_RESERVED_EPHEMERAL_DISK_SPACE_BYTES | The current threshold for disk space upon which the VM will be marked as `DiskFull`. | All tasks. | 1000000 |
64
63
| CCP_NODES | The list of nodes and number of cores per node that are allocated to a [multi-instance task](batch-mpi.md). Nodes and cores are listed in the format `numNodes<space>node1IP<space>node1Cores<space>`<br/>`node2IP<space>node2Cores<space> ...`, where the number of nodes is followed by one or more node IP addresses and the number of cores for each. | Multi-instance primary and subtasks. |`2 10.0.0.4 1 10.0.0.5 1`|
65
64
65
+
66
+
> [!Important]
67
+
> Exact values for paths for Environment Variables are considered implementation details and are subject to change.
68
+
> Use the Batch provided Environment Variables instead of attempting to construct raw path representations.
69
+
70
+
## Environment variables related to directory location
71
+
72
+
The following table specifies the values of each environment variable value postfix after the AZ_BATCH_NODE_ROOT_DIR value, see [AZ_BATCH_NODE_ROOT_DIR](files-and-directories.md#batch-root-directory-location) for more information.
73
+
74
+
|Environment Variable Name|Environment Variable Value Directory Postfix|
75
+
|:---|:---|
76
+
|AZ_BATCH_NODE_STARTUP_DIR|`startup`|
77
+
|AZ_BATCH_NODE_SHARED_DIR|`shared`|
78
+
|AZ_BATCH_NODE_MOUNTS_DIR|`fsmounts`|
79
+
80
+
## Task environment variables related to directory location
81
+
82
+
The job directories are different between [single-run job](jobs-and-tasks.md#jobs) and [job schedule](jobs-and-tasks.md#scheduled-jobs). The following table specifies the values of job directory in single-run job and job schedule.
83
+
84
+
|Job Type|Job Directory Value Postfix after AZ_BATCH_NODE_ROOT_DIR|
Copy file name to clipboardExpand all lines: articles/batch/batch-pool-vm-sizes.md
+3Lines changed: 3 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -82,6 +82,9 @@ node state. Support for `unverified` images isn't guaranteed.
82
82
> [PowerShell](/powershell/module/az.batch/get-azbatchsupportedimage), or [Azure CLI](/cli/azure/batch/pool/supported-images).
83
83
> For more information, see the [Batch best practices guide](best-practices.md) regarding Batch pool VM image selection.
84
84
85
+
> [!TIP]
86
+
> The value of the `AZ_BATCH_NODE_ROOT_DIR` compute node environment variable is dependent upon if the VM has a local temporary disk or not. See [Batch root directory location](files-and-directories.md#batch-root-directory-location) for more information.
87
+
85
88
## Next steps
86
89
87
90
- Learn about the [Batch service workflow and primary resources](batch-service-workflow-features.md) such as pools, nodes, jobs, and tasks.
Copy file name to clipboardExpand all lines: articles/batch/files-and-directories.md
+13Lines changed: 13 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -39,6 +39,19 @@ The root directory contains the following directory structure:
39
39
> [!IMPORTANT]
40
40
> When a node is removed from the pool, all of the files that are stored on the node are removed.
41
41
42
+
## Batch root directory location
43
+
44
+
The value of the `AZ_BATCH_NODE_ROOT_DIR` compute node environment variable will be determined by the VM size and the presence of a local temporary disk.
45
+
46
+
|Local Temporary Disk Present|Operating System Type|`AZ_BATCH_NODE_ROOT_DIR` Value|
47
+
|:---|:---|:---|
48
+
|No|Linux|`/opt/batch/data`|
49
+
|Yes|Linux|`/mnt/batch` or `/mnt/resource/batch`|
50
+
|No|Windows|`C:\batch\data`|
51
+
|Yes|Windows|`D:\batch`|
52
+
53
+
These environment variable values are implementation details and should not be considered immutable. As these values may change at any time, the use of environment variables instead of hardcoding the value is recommended.
54
+
42
55
## Next steps
43
56
44
57
- Learn about [error handling and detection](error-handling.md) in Azure Batch.
0 commit comments