forked from joncoons/Manufacturing-Vision-Accelerator-AMD64
-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathazure-pipelines.yml
88 lines (75 loc) · 2.9 KB
/
azure-pipelines.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
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
trigger:
batch: true
branches:
include:
- main
pool:
vmImage: ubuntu-latest
# self-hosted agent, if exists
# pool:
# name: Default
# demands:
# - agent.name -equals AIoT-T4-GPU-Edge
pr:
autoCancel: true
variables:
- group: "<your variable group name>"
stages:
- stage: Build
jobs:
- job: Build
steps:
- bash: pip install -U iotedgedev
displayName: 'Install iotedgedev into environment'
- task: gittools.gittools.setup-gitversion-task.gitversion/setup@0
displayName: 'Set GitVersion assembly'
inputs:
versionSpec: '5.x.x'
updateAssemblyInfo: true
- task: gittools.gittools.execute-gitversion-task.gitversion/execute@0
displayName: 'Calculate version number'
inputs:
targetPath: '$(System.DefaultWorkingDirectory)'
- bash: sudo docker login $(ACR_ADDR) -u $(ACR_UNAME) -p $(ACR_PWD)
displayName: 'Log into ACR'
- task: AzureIoTEdge@2
inputs:
action: 'Build module images'
templateFilePath: "deployment.amd64_gpu.template.json"
defaultPlatform: $(BUILD_PLATFORM)
displayName: Build Edge modules
- task: AzureIoTEdge@2
inputs:
action: 'Push module images'
containerregistrytype: 'Azure Container Registry'
azureSubscriptionEndpoint: $(AZURE_SERVICE_CONNECTION)
azureContainerRegistry: '{"loginServer":"$(ACR_ADDR)", "id" : "/subscriptions/$(AZURE_SUBSCRIPTION_ID)/resourceGroups/$(RESOURCE_GROUP)/providers/Microsoft.ContainerRegistry/registries/$(ACR_UNAME)"}'
templateFilePath: 'deployment.amd64_gpu.template.json'
defaultPlatform: $(BUILD_PLATFORM)
fillRegistryCredential: true
displayName: Push Edge modules to ACR
- script: |
cp config/deployment.amd64_gpu.amd64.json $(Build.ArtifactStagingDirectory)
displayName: Copy manifest to artifact directory
- publish: $(Build.ArtifactStagingDirectory)
artifact: config
- stage: Release
jobs:
- job: Release
steps:
# Download deployment manifest from build stage
- download: current
artifact: config
# Deploy to all edge devices
- task: AzureIoTEdge@2
displayName: Create Deployment
inputs:
action: Deploy to IoT Edge devices
deploymentFilePath: $(Pipeline.Workspace)/config/deployment.amd64_gpu.amd64.json
azureSubscription: $(AZURE_SERVICE_CONNECTION)
iothubname: $(IOT_HUB)
# Your automatic configuration name, if used in IoT Hub
# deploymentid: EDGE_OF_AI
# priority: '10'
deviceOption: 'Single Device'
deviceId: '<your_edge_device_name>'