Skip to content

Commit

Permalink
Initial live-live CI pipeline (dotnet#294)
Browse files Browse the repository at this point in the history
Initial changes towards combined live testing of the runtime subrepos
  • Loading branch information
trylek authored Dec 3, 2019
1 parent 8f69956 commit 8bdcba1
Show file tree
Hide file tree
Showing 12 changed files with 280 additions and 40 deletions.
28 changes: 26 additions & 2 deletions eng/pipelines/coreclr/templates/build-test-job.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,14 @@ parameters:
osSubgroup: ''
container: ''
testGroup: ''

# When set to a non-empty value (Debug / Release), it determines libraries
# build configuration to use for the tests. Setting this property implies
# a dependency of this job on the appropriate libraries build and is used
# to construct the name of the Azure artifact representing libraries build
# to use for building the tests.
liveLibrariesBuildConfig: ''

displayNameArgs: ''
condition: true
stagedBuild: false
Expand All @@ -31,6 +39,7 @@ jobs:
container: ${{ parameters.container }}
testGroup: ${{ parameters.testGroup }}
stagedBuild: ${{ parameters.stagedBuild }}
liveLibrariesBuildConfig: ${{ parameters.liveLibrariesBuildConfig }}
variables: ${{ parameters.variables }}
pool: ${{ parameters.pool }}

Expand All @@ -55,7 +64,11 @@ jobs:
# because it needs System.Private.Corelib; we should be able to remove this dependency
# by switching over to using reference assembly.
${{ if ne(parameters.stagedBuild, true) }}:
dependsOn: ${{ format('coreclr_product_build_{0}{1}_{2}_{3}', parameters.osGroup, parameters.osSubgroup, parameters.archType, parameters.buildConfig) }}
dependsOn:
- ${{ format('coreclr_product_build_{0}{1}_{2}_{3}', parameters.osGroup, parameters.osSubgroup, parameters.archType, parameters.buildConfig) }}
- ${{ if ne(parameters.liveLibrariesBuildConfig, '') }}:
- ${{ format('libraries_build_{0}_{1}{2}_{3}_{4}', 'netcoreapp', parameters.osGroup, parameters.osSubgroup, parameters.archType, parameters.liveLibrariesBuildConfig) }}


${{ if eq(parameters.testGroup, 'innerloop') }}:
timeoutInMinutes: 90
Expand All @@ -75,6 +88,17 @@ jobs:
displayName: Install native dependencies


# Optionally download live-built libraries
- ${{ if ne(parameters.liveLibrariesBuildConfig, '') }}:
- template: /eng/pipelines/common/download-artifact-step.yml
parameters:
unpackFolder: $(librariesDownloadDir)
cleanUnpackFolder: false
artifactFileName: '$(librariesArtifactName)$(archiveExtension)'
artifactName: '$(librariesArtifactName)'
displayName: 'live-built libraries'


# Download product binaries directory
- template: /eng/pipelines/common/download-artifact-step.yml
parameters:
Expand All @@ -85,7 +109,7 @@ jobs:


# Build managed test components
- script: $(coreClrRepoRootDir)build-test$(scriptExt) skipnative skipgeneratelayout $(buildConfig) $(archType) $(crossArg) $(priorityArg) ci
- script: $(coreClrRepoRootDir)build-test$(scriptExt) skipnative skipgeneratelayout $(buildConfig) $(archType) $(crossArg) $(priorityArg) ci $(librariesOverrideArg)
displayName: Build managed test components


Expand Down
20 changes: 17 additions & 3 deletions eng/pipelines/coreclr/templates/run-test-job.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,12 @@ parameters:
testGroup: ''
crossrootfsDir: ''
readyToRun: false
liveLibrariesBuildConfig: ''
crossgen2: false
helixQueues: ''
# If true, run the corefx tests instead of the coreclr ones
corefxTests: false
condition: true
stagedBuild: false
displayNameArgs: ''
runInUnloadableContext: false
Expand All @@ -38,6 +40,7 @@ jobs:
crossrootfsDir: ${{ parameters.crossrootfsDir }}
corefxTests: ${{ parameters.corefxTests }}
stagedBuild: ${{ parameters.stagedBuild }}
liveLibrariesBuildConfig: ${{ parameters.liveLibrariesBuildConfig }}
helixType: 'build/tests/'
pool: ${{ parameters.pool }}

Expand Down Expand Up @@ -105,6 +108,17 @@ jobs:

steps:

# Optionally download live-built libraries
- ${{ if ne(parameters.liveLibrariesBuildConfig, '') }}:
- template: /eng/pipelines/common/download-artifact-step.yml
parameters:
unpackFolder: $(librariesDownloadDir)
cleanUnpackFolder: false
artifactFileName: '$(librariesArtifactName)$(archiveExtension)'
artifactName: '$(librariesArtifactName)'
displayName: 'live-built libraries'


# Download and unzip managed test artifacts
- ${{ if ne(parameters.corefxTests, true) }}:
- template: /eng/pipelines/common/download-artifact-step.yml
Expand Down Expand Up @@ -151,19 +165,19 @@ jobs:
# the native artifacts to the final test folders is dependent on availability of the
# managed test artifacts.
- ${{ if ne(parameters.corefxTests, true) }}:
- script: $(coreClrRepoRootDir)build-test$(scriptExt) copynativeonly $(buildConfig) $(archType) $(priorityArg)
- script: $(coreClrRepoRootDir)build-test$(scriptExt) copynativeonly $(buildConfig) $(archType) $(priorityArg) $(librariesOverrideArg)
displayName: Copy native test components to test output folder


# Generate test host
- ${{ if eq(parameters.corefxTests, true) }}:
- script: $(coreClrRepoRootDir)build-test$(scriptExt) skipmanaged skipnative $(testhostArg) $(buildConfig) $(archType) $(crossArg) $(priorityArg)
- script: $(coreClrRepoRootDir)build-test$(scriptExt) skipmanaged skipnative $(testhostArg) $(buildConfig) $(archType) $(crossArg) $(priorityArg) $(librariesOverrideArg)
displayName: Generate test host


# Crossgen framework assemblies prior to triggering readyToRun execution runs.
- ${{ if eq(parameters.readyToRun, true) }}:
- script: $(coreClrRepoRootDir)build-test$(scriptExt) skipmanaged skipnative $(crossgenArg) $(buildConfig) $(archType) $(crossArg) $(priorityArg)
- script: $(coreClrRepoRootDir)build-test$(scriptExt) skipmanaged skipnative $(crossgenArg) $(buildConfig) $(archType) $(crossArg) $(priorityArg) $(librariesOverrideArg)
displayName: Crossgen framework assemblies


Expand Down
13 changes: 13 additions & 0 deletions eng/pipelines/coreclr/templates/xplat-pipeline-job.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ parameters:
testGroup: ''
crossrootfsDir: ''
corefxTests: false
liveLibrariesBuildConfig: ''
stagedBuild: false
strategy: ''
pool: ''
Expand Down Expand Up @@ -103,6 +104,18 @@ jobs:
- name: priorityArg
value: '-priority=1'

- librariesArtifactName: ''
- librariesOverrideArg: ''
- librariesDownloadDir: ''

- ${{ if ne(parameters.liveLibrariesBuildConfig, '') }}:
- librariesArtifactName: ${{ format('libraries_bin_{0}_{1}{2}_{3}_{4}', 'netcoreapp', parameters.osGroup, parameters.osSubgroup, parameters.archType, parameters.liveLibrariesBuildConfig) }}
- librariesDownloadDir: $(Build.SourcesDirectory)/artifacts
- ${{ if eq(parameters.osGroup, 'Windows_NT') }}:
- librariesOverrideArg: ' localcorefxpath $(Build.SourcesDirectory) localcorefxconfig ${{ parameters.liveLibrariesBuildConfig }}'
- ${{ if ne(parameters.osGroup, 'Windows_NT') }}:
- librariesOverrideArg: ' localcorefxpath=$(Build.SourcesDirectory) localcorefxconfig=${{ parameters.liveLibrariesBuildConfig }}'

- ${{ each variable in parameters.variables }}:
- ${{insert}}: ${{ variable }}

Expand Down
37 changes: 28 additions & 9 deletions eng/pipelines/libraries/base-job.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,9 @@ parameters:
osSubgroup: ''
framework: ''
isOfficialBuild: false
liveCoreClrBuildConfig: ''
timeoutInMinutes: 150
condition: true
container: ''
steps: []
dependsOn: []
Expand All @@ -14,29 +16,31 @@ parameters:
displayName: ''
testScope: ''
pool: ''
stepName: ''

jobs:
- template: /eng/common/templates/job/job.yml
parameters:
name: ${{ format('libraries_{0}_{1}_{2}{3}_{4}_{5}', parameters.stepName, parameters.framework, parameters.osGroup, parameters.osSubgroup, parameters.archType, parameters.buildConfig) }}
name: ${{ format('libraries_{0}_{1}_{2}{3}_{4}_{5}', parameters.name, parameters.framework, parameters.osGroup, parameters.osSubgroup, parameters.archType, parameters.buildConfig) }}
${{ if eq(parameters.framework, 'netcoreapp') }}:
displayName: ${{ format('{0} {1}{2} {3} {4}', parameters.stepName, parameters.osGroup, parameters.osSubgroup, parameters.archType, parameters.buildConfig) }}
displayName: ${{ format('Libraries {0} {1}{2} {3} {4}', parameters.displayName, parameters.osGroup, parameters.osSubgroup, parameters.archType, parameters.buildConfig) }}
${{ if ne(parameters.framework, 'netcoreapp') }}:
displayName: ${{ format('{0} {1} {2} {3} {4}', parameters.stepName, parameters.osGroup, parameters.framework, parameters.archType, parameters.buildConfig) }}
displayName: ${{ format('Libraries {0} {1} {2} {3} {4}', parameters.displayName, parameters.osGroup, parameters.framework, parameters.archType, parameters.buildConfig) }}

enableTelemetry: ${{ parameters.isOfficialBuild }} # TODO: figure out if it's needed
container: ${{ parameters.container }}
condition: ${{ parameters.condition }}
helixRepo: dotnet/runtime
pool: ${{ parameters.pool }}
variables:
- _buildScriptFileName: libraries
- _BuildConfig: ${{ parameters.buildConfig }}

- _msbuildCommonParameters: ''
- _stripSymbolsArg: ''
- _runtimeOSArg: ''
- _portableArg: ''
- _finalFrameworkArg: -framework ${{ parameters.framework }}
- _buildScript: $(buildScriptFileName)$(scriptExt)
- _buildScript: $(_buildScriptFileName)$(scriptExt)
- _warnAsErrorArg: ''
- _testScopeArg: ''

Expand Down Expand Up @@ -65,19 +69,26 @@ jobs:
- ${{ if eq(parameters.isOfficialBuild, 'true') }}:
- _msbuildCommonParameters: /p:OfficialBuildId=$(Build.BuildNumber)

- _coreClrArtifactName: ''
- _coreClrDownloadPath: ''
- _coreClrOverridePathArg: ''

- ${{ if ne(parameters.liveCoreClrBuildConfig, '') }}:
- _coreClrDownloadPath: '$(Build.SourcesDirectory)/artifacts/transport/coreclr'
- _coreClrArtifactName: 'CoreCLRProduct_${{ parameters.osGroup }}${{ parameters.osSubgroup }}_${{ parameters.archType }}_${{ parameters.liveCoreClrBuildConfig }}'
- _coreClrOverridePathArg: ' /p:CoreCLROverridePath=$(_coreClrDownloadPath)'

# Windows variables
- ${{ if eq(parameters.osGroup, 'Windows_NT') }}:
- _msbuildCommand: powershell -ExecutionPolicy ByPass -NoProfile eng\common\msbuild.ps1 -warnaserror:0 -ci
- _runtimeOSArg: /p:RuntimeOS=win10

# Non-Windows variables
- ${{ if ne(parameters.osGroup, 'Windows_NT') }}:
- _msbuildCommand: ./eng/common/msbuild.sh --warnaserror false --ci
- _buildScript: ./$(buildScriptFileName)$(scriptExt)
- _buildScript: ./$(_buildScriptFileName)$(scriptExt)
- ${{ if eq(parameters.isOfficialBuild, 'true') }}:
- _stripSymbolsArg: -stripSymbols

- _buildArguments: -configuration ${{ parameters.buildConfig }} -ci -arch ${{ parameters.archType }} $(_finalFrameworkArg) $(_stripSymbolsArg) $(_testScopeArg) $(_warnAsErrorArg) $(_runtimeOSArg) $(_portableArg) $(_msbuildCommonParameters)
- _buildArguments: -configuration ${{ parameters.buildConfig }} -ci -arch ${{ parameters.archType }} $(_finalFrameworkArg) $(_stripSymbolsArg) $(_testScopeArg) $(_warnAsErrorArg) $(_runtimeOSArg) $(_portableArg) $(_msbuildCommonParameters) $(_coreClrOverridePathArg)
- ${{ parameters.variables }}

dependsOn:
Expand All @@ -102,4 +113,12 @@ jobs:
git remote set-url origin $(Build.Repository.Uri)
displayName: Clone the repository from Checkout.bundle
- ${{ if ne(parameters.liveCoreClrBuildConfig, '') }}:
- template: /eng/pipelines/common/download-artifact-step.yml
parameters:
unpackFolder: $(_coreClrDownloadPath)
artifactFileName: '$(_coreClrArtifactName)$(archiveExtension)'
artifactName: '$(_coreClrArtifactName)'
displayName: 'CoreCLR build drop'

- ${{ parameters.steps }}
18 changes: 17 additions & 1 deletion eng/pipelines/libraries/build-job.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,14 @@ parameters:
archType: ''
framework: netcoreapp
isOfficialBuild: false

# When set to a non-empty value (Debug / Release), it determines CoreCLR
# build configuration to use for building libraries and tests. Setting this
# property implies a dependency of this job on the appropriate CoreCLR build
# and is used to construct the name of the Azure artifact representing
# CoreCLR build to use for building the libraries and library tests.
liveCoreClrBuildConfig: ''

timeoutInMinutes: 150
preBuildSteps: []
container: ''
Expand All @@ -22,12 +30,18 @@ jobs:
archType: ${{ parameters.archType }}
framework: ${{ parameters.framework }}
isOfficialBuild: ${{ parameters.isOfficialBuild }}
liveCoreClrBuildConfig: ${{ parameters.liveCoreClrBuildConfig }}
timeoutInMinutes: ${{ parameters.timeoutInMinutes }}
preBuildSteps: ${{ parameters.preBuildSteps }}
container: ${{ parameters.container }}
pool: ${{ parameters.pool }}
testScope: ${{ parameters.testScope }}
stepName: Build
name: build
displayName: 'Build'

${{ if ne(parameters.liveCoreClrBuildConfig, '') }}:
dependsOn:
- ${{ format('coreclr_product_build_{0}{1}_{2}_{3}', parameters.osGroup, parameters.osSubgroup, parameters.archType, parameters.liveCoreClrBuildConfig) }}

variables:
- _skipTestRestoreArg: /p:SkipTestRestore=true
Expand All @@ -40,6 +54,8 @@ jobs:
- ${{ if ne(parameters.framework, 'allConfigurations') }}:
- _skipTestRestoreArg: /p:SkipTestRestore=false

- ${{ parameters.variables }}

steps:
- script: $(_buildScript) -restore $(_buildArguments) $(_skipTestRestoreArg)
displayName: Restore
Expand Down
10 changes: 8 additions & 2 deletions eng/pipelines/libraries/build-test-job.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,14 @@ parameters:
archType: ''
framework: netcoreapp
isOfficialBuild: false
liveCoreClrBuildConfig: ''
timeoutInMinutes: 150
container: ''
publishTestArtifacs: true
pool: ''
testScope: ''
variables: {}
condition: true
runTests: false

jobs:
Expand All @@ -22,14 +24,17 @@ jobs:
archType: ${{ parameters.archType }}
framework: ${{ parameters.framework }}
isOfficialBuild: ${{ parameters.isOfficialBuild }}
condition: ${{ parameters.condition }}
liveCoreClrBuildConfig: ${{ parameters.liveCoreClrBuildConfig }}
timeoutInMinutes: ${{ parameters.timeoutInMinutes }}
container: ${{ parameters.container }}
pool: ${{ parameters.pool }}
testScope: ${{ parameters.testScope }}
stepName: Test
name: test_build
displayName: 'Test Build'

dependsOn:
- ${{ format('libraries_Build_{0}_{1}{2}_{3}_{4}', parameters.framework, parameters.osGroup, parameters.osSubgroup, parameters.archType, parameters.buildConfig) }}
- ${{ format('libraries_build_{0}_{1}{2}_{3}_{4}', parameters.framework, parameters.osGroup, parameters.osSubgroup, parameters.archType, parameters.buildConfig) }}

variables:
- _archiveTestsParameter: /p:ArchiveTests=true
Expand All @@ -44,6 +49,7 @@ jobs:
artifactName: ${{ format('libraries_bin_{0}_{1}{2}_{3}_{4}', parameters.framework, parameters.osGroup, parameters.osSubgroup, parameters.archType, parameters.buildConfig) }}
artifactFileName: ${{ format('libraries_bin_{0}_{1}{2}_{3}_{4}', parameters.framework, parameters.osGroup, parameters.osSubgroup, parameters.archType, parameters.buildConfig) }}$(archiveExtension)
unpackFolder: $(Build.SourcesDirectory)/artifacts
cleanUnpackFolder: false

- script: $(_buildScript) -restore $(_buildArguments) $(_skipTestRestoreArg)
displayName: Restore
Expand Down
2 changes: 1 addition & 1 deletion eng/pipelines/libraries/helix.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ parameters:

steps:
- script: ${{ parameters.msbuildScript }}
$(sourcesRoot)/sendtohelix.proj
$(Build.SourcesDirectory)/src/libraries/sendtohelix.proj
/t:test
/p:ArchGroup=${{ parameters.archGroup }}
/p:ConfigurationGroup=${{ parameters.configuration }}
Expand Down
13 changes: 9 additions & 4 deletions eng/pipelines/libraries/run-test-job.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,13 @@ parameters:
archType: ''
framework: netcoreapp
isOfficialBuild: false
liveCoreClrBuildConfig: ''
timeoutInMinutes: 150
pool: ''
testScope: ''
helixQueues: []
dependsOnBuildConfiguration: Debug
condition: true
variables: {}

jobs:
Expand All @@ -21,14 +23,17 @@ jobs:
archType: ${{ parameters.archType }}
framework: ${{ parameters.framework }}
isOfficialBuild: ${{ parameters.isOfficialBuild }}
liveCoreClrBuildConfig: ${{ parameters.liveCoreClrBuildConfig }}
timeoutInMinutes: ${{ parameters.timeoutInMinutes }}
container: '' # we just send to helix, no need to use a container.
condition: ${{ parameters.condition }}
pool: ${{ parameters.pool }}
stepName: Run
name: test_run
displayName: 'Test Run'

dependsOn:
- ${{ format('libraries_Build_{0}_{1}{2}_{3}_{4}', parameters.framework, parameters.osGroup, parameters.osSubgroup, parameters.archType, parameters.buildConfig) }}
- ${{ format('libraries_Test_{0}_{1}_x64_{2}', parameters.framework, parameters.osGroup, parameters.dependsOnBuildConfiguration) }}
- ${{ format('libraries_build_{0}_{1}{2}_{3}_{4}', parameters.framework, parameters.osGroup, parameters.osSubgroup, parameters.archType, parameters.buildConfig) }}
- ${{ format('libraries_test_build_{0}_{1}_x64_{2}', parameters.framework, parameters.osGroup, parameters.dependsOnBuildConfiguration) }}

variables:
- _archiveTestsParameter: /p:ArchiveTests=true
Expand Down Expand Up @@ -61,4 +66,4 @@ jobs:
framework: ${{ parameters.framework }}
testScope: ${{ parameters.testScope }}
creator: dotnet-bot
helixToken: ''
helixToken: ''
Loading

0 comments on commit 8bdcba1

Please sign in to comment.