Skip to content

Commit

Permalink
Refactor QNS Pipeline (microsoft#1122)
Browse files Browse the repository at this point in the history
  • Loading branch information
nibanks authored Dec 24, 2020
1 parent eb7e4da commit 4c29735
Show file tree
Hide file tree
Showing 2 changed files with 81 additions and 95 deletions.
117 changes: 43 additions & 74 deletions .azure/azure-pipelines.ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ trigger:
exclude:
- src/plugins/*
- docs/*
- README.md
pr:
branches:
include:
Expand All @@ -24,6 +25,7 @@ pr:
exclude:
- src/plugins/*
- docs/*
- README.md

name: 0.$(Date:yyyy).$(Date:MM).$(DayOfMonth).$(Rev:rr).0

Expand All @@ -38,39 +40,6 @@ stages:
# Builds
#

- stage: build_docker
displayName: Publish QNS Docker Image
condition: and(in(variables['Build.Reason'], 'IndividualCI', 'BatchedCI'), startsWith(variables['Build.SourceBranch'], 'refs/heads/main'))
dependsOn: []
jobs:
- job: publish_docker
displayName: Build and Publish
pool:
vmImage: 'ubuntu-latest'
steps:
- checkout: self
submodules: recursive
- task: Docker@2
displayName: Build and push an image to container registry
inputs:
command: buildAndPush
repository: 'public/msquic/qns'
dockerfile: '$(Build.SourcesDirectory)/Dockerfile'
containerRegistry: '9196310f-afae-4a53-8e35-b9e753eeb0f3'
tags: |
latest
v1.1.0.$(Build.BuildId)
- template: .\templates\run-qns.yml
parameters:
dependsOn: publish_docker
clients: [ 'quant', 'quic-go', 'msquic' ]
servers: [ 'msquic' ]
- template: .\templates\run-qns.yml
parameters:
dependsOn: publish_docker
clients: [ 'msquic' ]
servers: [ 'quant', 'quic-go' ]

- stage: build_winkernel_release
displayName: Build Windows Drivers - Release
dependsOn: []
Expand Down Expand Up @@ -524,49 +493,49 @@ stages:
# Mirror
#

- stage: mirror
displayName: Mirror Branch
dependsOn:
- build_windows_release
- build_winkernel_release
- build_linux_release
- build_windows_debug
- build_winkernel_debug
- build_linux_debug
- build_windows_nontest
- build_winkernel_nontest
- build_linux_nontest
condition: and(in(variables['Build.Reason'], 'IndividualCI', 'BatchedCI'), not(startsWith(variables['Build.SourceBranch'], 'refs/heads/feature/')), succeeded())
jobs:
- job: mirror
displayName: Mirror
pool:
vmImage: windows-latest
steps:
- checkout: self
persistCredentials: true
- task: PowerShell@2
displayName: Sync Changes to AzDO Mirror Branch
inputs:
pwsh: true
filePath: scripts/sync-mirror.ps1
arguments: -Branch $(Build.SourceBranch)
env:
AzDO_PAT: $(AzDO_PAT)
- ${{ if and(in(variables['Build.Reason'], 'IndividualCI', 'BatchedCI'), not(startsWith(variables['Build.SourceBranch'], 'refs/heads/feature/'))) }}:
- stage: mirror
displayName: Mirror Branch
dependsOn:
- build_windows_release
- build_winkernel_release
- build_linux_release
- build_windows_debug
- build_winkernel_debug
- build_linux_debug
- build_windows_nontest
- build_winkernel_nontest
- build_linux_nontest
jobs:
- job: mirror
displayName: Mirror
pool:
vmImage: windows-latest
steps:
- checkout: self
persistCredentials: true
- task: PowerShell@2
displayName: Sync Changes to AzDO Mirror Branch
inputs:
pwsh: true
filePath: scripts/sync-mirror.ps1
arguments: -Branch $(Build.SourceBranch)
env:
AzDO_PAT: $(AzDO_PAT)

#
# Distribution
#

- stage: distribution
displayName: Distribution
dependsOn:
- build_windows_release
- build_linux_release
- build_windows_debug
- build_linux_debug
- build_windows_nontest
- build_linux_nontest
condition: and(in(variables['Build.Reason'], 'IndividualCI', 'BatchedCI'), not(startsWith(variables['Build.SourceBranch'], 'refs/heads/feature/')), succeeded())
jobs:
- template: ./templates/build-distribution.yml
- ${{ if and(in(variables['Build.Reason'], 'IndividualCI', 'BatchedCI'), not(startsWith(variables['Build.SourceBranch'], 'refs/heads/feature/'))) }}:
- stage: distribution
displayName: Distribution
dependsOn:
- build_windows_release
- build_linux_release
- build_windows_debug
- build_linux_debug
- build_windows_nontest
- build_linux_nontest
jobs:
- template: ./templates/build-distribution.yml
59 changes: 38 additions & 21 deletions .azure/azure-pipelines.qns.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,33 @@
# specified client and/or server.
#

trigger: none
trigger:
batch: true
branches:
include:
- main
paths:
exclude:
- src/plugins/*
- docs/*
- README.md
pr: none

name: 0.$(Date:yyyy).$(Date:MM).$(DayOfMonth).$(Rev:rr).0

parameters:
- name: custom_build
type: boolean
displayName: Build docker image
default: false
- name: measurements
type: boolean
displayName: Run Measurements
default: false
- name: timeout
type: number
displayName: Timeout (min)
default: 15
- name: client
type: string
displayName: Client
Expand All @@ -17,21 +38,9 @@ parameters:
type: string
displayName: Server
default: 'all'
- name: timeout
type: number
displayName: Timeout (min)
default: 25
- name: measurements
type: boolean
displayName: Run Measurements
default: false
- name: build
type: boolean
displayName: Build docker image
default: false

jobs:
- ${{ if parameters.build }}:
- ${{ if or(parameters.custom_build, eq(variables['Build.Reason'], 'BatchedCI')) }}:
- job: publish_docker
displayName: Build and Publish
pool:
Expand All @@ -46,20 +55,28 @@ jobs:
repository: 'public/msquic/qns'
dockerfile: '$(Build.SourcesDirectory)/Dockerfile'
containerRegistry: '9196310f-afae-4a53-8e35-b9e753eeb0f3'
tags: custom-$(Build.BuildId)
${{ if eq(variables['Build.Reason'], 'BatchedCI') }}:
tags: |
latest
v1.1.0.$(Build.BuildId)
${{ if ne(variables['Build.Reason'], 'BatchedCI') }}:
tags: custom-$(Build.BuildId)
- template: .\templates\run-qns.yml
parameters:
${{ if parameters.build }}:
${{ if or(parameters.custom_build, eq(variables['Build.Reason'], 'BatchedCI')) }}:
dependsOn: publish_docker
timeout: ${{ parameters.timeout }}
measurements: ${{ parameters.measurements }}
${{ if parameters.build }}:
${{ if and(parameters.custom_build, ne(variables['Build.Reason'], 'BatchedCI') }}:
build: custom-$(Build.BuildId)
${{ if eq(parameters.client, 'all') }}:
${{ if eq(variables['Build.Reason'], 'BatchedCI') }}:
clients: [ 'quic-go', 'quant', 'msquic' ]
servers: [ 'quic-go', 'quant', 'msquic' ]
${{ if and(eq(parameters.client, 'all'), ne(variables['Build.Reason'], 'BatchedCI')) }}:
clients: [ 'quic-go', 'quicly', 'ngtcp2', 'quant', 'mvfst', 'quiche', 'kwik', 'picoquic', 'aioquic', 'neqo', 'msquic' ]
${{ if ne(parameters.client, 'all') }}:
${{ if and(ne(parameters.client, 'all'), ne(variables['Build.Reason'], 'BatchedCI')) }}:
clients: [ '${{ parameters.client }}' ]
${{ if eq(parameters.server, 'all') }}:
${{ if and(eq(parameters.server, 'all'), ne(variables['Build.Reason'], 'BatchedCI')) }}:
servers: [ 'quic-go', 'quicly', 'ngtcp2', 'quant', 'mvfst', 'quiche', 'picoquic', 'aioquic', 'neqo', 'nginx', 'msquic' ]
${{ if ne(parameters.server, 'all') }}:
${{ if and(ne(parameters.server, 'all'), ne(variables['Build.Reason'], 'BatchedCI')) }}:
servers: [ '${{ parameters.server }}' ]

0 comments on commit 4c29735

Please sign in to comment.