From 52efca0acafbaf6a7dffa1431582cdc27bc84741 Mon Sep 17 00:00:00 2001 From: Scott Donohoo Date: Thu, 5 Jan 2023 09:08:35 -0600 Subject: [PATCH] Revert to main branch --- ...ploy-batch-endpoint-pipeline-classical.yml | 8 +- ...loy-online-endpoint-pipeline-classical.yml | 8 +- .../deploy-batch-endpoint-pipeline.yml | 100 ++++++----- .../deploy-model-training-pipeline.yml | 86 +++++----- .../deploy-online-endpoint-pipeline.yml | 81 +++++---- .../deploy-model-training-pipeline.yml | 12 +- .../deploy-online-endpoint-pipeline.yml | 8 +- .../deploy-model-training-pipeline.yml | 161 +++++++++--------- .../github-actions/tf-gha-deploy-infra.yml | 4 +- .../deploy-model-training-pipeline.yml | 110 ++++++------ 10 files changed, 285 insertions(+), 293 deletions(-) diff --git a/classical/aml-cli-v2/mlops/github-actions/deploy-batch-endpoint-pipeline-classical.yml b/classical/aml-cli-v2/mlops/github-actions/deploy-batch-endpoint-pipeline-classical.yml index 1d33a11..cbe54ba 100644 --- a/classical/aml-cli-v2/mlops/github-actions/deploy-batch-endpoint-pipeline-classical.yml +++ b/classical/aml-cli-v2/mlops/github-actions/deploy-batch-endpoint-pipeline-classical.yml @@ -22,12 +22,12 @@ jobs: echo "config-file=$config_env" >> $GITHUB_OUTPUT; get-config: needs: set-env-branch - uses: Azure/mlops-templates/.github/workflows/read-yaml.yml@main-dec31 # TODO - revert to @main + uses: Azure/mlops-templates/.github/workflows/read-yaml.yml@main with: file_name: ${{ needs.set-env-branch.outputs.config-file}} create-compute: needs: get-config - uses: Azure/mlops-templates/.github/workflows/create-compute.yml@main-dec31 # TODO - revert to @main + uses: Azure/mlops-templates/.github/workflows/create-compute.yml@main with: cluster_name: batch-cluster size: STANDARD_DS3_V2 @@ -40,7 +40,7 @@ jobs: creds: ${{secrets.AZURE_CREDENTIALS}} create-endpoint: needs: [get-config, create-compute] - uses: Azure/mlops-templates/.github/workflows/create-endpoint.yml@main-dec31 # TODO - revert to @main + uses: Azure/mlops-templates/.github/workflows/create-endpoint.yml@main with: resource_group: ${{ needs.get-config.outputs.resource_group }} workspace_name: ${{ needs.get-config.outputs.aml_workspace }} @@ -50,7 +50,7 @@ jobs: secrets: creds: ${{secrets.AZURE_CREDENTIALS}} create-deployment: - uses: Azure/mlops-templates/.github/workflows/create-deployment.yml@main-dec31 # TODO - revert to @main + uses: Azure/mlops-templates/.github/workflows/create-deployment.yml@main needs: [get-config, create-endpoint] with: resource_group: ${{ needs.get-config.outputs.resource_group }} diff --git a/classical/aml-cli-v2/mlops/github-actions/deploy-online-endpoint-pipeline-classical.yml b/classical/aml-cli-v2/mlops/github-actions/deploy-online-endpoint-pipeline-classical.yml index e466692..51edfcb 100644 --- a/classical/aml-cli-v2/mlops/github-actions/deploy-online-endpoint-pipeline-classical.yml +++ b/classical/aml-cli-v2/mlops/github-actions/deploy-online-endpoint-pipeline-classical.yml @@ -22,12 +22,12 @@ jobs: echo "config-file=$config_env" >> $GITHUB_OUTPUT; get-config: needs: set-env-branch - uses: Azure/mlops-templates/.github/workflows/read-yaml.yml@main-dec31 # TODO - revert to @main + uses: Azure/mlops-templates/.github/workflows/read-yaml.yml@main with: file_name: ${{ needs.set-env-branch.outputs.config-file}} create-endpoint: needs: get-config - uses: Azure/mlops-templates/.github/workflows/create-endpoint.yml@main-dec31 # TODO - revert to @main + uses: Azure/mlops-templates/.github/workflows/create-endpoint.yml@main with: resource_group: ${{ needs.get-config.outputs.resource_group }} workspace_name: ${{ needs.get-config.outputs.aml_workspace }} @@ -37,7 +37,7 @@ jobs: secrets: creds: ${{secrets.AZURE_CREDENTIALS}} create-deployment: - uses: Azure/mlops-templates/.github/workflows/create-deployment.yml@main-dec31 # TODO - revert to @main + uses: Azure/mlops-templates/.github/workflows/create-deployment.yml@main needs: [get-config, create-endpoint] with: resource_group: ${{ needs.get-config.outputs.resource_group }} @@ -49,7 +49,7 @@ jobs: secrets: creds: ${{secrets.AZURE_CREDENTIALS}} allocate-traffic: - uses: Azure/mlops-templates/.github/workflows/allocate-traffic.yml@main-dec31 # TODO - revert to @main + uses: Azure/mlops-templates/.github/workflows/allocate-traffic.yml@main needs: [get-config, create-deployment] with: resource_group: ${{ needs.get-config.outputs.resource_group }} diff --git a/classical/python-sdk-v2/mlops/devops-pipelines/deploy-batch-endpoint-pipeline.yml b/classical/python-sdk-v2/mlops/devops-pipelines/deploy-batch-endpoint-pipeline.yml index 9788999..60a037e 100644 --- a/classical/python-sdk-v2/mlops/devops-pipelines/deploy-batch-endpoint-pipeline.yml +++ b/classical/python-sdk-v2/mlops/devops-pipelines/deploy-batch-endpoint-pipeline.yml @@ -2,67 +2,65 @@ # Licensed under the MIT License. variables: -- ${{ if eq(variables['Build.SourceBranchName'], 'main') }}: - # 'main' branch: PRD environment - - template: ../../config-infra-prod.yml -- ${{ if ne(variables['Build.SourceBranchName'], 'main') }}: - # 'develop' or feature branches: DEV environment - - template: ../../config-infra-dev.yml -- name: version - value: python-sdk-v2 -- name: endpoint_name - value: taxi-batch-$(namespace)$(postfix)$(environment) + - ${{ if eq(variables['Build.SourceBranchName'], 'main') }}: + # 'main' branch: PRD environment + - template: ../../config-infra-prod.yml + - ${{ if ne(variables['Build.SourceBranchName'], 'main') }}: + # 'develop' or feature branches: DEV environment + - template: ../../config-infra-dev.yml + - name: version + value: python-sdk-v2 + - name: endpoint_name + value: taxi-batch-$(namespace)$(postfix)$(environment) trigger: -- none + - none pool: vmImage: ubuntu-20.04 - resources: repositories: - - repository: mlops-templates # Template Repo + - repository: mlops-templates # Template Repo name: Azure/mlops-templates # need to change org name from "Azure" to your own org endpoint: github-connection # need to set up and hardcode type: github - ref: main-dec31 - + ref: main stages: -- stage: CreateBatchEndpoint - displayName: Create/Update Batch Endpoint - jobs: - - job: DeployBatchEndpoint - steps: - - checkout: self - path: s/ - - checkout: mlops-templates - path: s/templates/ - - template: templates/aml-cli-v2/install-az-cli.yml@mlops-templates - - template: templates/aml-cli-v2/install-aml-cli.yml@mlops-templates - - template: templates/aml-cli-v2/connect-to-workspace.yml@mlops-templates - - template: templates/aml-cli-v2/create-compute.yml@mlops-templates - parameters: - cluster_name: batch-cluster # name must match cluster name in deployment file below - size: STANDARD_DS3_V2 - min_instances: 0 - max_instances: 5 - cluster_tier: dedicated - - template: templates/${{ variables.version }}/create-batch-endpoint.yml@mlops-templates - parameters: - endpoint_name: "${{ variables.endpoint_name }}" - endpoint_description: "Taxi batch endpoint" - auth_mode: "aad_token" - - template: templates/${{ variables.version }}/create-batch-deployment.yml@mlops-templates - parameters: - deployment_name: taxi-batch-dp - deployment_description: "Taxi batch deployment" - endpoint_name: "${{ variables.endpoint_name }}" - model_path: "taxi-model@latest" - compute: batch-cluster - - template: templates/${{ variables.version }}/test-batch-endpoint.yml@mlops-templates - parameters: - endpoint_name: "${{ variables.endpoint_name }}" - sample_request: data/taxi-batch.csv - request_type: uri_file #either uri_folder or uri_file + - stage: CreateBatchEndpoint + displayName: Create/Update Batch Endpoint + jobs: + - job: DeployBatchEndpoint + steps: + - checkout: self + path: s/ + - checkout: mlops-templates + path: s/templates/ + - template: templates/aml-cli-v2/install-az-cli.yml@mlops-templates + - template: templates/aml-cli-v2/install-aml-cli.yml@mlops-templates + - template: templates/aml-cli-v2/connect-to-workspace.yml@mlops-templates + - template: templates/aml-cli-v2/create-compute.yml@mlops-templates + parameters: + cluster_name: batch-cluster # name must match cluster name in deployment file below + size: STANDARD_DS3_V2 + min_instances: 0 + max_instances: 5 + cluster_tier: dedicated + - template: templates/${{ variables.version }}/create-batch-endpoint.yml@mlops-templates + parameters: + endpoint_name: "${{ variables.endpoint_name }}" + endpoint_description: "Taxi batch endpoint" + auth_mode: "aad_token" + - template: templates/${{ variables.version }}/create-batch-deployment.yml@mlops-templates + parameters: + deployment_name: taxi-batch-dp + deployment_description: "Taxi batch deployment" + endpoint_name: "${{ variables.endpoint_name }}" + model_path: "taxi-model@latest" + compute: batch-cluster + - template: templates/${{ variables.version }}/test-batch-endpoint.yml@mlops-templates + parameters: + endpoint_name: "${{ variables.endpoint_name }}" + sample_request: data/taxi-batch.csv + request_type: uri_file #either uri_folder or uri_file diff --git a/classical/python-sdk-v2/mlops/devops-pipelines/deploy-model-training-pipeline.yml b/classical/python-sdk-v2/mlops/devops-pipelines/deploy-model-training-pipeline.yml index 61e1e44..e4e9452 100644 --- a/classical/python-sdk-v2/mlops/devops-pipelines/deploy-model-training-pipeline.yml +++ b/classical/python-sdk-v2/mlops/devops-pipelines/deploy-model-training-pipeline.yml @@ -23,48 +23,48 @@ resources: name: Azure/mlops-templates # need to change org name from "Azure" to your own org endpoint: github-connection # need to set up and hardcode type: github - ref: main-dec31 + ref: main stages: -- stage: DeployTrainingPipeline - displayName: Deploy Training Pipeline - jobs: - - job: DeployTrainingPipeline - timeoutInMinutes: 120 # how long to run the job before automatically cancelling - steps: - - checkout: self - path: s/ - - checkout: mlops-templates - path: s/templates/ - - template: templates/aml-cli-v2/install-az-cli.yml@mlops-templates - - template: templates/aml-cli-v2/install-aml-cli.yml@mlops-templates - - template: templates/python-sdk-v2/install-requirements.yml@mlops-templates - - template: templates/aml-cli-v2/connect-to-workspace.yml@mlops-templates - - template: templates/aml-cli-v2/create-compute.yml@mlops-templates - parameters: - cluster_name: cpu-cluster - size: Standard_DS3_v2 - min_instances: 0 - max_instances: 4 - cluster_tier: low_priority - - template: templates/${{ variables.version }}/register-environment.yml@mlops-templates - parameters: - environment_name: taxi-train-env - environment_description: "Training Environment for Taxi Pipeline" - environment_path: data-science/environment/train-conda.yml - build_type: conda - - template: templates/${{ variables.version }}/register-data-asset.yml@mlops-templates - parameters: - data_name: taxi-data - data_description: taxi-training-dataset - data_path: data/taxi-data.csv - data_type: uri_file - - template: templates/${{ variables.version }}/run-pipeline.yml@mlops-templates - parameters: - pipeline_path: mlops/azureml/train/run_pipeline.py - experiment_name: taxi-train-pipeline - data_name: taxi-data - environment_name: taxi-train-env - compute_name: cpu-cluster - enable_monitoring: $(enable_monitoring) - table_name: 'taximonitoring' + - stage: DeployTrainingPipeline + displayName: Deploy Training Pipeline + jobs: + - job: DeployTrainingPipeline + timeoutInMinutes: 120 # how long to run the job before automatically cancelling + steps: + - checkout: self + path: s/ + - checkout: mlops-templates + path: s/templates/ + - template: templates/aml-cli-v2/install-az-cli.yml@mlops-templates + - template: templates/aml-cli-v2/install-aml-cli.yml@mlops-templates + - template: templates/python-sdk-v2/install-requirements.yml@mlops-templates + - template: templates/aml-cli-v2/connect-to-workspace.yml@mlops-templates + - template: templates/aml-cli-v2/create-compute.yml@mlops-templates + parameters: + cluster_name: cpu-cluster + size: Standard_DS3_v2 + min_instances: 0 + max_instances: 4 + cluster_tier: low_priority + - template: templates/${{ variables.version }}/register-environment.yml@mlops-templates + parameters: + environment_name: taxi-train-env + environment_description: "Training Environment for Taxi Pipeline" + environment_path: data-science/environment/train-conda.yml + build_type: conda + - template: templates/${{ variables.version }}/register-data-asset.yml@mlops-templates + parameters: + data_name: taxi-data + data_description: taxi-training-dataset + data_path: data/taxi-data.csv + data_type: uri_file + - template: templates/${{ variables.version }}/run-pipeline.yml@mlops-templates + parameters: + pipeline_path: mlops/azureml/train/run_pipeline.py + experiment_name: taxi-train-pipeline + data_name: taxi-data + environment_name: taxi-train-env + compute_name: cpu-cluster + enable_monitoring: $(enable_monitoring) + table_name: "taximonitoring" diff --git a/classical/python-sdk-v2/mlops/devops-pipelines/deploy-online-endpoint-pipeline.yml b/classical/python-sdk-v2/mlops/devops-pipelines/deploy-online-endpoint-pipeline.yml index a1a6cee..f3f68c3 100644 --- a/classical/python-sdk-v2/mlops/devops-pipelines/deploy-online-endpoint-pipeline.yml +++ b/classical/python-sdk-v2/mlops/devops-pipelines/deploy-online-endpoint-pipeline.yml @@ -2,57 +2,56 @@ # Licensed under the MIT License. variables: -- ${{ if eq(variables['Build.SourceBranchName'], 'main') }}: - # 'main' branch: PRD environment - - template: ../../config-infra-prod.yml -- ${{ if ne(variables['Build.SourceBranchName'], 'main') }}: - # 'develop' or feature branches: DEV environment - - template: ../../config-infra-dev.yml -- name: version - value: python-sdk-v2 -- name: endpoint_name - value: taxi-online-$(namespace)$(postfix)$(environment) + - ${{ if eq(variables['Build.SourceBranchName'], 'main') }}: + # 'main' branch: PRD environment + - template: ../../config-infra-prod.yml + - ${{ if ne(variables['Build.SourceBranchName'], 'main') }}: + # 'develop' or feature branches: DEV environment + - template: ../../config-infra-dev.yml + - name: version + value: python-sdk-v2 + - name: endpoint_name + value: taxi-online-$(namespace)$(postfix)$(environment) trigger: -- none + - none pool: vmImage: ubuntu-20.04 - resources: repositories: - - repository: mlops-templates # Template Repo + - repository: mlops-templates # Template Repo name: Azure/mlops-templates # need to change org name from "Azure" to your own org endpoint: github-connection # need to set up and hardcode type: github - ref: main-dec31 + ref: main stages: -- stage: CreateOnlineEndpoint - displayName: Create/Update Online Endpoint - jobs: - - job: DeployOnlineEndpoint - steps: - - checkout: self - path: s/ - - checkout: mlops-templates - path: s/templates/ - - template: templates/aml-cli-v2/install-az-cli.yml@mlops-templates - - template: templates/aml-cli-v2/install-aml-cli.yml@mlops-templates - - template: templates/aml-cli-v2/connect-to-workspace.yml@mlops-templates - - template: templates/${{ variables.version }}/create-online-endpoint.yml@mlops-templates - parameters: - endpoint_name: "${{ variables.endpoint_name }}" - endpoint_description: "Taxi Online Endpoint" - auth_mode: "aml_token" - - template: templates/${{ variables.version }}/create-online-deployment.yml@mlops-templates - parameters: - deployment_name: taxi-online-dp - endpoint_name: "${{ variables.endpoint_name }}" - model_path: "taxi-model@latest" - traffic_allocation: 100 - - template: templates/${{ variables.version }}/test-online-endpoint.yml@mlops-templates - parameters: - endpoint_name: "${{ variables.endpoint_name }}" - sample_request: data/taxi-request.json + - stage: CreateOnlineEndpoint + displayName: Create/Update Online Endpoint + jobs: + - job: DeployOnlineEndpoint + steps: + - checkout: self + path: s/ + - checkout: mlops-templates + path: s/templates/ + - template: templates/aml-cli-v2/install-az-cli.yml@mlops-templates + - template: templates/aml-cli-v2/install-aml-cli.yml@mlops-templates + - template: templates/aml-cli-v2/connect-to-workspace.yml@mlops-templates + - template: templates/${{ variables.version }}/create-online-endpoint.yml@mlops-templates + parameters: + endpoint_name: "${{ variables.endpoint_name }}" + endpoint_description: "Taxi Online Endpoint" + auth_mode: "aml_token" + - template: templates/${{ variables.version }}/create-online-deployment.yml@mlops-templates + parameters: + deployment_name: taxi-online-dp + endpoint_name: "${{ variables.endpoint_name }}" + model_path: "taxi-model@latest" + traffic_allocation: 100 + - template: templates/${{ variables.version }}/test-online-endpoint.yml@mlops-templates + parameters: + endpoint_name: "${{ variables.endpoint_name }}" + sample_request: data/taxi-request.json diff --git a/cv/aml-cli-v2/mlops/github-actions/deploy-model-training-pipeline.yml b/cv/aml-cli-v2/mlops/github-actions/deploy-model-training-pipeline.yml index b9d35c9..f9a4292 100644 --- a/cv/aml-cli-v2/mlops/github-actions/deploy-model-training-pipeline.yml +++ b/cv/aml-cli-v2/mlops/github-actions/deploy-model-training-pipeline.yml @@ -22,12 +22,12 @@ jobs: echo "config-file=$config_env" >> $GITHUB_OUTPUT; get-config: needs: set-env-branch - uses: Azure/mlops-templates/.github/workflows/read-yaml.yml@main-dec31 # TODO - revert to @main + uses: Azure/mlops-templates/.github/workflows/read-yaml.yml@main with: file_name: ${{ needs.set-env-branch.outputs.config-file}} create-dataprep-compute: needs: [get-config] - uses: Azure/mlops-templates/.github/workflows/create-compute.yml@main-dec31 + uses: Azure/mlops-templates/.github/workflows/create-compute.yml@main with: cluster_name: cpu-cluster size: Standard_DS3_v2 @@ -40,7 +40,7 @@ jobs: creds: ${{secrets.AZURE_CREDENTIALS}} create-training-compute: needs: get-config - uses: Azure/mlops-templates/.github/workflows/create-compute.yml@main-dec31 # TODO - revert to @main + uses: Azure/mlops-templates/.github/workflows/create-compute.yml@main with: cluster_name: gpu-cluster size: Standard_NC6 @@ -53,7 +53,7 @@ jobs: creds: ${{secrets.AZURE_CREDENTIALS}} register-environment: needs: [get-config, create-dataprep-compute, create-training-compute] - uses: Azure/mlops-templates/.github/workflows/register-environment.yml@main-dec31 # TODO - revert to @main + uses: Azure/mlops-templates/.github/workflows/register-environment.yml@main with: resource_group: ${{ needs.get-config.outputs.resource_group }} workspace_name: ${{ needs.get-config.outputs.aml_workspace }} @@ -62,7 +62,7 @@ jobs: creds: ${{secrets.AZURE_CREDENTIALS}} register-dataset: needs: [get-config, register-environment] - uses: Azure/mlops-templates/.github/workflows/register-dataset.yml@main-dec31 # TODO - revert to @main + uses: Azure/mlops-templates/.github/workflows/register-dataset.yml@main with: resource_group: ${{ needs.get-config.outputs.resource_group }} workspace_name: ${{ needs.get-config.outputs.aml_workspace }} @@ -80,7 +80,7 @@ jobs: register-environment, register-dataset, ] - uses: Azure/mlops-templates/.github/workflows/run-pipeline.yml@main-dec31 # TODO - revert to @main + uses: Azure/mlops-templates/.github/workflows/run-pipeline.yml@main with: resource_group: ${{ needs.get-config.outputs.resource_group }} workspace_name: ${{ needs.get-config.outputs.aml_workspace }} diff --git a/cv/aml-cli-v2/mlops/github-actions/deploy-online-endpoint-pipeline.yml b/cv/aml-cli-v2/mlops/github-actions/deploy-online-endpoint-pipeline.yml index 0f3b8b6..5c12b6c 100644 --- a/cv/aml-cli-v2/mlops/github-actions/deploy-online-endpoint-pipeline.yml +++ b/cv/aml-cli-v2/mlops/github-actions/deploy-online-endpoint-pipeline.yml @@ -22,12 +22,12 @@ jobs: echo "config-file=$config_env" >> $GITHUB_OUTPUT; get-config: needs: set-env-branch - uses: Azure/mlops-templates/.github/workflows/read-yaml.yml@main-dec31 # TODO - revert to @main + uses: Azure/mlops-templates/.github/workflows/read-yaml.yml@main with: file_name: ${{ needs.set-env-branch.outputs.config-file}} create-endpoint: needs: get-config - uses: Azure/mlops-templates/.github/workflows/create-endpoint.yml@main-dec31 # TODO - revert to @main + uses: Azure/mlops-templates/.github/workflows/create-endpoint.yml@main with: resource_group: ${{ needs.get-config.outputs.resource_group }} workspace_name: ${{ needs.get-config.outputs.aml_workspace }} @@ -37,7 +37,7 @@ jobs: secrets: creds: ${{secrets.AZURE_CREDENTIALS}} create-deployment: - uses: Azure/mlops-templates/.github/workflows/create-deployment.yml@main-dec31 # TODO - revert to @main + uses: Azure/mlops-templates/.github/workflows/create-deployment.yml@main needs: [get-config, create-endpoint] with: resource_group: ${{ needs.get-config.outputs.resource_group }} @@ -49,7 +49,7 @@ jobs: secrets: creds: ${{secrets.AZURE_CREDENTIALS}} allocate-traffic: - uses: Azure/mlops-templates/.github/workflows/allocate-traffic.yml@main-dec31 # TODO - revert to @main + uses: Azure/mlops-templates/.github/workflows/allocate-traffic.yml@main needs: [get-config, create-deployment] with: resource_group: ${{ needs.get-config.outputs.resource_group }} diff --git a/cv/python-sdk-v1/mlops/devops-pipelines/deploy-model-training-pipeline.yml b/cv/python-sdk-v1/mlops/devops-pipelines/deploy-model-training-pipeline.yml index 12c986c..4b344aa 100644 --- a/cv/python-sdk-v1/mlops/devops-pipelines/deploy-model-training-pipeline.yml +++ b/cv/python-sdk-v1/mlops/devops-pipelines/deploy-model-training-pipeline.yml @@ -2,105 +2,102 @@ # Licensed under the MIT License. variables: -- template: ../../config-aml.yml -- ${{ if eq(variables['Build.SourceBranchName'], 'main') }}: - # 'main' branch: PRD environment - - template: ../../config-infra-prod.yml -- ${{ if ne(variables['Build.SourceBranchName'], 'main') }}: - # 'develop' or feature branches: DEV environment - - template: ../../config-infra-dev.yml -- name: version - value: python-sdk-v1 - + - template: ../../config-aml.yml + - ${{ if eq(variables['Build.SourceBranchName'], 'main') }}: + # 'main' branch: PRD environment + - template: ../../config-infra-prod.yml + - ${{ if ne(variables['Build.SourceBranchName'], 'main') }}: + # 'develop' or feature branches: DEV environment + - template: ../../config-infra-dev.yml + - name: version + value: python-sdk-v1 trigger: -- none + - none pool: vmImage: $(ap_vm_image) - resources: repositories: - - repository: mlops-templates # Template Repo + - repository: mlops-templates # Template Repo name: Azure/mlops-templates # need to change org name from "Azure" to your own org endpoint: github-connection # need to set up and hardcode type: github - ref: main-dec31 + ref: main stages: -- stage: DeployTrainingPipeline - displayName: Deploy Training Pipeline - jobs: - - job: DeployTrainingPipeline - steps: - - # Setup - - checkout: self - path: s/ - - checkout: mlops-templates - path: s/templates/ - - template: templates/${{ variables.version }}/install-az-cli.yml@mlops-templates - - template: templates/${{ variables.version }}/install-aml-cli.yml@mlops-templates - - template: templates/${{ variables.version }}/connect-to-workspace.yml@mlops-templates + - stage: DeployTrainingPipeline + displayName: Deploy Training Pipeline + jobs: + - job: DeployTrainingPipeline + steps: + # Setup + - checkout: self + path: s/ + - checkout: mlops-templates + path: s/templates/ + - template: templates/${{ variables.version }}/install-az-cli.yml@mlops-templates + - template: templates/${{ variables.version }}/install-aml-cli.yml@mlops-templates + - template: templates/${{ variables.version }}/connect-to-workspace.yml@mlops-templates - # Environment - - template: templates/${{ variables.version }}/create-environment.yml@mlops-templates - parameters: - environment_name: $(training_env_name) - build_type: folder - environment_file: $(training_env_path) + # Environment + - template: templates/${{ variables.version }}/create-environment.yml@mlops-templates + parameters: + environment_name: $(training_env_name) + build_type: folder + environment_file: $(training_env_path) - # Compute - - template: templates/${{ variables.version }}/get-compute.yml@mlops-templates - parameters: - compute_type: training + # Compute + - template: templates/${{ variables.version }}/get-compute.yml@mlops-templates + parameters: + compute_type: training - # Datasets (images + labels) - # Images dataset - - task: Bash@3 - displayName: 'Download data' - inputs: - targetType: inline - script: | - mkdir -p $(training_dataset_local_path) - curl $(training_dataset_storage_url) | tar xvf - --no-same-owner -C $(training_dataset_local_path) - - template: templates/${{ variables.version }}/register-dataset.yml@mlops-templates - parameters: - data_type: training - # Labels dataset - - template: templates/${{ variables.version }}/register-dataset.yml@mlops-templates - parameters: - data_type: training - datasetName: $(labels_dataset_name) - datasetDescription: $(labels_dataset_description) - datasetLocalPath: $(labels_dataset_local_path) - datasetPathOnDatastore: $(labels_dataset_path_on_datastore) - datasetType: $(labels_dataset_type) + # Datasets (images + labels) + # Images dataset + - task: Bash@3 + displayName: "Download data" + inputs: + targetType: inline + script: | + mkdir -p $(training_dataset_local_path) + curl $(training_dataset_storage_url) | tar xvf - --no-same-owner -C $(training_dataset_local_path) + - template: templates/${{ variables.version }}/register-dataset.yml@mlops-templates + parameters: + data_type: training + # Labels dataset + - template: templates/${{ variables.version }}/register-dataset.yml@mlops-templates + parameters: + data_type: training + datasetName: $(labels_dataset_name) + datasetDescription: $(labels_dataset_description) + datasetLocalPath: $(labels_dataset_local_path) + datasetPathOnDatastore: $(labels_dataset_path_on_datastore) + datasetType: $(labels_dataset_type) - # Deploy training pipeline - - template: templates/${{ variables.version }}/deploy-training-pipeline.yml@mlops-templates - - template: templates/${{ variables.version }}/add-pipeline-to-endpoint.yml@mlops-templates - - task: Bash@3 - name: export_pipeline_id - displayName: "Export Pipeline ID" - inputs: - targetType: "inline" - script: | - echo "##vso[task.setvariable variable=pipeline_id;isOutput=true;]$(pipeline_id)" + # Deploy training pipeline + - template: templates/${{ variables.version }}/deploy-training-pipeline.yml@mlops-templates + - template: templates/${{ variables.version }}/add-pipeline-to-endpoint.yml@mlops-templates + - task: Bash@3 + name: export_pipeline_id + displayName: "Export Pipeline ID" + inputs: + targetType: "inline" + script: | + echo "##vso[task.setvariable variable=pipeline_id;isOutput=true;]$(pipeline_id)" - # Run training - - job: invoke_pipeline - displayName: 'Invoke pipeline' - pool: server - timeoutInMinutes: 0 - dependsOn: DeployTrainingPipeline - variables: - pipeline_id: $[ dependencies.DeployTrainingPipeline.outputs['export_pipeline_id.pipeline_id'] ] - steps: + # Run training + - job: invoke_pipeline + displayName: "Invoke pipeline" + pool: server + timeoutInMinutes: 0 + dependsOn: DeployTrainingPipeline + variables: + pipeline_id: $[ dependencies.DeployTrainingPipeline.outputs['export_pipeline_id.pipeline_id'] ] + steps: - task: ms-air-aiagility.vss-services-azureml.azureml-restApi-task.MLPublishedPipelineRestAPITask@0 - displayName: 'Invoke AML Pipeline' + displayName: "Invoke AML Pipeline" inputs: - azureSubscription: '$(ado_service_connection_aml_ws)' - PipelineId: '$(PIPELINE_ID)' - ExperimentName: '$(training_experiment_name)' + azureSubscription: "$(ado_service_connection_aml_ws)" + PipelineId: "$(PIPELINE_ID)" + ExperimentName: "$(training_experiment_name)" diff --git a/infrastructure/terraform/github-actions/tf-gha-deploy-infra.yml b/infrastructure/terraform/github-actions/tf-gha-deploy-infra.yml index 0cd266b..38fd5f9 100644 --- a/infrastructure/terraform/github-actions/tf-gha-deploy-infra.yml +++ b/infrastructure/terraform/github-actions/tf-gha-deploy-infra.yml @@ -25,12 +25,12 @@ jobs: echo "config-file=$config_env" >> $GITHUB_OUTPUT; get-config: needs: set-env-branch - uses: Azure/mlops-templates/.github/workflows/read-yaml.yml@main-dec31 # TODO - revert to @main + uses: Azure/mlops-templates/.github/workflows/read-yaml.yml@main with: file_name: ${{ needs.set-env-branch.outputs.config-file}} test-terraform-state-deployment: needs: [get-config, set-env-branch] - uses: Azure/mlops-templates/.github/workflows/tf-gha-install-terraform.yml@main-dec31 # TODO - revert to @main + uses: Azure/mlops-templates/.github/workflows/tf-gha-install-terraform.yml@main with: TFAction: "apply" dply_environment: ${{ needs.set-env-branch.outputs.config-file }} diff --git a/nlp/python-sdk-v2/mlops/devops-pipelines/deploy-model-training-pipeline.yml b/nlp/python-sdk-v2/mlops/devops-pipelines/deploy-model-training-pipeline.yml index da5f24c..c074a55 100644 --- a/nlp/python-sdk-v2/mlops/devops-pipelines/deploy-model-training-pipeline.yml +++ b/nlp/python-sdk-v2/mlops/devops-pipelines/deploy-model-training-pipeline.yml @@ -2,72 +2,70 @@ # Licensed under the MIT License. variables: -- ${{ if eq(variables['Build.SourceBranchName'], 'main') }}: - # 'main' branch: PRD environment - - template: ../../config-infra-prod.yml -- ${{ if ne(variables['Build.SourceBranchName'], 'main') }}: - # 'develop' or feature branches: DEV environment - - template: ../../config-infra-dev.yml -- name: version - value: python-sdk-v2 - + - ${{ if eq(variables['Build.SourceBranchName'], 'main') }}: + # 'main' branch: PRD environment + - template: ../../config-infra-prod.yml + - ${{ if ne(variables['Build.SourceBranchName'], 'main') }}: + # 'develop' or feature branches: DEV environment + - template: ../../config-infra-dev.yml + - name: version + value: python-sdk-v2 trigger: -- none + - none pool: vmImage: ubuntu-20.04 - resources: repositories: - - repository: mlops-templates # Template Repo + - repository: mlops-templates # Template Repo name: Azure/mlops-templates # need to change org name from "Azure" to your own org endpoint: github-connection # need to set up and hardcode type: github - ref: main-dec31 + ref: main stages: -- stage: DeployTrainingPipeline - displayName: Deploy Training Pipeline - jobs: - - job: DeployTrainingPipeline - steps: - - checkout: self - path: s/ - - checkout: mlops-templates - path: s/templates/ - - template: templates/aml-cli-v2/install-az-cli.yml@mlops-templates - - template: templates/aml-cli-v2/install-aml-cli.yml@mlops-templates - - template: templates/python-sdk-v2/install-requirements.yml@mlops-templates - - template: templates/aml-cli-v2/connect-to-workspace.yml@mlops-templates - - template: templates/${{ variables.version }}/create-compute.yml@mlops-templates - parameters: - cluster_name: cpu-cluster - size: STANDARD_DS3_V2 - min_instances: 0 - max_instances: 1 - cluster_tier: dedicated - - template: templates/${{ variables.version }}/create-compute.yml@mlops-templates - parameters: - cluster_name: cpu-cluster-lg - size: Standard_D14_v2 - min_instances: 0 - max_instances: 1 - cluster_tier: dedicated - - template: templates/${{ variables.version }}/create-compute.yml@mlops-templates - parameters: - cluster_name: gpu-cluster - size: Standard_NV6 - min_instances: 0 - max_instances: 1 - cluster_tier: dedicated - - template: templates/${{ variables.version }}/register-environment.yml@mlops-templates - parameters: - build_type: docker - environment_name: nlp_summarization_train - environment_path: data-science/environments/training - - template: templates/${{ variables.version }}/run-pipeline.yml@mlops-templates - parameters: - pipeline_path: mlops/azureml/train/pipeline-train.py - experiment_name: $(environment)_nlp_summarization_$(Build.SourceBranchName) + - stage: DeployTrainingPipeline + displayName: Deploy Training Pipeline + jobs: + - job: DeployTrainingPipeline + steps: + - checkout: self + path: s/ + - checkout: mlops-templates + path: s/templates/ + - template: templates/aml-cli-v2/install-az-cli.yml@mlops-templates + - template: templates/aml-cli-v2/install-aml-cli.yml@mlops-templates + - template: templates/python-sdk-v2/install-requirements.yml@mlops-templates + - template: templates/aml-cli-v2/connect-to-workspace.yml@mlops-templates + - template: templates/${{ variables.version }}/create-compute.yml@mlops-templates + parameters: + cluster_name: cpu-cluster + size: STANDARD_DS3_V2 + min_instances: 0 + max_instances: 1 + cluster_tier: dedicated + - template: templates/${{ variables.version }}/create-compute.yml@mlops-templates + parameters: + cluster_name: cpu-cluster-lg + size: Standard_D14_v2 + min_instances: 0 + max_instances: 1 + cluster_tier: dedicated + - template: templates/${{ variables.version }}/create-compute.yml@mlops-templates + parameters: + cluster_name: gpu-cluster + size: Standard_NV6 + min_instances: 0 + max_instances: 1 + cluster_tier: dedicated + - template: templates/${{ variables.version }}/register-environment.yml@mlops-templates + parameters: + build_type: docker + environment_name: nlp_summarization_train + environment_path: data-science/environments/training + - template: templates/${{ variables.version }}/run-pipeline.yml@mlops-templates + parameters: + pipeline_path: mlops/azureml/train/pipeline-train.py + experiment_name: $(environment)_nlp_summarization_$(Build.SourceBranchName)