Skip to content

Commit 8da7caa

Browse files
authored
Merge pull request #251622 from cloga/lochen/tsg-code-first
Lochen/tsg code first
2 parents 6dec90a + 9d10915 commit 8da7caa

File tree

8 files changed

+108
-174
lines changed

8 files changed

+108
-174
lines changed

articles/machine-learning/prompt-flow/get-started-prompt-flow.md

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -26,10 +26,6 @@ This article walks you through the main user journey of using Prompt flow in Azu
2626
> Prompt flow is **not supported** in the workspace which has data isolation enabled. The enableDataIsolation flag can only be set at the workspace creation phase and can't be updated.
2727
>
2828
>Prompt flow is **not supported** in the project workspace which was created with a workspace hub. The workspace hub is a private preview feature.
29-
>
30-
>Prompt flow is **not supported** in workspaces that enable managed VNet. Managed VNet is a private preview feature.
31-
>
32-
>Prompt flow is **not supported** if you secure your Azure AI services account(Azure openAI, Azure cognitive search, Azure content safety) with virtual networks. If you want to use these as connection in prompt flow please allow access from all networks.
3329
3430
In your Azure Machine Learning workspace, you can enable Prompt flow by turning on **Build AI solutions with Prompt flow** in the **Manage preview features** panel.
3531

articles/machine-learning/prompt-flow/how-to-create-manage-runtime.md

