Skip to content

deploy-online-endpoint-pipeline #57

deploy-online-endpoint-pipeline

deploy-online-endpoint-pipeline #57

name: deploy-online-endpoint-pipeline
on:
workflow_dispatch:
jobs:
get-config:
uses: Azure/mlops-templates/.github/workflows/read-yaml.yml@main
with:
file_name: config-infra-prod.yml
get-endpoint:
env:
name_enpoint: ${{ format('taxi{0}', needs.get-config.outputs.oep) }}
needs: get-config
runs-on: ubuntu-latest
outputs:
check_enpoint: ${{ steps.get-ml-endpoint.outputs.CHECK_ENPOINT }}
name_enpoint: ${{ format('taxi{0}', needs.get-config.outputs.oep) }}
steps:
- name: "Az CLI login"
uses: azure/login@v1
with:
creds: ${{secrets.AZURE_CREDENTIALS}}
enable-AzPSSession: true
- name: install-extension
run: az extension add -n ml -y
- name: update-extension
run: az extension update -n ml
- id: get-ml-endpoint
name: get-ml-endpoint
run: |
check_endpoint=$(az ml online-endpoint show --n ${{ format('taxi{0}', needs.get-config.outputs.oep) }} -g ${{ needs.get-config.outputs.resource_group }} -w ${{ needs.get-config.outputs.aml_workspace }} --query name)
echo "CHECK_ENPOINT=$check_endpoint" >> $GITHUB_OUTPUT
name_point=${{ env.name_enpoint }}
echo "$name_point"
echo $check_endpoint
if [[ "$name_point" == $check_endpoint ]]
then
echo "same"
else
echo "not same"
fi
# TODO: Update if exists else create
create-endpoint:
if: ${{ needs.get-endpoint.outputs.check_enpoint }} != ${{ needs.get-endpoint.outputs.name_enpoint }}
needs: [get-config, get-endpoint]
runs-on: ubuntu-latest
steps:
- id: test
name: test
run: |
echo "ccccccccccccccccccccc"
echo ${{ needs.get-endpoint.outputs.check_enpoint }}
echo ${{ needs.get-endpoint.outputs.name_enpoint }}
# - id: create-end
# name: create-end
# 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 }}
# endpoint_file: mlops/azureml/deploy/online/online-endpoint.yml
# endpoint_name: ${{ format('taxi{0}', needs.get-config.outputs.oep) }}
# endpoint_type: online
# secrets:
# creds: ${{secrets.AZURE_CREDENTIALS}}
# # TODO: Update if exists else create
# create-deployment:
# uses: Azure/mlops-templates/.github/workflows/create-deployment.yml@main
# needs: [get-config]
# with:
# resource_group: ${{ needs.get-config.outputs.resource_group }}
# workspace_name: ${{ needs.get-config.outputs.aml_workspace }}
# endpoint_file: mlops/azureml/deploy/online/online-deployment.yml
# endpoint_name: ${{ format('taxi{0}', needs.get-config.outputs.oep) }}
# endpoint_type: online
# deployment_name: taxi-online-dp
# secrets:
# creds: ${{secrets.AZURE_CREDENTIALS}}
# allocate-traffic:
# uses: Azure/mlops-templates/.github/workflows/allocate-traffic.yml@main
# needs: [get-config]
# with:
# resource_group: ${{ needs.get-config.outputs.resource_group }}
# workspace_name: ${{ needs.get-config.outputs.aml_workspace }}
# traffic_allocation: taxi-online-dp=100
# endpoint_name: ${{ format('taxi{0}', needs.get-config.outputs.oep) }}
# secrets:
# creds: ${{secrets.AZURE_CREDENTIALS}}