Skip to content

Commit 9eedde4

Browse files
committed
run Translator in disconnected environment
1 parent cca3bba commit 9eedde4

File tree

1 file changed

+48
-40
lines changed

1 file changed

+48
-40
lines changed

articles/cognitive-services/Translator/containers/translator-disconnected-containers.md

Lines changed: 48 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,14 @@ ms.date: 01/13/2023
1111
ms.author: lajanuar
1212
---
1313

14+
<!-- markdownlint-disable MD036 -->
15+
<!-- markdownlint-disable MD001 -->
16+
1417
# Use Translator containers in disconnected environments
1518

16-
* Containers enable you to run Translator APIs in your own environment, and are great for your specific security and data governance requirements.
17-
* Disconnected containers enable you to use several of these APIs disconnected from the internet.
19+
Azure Cognitive Services Translator containers allow you to use Translator Service APIs with the benefits of containerization. Translator disconnected containers are offered through a commitment tier pricing model offered at a discounted rate compared to the pay-as-you-go pricing model. With commitment tier pricing, you can commit to using Translator Service features for a fixed fee at a predictable total cost based on the needs of your workload.
20+
21+
## Get started
1822

1923
Before attempting to run a Docker container in an offline environment, make sure you're familiar with the following requirements to successfully download and use the container:
2024

