Skip to content

Commit 34eb983

Browse files
Arm64 build/test/publish. (dotnet#5860)
* Arm helix * yml cross fixes. * yml cross fixes. * yml cross fixes. * yml cross fixes. * yml cross testing * Adding docker again. * queue changes. * queue changes. * queue changes. * arm pre commands * arm pre commands * arm pre commands * arm pre commands * arm pre commands * arm pre commands * arm pre commands * Arm helix changes. * Arm helix changes. * Removing arm so PR can go. * FIxes from PR comments. Adding arm32 back. * Fix using statements. * Namespace fixes. * Added missed cmake code. * Cmake fixes * M1 Additions * Changes from PR comments. * x86x64 fact attribute. * Fixes from PR comments. * Fixes from PR comments. * Fixes for Centos 7 fact and Featurizers fact. * Code Analysis version and Not fail on M1. * disable m1 tests in prs. * disable m1 tests in prs. * disable m1 tests in prs. * disable m1 tests in prs. * Change to full url * Look in osx-arm64 folder for baseline files. * Fixed -mthumb flag issue. * Fixes from PR comments. * Fixes from PR comments. * Final test fixed. * Final Fixes from PR comments.
1 parent f70af3a commit 34eb983

File tree

102 files changed

+14324
-186
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

102 files changed

+14324
-186
lines changed

.vsts-dotnet-ci.yml

Lines changed: 72 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,57 @@ resources:
1010
- container: UbuntuContainer
1111
image: mcr.microsoft.com/dotnet-buildtools/prereqs:ubuntu-16.04-mlnet-20200515184230-2c829e8
1212

13+
- container: UbuntuCrossArmContainer
14+
image: mcr.microsoft.com/dotnet-buildtools/prereqs:ubuntu-18.04-mlnet-cross-arm-20210512124625-2e59a5f
15+
16+
- container: UbuntuCrossArm64Container
17+
image: mcr.microsoft.com/dotnet-buildtools/prereqs:ubuntu-18.04-mlnet-cross-arm64-20210512124625-2e59a5f
18+
1319
jobs:
20+
- template: /build/ci/job-template.yml
21+
parameters:
22+
architecture: arm
23+
name: Ubuntu_x64_cross_arm_NetCoreApp31
24+
buildScript: ./build.sh
25+
container: UbuntuCrossArmContainer
26+
customMatrixes:
27+
Debug_Build:
28+
_configuration: Debug-netcoreapp3_1
29+
_config_short: DI
30+
_includeBenchmarkData: false
31+
_targetFramework: netcoreapp3.1
32+
Release_Build:
33+
_configuration: Release-netcoreapp3_1
34+
_config_short: RI
35+
_includeBenchmarkData: true
36+
_targetFramework: netcoreapp3.1
37+
innerLoop: true
38+
pool:
39+
name: Hosted Ubuntu 1604
40+
helixQueue: [email protected]/dotnet-buildtools/prereqs:ubuntu-18.04-helix-arm32v7-20210531091521-97d8652
41+
42+
- template: /build/ci/job-template.yml
43+
parameters:
44+
architecture: arm64
45+
name: Ubuntu_x64_cross_arm64_NetCoreApp31
46+
buildScript: ./build.sh
47+
container: UbuntuCrossArm64Container
48+
customMatrixes:
49+
Debug_Build:
50+
_configuration: Debug-netcoreapp3_1
51+
_config_short: DI
52+
_includeBenchmarkData: false
53+
_targetFramework: netcoreapp3.1
54+
Release_Build:
55+
_configuration: Release-netcoreapp3_1
56+
_config_short: RI
57+
_includeBenchmarkData: true
58+
_targetFramework: netcoreapp3.1
59+
innerLoop: true
60+
pool:
61+
name: Hosted Ubuntu 1604
62+
helixQueue: [email protected]/dotnet-buildtools/prereqs:ubuntu-18.04-helix-arm64v8-20210531091519-97d8652
63+
1464
- template: /build/ci/job-template.yml
1565
parameters:
1666
name: Centos_x64_NetCoreApp31
@@ -51,6 +101,28 @@ jobs:
51101
name: Hosted macOS
52102
helixQueue: OSX.1015.Amd64.Open
53103

104+
- template: /build/ci/job-template.yml
105+
parameters:
106+
architecture: arm64
107+
name: MacOS_cross_arm64_NetCoreApp21
108+
buildScript: ./build.sh
109+
customMatrixes:
110+
Debug_Build:
111+
_configuration: Debug-netcoreapp3_1
112+
_config_short: DI
113+
_includeBenchmarkData: false
114+
_targetFramework: netcoreapp3.1
115+
Release_Build:
116+
_configuration: Release-netcoreapp3_1
117+
_config_short: RI
118+
_includeBenchmarkData: true
119+
_targetFramework: netcoreapp3.1
120+
innerLoop: true
121+
pool:
122+
vmImage: macOS-10.15
123+
testTargetFramework: net6.0
124+
helixQueue: OSX.1100.Arm64.Open
125+
54126
- template: /build/ci/job-template.yml
55127
parameters:
56128
name: Windows_x64_NetCoreApp31

build/ci/job-template.yml

Lines changed: 20 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ parameters:
1313
container: ''
1414
useVSTestTask: false
1515
helixQueue: ''
16+
testTargetFramework: ''
1617

1718
jobs:
1819
- job: ${{ parameters.name }}
@@ -36,6 +37,12 @@ jobs:
3637
spaceValue: ' '
3738
${{ if eq(parameters.buildScript, './build.sh') }}:
3839
spaceValue: '%20'
40+
${{ if and(eq(parameters.pool.name, 'Hosted Ubuntu 1604'), contains(parameters.name, 'cross')) }}:
41+
ROOTFS_DIR: '/crossrootfs/${{ parameters.architecture }}'
42+
${{ if eq(parameters.testTargetFramework, '') }}:
43+
testTargetFramework: ''
44+
${{ if ne(parameters.testTargetFramework, '') }}:
45+
testTargetFramework: '/p:TestTargetFramework=${{ parameters.testTargetFramework }}'
3946
strategy:
4047
matrix:
4148
${{ if eq(parameters.customMatrixes, '') }}:
@@ -64,13 +71,17 @@ jobs:
6471
displayName: MacOS Homebrew bug Workaround
6572
continueOnError: true
6673
# Extra MacOS step required to install OS-specific dependencies
67-
- ${{ if eq(parameters.pool.name, 'Hosted macOS') }}:
74+
- ${{ if and(eq(parameters.pool.name, 'Hosted macOS'), not(contains(parameters.name, 'cross'))) }}:
6875
- script: brew update && brew install mono-libgdiplus && brew install $(Build.SourcesDirectory)/build/libomp.rb --build-from-source --formula && brew link libomp --force
6976
displayName: Install MacOS build dependencies
77+
# Extra Apple MacOS step required to install OS-specific dependencies
78+
- ${{ if and(contains(parameters.pool.vmImage, 'macOS'), contains(parameters.name, 'cross')) }}:
79+
- script: brew update && brew install mono-libgdiplus && brew install libomp && brew link libomp --force
80+
displayName: Install MacOS ARM build dependencies
7081
- ${{ if and( eq(parameters.nightlyBuild, 'true'), eq(parameters.pool.name, 'Hosted Ubuntu 1604')) }}:
7182
- bash: echo "##vso[task.setvariable variable=LD_LIBRARY_PATH]$(nightlyBuildRunPath):$LD_LIBRARY_PATH"
7283
displayName: Set LD_LIBRARY_PATH for Ubuntu and CentOS to locate Native shared library in current running path
73-
- script: ${{ parameters.buildScript }} -configuration $(_configuration) /p:TargetArchitecture=${{ parameters.architecture }} /p:TestArchitectures=${{ parameters.architecture }} /p:Coverage=${{ parameters.codeCoverage }}
84+
- script: ${{ parameters.buildScript }} -configuration $(_configuration) /p:TargetArchitecture=${{ parameters.architecture }} /p:TestArchitectures=${{ parameters.architecture }} /p:Coverage=${{ parameters.codeCoverage }} $(testTargetFramework)
7485
displayName: Build
7586
- ${{ if eq(parameters.pool.name, 'Hosted macOS') }}:
7687
- task: Bash@3
@@ -144,7 +155,7 @@ jobs:
144155
publishRunAttachments: true
145156
- ${{ if eq(parameters.innerLoop, 'true') }}:
146157
- ${{ if eq(parameters.codeCoverage, True) }}:
147-
- script: ${{ parameters.buildScript }} /p:Build=false -configuration $(_configuration) /p:TargetArchitecture=${{ parameters.architecture }} /p:TestArchitectures=${{ parameters.architecture }} -test -integrationTest -ci /p:TestRunnerAdditionalArguments='-notrait$(spaceValue)Category=SkipInCI' /p:Coverage=${{ parameters.codeCoverage }}
158+
- script: ${{ parameters.buildScript }} /p:Build=false -configuration $(_configuration) /p:TargetArchitecture=${{ parameters.architecture }} /p:TestArchitectures=${{ parameters.architecture }} -test -integrationTest -ci /p:TestRunnerAdditionalArguments='-notrait$(spaceValue)Category=SkipInCI' /p:Coverage=${{ parameters.codeCoverage }} $(testTargetFramework)
148159
displayName: Run CI Tests.
149160
- ${{ if eq(parameters.codeCoverage, False) }}:
150161
- template: /build/ci/send-to-helix.yml
@@ -155,9 +166,14 @@ jobs:
155166
${{ if eq(parameters.buildScript, 'build.cmd') }}:
156167
MsBuildScript: 'powershell $(Build.SourcesDirectory)/eng/common/msbuild.ps1'
157168
WarnAsError: '-warnAsError 0'
169+
TestTargetFramework: '$(testTargetFramework)'
158170
${{ if eq(parameters.buildScript, './build.sh') }}:
159171
MsBuildScript: '$(Build.SourcesDirectory)/eng/common/msbuild.sh'
160172
WarnAsError: '--warnAsError false'
173+
TestTargetFramework: '$(testTargetFramework)'
174+
# Don't have M1 failures fail the build for now.
175+
${{ if and(contains(parameters.pool.vmImage, 'macOS'), contains(parameters.name, 'cross')) }}:
176+
continueOnError: true
161177
- script: $(dotnetPath) msbuild -restore build/Codecoverage.proj
162178
displayName: Upload coverage to codecov.io
163179
condition: and(succeeded(), eq(${{ parameters.codeCoverage }}, True))
@@ -221,5 +237,5 @@ jobs:
221237
script: Get-ChildItem -Path '.\artifacts\bin' -Recurse | Where-Object {$_.FullName -like "*runtimes*"} | Remove-Item -Recurse -Confirm:$false -Force
222238
displayName: Clean up runtime folder for package (Unix)
223239
- ${{ if eq(parameters.nightlyBuild, 'false') }}:
224-
- script: ${{ parameters.buildScript }} /p:Build=false -pack -ci -configuration $(_configuration) /p:TargetArchitecture=${{ parameters.architecture }} /p:TestArchitectures=${{ parameters.architecture }}
240+
- script: ${{ parameters.buildScript }} /p:Build=false -pack -ci -configuration $(_configuration) /p:TargetArchitecture=${{ parameters.architecture }} /p:TestArchitectures=${{ parameters.architecture }} $(testTargetFramework)
225241
displayName: Build Packages

build/ci/send-to-helix.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ parameters:
99
Architecture: 'x64'
1010
MsBuildScript: ''
1111
WarnAsError: ''
12+
TestTargetFramework: ''
1213
HelixConfiguration: '' # optional -- additional property attached to a job
1314
IncludeDotNetCli: true # optional -- true will download a version of the .NET CLI onto the Helix machine as a correlation payload; requires DotNetCliPackageType and DotNetCliVersion
1415
EnableXUnitReporter: true # optional -- true enables XUnit result reporting to Mission Control
@@ -38,9 +39,12 @@ steps:
3839
/p:WaitForWorkItemCompletion=${{ parameters.WaitForWorkItemCompletion }}
3940
/p:HelixBaseUri=${{ parameters.HelixBaseUri }}
4041
${{ parameters.WarnAsError }}
42+
${{ parameters.TestTargetFramework }}
4143
displayName: ${{ parameters.DisplayNamePrefix }}
4244
env:
4345
SYSTEM_ACCESSTOKEN: $(System.AccessToken)
4446
Creator: ${{ parameters.Creator }}
4547
HelixTargetQueues: ${{ parameters.HelixTargetQueues }}
4648
continueOnError: ${{ parameters.continueOnError }}
49+
${{ if and(contains(parameters.HelixTargetQueues, 'OSX.1100.Arm64.Open'), in(variables['Build.Reason'], 'PullRequest')) }}:
50+
enabled: False

build/vsts-ci.yml

Lines changed: 108 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,15 @@ resources:
77
- container: CentosContainer
88
image: mcr.microsoft.com/dotnet-buildtools/prereqs:centos-7-mlnet-8bba86b-20190314145033
99

10+
- container: UbuntuCrossArmContainer
11+
image: mcr.microsoft.com/dotnet-buildtools/prereqs:ubuntu-18.04-mlnet-cross-arm-20210512124625-2e59a5f
12+
13+
- container: UbuntuCrossArm64Container
14+
image: mcr.microsoft.com/dotnet-buildtools/prereqs:ubuntu-18.04-mlnet-cross-arm64-20210512124625-2e59a5f
15+
1016
phases:
1117
################################################################################
12-
- phase: Linux
18+
- phase: Linux_x64
1319
################################################################################
1420
variables:
1521
BuildConfig: Release
@@ -29,7 +35,67 @@ phases:
2935
displayName: build redist
3036
# Only build native assets to avoid conflicts.
3137
- script: ./build.sh -configuration $(BuildConfig) -projects $(Build.SourcesDirectory)/src/Native/Native.proj /p:TargetArchitecture=x64 /p:CopyPackageAssets=true
32-
displayName: Build
38+
displayName: Build Native Assets
39+
40+
- task: PublishBuildArtifacts@1
41+
displayName: Publish Linux package assets
42+
inputs:
43+
pathToPublish: $(Build.SourcesDirectory)/artifacts/pkgassets
44+
artifactName: PackageAssets
45+
artifactType: container
46+
47+
################################################################################
48+
- phase: Linux_arm
49+
################################################################################
50+
variables:
51+
BuildConfig: Release-netcoreapp3_1
52+
OfficialBuildId: $(BUILD.BUILDNUMBER)
53+
DOTNET_CLI_TELEMETRY_OPTOUT: 1
54+
DOTNET_SKIP_FIRST_TIME_EXPERIENCE: 1
55+
DOTNET_MULTILEVEL_LOOKUP: 0
56+
queue:
57+
name: DotNet-Build
58+
demands:
59+
- agent.os -equals linux
60+
container: UbuntuCrossArmContainer
61+
steps:
62+
- script: ./restore.sh
63+
displayName: restore all projects
64+
- script: ./build.sh -configuration $(BuildConfig) /p:CopyPackageAssets=true /p:SkipRIDAgnosticAssets=true -projects $(Build.SourcesDirectory)/src/Redist/Microsoft.ML.DnnImageFeaturizer.ModelRedist/Microsoft.ML.DnnImageFeaturizer.ModelRedist.proj
65+
displayName: build redist
66+
# Only build native assets to avoid conflicts.
67+
- script: ./build.sh -configuration $(BuildConfig) -projects $(Build.SourcesDirectory)/src/Native/Native.proj /p:TargetArchitecture=arm /p:CopyPackageAssets=true
68+
displayName: Build Native Assets
69+
70+
- task: PublishBuildArtifacts@1
71+
displayName: Publish Linux package assets
72+
inputs:
73+
pathToPublish: $(Build.SourcesDirectory)/artifacts/pkgassets
74+
artifactName: PackageAssets
75+
artifactType: container
76+
77+
################################################################################
78+
- phase: Linux_arm64
79+
################################################################################
80+
variables:
81+
BuildConfig: Release-netcoreapp3_1
82+
OfficialBuildId: $(BUILD.BUILDNUMBER)
83+
DOTNET_CLI_TELEMETRY_OPTOUT: 1
84+
DOTNET_SKIP_FIRST_TIME_EXPERIENCE: 1
85+
DOTNET_MULTILEVEL_LOOKUP: 0
86+
queue:
87+
name: DotNet-Build
88+
demands:
89+
- agent.os -equals linux
90+
container: UbuntuCrossArm64Container
91+
steps:
92+
- script: ./restore.sh
93+
displayName: restore all projects
94+
- script: ./build.sh -configuration $(BuildConfig) /p:CopyPackageAssets=true /p:SkipRIDAgnosticAssets=true -projects $(Build.SourcesDirectory)/src/Redist/Microsoft.ML.DnnImageFeaturizer.ModelRedist/Microsoft.ML.DnnImageFeaturizer.ModelRedist.proj
95+
displayName: build redist
96+
# Only build native assets to avoid conflicts.
97+
- script: ./build.sh -configuration $(BuildConfig) -projects $(Build.SourcesDirectory)/src/Native/Native.proj /p:TargetArchitecture=arm64 /p:CopyPackageAssets=true
98+
displayName: Build Native Assets
3399

34100
- task: PublishBuildArtifacts@1
35101
displayName: Publish Linux package assets
@@ -63,7 +129,41 @@ phases:
63129
displayName: build redist
64130
# Only build native assets to avoid conflicts.
65131
- script: ./build.sh -projects $(Build.SourcesDirectory)/src/Native/Native.proj -configuration $(BuildConfig) /p:TargetArchitecture=x64 /p:CopyPackageAssets=true
66-
displayName: Build
132+
displayName: Build Native Assets
133+
134+
- task: PublishBuildArtifacts@1
135+
displayName: Publish macOS package assets
136+
inputs:
137+
pathToPublish: $(Build.SourcesDirectory)/artifacts/pkgassets
138+
artifactName: PackageAssets
139+
artifactType: container
140+
141+
################################################################################
142+
- phase: MacOS_Apple_Silicon
143+
################################################################################
144+
variables:
145+
BuildConfig: Release-netcoreapp3_1
146+
OfficialBuildId: $(BUILD.BUILDNUMBER)
147+
DOTNET_CLI_TELEMETRY_OPTOUT: 1
148+
DOTNET_SKIP_FIRST_TIME_EXPERIENCE: 1
149+
DOTNET_MULTILEVEL_LOOKUP: 0
150+
queue:
151+
vmImage: macOS-10.15
152+
steps:
153+
# Work around MacOS Homebrew image/environment bug: https://github.com/actions/virtual-environments/issues/2322#issuecomment-749211076
154+
- script: |
155+
rm -rf /usr/local/bin/2to3
156+
displayName: MacOS Homebrew bug Workaround
157+
continueOnError: true
158+
- script: brew update && brew unlink [email protected] && brew install mono-libgdiplus && brew install libomp && brew link libomp --force
159+
displayName: Install build dependencies
160+
- script: ./restore.sh
161+
displayName: restore all projects
162+
- script: ./build.sh -configuration $(BuildConfig) /p:CopyPackageAssets=true /p:SkipRIDAgnosticAssets=true -projects $(Build.SourcesDirectory)/src/Redist/Microsoft.ML.DnnImageFeaturizer.ModelRedist/Microsoft.ML.DnnImageFeaturizer.ModelRedist.proj
163+
displayName: build redist
164+
# Only build native assets to avoid conflicts.
165+
- script: ./build.sh -projects $(Build.SourcesDirectory)/src/Native/Native.proj -configuration $(BuildConfig) /p:TargetArchitecture=arm64 /p:CopyPackageAssets=true
166+
displayName: Build Native Assets
67167

68168
- task: PublishBuildArtifacts@1
69169
displayName: Publish macOS package assets
@@ -107,7 +207,7 @@ phases:
107207
displayName: build redist
108208
# Only build native assets to avoid conflicts.
109209
- script: ./build.cmd -projects $(Build.SourcesDirectory)/src/Native/Native.proj -configuration $(BuildConfig) /p:TargetArchitecture=x86 /p:CopyPackageAssets=true
110-
displayName: Build
210+
displayName: Build Native Assets
111211

112212
- script: ./sign.cmd -configuration $(BuildConfig) /p:TargetArchitecture=x86 /p:SignBinaries=true
113213
displayName: sign binaries
@@ -181,10 +281,13 @@ phases:
181281
- phase: Package
182282
################################################################################
183283
dependsOn:
184-
- Linux
284+
- Linux_x64
285+
- Linux_arm
286+
- Linux_arm64
185287
- MacOS
186288
- Windows_x86
187289
- Windows_x64
290+
- MacOS_Apple_Silicon
188291
variables:
189292
BuildConfig: Release
190293
OfficialBuildId: $(BUILD.BUILDNUMBER)

eng/Versions.props

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@
7676
<MicrosoftBuildTasksCoreVersion>15.7.179</MicrosoftBuildTasksCoreVersion>
7777
<MicrosoftBuildUtilitiesCoreVersion>15.7.179</MicrosoftBuildUtilitiesCoreVersion>
7878
<MicrosoftCodeAnalysisAnalyzersVersion>2.6.3</MicrosoftCodeAnalysisAnalyzersVersion>
79-
<MicrosoftCodeAnalysisCSharpVersion>2.9.0</MicrosoftCodeAnalysisCSharpVersion>
79+
<MicrosoftCodeAnalysisCSharpVersion>3.7.0</MicrosoftCodeAnalysisCSharpVersion>
8080
<MsbuildTaskMicrosoftCodeAnalysisCSharpVersion>3.4.0</MsbuildTaskMicrosoftCodeAnalysisCSharpVersion>
8181
<MicrosoftIdentityModelClientsActiveDirectoryVersion>3.19.8</MicrosoftIdentityModelClientsActiveDirectoryVersion>
8282
<MicrosoftRestClientRuntimeVersion>2.3.13</MicrosoftRestClientRuntimeVersion>

0 commit comments

Comments
 (0)