Skip to content

Commit 000be30

Browse files
authored
Merge pull request #233449 from lgayhardt/amlregcomp0423
update register component in UI and common errors
2 parents 7874484 + ec2c6d8 commit 000be30

File tree

4 files changed

+36
-18
lines changed

4 files changed

+36
-18
lines changed

articles/machine-learning/how-to-create-component-pipelines-ui.md

Lines changed: 25 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ ms.subservice: core
88
ms.author: keli19
99
author: likebupt
1010
ms.reviewer: lagayhar
11-
ms.date: 05/10/2022
11+
ms.date: 03/27/2022
1212
ms.topic: how-to
1313
ms.custom: devplatv2, designer, event-tier1-build-2022, ignite-2022
1414
---
@@ -17,7 +17,7 @@ ms.custom: devplatv2, designer, event-tier1-build-2022, ignite-2022
1717

1818
[!INCLUDE [cli v2](../../includes/machine-learning-cli-v2.md)]
1919

20-
In this article, you'll learn how to create and run [machine learning pipelines](concept-ml-pipelines.md) by using the Azure Machine Learning studio and [Components](concept-component.md). You can create pipelines without using components, but components offer better amount of flexibility and reuse. Azure Machine Learning Pipelines may be defined in YAML and [run from the CLI](how-to-create-component-pipelines-cli.md), [authored in Python](how-to-create-component-pipeline-python.md), or composed in Azure Machine Learning Studio Designer with a drag-and-drop UI. This document focuses on the Azure Machine Learning studio designer UI.
20+
In this article, you'll learn how to create and run [machine learning pipelines](concept-ml-pipelines.md) by using the Azure Machine Learning studio and [Components](concept-component.md). You can create pipelines without using components, but components offer better amount of flexibility and reuse. Azure Machine Learning Pipelines may be defined in YAML and [run from the CLI](how-to-create-component-pipelines-cli.md), [authored in Python](how-to-create-component-pipeline-python.md), or composed in Azure Machine Learning studio Designer with a drag-and-drop UI. This document focuses on the Azure Machine Learning studio designer UI.
2121

2222
## Prerequisites
2323

