az ml component
Note
此参考是 Azure CLI(版本 2.15.0 或更高版本) 的 ml 扩展的一部分。 该扩展将在首次运行 az ml component 命令时自动安装。 了解更多关于扩展的信息。
管理 Azure ML 组件。
Azure ML 组件定义管道作业的组件配置。 可以配置组件的输入/输出端口、执行环境和命令。 创建组件后,可以引用管道作业中的组件,以在 docker 容器中执行它们。
命令
| 名称 | 说明 | 类型 | Status |
|---|---|---|---|
| az ml component archive |
存档组件。 |
Extension | GA |
| az ml component create |
创建组件。 |
Extension | GA |
| az ml component list |
列出工作区中的组件。 |
Extension | GA |
| az ml component prepare-for-sign |
准备用于签名的组件。 |
Extension | GA |
| az ml component restore |
还原已存档的组件。 |
Extension | GA |
| az ml component show |
显示组件的详细信息。 |
Extension | GA |
| az ml component update |
更新组件。 目前只有几个字段(说明,display_name)支持更新。 |
Extension | GA |
az ml component archive
存档组件。
默认情况下,存档组件会在列表查询(az ml component list)中隐藏它。 仍可以在管道中继续引用和使用存档组件。 可以存档组件容器或特定组件版本。 存档组件容器将存档该给定名称下组件的所有版本。 可以使用 .. 还原存档组件 az ml component restore。 如果存档整个组件容器,则无法还原组件的单个版本 - 需要还原组件容器。
az ml component archive --name
[--label]
[--registry-name]
[--resource-group]
[--version]
[--workspace-name]
示例
存档组件容器(存档该组件的所有版本)
az ml component archive --name my-component --resource-group my-resource-group --workspace-name my-workspace
存档特定组件版本
az ml component archive --name my-component --version 1 --resource-group my-resource-group --workspace-name my-workspace
必需参数
组件的名称。
可选参数
The following parameters are optional, but depending on the context, one or more might become required for the command to execute successfully.
组件的标签。
如果提供,该命令将面向注册表而不是工作区。 因此,不需要资源组和工作区。
资源组的名称。 可以使用 az configure --defaults group=<name>配置默认组。
组件的版本。
Azure ML 工作区的名称。 可以使用 配置默认工作区 az configure --defaults workspace=<name>。
全局参数
提高日志记录详细程度以显示所有调试日志。
| 属性 | 值 |
|---|---|
| 默认值: | False |
显示此帮助消息并退出。
仅显示错误,禁止显示警告。
| 属性 | 值 |
|---|---|
| 默认值: | False |
输出格式。
| 属性 | 值 |
|---|---|
| 默认值: | json |
| 接受的值: | json, jsonc, none, table, tsv, yaml, yamlc |
JMESPath 查询字符串。 有关更多信息和示例,请参阅 http://jmespath.org/。
订阅的名称或 ID。 可以使用 az account set -s NAME_OR_ID 配置默认订阅。
增加日志记录详细程度。 使用 --debug 获取完整的调试日志。
| 属性 | 值 |
|---|---|
| 默认值: | False |
az ml component create
创建组件。
az ml component create --file
[--name]
[--registry-name]
[--resource-group]
[--set]
[--skip-validation]
[--version]
[--workspace-name]
示例
从 YAML 规范文件创建组件
az ml component create --file my_component.yml --resource-group my-resource-group --workspace-name my-workspace
从具有指定版本的 YAML 规范文件创建组件
az ml component create --file my_component.yml --version 1 --resource-group my-resource-group --workspace-name my-workspace
从 YAML 规范文件在注册表中创建组件
az ml component create --file my_component.yml --registry-name my-registry-name --resource-group my-resource-group
从具有指定版本的 YAML 规范文件在注册表中创建组件
az ml component create --file my_component.yml --version 1 --registry-name my-registry-name --resource-group my-resource-group
必需参数
包含 Azure ML 组件规范的 YAML 文件的本地路径。 可以在以下位置找到组件的 YAML 参考文档:https://aka.ms/ml-cli-v2-component-command-yaml-reference。
可选参数
The following parameters are optional, but depending on the context, one or more might become required for the command to execute successfully.
组件的名称。
如果提供,该命令将面向注册表而不是工作区。 因此,不需要资源组和工作区。
资源组的名称。 可以使用 az configure --defaults group=<name>配置默认组。
通过指定要设置的属性路径和值来更新对象。 示例:--set property1.property2=value。
在创建资源时跳过验证。 请注意,依赖资源不会跳过创建中的验证。
| 属性 | 值 |
|---|---|
| 默认值: | False |
组件的版本。
Azure ML 工作区的名称。 可以使用 配置默认工作区 az configure --defaults workspace=<name>。
全局参数
提高日志记录详细程度以显示所有调试日志。
| 属性 | 值 |
|---|---|
| 默认值: | False |
显示此帮助消息并退出。
仅显示错误,禁止显示警告。
| 属性 | 值 |
|---|---|
| 默认值: | False |
输出格式。
| 属性 | 值 |
|---|---|
| 默认值: | json |
| 接受的值: | json, jsonc, none, table, tsv, yaml, yamlc |
JMESPath 查询字符串。 有关更多信息和示例,请参阅 http://jmespath.org/。
订阅的名称或 ID。 可以使用 az account set -s NAME_OR_ID 配置默认订阅。
增加日志记录详细程度。 使用 --debug 获取完整的调试日志。
| 属性 | 值 |
|---|---|
| 默认值: | False |
az ml component list
列出工作区中的组件。
az ml component list [--archived-only]
[--include-archived]
[--max-results]
[--name]
[--registry-name]
[--resource-group]
[--workspace-name]
示例
列出工作区中的所有组件
az ml component list --resource-group my-resource-group --workspace-name my-workspace
列出工作区中指定名称的所有组件版本
az ml component list --name my-component --resource-group my-resource-group --workspace-name my-workspace
使用 --query 参数对命令结果执行 JMESPath 查询,列出工作区中的所有组件。
az ml component list --query "[].{Name:name}" --output table --resource-group my-resource-group --workspace-name my-workspace
列出注册表中的所有组件
az ml component list --registry-name my-registry-name --resource-group my-resource-group
列出注册表中指定名称的所有组件版本
az ml component list --name my-component --registry-name my-registry-name --resource-group my-resource-group
使用 --query 参数列出注册表中的所有组件,以对命令结果执行 JMESPath 查询。
az ml component list --query "[].{Name:name}" --output table --registry-name my-registry-name --resource-group my-resource-group
可选参数
The following parameters are optional, but depending on the context, one or more might become required for the command to execute successfully.
仅列出存档的组件。
| 属性 | 值 |
|---|---|
| 默认值: | False |
列出存档的组件和活动组件。
| 属性 | 值 |
|---|---|
| 默认值: | False |
要返回的最大结果数。
组件的名称。
如果提供,该命令将面向注册表而不是工作区。 因此,不需要资源组和工作区。
资源组的名称。 可以使用 az configure --defaults group=<name>配置默认组。
Azure ML 工作区的名称。 可以使用 配置默认工作区 az configure --defaults workspace=<name>。
全局参数
提高日志记录详细程度以显示所有调试日志。
| 属性 | 值 |
|---|---|
| 默认值: | False |
显示此帮助消息并退出。
仅显示错误,禁止显示警告。
| 属性 | 值 |
|---|---|
| 默认值: | False |
输出格式。
| 属性 | 值 |
|---|---|
| 默认值: | json |
| 接受的值: | json, jsonc, none, table, tsv, yaml, yamlc |
JMESPath 查询字符串。 有关更多信息和示例,请参阅 http://jmespath.org/。
订阅的名称或 ID。 可以使用 az account set -s NAME_OR_ID 配置默认订阅。
增加日志记录详细程度。 使用 --debug 获取完整的调试日志。
| 属性 | 值 |
|---|---|
| 默认值: | False |
az ml component prepare-for-sign
准备用于签名的组件。
准备用于签名的组件将生成 2 个文件:catalog.json 和 catalog.json.sig,这些文件包含为目标文件夹中存在的每个文件生成的 SHA256。 如果文件已存在,将删除这些文件,并使用更新的签名创建新文件。
az ml component prepare-for-sign --file
[--registry-name]
[--resource-group]
[--workspace-name]
示例
准备用于签名的 YAML 规范文件中的组件
az ml component prepare-for-sign --file my_component.yml --resource-group my-resource-group --workspace-name my-workspace
从 YAML 规范文件准备注册表中的组件进行签名
az ml component prepare-for-sign --file my_component.yml --registry-name my-registry-name --resource-group my-resource-group
必需参数
包含 Azure ML 组件规范的 YAML 文件的本地路径。 可以在以下位置找到组件的 YAML 参考文档:https://aka.ms/ml-cli-v2-component-command-yaml-reference。
可选参数
The following parameters are optional, but depending on the context, one or more might become required for the command to execute successfully.
如果提供,该命令将面向注册表而不是工作区。 因此,不需要资源组和工作区。
资源组的名称。 可以使用 az configure --defaults group=<name>配置默认组。
Azure ML 工作区的名称。 可以使用 配置默认工作区 az configure --defaults workspace=<name>。
全局参数
提高日志记录详细程度以显示所有调试日志。
| 属性 | 值 |
|---|---|
| 默认值: | False |
显示此帮助消息并退出。
仅显示错误,禁止显示警告。
| 属性 | 值 |
|---|---|
| 默认值: | False |
输出格式。
| 属性 | 值 |
|---|---|
| 默认值: | json |
| 接受的值: | json, jsonc, none, table, tsv, yaml, yamlc |
JMESPath 查询字符串。 有关更多信息和示例,请参阅 http://jmespath.org/。
订阅的名称或 ID。 可以使用 az account set -s NAME_OR_ID 配置默认订阅。
增加日志记录详细程度。 使用 --debug 获取完整的调试日志。
| 属性 | 值 |
|---|---|
| 默认值: | False |
az ml component restore
还原已存档的组件。
还原存档组件后,它将不再从列表查询中隐藏(az ml component list)。 如果存档了整个组件容器,则可以还原该存档的容器。 这将还原该给定名称下组件的所有版本。 如果存档整个组件容器,则不能仅还原特定组件版本 - 需要还原整个容器。 如果仅存档了单个组件版本,则可以还原该特定版本。
az ml component restore --name
[--label]
[--registry-name]
[--resource-group]
[--version]
[--workspace-name]
示例
还原存档的组件容器(还原该组件的所有版本)
az ml component restore --name my-component --resource-group my-resource-group --workspace-name my-workspace
还原特定的存档组件版本
az ml component restore --name my-component --version 1 --resource-group my-resource-group --workspace-name my-workspace
必需参数
组件的名称。
可选参数
The following parameters are optional, but depending on the context, one or more might become required for the command to execute successfully.
组件的标签。
如果提供,该命令将面向注册表而不是工作区。 因此,不需要资源组和工作区。
资源组的名称。 可以使用 az configure --defaults group=<name>配置默认组。
组件的版本。
Azure ML 工作区的名称。 可以使用 配置默认工作区 az configure --defaults workspace=<name>。
全局参数
提高日志记录详细程度以显示所有调试日志。
| 属性 | 值 |
|---|---|
| 默认值: | False |
显示此帮助消息并退出。
仅显示错误,禁止显示警告。
| 属性 | 值 |
|---|---|
| 默认值: | False |
输出格式。
| 属性 | 值 |
|---|---|
| 默认值: | json |
| 接受的值: | json, jsonc, none, table, tsv, yaml, yamlc |
JMESPath 查询字符串。 有关更多信息和示例,请参阅 http://jmespath.org/。
订阅的名称或 ID。 可以使用 az account set -s NAME_OR_ID 配置默认订阅。
增加日志记录详细程度。 使用 --debug 获取完整的调试日志。
| 属性 | 值 |
|---|---|
| 默认值: | False |
az ml component show
显示组件的详细信息。
az ml component show --name
[--label]
[--registry-name]
[--resource-group]
[--version]
[--workspace-name]
示例
显示具有指定名称和版本的组件的详细信息
az ml component show --name my-component --version 1 --resource-group my-resource-group --workspace-name my-workspace
显示注册表中具有指定名称和版本组件的详细信息
az ml component show --name my-component --version 1 --registry-name my-registry-name --resource-group my-resource-group
必需参数
组件的名称。
可选参数
The following parameters are optional, but depending on the context, one or more might become required for the command to execute successfully.
组件的标签。
如果提供,该命令将面向注册表而不是工作区。 因此,不需要资源组和工作区。
资源组的名称。 可以使用 az configure --defaults group=<name>配置默认组。
组件的版本。
Azure ML 工作区的名称。 可以使用 配置默认工作区 az configure --defaults workspace=<name>。
全局参数
提高日志记录详细程度以显示所有调试日志。
| 属性 | 值 |
|---|---|
| 默认值: | False |
显示此帮助消息并退出。
仅显示错误,禁止显示警告。
| 属性 | 值 |
|---|---|
| 默认值: | False |
输出格式。
| 属性 | 值 |
|---|---|
| 默认值: | json |
| 接受的值: | json, jsonc, none, table, tsv, yaml, yamlc |
JMESPath 查询字符串。 有关更多信息和示例,请参阅 http://jmespath.org/。
订阅的名称或 ID。 可以使用 az account set -s NAME_OR_ID 配置默认订阅。
增加日志记录详细程度。 使用 --debug 获取完整的调试日志。
| 属性 | 值 |
|---|---|
| 默认值: | False |
az ml component update
更新组件。 目前只有几个字段(说明,display_name)支持更新。
az ml component update --name
--resource-group
--workspace-name
[--add]
[--force-string]
[--label]
[--registry-name]
[--remove]
[--set]
[--version]
示例
更新组件的说明
az ml component update -n my_component -v 1 --set description="new description" -g my-resource-group -w my-workspace
必需参数
组件的名称。
资源组的名称。 可以使用 az configure --defaults group=<name>配置默认组。
Azure ML 工作区的名称。 可以使用 配置默认工作区 az configure --defaults workspace=<name>。
可选参数
The following parameters are optional, but depending on the context, one or more might become required for the command to execute successfully.
通过指定路径和键值对将对象添加到对象列表。 示例:--add property.listProperty <key=value, string or JSON string>。
| 属性 | 值 |
|---|---|
| Parameter group: | Generic Update Arguments |
| 默认值: | [] |
使用“set”或“add”时,保留字符串文本,而不是尝试转换为 JSON。
| 属性 | 值 |
|---|---|
| Parameter group: | Generic Update Arguments |
| 默认值: | False |
组件的标签。
如果提供,该命令将面向注册表而不是工作区。 因此,不需要资源组和工作区。
从列表中删除属性或元素。 示例: --remove property.list <indexToRemove> OR --remove propertyToRemove.
| 属性 | 值 |
|---|---|
| Parameter group: | Generic Update Arguments |
| 默认值: | [] |
通过指定要设置的属性路径和值来更新对象。 示例:--set property1.property2=<value>。
| 属性 | 值 |
|---|---|
| Parameter group: | Generic Update Arguments |
| 默认值: | [] |
组件的版本。
全局参数
提高日志记录详细程度以显示所有调试日志。
| 属性 | 值 |
|---|---|
| 默认值: | False |
显示此帮助消息并退出。
仅显示错误,禁止显示警告。
| 属性 | 值 |
|---|---|
| 默认值: | False |
输出格式。
| 属性 | 值 |
|---|---|
| 默认值: | json |
| 接受的值: | json, jsonc, none, table, tsv, yaml, yamlc |
JMESPath 查询字符串。 有关更多信息和示例,请参阅 http://jmespath.org/。
订阅的名称或 ID。 可以使用 az account set -s NAME_OR_ID 配置默认订阅。
增加日志记录详细程度。 使用 --debug 获取完整的调试日志。
| 属性 | 值 |
|---|---|
| 默认值: | False |