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/quick-create-cli.md
+14-14Lines changed: 14 additions & 14 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -20,11 +20,14 @@ This quickstart uses Azure CLI commands and scripts to create and manage Batch r
20
20
21
21
You can run the Azure CLI commands in this quickstart interactively in Azure Cloud Shell. To run the commands in the Cloud Shell, select **Open Cloudshell** at the upper-right corner of a code block. Select **Copy** to copy the code, and paste it into Cloud Shell to run it. You can also [run Cloud Shell from within the Azure portal](https://shell.azure.com). Cloud Shell always uses the latest version of the Azure CLI.
22
22
23
-
You can also [install Azure CLI locally](/cli/azure/install-azure-cli) to run the commands. The steps in this article require Azure CLI version 2.0.20 or later. Run [az version](/cli/azure/reference-index?#az-version) to see your installed version and dependent libraries, and run [az upgrade](/cli/azure/reference-index?#az-upgrade) to upgrade. If you use a local installation, sign in to Azure by using the [az login](/cli/azure/reference-index#az-login) command.
23
+
Alternatively, you can [install Azure CLI locally](/cli/azure/install-azure-cli) to run the commands. The steps in this article require Azure CLI version 2.0.20 or later. Run [az version](/cli/azure/reference-index?#az-version) to see your installed version and dependent libraries, and run [az upgrade](/cli/azure/reference-index?#az-upgrade) to upgrade. If you use a local installation, sign in to Azure by using the [az login](/cli/azure/reference-index#az-login) command.
24
+
25
+
>[!NOTE]
26
+
>For some regions and subscription types, quota restrictions might cause Batch account or node creation to fail or not complete. In this situation, you can request a quota increase at no charge. For more information, see [Batch service quotas and limits](batch-quota-limit.md).
24
27
25
28
## Create a resource group
26
29
27
-
Run the following [az group create](/cli/azure/group#az-group-create) command to create an Azure resource group named `qsBatch` in the `eastus` Azure region. The resource group is a logical container that holds the Azure resources for this quickstart.
30
+
Run the following [az group create](/cli/azure/group#az-group-create) command to create an Azure resource group named `qsBatch` in the `eastus2` Azure region. The resource group is a logical container that holds the Azure resources for this quickstart.
28
31
29
32
```azurecli-interactive
30
33
az group create \
@@ -36,7 +39,7 @@ az group create \
36
39
37
40
Use the [az storage account create](/cli/azure/storage/account#az-storage-account-create) command to create an Azure Storage account to link to your Batch account. Although this quickstart doesn't use the storage account, most real-world Batch workloads use a linked storage account to deploy applications and store input and output data.
38
41
39
-
Run the following command to create a `Stamdard_LRS` SKU storage account named `mybatchstorage` in your resource group:
42
+
Run the following command to create a Standard_LRS SKU storage account named `mybatchstorage` in your resource group:
40
43
41
44
```azurecli-interactive
42
45
az storage account create \
@@ -58,7 +61,7 @@ az batch account create \
58
61
--location eastus2
59
62
```
60
63
61
-
Sign in to the new Batch account by running the [az batch account login](/cli/azure/batch/account#az-batch-account-login) command. After you authenticate your account with Batch, the rest of the `az batch`quickstart commands use this account context.
64
+
Sign in to the new Batch account by running the [az batch account login](/cli/azure/batch/account#az-batch-account-login) command. Once you authenticate your account with Batch, subsequent `az batch` commands in this session use this account context.
62
65
63
66
```azurecli-interactive
64
67
az batch account login \
@@ -69,7 +72,7 @@ az batch account login \
69
72
70
73
## Create a pool of compute nodes
71
74
72
-
Use the [az batch pool create](/cli/azure/batch/pool#az-batch-pool-create) command to create a pool of Linux compute nodes in your Batch account. The following example creates a pool named `myPool` that consists of two `Standard_A1_v2` size nodes running `Ubuntu 18.04 LTS` OS. This node size offers a good balance of performance versus cost for this quickstart example.
75
+
Run the [az batch pool create](/cli/azure/batch/pool#az-batch-pool-create) command to create a pool of Linux compute nodes in your Batch account. The following example creates a pool named `myPool` that consists of two Standard_A1_v2 size VMs running Ubuntu 18.04 LTS OS. This node size offers a good balance of performance versus cost for this quickstart example.
73
76
74
77
```azurecli-interactive
75
78
az batch pool create \
@@ -79,20 +82,18 @@ az batch pool create \
79
82
--node-agent-sku-id "batch.node.ubuntu 18.04"
80
83
```
81
84
82
-
Batch creates the pool immediately, but takes a few minutes to allocate and start the compute nodes. During this time, the pool is in the `resizing` state.
83
-
84
-
To see the pool status, run the [az batch pool show](/cli/azure/batch/pool#az-batch-pool-show) command. This command shows all the properties of the pool, and you can query for specific properties. The following command queries for the pool allocation state:
85
+
Batch creates the pool immediately, but takes a few minutes to allocate and start the compute nodes. To see the pool status, use the [az batch pool show](/cli/azure/batch/pool#az-batch-pool-show) command. This command shows all the properties of the pool, and you can query for specific properties. The following command queries for the pool allocation state:
85
86
86
87
```azurecli-interactive
87
88
az batch pool show --pool-id myPool \
88
89
--query "allocationState"
89
90
```
90
91
91
-
You can do the following steps to create a job and tasks while the pool state is still `resizing`. The pool is ready to run tasks when the allocation state is `steady` and all the nodes are running.
92
+
While Batch allocates and starts the nodes, the pool is in the `resizing` state. You can create a job and tasks while the pool state is still `resizing`. The pool is ready to run tasks when the allocation state is `steady` and all the nodes are running.
92
93
93
94
## Create a job
94
95
95
-
Use the [az batch job create](/cli/azure/batch/job#az-batch-job-create) command to create a Batch job to run on your pool. A Batch job is a logical group of one or more tasks. The job includes settings common to the tasks, such as the pool to run tasks on. The following example creates a job called `myJob` on `myPool` that initially has no tasks.
96
+
Use the [az batch job create](/cli/azure/batch/job#az-batch-job-create) command to create a Batch job to run on your pool. A Batch job is a logical group of one or more tasks. The job includes settings common to the tasks, such as the pool to run on. The following example creates a job called `myJob` on `myPool` that initially has no tasks.
96
97
97
98
```azurecli-interactive
98
99
az batch job create \
@@ -102,11 +103,10 @@ az batch job create \
102
103
103
104
## Create job tasks
104
105
105
-
Use the [az batch task create](/cli/azure/batch/task#az-batch-task-create) command to create some tasks to run in the job. Each task has a command line that specifies an app or script. Batch provides several ways to deploy apps and scripts to compute nodes.
106
+
Batch provides several ways to deploy apps and scripts to compute nodes. Use the [az batch task create](/cli/azure/batch/task#az-batch-task-create) command to create tasks to run in the job. Each task has a command line that specifies an app or script.
106
107
107
108
The following Bash script creates four identical, parallel tasks called `myTask1` through `myTask4`. The task command line displays the Batch environment variables on the compute node, and then waits 90 seconds.
108
109
109
-
110
110
```azurecli-interactive
111
111
for i in {1..4}
112
112
do
@@ -131,7 +131,7 @@ az batch task show \
131
131
--task-id myTask1
132
132
```
133
133
134
-
The command output includes many details. For example, the `nodeId` shows the name of the pool node that ran the task. An `exitCode` of `0` indicates that the task command line completed successfully.
134
+
The command output includes many details. For example, an `exitCode`of `0` indicates that the task command completed successfully. The `nodeId` shows the name of the pool node that ran the task.
Use the [az batch task file download](/cli/azure/batch/task#az-batch-task-file-download) command to download output files to a local directory. The following example downloads the *stdout.txt* file:
159
+
The [az batch task file download](/cli/azure/batch/task#az-batch-task-file-download) command downloads output files to a local directory. Run the following example to download the *stdout.txt* file:
>For some regions and subscription types, quota restrictions might cause Batch account or node creation to fail or not complete. In this situation, you can request a quota increase at no charge. For more information, see [Batch service quotas and limits](batch-quota-limit.md).
21
+
19
22
<aname="create-a-batch-account"></a>
20
23
## Create a Batch account and Azure Storage account
Copy file name to clipboardExpand all lines: articles/batch/quick-run-python.md
+4-6Lines changed: 4 additions & 6 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -152,7 +152,7 @@ Review the code to understand the steps in the [Azure Batch Python Quickstart](h
152
152
153
153
To create a Batch pool, the app uses the [PoolAddParameter](/python/api/azure-batch/azure.batch.models.pooladdparameter) class to set the number of nodes, VM size, and pool configuration. The following [VirtualMachineConfiguration](/python/api/azure-batch/azure.batch.models.virtualmachineconfiguration) object specifies an [ImageReference](/python/api/azure-batch/azure.batch.models.imagereference) to an Ubuntu Server 20.04 LTS Azure Marketplace image. Batch supports a wide range of Linux and Windows Server Marketplace images, and also supports custom VM images.
154
154
155
-
The `POOL_NODE_COUNT` and `POOL_VM_SIZE` are defined constants. The app creates a pool of two size *Standard_DS1_v2* nodes. This size offers a good balance of performance versus cost for this quickstart.
155
+
The `POOL_NODE_COUNT` and `POOL_VM_SIZE` are defined constants. The app creates a pool of two size Standard_DS1_v2 nodes. This size offers a good balance of performance versus cost for this quickstart.
156
156
157
157
The [pool.add](/python/api/azure-batch/azure.batch.operations.pooloperations#azure-batch-operations-pooloperations-add) method submits the pool to the Batch service.
The app creates a list of task objects by using the [TaskAddParameter](/python/api/azure-batch/azure.batch.models.taskaddparameter) class. Each task uses a `command_line` parameter to specify an app or script. Batch provides several ways to deploy apps and scripts to compute nodes.
192
+
Batch provides several ways to deploy apps and scripts to compute nodes. This app creates a list of task objects by using the [TaskAddParameter](/python/api/azure-batch/azure.batch.models.taskaddparameter) class. Each task processes an input file by using a `command_line` parameter to specify an app or script.
193
193
194
-
The following command line script processes the input `resource_files` objects. The script runs the Bash shell `cat` command to display the text files.
195
-
196
-
The app then uses the [task.add_collection](/python/api/azure-batch/azure.batch.operations.taskoperations#azure-batch-operations-taskoperations-add-collection) method to add each task to the job, which queues the tasks to run on the compute nodes.
194
+
The following script processes the input `resource_files` objects by running the Bash shell `cat` command to display the text files. The app then uses the [task.add_collection](/python/api/azure-batch/azure.batch.operations.taskoperations#azure-batch-operations-taskoperations-add-collection) method to add each task to the job, which queues the tasks to run on the compute nodes.
The app monitors task state to make sure the tasks complete. When each task runs successfully, the output of the task command writes to the *stdout.txt* file. The app then displays the *stdout.txt* file for each completed task.
213
+
The app monitors task state to make sure the tasks complete. When each task runs successfully, the task command output writes to the *stdout.txt* file. The app then displays the *stdout.txt* file for each completed task.
0 commit comments