@@ -34,8 +34,6 @@ In this article, you'll learn how to create and run [machine learning pipelines]
3434
cd azureml-examples/cli/jobs/pipelines-with-components/
3535
```
3636
37-
## Register component in your workspace
38-
3937
>[!Note]
4038
> Designer supports two type of components, classic prebuilt components and custom components. These two types of components are not compatible.
4139
>
@@ -44,23 +42,34 @@ In this article, you'll learn how to create and run [machine learning pipelines]
4442
>
4543
>Custom components allow you to provide your own code as a component. It supports sharing across workspaces and seamless authoring across Studio, CLI, and SDK interfaces.
4644
>
47-
>This article applies to custom components.
45+
>This article applies to **custom components**.
46+
47+
## Register component in your workspace
4848
49-
To build pipeline using components in UI, you need to register components to your workspace first. You can use CLI or SDK to register components to your workspace, so that you can share and reuse the component within the workspace. Registered components support automatic versioning so you can update the component but assure that pipelines that require an older version will continue to work.
49+
To build pipeline using components in UI, you need to register components to your workspace first. You can use UI, CLI or SDK to register components to your workspace, so that you can share and reuse the component within the workspace. Registered components support automatic versioning so you can update the component but assure that pipelines that require an older version will continue to work.
5050
51-
In the example below take using CLI for example. If you want to learn more about how to build a component, see [Create and run pipelines using components with CLI](how-to-create-component-pipelines-cli.md).
51+
The example below uses UI to register components, and the [component source files](https://github.com/Azure/azureml-examples/tree/main/cli/jobs/pipelines-with-components/basics/1b_e2e_registered_components) are in the `cli/jobs/pipelines-with-components/basics/1b_e2e_registered_components` directory of the [`azureml-examples` repository](https://github.com/Azure/azureml-examples). You need to clone the repo to local first.
5252
53-
1. From the `cli/jobs/pipelines-with-components/basics` directory of the [`azureml-examples` repository](https://github.com/Azure/azureml-examples), navigate to the `1b_e2e_registered_components` subdirectory.
53+
1. In your Azure Machine Learning workspace, navigate to **Components** page and select **New Component**.
5454
55-
1. Register the components to Azure Machine Learning workspace using following commands. Learn more about [ML components](concept-component.md).
55+
:::image type="content" source="./media/how-to-create-component-pipelines-ui/register-component-entry-button.png" alt-text="Screenshot showing register entry button in component page." lightbox ="./media/how-to-create-component-pipelines-ui/register-component-entry-button.png":::
5656
57-
```CLI
58-
az ml component create --file train.yml
59-
az ml component create --file score.yml
60-
az ml component create --file eval.yml
61-
```
57+
1. This example will use `train.yml` [in the directory](https://github.com/Azure/azureml-examples/tree/main/cli/jobs/pipelines-with-components/basics/1b_e2e_registered_components). The YAML file defines the name, type, interface including inputs and outputs, code, environment and command of this component. The code of this component `train.py` is under `./train_src` folder, which describes the execution logic of this component. To learn more about the component schema, see the [command component YAML schema reference](reference-yaml-component-command.md).
58+
59+
>[!Note]
60+
> When register components in UI, `code` defined in the component YAML file can only point to the current folder where YAML file locates or the subfolders, which means you cannot specify `../` for `code` as UI cannot recognize the parent directory.
61+
> `additional_includes` can only point to the current or sub folder.
62+
63+
64+
1. Select Upload from **Folder**, and select the `1b_e2e_registered_components` folder to upload. Select `train.yml` from the drop down list below.
65+
66+
:::image type="content" source="./media/how-to-create-component-pipelines-ui/upload-from-local-folder.png" alt-text="Screenshot showing upload from local folder." lightbox ="./media/how-to-create-component-pipelines-ui/upload-from-local-folder.png":::
67+
68+
1. Select **Next** in the bottom, and you can confirm the details of this component. Once you've confirmed, select **Create** to finish the registration process.
69+
70+
1. Repeat the steps above to register Score and Eval component using `score.yml` and `eval.yml` as well.
6271
63-
1. After register component successfully, you can see your component in the studio UI.
72+
1. After registering the three components successfully, you can see your components in the studio UI.
6473
6574
:::image type="content" source="./media/how-to-create-component-pipelines-ui/component-page.png" alt-text="Screenshot showing registered component in component page." lightbox ="./media/how-to-create-component-pipelines-ui/component-page.png":::
6675
@@ -104,7 +113,7 @@ In the example below take using CLI for example. If you want to learn more about
104113
105114
1. Select submit, and fill in the required information for your pipeline job.
106115
107-
:::image type="content" source="./media/how-to-create-component-pipelines-ui/submit-pipeline.png" alt-text="Screenshot of set up pipeline job with submit highlighted." lightbox ="./media/how-to-create-component-pipelines-ui/submit-pipeline.png":::
116+
:::image type="content" source="./media/how-to-create-component-pipelines-ui/submit-pipeline.png" alt-text="Screenshot of setup pipeline job with submit highlighted." lightbox ="./media/how-to-create-component-pipelines-ui/submit-pipeline.png":::
108117
109118
1. After submit successfully, you'll see a job detail page link in the left page. Select **Job detail** to go to pipeline job detail page for checking status and debugging.
110119
99.8 KB
Loading
71.3 KB
Loading

articles/machine-learning/reference-yaml-component-command.md

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ The source JSON schema can be found at https://azuremlschemas.azureedge.net/late
3737
| `is_deterministic` | boolean |This option determines if the component will produce the same output for the same input data. You should usually set this to `false` for components that load data from external sources, such as importing data from a URL. This is because the data at the URL might change over time. | | `true` |
3838
| `command` | string | **Required.** The command to execute. | | |
3939
| `code` | string | Local path to the source code directory to be uploaded and used for the component. | | |
40-
| `environment` | string or object | **Required.** The environment to use for the component. This value can be either a reference to an existing versioned environment in the workspace or an inline environment specification. <br><br> To reference an existing environment, use the `azureml:<environment-name>:<environment-version>` syntax. <br><br> To define an environment inline, follow the [Environment schema](reference-yaml-environment.md#yaml-syntax). Exclude the `name` and `version` properties as they are not supported for inline environments. | | |
40+
| `environment` | string or object | **Required.** The environment to use for the component. This value can be either a reference to an existing versioned environment in the workspace or an inline environment specification. <br><br> To reference an existing environment, use the `azureml:<environment-name>:<environment-version>` syntax. <br><br> To define an environment inline, follow the [Environment schema](reference-yaml-environment.md#yaml-syntax). Exclude the `name` and `version` properties as they aren't supported for inline environments. | | |
4141
| `distribution` | object | The distribution configuration for distributed training scenarios. One of [MpiConfiguration](#mpiconfiguration), [PyTorchConfiguration](#pytorchconfiguration), or [TensorFlowConfiguration](#tensorflowconfiguration). | | |
4242
| `resources.instance_count` | integer | The number of nodes to use for the job. | | `1` |
4343
| `inputs` | object | Dictionary of component inputs. The key is a name for the input within the context of the component and the value is the component input definition. <br><br> Inputs can be referenced in the `command` using the `${{ inputs.<input_name> }}` expression. | | |
@@ -108,7 +108,7 @@ Examples are available in the [examples GitHub repository](https://github.com/Az
108108

109109
### Define optional inputs in command line
110110
When the input is set as `optional = true`, you need use `$[[]]` to embrace the command line with inputs. For example `$[[--input1 ${{inputs.input1}}]`. The command line at runtime may have different inputs.
111-
- If you are using only specify the required `training_data` and `model_output` parameters, the command line will look like:
111+
- If you're using only specify the required `training_data` and `model_output` parameters, the command line will look like:
112112

113113
```azurecli
114114
python train.py --training_data some_input_path --learning_rate 0.01 --learning_rate_schedule time-based --model_output some_output_path
@@ -121,6 +121,15 @@ If no value is specified at runtime, `learning_rate` and `learning_rate_schedule
121121
python train.py --training_data some_input_path --max_epocs 10 --learning_rate 0.01 --learning_rate_schedule time-based --model_output some_output_path
122122
```
123123

124+
## Common errors and recommendation
125+
126+
Following are some common errors and corresponding recommended suggestions when you define a component.
127+
128+
| Key | Errors | Recommendation |
129+
| --- | ---- | ----------- |
130+
|command|1. Only optional inputs can be in `$[[]]`<br> 2. Using `\` to make a new line isn't supported in command.<br>3. Inputs or outputs aren't found.|1. Check that all the inputs or outputs used in command are already defined in the `inputs` and `outputs` sections, and use the correct format for optional inputs `$[[]]` or required ones `${{}}`.<br>2. Don't use `\` to make a new line.|
131+
|environment|1. No definition exists for environment `{envName}` version `{envVersion}`. <br>2. No environment exists for name `{envName}`, version `{envVersion}`.<br>3. Couldn't find asset with ID `{envAssetId}`. |1. Make sure the environment name and version you refer in the component definition exists. <br>2. You need to specify the version if you refer to a registered environment.|
132+
|inputs/outputs|1. Inputs/outputs names conflict with system reserved parameters.<br>2. Duplicated names of inputs or outputs.|1. Don't use any of these reserved parameters as your inputs/outputs name: `path`, `ld_library_path`, `user`, `logname`, `home`, `pwd`, `shell`.<br>2. Make sure names of inputs and outputs aren't duplicated.|
124133

125134
## Next steps
126135

0 commit comments

Comments
 (0)