Skip to content

Commit dd8276b

Browse files
author
Xiyao Dong
committed
update
1 parent c1eb0d4 commit dd8276b

File tree

1 file changed

+39
-8
lines changed

1 file changed

+39
-8
lines changed

articles/batch/batch-compute-node-environment-variables.md

Lines changed: 39 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -45,24 +45,55 @@ The command lines executed by tasks on compute nodes don't run under a shell. Th
4545
| 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` |
4646
| 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` |
4747
| 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:\batch\data\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:\batch\data\tasks\workitems\jobprepreleasesamplejob\job-1\jobpreparation\wd` |
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. | [AZ_BATCH_JOB_PREP_DIR](#task-environment-variables-related-to-file-location) |
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. | [AZ_BATCH_JOB_PREP_WORKING_DIR](#task-environment-variables-related-to-file-location) |
5050
| 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` |
5151
| AZ_BATCH_NODE_ID | The ID of the node that the task is assigned to. | All tasks. | tvm-1219235766_3-20160919t172711z |
5252
| 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` |
5353
| 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` (VMSize with temporary disk) or `/opt/batch/data/tasks/fsmounts` (VMSize without temporary disk) |
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. | [AZ_BATCH_NODE_MOUNTS_DIR](#environment-variables-related-to-file-location) |
5555
| 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) |
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. | `D:\batch\tasks\shared` (Windows) or `/mnt/batch/tasks/shared` (Linux) |
57-
| AZ_BATCH_NODE_STARTUP_DIR | The full path of the [start task directory](files-and-directories.md) on the node. | All tasks. | `D:\batch\tasks\startup` or `/mnt/batch/tasks/startup` |
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. | [AZ_BATCH_NODE_SHARED_DIR](#environment-variables-related-to-file-location) |
57+
| 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-file-location) |
5858
| 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:\batch\data\tasks\workitems\batchjob001\job-1\task001` (Windows, VMSize without temporary disk) or `D:\batch\tasks\workitems\batchjob001\job-1\task001` (Windows, VMSize with temporary disk) |
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. | [AZ_BATCH_TASK_DIR](#task-environment-variables-related-to-file-location) |
6060
| 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. | `D:\batch\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. | `D:\batch\tasks\workitems\batchjob001\job-1\task001\wd` |
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. | [AZ_BATCH_TASK_SHARED_DIR](#task-environment-variables-related-to-file-location) |
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. | [AZ_BATCH_TASK_WORKING_DIR](#task-environment-variables-related-to-file-location) |
6363
| 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 |
6464
| 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` |
6565

66+
67+
## Environment variables related to file location
68+
69+
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.
70+
71+
|Environment Variable Name|Environment Variable Value Directory Postfix|
72+
|:---|:---|
73+
|AZ_BATCH_NODE_STARTUP_DIR|`startup`|
74+
|AZ_BATCH_NODE_SHARED_DIR|`shared`|
75+
|AZ_BATCH_NODE_MOUNTS_DIR|`fsmounts`|
76+
77+
## Task environment variables related to file location
78+
79+
The job directory are different between [single-run job](jobs-and-tasks.md#jobs) and [job schedule](jobs-and-tasks.md#scheduled-jobs), following table specifies the values of job directory in single-run job and job schedule.
80+
81+
|Job Directory Value Postfix after AZ_BATCH_NODE_ROOT_DIR|Job Type|
82+
|:---|:---|
83+
|`workitems\{job name}\job-1`|Job|
84+
|`workitems\{job schedule name}\{job name}`|Job Schedule|
85+
86+
The following table specifies the values of each environment variable value postfix after job directory.
87+
88+
|Environment Variable Name|Environment Variable Value Directory Postfix After Job Directory|
89+
|:---|:---|
90+
|AZ_BATCH_TASK_WORKING_DIR|`{task name}\wd`|
91+
|AZ_BATCH_TASK_DIR|`{task name}`|
92+
|AZ_BATCH_TASK_SHARED_DIR|`{task name}`|
93+
|AZ_BATCH_JOB_PREP_DIR|`{job prepration task name}`|
94+
|AZ_BATCH_JOB_PREP_WORKING_DIR|`{job prepration task name}\wd`|
95+
96+
6697
## Next steps
6798

6899
- Learn how to [use environment variables with Batch](jobs-and-tasks.md#environment-settings-for-tasks).

0 commit comments

Comments
 (0)