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/cognitive-services/Translator/containers/translator-disconnected-containers.md
+48-40Lines changed: 48 additions & 40 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -11,10 +11,14 @@ ms.date: 01/13/2023
11
11
ms.author: lajanuar
12
12
---
13
13
14
+
<!-- markdownlint-disable MD036 -->
15
+
<!-- markdownlint-disable MD001 -->
16
+
14
17
# Use Translator containers in disconnected environments
15
18
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
18
22
19
23
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:
20
24
@@ -32,23 +36,21 @@ Complete and submit the [request form](https://aka.ms/csdisconnectedcontainers)
32
36
Access is limited to customers that meet the following requirements:
33
37
34
38
* 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:
36
40
* Environment or device(s) with zero connectivity to internet.
37
41
* Remote location that occasionally has internet access.
38
42
* Organization under strict regulation of not sending any kind of data back to cloud.
39
43
* 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.
40
44
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
44
46
45
47
1. Create a [Translator resource](https://portal.azure.com/#create/Microsoft.CognitiveServicesTextTranslation) in the Azure portal.
46
48
47
49
2. Enter the applicable information to create your resource. Be sure to select **Commitment tier disconnected containers** as your pricing tier.
48
50
49
51
> [!NOTE]
50
52
>
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.
52
54
53
55
:::image type="content" source="../media/create-resource-offline-container.png" alt-text="A screenshot showing resource creation on the Azure portal.":::
54
56
@@ -62,22 +64,22 @@ There are three required parameters for all Cognitive Services' containers:
62
64
* The endpoint URL for your resource from the Azure portal.
63
65
* The API key for your resource from the Azure portal.
64
66
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.
66
68
67
69
:::image type="content" source="../media/quickstarts/keys-and-endpoint-portal.png" alt-text="Screenshot: Azure portal keys and endpoint page.":::
68
70
69
71
> [!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.
71
73
72
74
## Download a Docker container with `docker pull`
73
75
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:
|•**`docker pull [image]:version`**| A specific container image |mcr.microsoft.com/azure-cognitive-services/translator/text-translation:1.0.019410001-amd64 |
82
+
|•**`docker pull [image]:[version]`**| A specific container image |mcr.microsoft.com/azure-cognitive-services/translator/text-translation:1.0.019410001-amd64 |
81
83
82
84
**Example Docker pull command**
83
85
@@ -93,20 +95,20 @@ Now that you've downloaded your container, you'll need to execute the `docker ru
93
95
***`Languages={language list}`**. You must include this parameter to download model files for the [languages](../language-support.md) you want to translate.
94
96
95
97
> [!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.
97
99
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.
99
101
100
-
|Parameter| Value | Format|
102
+
|Placeholder| Value | Format|
101
103
|-------------|-------|---|
102
104
|`[image]`| The container image you want to use. |`mcr.microsoft.com/azure-cognitive-services/translator/text-translation`|
103
105
|`{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`|
105
107
|`{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`|
107
109
|`{CONTAINER_LICENSE_DIRECTORY}`| Location of the license folder on the container's local filesystem. |`/path/to/license/directory`|
### Translation models and container configuration
135
137
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:
@@ -142,22 +144,24 @@ After you've [configured the container](#configure-the-container-to-run-in-a-dis
142
144
143
145
## Run the container in a disconnected environment
144
146
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.
146
148
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.
148
150
149
151
Placeholder | Value | Format|
150
152
|-------------|-------|---|
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`|
152
154
`{MEMORY_SIZE}` | The appropriate size of memory to allocate for your container. | `16g` |
153
155
|`{NUMBER_CPUS}`| The appropriate number of CPUs to allocate for your container. |`4`|
154
156
|`{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`|
157
159
|`{OUTPUT_PATH}`| The output path for logging [usage records](#usage-records). |`/host/output:/path/to/output/directory`|
158
160
|`{CONTAINER_LICENSE_DIRECTORY}`| Location of the license folder on the container's local filesystem. |`/path/to/license/directory`|
159
161
|`{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`|
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
188
190
189
191
Here are a few more parameters and commands you may need to run the container.
190
192
191
-
## Usage records
193
+
####Usage records
192
194
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.
194
196
195
-
### Arguments for storing logs
197
+
####Arguments for storing logs
196
198
197
199
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:
198
200
201
+
**Example `docker run` command**
202
+
199
203
```docker
200
204
docker run -v /host/output:{OUTPUT_PATH} ... <image> ... Mounts:Output={OUTPUT_PATH}
201
205
```
202
206
203
-
### Get records using the container endpoints
207
+
####Get records using the container endpoints
204
208
205
-
The container provides two endpoints for returning records about its usage.
209
+
The container provides two endpoints for returning records regarding its usage.
206
210
207
211
#### Get all records
208
212
@@ -212,9 +216,11 @@ The following endpoint will provide a report summarizing all of the usage collec
212
216
https://<service>/records/usage-logs/
213
217
```
214
218
215
-
for example: `http://localhost:5000/records/usage-logs`.
219
+
**Example HTTPS endpoint**
216
220
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:
218
224
219
225
```json
220
226
{
@@ -231,13 +237,13 @@ It will return JSON similar to this example:
231
237
232
238
#### Get records for a specific month
233
239
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:
it will return a JSON response similar to this example:
246
+
This usage-logs endpoint will return a JSON response similar to this example:
241
247
242
248
```json
243
249
{
@@ -260,16 +266,18 @@ You can choose a different commitment plan in the **Commitment Tier pricing** se
260
266
261
267
## End a commitment plan
262
268
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.
264
270
265
271
## Troubleshooting
266
272
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.
268
274
269
275
> [!TIP]
270
276
> For more troubleshooting information and guidance, see [Disconnected containers Frequently asked questions (FAQ)](../../containers/disconnected-container-faq.yml).
271
277
278
+
That's it! You've learned how to create and run disconnected containers for Azure Translator Service.
279
+
272
280
## Next steps
273
281
274
282
> [!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