@@ -32,23 +36,21 @@ Complete and submit the [request form](https://aka.ms/csdisconnectedcontainers)
3236
Access is limited to customers that meet the following requirements:
3337

3438
* Your organization should be identified as strategic customer or partner with Microsoft.
35-
* Disconnected containers are expected to run fully offline, hence your use cases must meet atleast one of these or similar requirements:
39+
* Disconnected containers are expected to run fully offline, hence your use cases must meet at least one of these or similar requirements:
3640
* Environment or device(s) with zero connectivity to internet.
3741
* Remote location that occasionally has internet access.
3842
* Organization under strict regulation of not sending any kind of data back to cloud.
3943
* Application completed as instructed. Make certain to pay close attention to guidance provided throughout the application to ensure you provide all the necessary information required for approval.
4044

41-
## Purchase a commitment plan to use containers in disconnected environments
42-
43-
### Create a new resource
45+
## Create a new resource and purchase a commitment plan
4446

4547
1. Create a [Translator resource](https://portal.azure.com/#create/Microsoft.CognitiveServicesTextTranslation) in the Azure portal.
4648

4749
2. Enter the applicable information to create your resource. Be sure to select **Commitment tier disconnected containers** as your pricing tier.
4850

4951
> [!NOTE]
5052
>
51-
> * You will only see the option to purchase a commitment tier if you have been approved by Microsoft.
53+
> * You will only see the option to purchase a commitment tier only if you have been approved by Microsoft.
5254
5355
:::image type="content" source="../media/create-resource-offline-container.png" alt-text="A screenshot showing resource creation on the Azure portal.":::
5456

@@ -62,22 +64,22 @@ There are three required parameters for all Cognitive Services' containers:
6264
* The endpoint URL for your resource from the Azure portal.
6365
* The API key for your resource from the Azure portal.
6466

65-
Both the endpoint URL and API key are needed when you first run the container, to configure it for disconnected usage. You can find the key and endpoint on the **Key and endpoint** page for your resource.
67+
Both the endpoint URL and API key are needed when you first run the container to configure it for disconnected usage. You can find the key and endpoint on the **Key and endpoint** page for your resource in the Azure portal.
6668

6769
:::image type="content" source="../media/quickstarts/keys-and-endpoint-portal.png" alt-text="Screenshot: Azure portal keys and endpoint page.":::
6870

6971
> [!IMPORTANT]
70-
> You will only use your key and endpoint to configure the container to be run in a disconnected environment. After you configure the container, you won't need them to send API requests. Store them securely, for example, using Azure Key Vault. Only one key is necessary for this process.
72+
> You will only use your key and endpoint to configure the container to run in a disconnected environment. After you configure the container, you won't need the key and endpoint values to send API requests. Store them securely, for example, using Azure Key Vault. Only one key is necessary for this process.
7173
7274
## Download a Docker container with `docker pull`
7375

74-
After you have a license file, download the Docker container you have approval to run in a disconnected environment. For example:
76+
Download the Docker container that has been approved to run in a disconnected environment. For example:
7577

7678
|Docker pull command | Value |Format|
7779
|----------|-------|------|
78-
|&bullet; **`docker pull [image]**</br>&bullet; **docker pull [image]:latest`**|The latest container image.|&bullet; mcr.microsoft.com/azure-cognitive-services/translator/text-translation</br> </br>&bullet; mcr.microsoft.com/azure-cognitive-services/translator/text-translation: latest |
80+
|&bullet; **`docker pull [image]`**</br>&bullet; **`docker pull [image]:latest`**|The latest container image.|&bullet; mcr.microsoft.com/azure-cognitive-services/translator/text-translation</br> </br>&bullet; mcr.microsoft.com/azure-cognitive-services/translator/text-translation: latest |
7981
|||
80-
|&bullet; **`docker pull [image]:version`** | A specific container image |mcr.microsoft.com/azure-cognitive-services/translator/text-translation:1.0.019410001-amd64 |
82+
|&bullet; **`docker pull [image]:[version]`** | A specific container image |mcr.microsoft.com/azure-cognitive-services/translator/text-translation:1.0.019410001-amd64 |
8183

8284
**Example Docker pull command**
8385

@@ -93,20 +95,20 @@ Now that you've downloaded your container, you'll need to execute the `docker ru
9395
* **`Languages={language list}`**. You must include this parameter to download model files for the [languages](../language-support.md) you want to translate.
9496

9597
> [!IMPORTANT]
96-
> The container will generate a `docker run` template that you can use to run the container, containing parameters you will need for the downloaded models and configuration file. Make sure you save this template.
98+
> The `docker run` command will generate a template that you can use to run the container. The template contains parameters you'll need for the downloaded models and configuration file. Make sure you save this template.
9799
98-
The following example shows the formatting of the `docker run` command you'll use, with placeholder values. Replace these placeholder values with your own values.
100+
The following example shows the formatting of the `docker run` command with placeholder values. Replace these placeholder values with your own values.
99101

100-
| Parameter | Value | Format|
102+
| Placeholder | Value | Format|
101103
|-------------|-------|---|
102104
| `[image]` | The container image you want to use. | `mcr.microsoft.com/azure-cognitive-services/translator/text-translation` |
103105
| `{LICENSE_MOUNT}` | The path where the license will be downloaded, and mounted. | `/host/license:/path/to/license/directory` |
104-
| `{MODEL_MOUNT_PATH}`| The path where the machine translation models will be downloaded, and mounted. Your directory structure must be formatted as **/usr/local/models** | /host/translator/models:/usr/local/models|
106+
| `{MODEL_MOUNT_PATH}`| The path where the machine translation models will be downloaded, and mounted. Your directory structure must be formatted as **/usr/local/models** | `/host/translator/models:/usr/local/models`|
105107
| `{ENDPOINT_URI}` | The endpoint for authenticating your service request. You can find it on your resource's **Key and endpoint** page, in the Azure portal. | `https://<your-custom-subdomain>.cognitiveservices.azure.com` |
106-
| `{API_KEY}` | The key for your Text Analytics resource. You can find it on your resource's **Key and endpoint** page, in the Azure portal. |`xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx`|
108+
| `{API_KEY}` | The key for your Text Analytics resource. You can find it on your resource's **Key and endpoint** page, in the Azure portal. |`32-character-string`|
107109
| `{CONTAINER_LICENSE_DIRECTORY}` | Location of the license folder on the container's local filesystem. | `/path/to/license/directory` |
108110

109-
**Example Docker pull command**
111+
**Example `docker pull` command**
110112

111113
```docker
112114
@@ -133,7 +135,7 @@ Mounts:License={CONTAINER_LICENSE_DIRECTORY} \
133135

134136
### Translation models and container configuration
135137

136-
After you've [configured the container](#configure-the-container-to-run-in-a-disconnected-environment), the values for the downloaded translation models and container configuration will be generated and displayed in the container output. For example:
138+
After you've [configured the container](#configure-the-container-to-run-in-a-disconnected-environment), the values for the downloaded translation models and container configuration will be generated and displayed in the container output:
137139

138140
```bash
139141
-e MODELS= usr/local/models/model1/, usr/local/models/model2/
@@ -142,22 +144,24 @@ After you've [configured the container](#configure-the-container-to-run-in-a-dis
142144

143145
## Run the container in a disconnected environment
144146

145-
Once the license file has been downloaded, you can run the container in a disconnected environment with your license, appropriate memory, and suitable CPU allocations. The following example shows the formatting of the `docker run` command you'll use, with placeholder values. Replace these placeholders values with your own values.
147+
Once the license file has been downloaded, you can run the container in a disconnected environment with your license, appropriate memory, and suitable CPU allocations. The following example shows the formatting of the `docker run` command with placeholder values. Replace these placeholders values with your own values.
146148

147-
Wherever the container is run, the license file must be mounted to the container and the location of the license folder on the container's local filesystem must be specified with `Mounts:License=`. In addition, an output mount must be specified so that billing usage records can be written.
149+
Whenever the container is run, the license file must be mounted to the container and the location of the license folder on the container's local filesystem must be specified with `Mounts:License=`. In addition, an output mount must be specified so that billing usage records can be written.
148150

149151
Placeholder | Value | Format|
150152
|-------------|-------|---|
151-
| `{IMAGE}` | The container image you want to use. | `mcr.microsoft.com/azure-cognitive-services/translator/text-translation` |
153+
| `[image]`| The container image you want to use. | `mcr.microsoft.com/azure-cognitive-services/translator/text-translation` |
152154
`{MEMORY_SIZE}` | The appropriate size of memory to allocate for your container. | `16g` |
153155
| `{NUMBER_CPUS}` | The appropriate number of CPUs to allocate for your container. | `4` |
154156
| `{LICENSE_MOUNT}` | The path where the license will be located and mounted. | `/host/translator/license:/path/to/license/directory` |
155-
|`{MODEL_MOUNT_PATH}`| The path where the machine translation models will be downloaded, and mounted. Your directory structure must be formatted as **/usr/local/models** | /host/translator/models:/usr/local/models|
156-
|`{MODELS_DIRECTORY_LIST}`|List of comma separated directories each having a machine translation model. | /usr/local/models/enu_esn_generalnn_2022240501,/usr/local/models/esn_enu_generalnn_2022240501 |
157+
|`{MODEL_MOUNT_PATH}`| The path where the machine translation models will be downloaded, and mounted. Your directory structure must be formatted as **/usr/local/models** | `/host/translator/models:/usr/local/models`|
158+
|`{MODELS_DIRECTORY_LIST}`|List of comma separated directories each having a machine translation model. | `/usr/local/models/enu_esn_generalnn_2022240501,/usr/local/models/esn_enu_generalnn_2022240501` |
157159
| `{OUTPUT_PATH}` | The output path for logging [usage records](#usage-records). | `/host/output:/path/to/output/directory` |
158160
| `{CONTAINER_LICENSE_DIRECTORY}` | Location of the license folder on the container's local filesystem. | `/path/to/license/directory` |
159161
| `{CONTAINER_OUTPUT_DIRECTORY}` | Location of the output folder on the container's local filesystem. | `/path/to/output/directory` |
160-
|`{TRANSLATOR_CONFIG_JSON}`| Translator system configuration file used by container internally.| /usr/local/models/Config/5a72fa7c-394b-45db-8c06-ecdfc98c0832 |
162+
|`{TRANSLATOR_CONFIG_JSON}`| Translator system configuration file used by container internally.| `/usr/local/models/Config/5a72fa7c-394b-45db-8c06-ecdfc98c0832` |
163+
164+
**Example `docker run` command**
161165

162166
```docker
163167
@@ -182,27 +186,27 @@ Mounts:Output={CONTAINER_OUTPUT_DIRECTORY} \
182186
[image]
183187
```
184188

185-
That's it! You've learned how to create and run disconnected containers for Translator Service.
186-
187-
### Other parameters and commands
189+
## Other parameters and commands
188190

189191
Here are a few more parameters and commands you may need to run the container.
190192

191-
## Usage records
193+
#### Usage records
192194

193-
When operating Docker containers in a disconnected environment, the container will write usage records to a volume where they're collected over time. You can also call a REST endpoint to generate a report about service usage.
195+
When operating Docker containers in a disconnected environment, the container will write usage records to a volume where they're collected over time. You can also call a REST API endpoint to generate a report about service usage.
194196

195-
### Arguments for storing logs
197+
#### Arguments for storing logs
196198

197199
When run in a disconnected environment, an output mount must be available to the container to store usage logs. For example, you would include `-v /host/output:{OUTPUT_PATH}` and `Mounts:Output={OUTPUT_PATH}` in the following example, replacing `{OUTPUT_PATH}` with the path where the logs will be stored:
198200

201+
**Example `docker run` command**
202+
199203
```docker
200204
docker run -v /host/output:{OUTPUT_PATH} ... <image> ... Mounts:Output={OUTPUT_PATH}
201205
```
202206

203-
### Get records using the container endpoints
207+
#### Get records using the container endpoints
204208

205-
The container provides two endpoints for returning records about its usage.
209+
The container provides two endpoints for returning records regarding its usage.
206210

207211
#### Get all records
208212

@@ -212,9 +216,11 @@ The following endpoint will provide a report summarizing all of the usage collec
212216
https://<service>/records/usage-logs/
213217
```
214218

215-
for example: `http://localhost:5000/records/usage-logs`.
219+
**Example HTTPS endpoint**
216220

217-
It will return JSON similar to this example:
221+
`http://localhost:5000/records/usage-logs`.
222+
223+
This usage-logs endpoint will return a JSON response similar to this example:
218224

219225
```json
220226
{
@@ -231,13 +237,13 @@ It will return JSON similar to this example:
231237

232238
#### Get records for a specific month
233239

234-
The following endpoint will provide a report summarizing usage over a specific month and year.
240+
The following endpoint will provide a report summarizing usage over a specific month and year:
235241

236242
```HTTP
237243
https://<service>/records/usage-logs/{MONTH}/{YEAR}
238244
```
239245

240-
it will return a JSON response similar to this example:
246+
This usage-logs endpoint will return a JSON response similar to this example:
241247

242248
```json
243249
{
@@ -260,16 +266,18 @@ You can choose a different commitment plan in the **Commitment Tier pricing** se
260266

261267
## End a commitment plan
262268

263-
If you decide that you don't want to continue purchasing a commitment plan, you can set your resource's auto-renewal to **Do not auto-renew**. Your commitment plan will expire on the displayed commitment end date. After this date, you won't be charged for the commitment plan. You'll be able to continue using the Azure resource to make API calls, charged at pay-as-you-go pricing. You have until midnight (UTC) on the last day of the year to end a commitment plan for disconnected containers. If you do so, you won't be charged for the following year.
269+
If you decide that you don't want to continue purchasing a commitment plan, you can set your resource's auto-renewal to **Do not auto-renew**. Your commitment plan will expire on the displayed commitment end date. After this date, you won't be charged for the commitment plan. You'll be able to continue using the Azure resource to make API calls, charged at pay-as-you-go pricing. You'll have until midnight (UTC) on the last day of the year to end a commitment plan for disconnected containers. If you do so, you won't be charged for the following year.
264270

265271
## Troubleshooting
266272

267-
Run the container with an output mount and logging enabled. Those settings will enable the container to generate log files that are helpful for troubleshooting issues that happen while starting or running the container.
273+
Run the container with an output mount and logging enabled. These settings will enable the container to generate log files that are helpful for troubleshooting issues that happen while starting or running the container.
268274

269275
> [!TIP]
270276
> For more troubleshooting information and guidance, see [Disconnected containers Frequently asked questions (FAQ)](../../containers/disconnected-container-faq.yml).
271277
278+
That's it! You've learned how to create and run disconnected containers for Azure Translator Service.
279+
272280
## Next steps
273281

274282
> [!div class="nextstepaction"]
275-
> [Translate text request parameters for containers](translator-container-supported-parameters.md)
283+
> [Request parameters for Translator text containers](translator-container-supported-parameters.md)

0 commit comments

Comments
 (0)