From 0ff9f923e7417d27dd462752932ce62596c7576f Mon Sep 17 00:00:00 2001 From: Santiago Fernandez Madero Date: Fri, 20 Jul 2018 14:26:13 -0700 Subject: [PATCH 1/5] Remove Windows and Linux configurations from netci.groovy --- .vsts-dotnet-ci.yml | 21 +++++++++++++++++++++ build/ci/phase-template.yml | 32 ++++++++++++++++++++++++++++++++ netci.groovy | 32 ++++---------------------------- 3 files changed, 57 insertions(+), 28 deletions(-) create mode 100644 .vsts-dotnet-ci.yml create mode 100644 build/ci/phase-template.yml diff --git a/.vsts-dotnet-ci.yml b/.vsts-dotnet-ci.yml new file mode 100644 index 0000000000..079548ac1b --- /dev/null +++ b/.vsts-dotnet-ci.yml @@ -0,0 +1,21 @@ +resources: + containers: + - container: rhel7 + image: microsoft/dotnet-buildtools-prereqs:centos-7-b46d863-20180719033416 + +phases: +- template: /build/ci/phase-template.yml + parameters: + name: RHEL7 + buildScript: ./build.sh + queue: + container: rhel7 + +- template: /build/ci/phase-template.yml + parameters: + name: Windows_NT + buildScript: build.cmd + queue: + name: Hosted VS2017 + demands: + - agent.os -equals Windows_NT \ No newline at end of file diff --git a/build/ci/phase-template.yml b/build/ci/phase-template.yml new file mode 100644 index 0000000000..62a9108744 --- /dev/null +++ b/build/ci/phase-template.yml @@ -0,0 +1,32 @@ +parameters: + name: '' + buildScript: '' + queue: '' + +phases: + - phase: ${{ parameters.name }} + variables: + _buildScript: ${{ parameters.buildScript }} + _phaseName: ${{ parameters.name }} + queue: + parallel: 2 + matrix: + Build_Debug: + _configuration: Debug + Build_Release: + _configuration: Release + ${{ insert }}: ${{ parameters.queue }} + steps: + - script: $(_buildScript) -$(_configuration) -runtests + displayName: Build and Test + - task: PublishTestResults@2 + displayName: Publish Test Results + condition: succeededOrFailed() + inputs: + testRunner: 'vSTest' + testResultsFiles: '**/*.trx' + testRunTitle: Machinelearning_Tests_$(_phaseName)_$(_configuration) + configuration: $(_configuration) + mergeTestResults: true + - script: $(_buildScript) -buildPackages + displayName: Build Packages \ No newline at end of file diff --git a/netci.groovy b/netci.groovy index eb78c766a5..b955bf669f 100644 --- a/netci.groovy +++ b/netci.groovy @@ -6,46 +6,22 @@ import jobs.generation.Utilities; def project = GithubProject def branch = GithubBranchName -['Windows_NT', 'Linux', 'OSX10.13'].each { os -> +['OSX10.13'].each { os -> ['Debug', 'Release'].each { config -> [true, false].each { isPR -> // Calculate job name def jobName = os.toLowerCase() + '_' + config.toLowerCase() - def buildFile = ''; def machineAffinity = 'latest-or-auto' - // Calculate the build command - if (os == 'Windows_NT') { - buildFile = ".\\build.cmd" - } else { - buildFile = "./build.sh" - } - - def buildCommand = buildFile + " -$config -runtests" - def packCommand = buildFile + " -buildPackages" - def newJob = job(Utilities.getFullJobName(project, jobName, isPR)) { steps { - if (os == 'Windows_NT') { - batchFile(buildCommand) - batchFile(packCommand) - } - else { - // Shell - shell(buildCommand) - shell(packCommand) - } + shell("./build.sh -$config -runtests") + shell("./build.sh -buildPackages") } } - def osImageName = os - if (os == 'Linux') { - // Trigger a portable Linux build that runs on RHEL7.2 - osImageName = "RHEL7.2" - } - - Utilities.setMachineAffinity(newJob, osImageName, machineAffinity) + Utilities.setMachineAffinity(newJob, os, machineAffinity) Utilities.standardJobSetup(newJob, project, isPR, "*/${branch}") if (isPR) { From 6b09f7f91be6d3021d5812f9a3fbe389a59689e1 Mon Sep 17 00:00:00 2001 From: Santiago Fernandez Madero Date: Fri, 20 Jul 2018 14:31:33 -0700 Subject: [PATCH 2/5] Add end of line to yml files --- .vsts-dotnet-ci.yml | 2 +- build/ci/phase-template.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.vsts-dotnet-ci.yml b/.vsts-dotnet-ci.yml index 079548ac1b..554e9fc46f 100644 --- a/.vsts-dotnet-ci.yml +++ b/.vsts-dotnet-ci.yml @@ -18,4 +18,4 @@ phases: queue: name: Hosted VS2017 demands: - - agent.os -equals Windows_NT \ No newline at end of file + - agent.os -equals Windows_NT diff --git a/build/ci/phase-template.yml b/build/ci/phase-template.yml index 62a9108744..f1cf129611 100644 --- a/build/ci/phase-template.yml +++ b/build/ci/phase-template.yml @@ -29,4 +29,4 @@ phases: configuration: $(_configuration) mergeTestResults: true - script: $(_buildScript) -buildPackages - displayName: Build Packages \ No newline at end of file + displayName: Build Packages From d041cfc7f61e2f86fd931388a0fab607d14ebc4e Mon Sep 17 00:00:00 2001 From: Santiago Fernandez Madero Date: Fri, 20 Jul 2018 15:36:59 -0700 Subject: [PATCH 3/5] Add badges and change leg name to Linux --- .vsts-dotnet-ci.yml | 6 +++--- README.md | 4 ++-- build/ci/phase-template.yml | 4 ++-- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/.vsts-dotnet-ci.yml b/.vsts-dotnet-ci.yml index 554e9fc46f..80ed1b4ac7 100644 --- a/.vsts-dotnet-ci.yml +++ b/.vsts-dotnet-ci.yml @@ -1,15 +1,15 @@ resources: containers: - - container: rhel7 + - container: centos7 image: microsoft/dotnet-buildtools-prereqs:centos-7-b46d863-20180719033416 phases: - template: /build/ci/phase-template.yml parameters: - name: RHEL7 + name: Linux buildScript: ./build.sh queue: - container: rhel7 + container: centos7 - template: /build/ci/phase-template.yml parameters: diff --git a/README.md b/README.md index d20d3f73c4..9ccd06c165 100644 --- a/README.md +++ b/README.md @@ -44,9 +44,9 @@ To build ML.NET from source please visit our [developers guide](docs/project-doc | | x64 Debug | x64 Release | |:---|----------------:|------------------:| -|**Linux**|[![x64-debug](https://ci2.dot.net/job/dotnet_machinelearning/job/master/job/linux_debug/badge/icon)](https://ci2.dot.net/job/dotnet_machinelearning/job/master/job/linux_debug/lastCompletedBuild)|[![x64-release](https://ci2.dot.net/job/dotnet_machinelearning/job/master/job/linux_release/badge/icon)](https://ci2.dot.net/job/dotnet_machinelearning/job/master/job/linux_release/lastCompletedBuild)| +|**Linux**|[![x64-debug](https://dotnet.visualstudio.com/public/_apis/build/status/104?branch=master)](https://dotnet.visualstudio.com/DotNet-Public/_build/latest?definitionId=104&branch=master)|[![x64-release](https://dotnet.visualstudio.com/public/_apis/build/status/104?branch=master)](https://dotnet.visualstudio.com/DotNet-Public/_build/latest?definitionId=104&branch=master)| |**macOS**|[![x64-debug](https://ci2.dot.net/job/dotnet_machinelearning/job/master/job/osx10.13_debug/badge/icon)](https://ci2.dot.net/job/dotnet_machinelearning/job/master/job/osx10.13_debug/lastCompletedBuild)|[![x64-release](https://ci2.dot.net/job/dotnet_machinelearning/job/master/job/osx10.13_release/badge/icon)](https://ci2.dot.net/job/dotnet_machinelearning/job/master/job/osx10.13_release/lastCompletedBuild)| -|**Windows**|[![x64-debug](https://ci2.dot.net/job/dotnet_machinelearning/job/master/job/windows_nt_debug/badge/icon)](https://ci2.dot.net/job/dotnet_machinelearning/job/master/job/windows_nt_debug/lastCompletedBuild)|[![x64-release](https://ci2.dot.net/job/dotnet_machinelearning/job/master/job/windows_nt_release/badge/icon)](https://ci2.dot.net/job/dotnet_machinelearning/job/master/job/windows_nt_release/lastCompletedBuild)| +|**Windows**|[![x64-debug](https://dotnet.visualstudio.com/public/_apis/build/status/104?branch=master)](https://dotnet.visualstudio.com/DotNet-Public/_build/latest?definitionId=104&branch=master)|[![x64-release](https://dotnet.visualstudio.com/public/_apis/build/status/104?branch=master)](https://dotnet.visualstudio.com/DotNet-Public/_build/latest?definitionId=104&branch=master)| ## Contributing diff --git a/build/ci/phase-template.yml b/build/ci/phase-template.yml index f1cf129611..257abbd0ce 100644 --- a/build/ci/phase-template.yml +++ b/build/ci/phase-template.yml @@ -1,7 +1,7 @@ parameters: name: '' buildScript: '' - queue: '' + queue: {} phases: - phase: ${{ parameters.name }} @@ -25,7 +25,7 @@ phases: inputs: testRunner: 'vSTest' testResultsFiles: '**/*.trx' - testRunTitle: Machinelearning_Tests_$(_phaseName)_$(_configuration) + testRunTitle: Machinelearning_Tests_$(_phaseName)_$(_configuration)_$(Build.BuildNumber) configuration: $(_configuration) mergeTestResults: true - script: $(_buildScript) -buildPackages From 783105b76014a5fa8c7bb1c8cdff42dc9003c8ad Mon Sep 17 00:00:00 2001 From: Santiago Fernandez Madero Date: Fri, 20 Jul 2018 15:48:28 -0700 Subject: [PATCH 4/5] Not merge test results --- build/ci/phase-template.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/build/ci/phase-template.yml b/build/ci/phase-template.yml index 257abbd0ce..d6c2779361 100644 --- a/build/ci/phase-template.yml +++ b/build/ci/phase-template.yml @@ -27,6 +27,5 @@ phases: testResultsFiles: '**/*.trx' testRunTitle: Machinelearning_Tests_$(_phaseName)_$(_configuration)_$(Build.BuildNumber) configuration: $(_configuration) - mergeTestResults: true - script: $(_buildScript) -buildPackages displayName: Build Packages From 77690afe6b5db68528f4a1c40af77dec416d34e1 Mon Sep 17 00:00:00 2001 From: Santiago Fernandez Madero Date: Fri, 20 Jul 2018 16:05:59 -0700 Subject: [PATCH 5/5] Add searchFolder to publish test results task --- build/ci/phase-template.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/build/ci/phase-template.yml b/build/ci/phase-template.yml index d6c2779361..2c8430465a 100644 --- a/build/ci/phase-template.yml +++ b/build/ci/phase-template.yml @@ -24,8 +24,10 @@ phases: condition: succeededOrFailed() inputs: testRunner: 'vSTest' + searchFolder: '$(System.DefaultWorkingDirectory)/bin' testResultsFiles: '**/*.trx' testRunTitle: Machinelearning_Tests_$(_phaseName)_$(_configuration)_$(Build.BuildNumber) configuration: $(_configuration) + mergeTestResults: true - script: $(_buildScript) -buildPackages displayName: Build Packages