Skip to content

Move Windows and Linux CI to VSTS #566

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 5 commits into from
Jul 23, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 21 additions & 0 deletions .vsts-dotnet-ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
resources:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we move this file from the root of the repo and instead put it in the build folder?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I left it in the root because if it is in the root we get Resource Authorization automatically:
https://github.com/Microsoft/vsts-agent/blob/master/docs/preview/yamlgettingstarted-authz.md

They do have plans on supporting directory structure for this though:
microsoft/azure-pipelines-agent#1430

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That is unfortunate.

containers:
- container: centos7
image: microsoft/dotnet-buildtools-prereqs:centos-7-b46d863-20180719033416
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

dotnet-buildtools-prereqs:centos-7-b46d863-20180719033416 [](start = 21, length = 57)

does this docker image contains libgdiplus?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Member Author

@safern safern Jul 23, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I’m trying to build and run the tests locally in my computer with the same container. I’ll update you. Using your branch of course

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The tests that you added passed in my machine when using that docker image. I just need to dig why they are failing in VSTS, maybe not picking the right docker image. I'll update you.


phases:
- template: /build/ci/phase-template.yml
parameters:
name: Linux
buildScript: ./build.sh
queue:
container: centos7

- template: /build/ci/phase-template.yml
parameters:
name: Windows_NT
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Windows_NT [](start = 10, length = 10)

I obviously don't have knowleage regarding build system, but from what I see we have 4 nodes in VSTS where Windows_NT is not running, and also Windows builds on jenkins.
Is it intended?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So the jenkins Windows builds will stop showing up after I merge this PR. They keep showing because it takes the checked-in netci.groovy file instead of taking the one in this PR.

About the VSTS nodes, you can see here: https://dotnet.visualstudio.com/public/_build/results?buildId=7047&view=logs that the new Build Def, will run Linux and Windows in both Release and Debug mode simultaneously.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Got it, thank you for clarification.

buildScript: build.cmd
queue:
name: Hosted VS2017
demands:
- agent.os -equals Windows_NT
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
33 changes: 33 additions & 0 deletions build/ci/phase-template.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
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'
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

vSTest [](start = 21, length = 6)

don't we use xUnit tests, or they interchangeable?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We use xunit as a framework, but we use VSTest as our test runner:
https://github.com/dotnet/machinelearning/blob/master/test/run-tests.proj#L10

searchFolder: '$(System.DefaultWorkingDirectory)/bin'
testResultsFiles: '**/*.trx'
testRunTitle: Machinelearning_Tests_$(_phaseName)_$(_configuration)_$(Build.BuildNumber)
configuration: $(_configuration)
mergeTestResults: true
- script: $(_buildScript) -buildPackages
displayName: Build Packages
32 changes: 4 additions & 28 deletions netci.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down