Lines changed: 0 additions & 75 deletions
Original file line numberDiff line numberDiff line change
@@ -108,81 +108,6 @@ Go to runtime detail page and select update button at the top. You can change ne
108108
> [!NOTE]
109109
> If you used a custom environment, you need to rebuild it using latest prompt flow image first, and then update your runtime with the new custom environment.
110110
111-
## Troubleshooting guide for runtime
112-
113-
### Common issues
114-
115-
#### My runtime is failed with a system error **runtime not ready** when using a custom environment
116-
117-
:::image type="content" source="./media/how-to-create-manage-runtime/ci-failed-runtime-not-ready.png" alt-text="Screenshot of a failed run on the runtime detail page. " lightbox = "./media/how-to-create-manage-runtime/ci-failed-runtime-not-ready.png":::
118-
119-
First, go to the Compute Instance terminal and run `docker ps` to find the root cause.
120-
121-
Use `docker images` to check if the image was pulled successfully. If your image was pulled successfully, check if the Docker container is running. If it's already running, locate this runtime, which will attempt to restart the runtime and compute instance.
122-
123-
#### Run failed due to "No module named XXX"
124-
125-
This type error usually related to runtime lack required packages. If you're using default environment, make sure image of your runtime is using the latest version, learn more: [runtime update](#update-runtime-from-ui), if you're using custom image and you're using conda environment, make sure you have installed all required packages in your conda environment, learn more: [customize Prompt flow environment](how-to-customize-environment-runtime.md#customize-environment-with-docker-context-for-runtime).
126-
127-
#### Request timeout issue
128-
129-
##### Request timeout error shown in UI
130-
131-
**MIR runtime request timeout error in the UI:**
132-
133-
:::image type="content" source="./media/how-to-create-manage-runtime/mir-runtime-request-timeout.png" alt-text="Screenshot of a MIR runtime timeout error in the studio UI. " lightbox = "./media/how-to-create-manage-runtime/mir-runtime-request-timeout.png":::
134-
135-
Error in the example says "UserError: Upstream request timeout".
136-
137-
**Compute instance runtime request timeout error:**
138-
139-
:::image type="content" source="./media/how-to-create-manage-runtime/ci-runtime-request-timeout.png" alt-text="Screenshot of a compute instance runtime timeout error in the studio UI. " lightbox = "./media/how-to-create-manage-runtime/ci-runtime-request-timeout.png":::
140-
141-
Error in the example says "UserError: Invoking runtime gega-ci timeout, error message: The request was canceled due to the configured HttpClient.Timeout of 100 seconds elapsing".
142-
143-
#### How to identify which node consume the most time
144-
145-
1. Check the runtime logs
146-
147-
2. Trying to find below warning log format
148-
149-
{node_name} has been running for {duration} seconds.
150-
151-
For example:
152-
153-
- Case 1: Python script node running for long time.
154-
155-
:::image type="content" source="./media/how-to-create-manage-runtime/runtime-timeout-running-for-long-time.png" alt-text="Screenshot of a timeout run logs in the studio UI. " lightbox = "./media/how-to-create-manage-runtime/runtime-timeout-running-for-long-time.png":::
156-
157-
In this case, you can find that the `PythonScriptNode` was running for a long time (almost 300s), then you can check the node details to see what's the problem.
158-
159-
- Case 2: LLM node running for long time.
160-
161-
:::image type="content" source="./media/how-to-create-manage-runtime/runtime-timeout-by-language-model-timeout.png" alt-text="Screenshot of a timeout logs caused by LLM timeout in the studio UI. " lightbox = "./media/how-to-create-manage-runtime/runtime-timeout-by-language-model-timeout.png":::
162-
163-
In this case, if you find the message `request canceled` in the logs, it may be due to the OpenAI API call taking too long and exceeding the runtime limit.
164-
165-
An OpenAI API Timeout could be caused by a network issue or a complex request that requires more processing time. For more information, see [OpenAI API Timeout](https://help.openai.com/en/articles/6897186-timeout).
166-
167-
You can try waiting a few seconds and retrying your request. This usually resolves any network issues.
168-
169-
If retrying doesn't work, check whether you're using a long context model, such as ‘gpt-4-32k’, and have set a large value for `max_tokens`. If so, it's expected behavior because your prompt may generate a very long response that takes longer than the interactive mode upper threshold. In this situation, we recommend trying 'Bulk test', as this mode doesn't have a timeout setting.
170-
171-
3. If you can't find anything in runtime logs to indicate it's a specific node issue
172-
173-
Contact the Prompt Flow team ([promptflow-eng](mailto:[email protected])) with the runtime logs. We'll try to identify the root cause.
174-
175-
### Compute instance runtime related
176-
177-
#### How to find the compute instance runtime log for further investigation?
178-
179-
Go to the compute instance terminal and run `docker logs -<runtime_container_name>`
180-
181-
#### User doesn't have access to this compute instance. Please check if this compute instance is assigned to you and you have access to the workspace. Additionally, verify that you are on the correct network to access this compute instance.
182-
183-
:::image type="content" source="./media/how-to-create-manage-runtime/ci-flow-clone-others.png" alt-text="Screenshot of a don't have access error on the flow page. " lightbox = "./media/how-to-create-manage-runtime/ci-flow-clone-others.png":::
184-
185-
This because you're cloning a flow from others that is using compute instance as runtime. As compute instance runtime is user isolated, you need to create your own compute instance runtime or select a managed online deployment/endpoint runtime, which can be shared with others.
186111

187112
## Next steps
188113

articles/machine-learning/prompt-flow/how-to-customize-environment-runtime.md

Lines changed: 0 additions & 81 deletions
Original file line numberDiff line numberDiff line change
@@ -174,87 +174,6 @@ Follow [this document to add custom application](../how-to-create-compute-instan
174174

175175
:::image type="content" source="./media/how-to-customize-environment-runtime/runtime-creation-add-custom-application-ui.png" alt-text="Screenshot of compute showing custom applications. " lightbox = "./media/how-to-customize-environment-runtime/runtime-creation-add-custom-application-ui.png":::
176176

177-
## Create managed online deployment that can be used as Prompt flow runtime (deprecated)
178-
179-
> [!IMPORTANT]
180-
> Managed online endpoint/deployment as runtime is **deprecated**. Please use [Migrate guide for managed online endpoint/deployment runtime](./migrate-managed-inference-runtime.md).
181-
182-
### Create managed online deployment that can be used as Prompt flow runtime via CLI v2
183-
184-
Learn more about [deploy and score a machine learning model by using an online endpoint](../how-to-deploy-online-endpoints.md)
185-
186-
#### Create managed online endpoint
187-
188-
To define a managed online endpoint, you can use the following yaml template. Make sure to replace the `ENDPOINT_NAME` with the desired name for your endpoint.
189-
190-
```yaml
191-
$schema: https://azuremlschemas.azureedge.net/latest/managedOnlineEndpoint.schema.json
192-
name: <ENDPOINT_NAME>
193-
description: this is a sample promptflow endpoint
194-
auth_mode: key
195-
```
196-
197-
Use following CLI command `az ml online-endpoint create -f <yaml_file> -g <resource_group> -w <workspace_name>` to create managed online endpoint. To learn more, see [Deploy and score a machine learning model by using an online endpoint](../how-to-deploy-online-endpoints.md).
198-
199-
#### Create Prompt flow runtime image config file
200-
201-
To configure your Prompt flow runtime, place the following config file in your model folder. This config file provides the necessary information for the runtime to work properly.
202-
203-
For the `mt_service_endpoint` parameter, follow this format: `https://<region>.api.azureml.ms`. For example, if your region is eastus, then your service endpoint should be `https://eastus.api.azureml.ms`
204-
205-
```yaml
206-
storage:
207-
storage_account: <WORKSPACE_LINKED_STORAGE>
208-
deployment:
209-
subscription_id: <SUB_ID>
210-
resource_group: <RG_NAME>
211-
workspace_name: <WORKSPACE_NAME>
212-
endpoint_name: <ENDPOINT_NAME>
213-
deployment_name: blue
214-
mt_service_endpoint: <PROMPT_FLOW_SERVICE_ENDPOINT>
215-
```
216-
217-
#### Create managed online endpoint
218-
219-
You need to replace the following placeholders with your own values:
220-
221-
- `ENDPOINT_NAME`: the name of the endpoint you created in the previous step
222-
- `PRT_CONFIG_FILE`: the name of the config file that contains the port and runtime settings. Include the parent model folder name, for example, if model folder name is `model`, then the config file name should be `model/config.yaml`.
223-
- `IMAGE_NAME` to name of your own image, for example: `mcr.microsoft.com/azureml/promptflow/promptflow-runtime:<newest_version>`, you can also follow [Customize environment with docker context for runtime](#customize-environment-with-docker-context-for-runtime) to create your own environment.
224-
225-
```yaml
226-
$schema: https://azuremlschemas.azureedge.net/latest/managedOnlineDeployment.schema.json
227-
name: blue
228-
endpoint_name: <ENDPOINT_NAME>
229-
type: managed
230-
model:
231-
path: ./
232-
type: custom_model
233-
instance_count: 1
234-
# 4core, 32GB
235-
instance_type: Standard_E4s_v3
236-
request_settings:
237-
max_concurrent_requests_per_instance: 10
238-
request_timeout_ms: 90000
239-
environment_variables:
240-
PRT_CONFIG_FILE: <PRT_CONFIG_FILE>
241-
environment:
242-
name: promptflow-runtime
243-
image: <IMAGE_NAME>
244-
inference_config:
245-
liveness_route:
246-
port: 8080
247-
path: /health
248-
readiness_route:
249-
port: 8080
250-
path: /health
251-
scoring_route:
252-
port: 8080
253-
path: /score
254-
255-
```
256-
257-
Use following CLI command `az ml online-deployment create -f <yaml_file> -g <resource_group> -w <workspace_name>` to create managed online deployment that can be used as a Prompt flow runtime.
258177

259178
## Next steps
260179

articles/machine-learning/prompt-flow/how-to-deploy-for-real-time-inference.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,12 @@ If you didn't complete the tutorial, you need to build a flow. Testing the flow
4545

4646
We'll use the sample flow **Web Classification** as example to show how to deploy the flow. This sample flow is a standard flow. Deploying chat flows is similar. Evaluation flow doesn't support deployment.
4747

48+
## Define the environment used by deployment
49+
50+
When you deploy prompt flow to managed online endpoint in UI. You need define the environment used by this flow. By default, it will use the latest prompt image version. You can specify extra packages you needed in `requirements.txt`. You can find `requirements.txt` in the root folder of your flow folder, which is system generated file.
51+
52+
:::image type="content" source="./media/how-to-deploy-for-real-time-inference/requirements-text.png" alt-text="Screenshot of Web requirements-text. " lightbox = "./media/how-to-deploy-for-real-time-inference/requirements-text.png":::
53+
4854
## Create an online endpoint
4955

5056
Now that you have built a flow and tested it properly, it's time to create your online endpoint for real-time inference.

articles/machine-learning/prompt-flow/how-to-secure-prompt-flow.md

Lines changed: 9 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -54,27 +54,25 @@ Workspace managed virtual network is the recommended way to support network isol
5454
5555
:::image type="content" source="./media/how-to-secure-prompt-flow/outbound-rule-non-azure-resources.png" alt-text="Screenshot of user defined outbound rule for non Azure resource." lightbox = "./media/how-to-secure-prompt-flow/outbound-rule-non-azure-resources.png":::
5656
57+
4. In workspace which enable managed VNet, you can only deploy prompt flow to managed online endpoint. You can follow [Secure your managed online endpoints with network isolation](../how-to-secure-kubernetes-inferencing-environment.md) to secure your managed online endpoint.
58+
5759
## Secure prompt flow use your own virtual network
5860
5961
- To set up Azure Machine Learning related resources as private, see [Secure workspace resources](../how-to-secure-workspace-vnet.md).
6062
- Meanwhile, you can follow [private Azure Cognitive Services](../../ai-services/cognitive-services-virtual-networks.md) to make them as private.
63+
- If you want to deploy prompt flow in workspace which secured by your own virtual network, you can deploy it to AKS cluster which is in the same virtual network. You can follow [Secure your RAG workflows with network isolation](../how-to-secure-rag-workflows.md) to secure your AKS cluster.
6164
- You can either create private endpoint to the same virtual network or leverage virtual network peering to make them communicate with each other.
6265
63-
## Limitations
66+
## Known limitations
6467
65-
- Only public access enable storage account is supported. You can't use private storage account now.
68+
- Only public access enable storage account is supported. You can't use private storage account now. Find workaround here: [Why I can't create or upgrade my flow when I disable public network access of storage account?](./tools-reference/troubleshoot-guidance.md#why-i-cant-create-or-upgrade-my-flow-when-i-disable-public-network-access-of-storage-account)
6669
- Workspace hub / lean workspace and AI studio don't support bring your own virtual network.
6770
- Managed online endpoint only supports workspace managed virtual network. If you want to use your own virtual network, you may need one workspace for prompt flow authoring with your virtual network and another workspace for prompt flow deployment using managed online endpoint with workspace managed virtual network.
6871

69-
## FAQ
70-
71-
### Why I can't create or upgrade my flow when I disable public network access of storage account?
72-
Prompt flow rely on fileshare to store snapshot of flow. Prompt flow didn't support private storage account now. Here are some workarounds you can try:
73-
- Make the storage account as public access enabled if there is no security concern.
74-
- If you are only use UI to authoring promptflow, you can add following flights (flight=PromptFlowCodeFirst=false) to use our old UI.
75-
- You can use our CLI/SDK to authoring promptflow, CLI/SDK authong didn't rely on fileshare. See [Integrate Prompt Flow with LLM-based application DevOps ](how-to-integrate-with-llm-app-devops.md).
76-
7772
## Next steps
7873

7974
- [Secure workspace resources](../how-to-secure-workspace-vnet.md)
80-
- [Workspace managed network isolation](../how-to-managed-network.md)
75+
- [Workspace managed network isolation](../how-to-managed-network.md)
76+
- [Secure Azure Kubernetes Service inferencing environment](../how-to-secure-online-endpoint.md)
77+
- [Secure your managed online endpoints with network isolation](../how-to-secure-kubernetes-inferencing-environment.md)
78+
- [Secure your RAG workflows with network isolation](../how-to-secure-rag-workflows.md)
65.2 KB
Loading
61.9 KB
Loading

0 commit comments

Comments
 (0)