forked from liupeirong/MLOpsManufacturing
-
Notifications
You must be signed in to change notification settings - Fork 0
/
lva-console-app.yml
64 lines (55 loc) · 2.04 KB
/
lva-console-app.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
# Template for running the LVA console app
parameters:
- name: consoleAppArtifactName
type: string
- name: environment
type: string
- name: iotArtifactName
type: string
- name: iotHubConnectionString
type: string
- name: iotHubName
type: string
- name: moduleId
type: string
- name: operationsFile
type: string
- name: pythonVersion
type: string
- name: serviceConnection
type: string
steps:
# This downloads the artifact to the $(Pipeline.Workspace) directory
- download: current
displayName: 'Download IoT edge artifact'
artifact: ${{ parameters.iotArtifactName }}
# This downloads the artifact to the $(Pipeline.Workspace) directory
- download: current
displayName: 'Download LVA console app artifact'
artifact: ${{ parameters.consoleAppArtifactName }}
- task: AzureCLI@2
displayName: 'Deactivate and delete existing LVA graph instances'
inputs:
azureSubscription: ${{ parameters.serviceConnection }}
scriptType: 'bash'
scriptLocation: 'scriptPath'
scriptPath: '$(Pipeline.Workspace)/IoTEdgeModules/scripts/cleanupLvaEdgeModule.sh'
arguments: 'environment=${{ parameters.environment }} moduleId=${{ parameters.moduleId }} iotHub=${{ parameters.iotHubName }}'
failOnStandardError: true
- task: UsePythonVersion@0
displayName: 'Set python version'
inputs:
versionSpec: ${{ parameters.pythonVersion }}
- script: python -m pip install --upgrade pip setuptools wheel
displayName: 'Install tools'
- script: pip install -r requirements.txt
displayName: 'Install requirements'
workingDirectory: $(Pipeline.Workspace)/LVAConsoleApp
- script: |
echo "##vso[task.setvariable variable=OPERATIONS_FILENAME]${{ parameters.operationsFile }}"
echo "##vso[task.setvariable variable=TAG_VALUE]${{ parameters.environment }}"
echo "##vso[task.setvariable variable=IOTHUB_CONNECTION_STRING]${{ parameters.iotHubConnectionString }}"
displayName: 'Set environment variables needed for console app'
- script: python main.py
displayName: Run LVA console app
workingDirectory: $(Pipeline.Workspace)/LVAConsoleApp