You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

基于MLOps-v2 Accelerator的训练部署流水线执行问题求助

一、解决GitHub流水线register-dataset任务失败问题

1. 补充代码检出步骤

在set-env-branch任务里添加代码检出动作,保证Runner能获取到仓库里的data.yml文件:

jobs:
  set-env-branch:
    runs-on: ubuntu-latest
    outputs:
      config-file: ${{ steps.set-output-defaults.outputs.config-file }}
    steps:
      - name: 检出仓库代码
        uses: actions/checkout@v4  # 新增该行
      - id: set-prod-branch
        # 后续原有步骤保持不变

2. 对齐文件路径与流水线配置

  • 如果你已经把data.yml移到仓库根目录,就把register-dataset任务里的data_file参数改成根路径:
register-dataset:
  needs: get-config
  uses: Azure/mlops-templates/.github/workflows/register-dataset.yml@main
  with:
    # 其他参数不变
    data_file: data.yml  # 修改为实际存放路径
  • 确认data.yml已经提交并推送到远程仓库,避免本地修改未同步到云端。

3. 检查模板流水线的代码依赖

查看Azure/mlops-templates/.github/workflows/register-dataset.yml模板是否包含代码检出步骤。如果模板没做这件事,要么给模板补上actions/checkout,要么确保调用模板前已经完成代码检出(步骤1已经覆盖这种情况)。

二、解决Azure DevOps无法识别YAML语法问题

你提供的YAML是Azure ML Pipeline Job的定义文件,不属于Azure DevOps流水线的语法规范,需要按以下方式调整:

方案1:在Azure DevOps中触发Azure ML Pipeline

编写Azure DevOps流水线YAML,通过Azure CLI提交AML Pipeline任务:

trigger: none
pr: none

pool:
  vmImage: ubuntu-latest

steps:
- task: AzureCLI@2
  inputs:
    azureSubscription: '<你的Azure服务连接名称>'
    scriptType: bash
    scriptLocation: inlineScript
    inlineScript: |
      az ml job create --file <你的AML Pipeline YAML文件路径> --resource-group <资源组名称> --workspace-name <AML工作区名称>

方案2:修正AML Pipeline Job定义的语法错误

如果是要修复AML Pipeline本身的语法问题(用于直接提交到AML平台):

  1. 删除重复字段
    删掉重复的experiment_name,只保留一个:
$schema: https://azuremlschemas.azureedge.net/latest/pipelineJob.schema.json
type: pipeline
experiment_name: fish-health-diagnostics-training
description: Training Pipeline to train model 0 used to diagnostic the fish health
  1. 修正输入类型错误
    inputs.input的类型是uri_file,但路径指向的是AML环境,要改成environment类型:
inputs:
  input:
    type: environment
    path: azureml:fish-health-train-env@latest
  # 其他输入参数保持不变
  1. 调整代码路径
    jobs里的code路径../../../data-science/src是相对路径,要么保证提交Pipeline时的工作目录和该路径匹配,要么改成AML数据存储的绝对路径:
code: azureml://datastores/workspaceblobstore/paths/data-science/src

内容的提问来源于stack exchange,提问作者Aboua Kevin

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.07.22 20:05:40