Skip to content

Commit f6cacdd

Browse files
authored
Merge pull request #2101 from crummel/rhelMatrix
Add ARM64 RHEL to CI matrix
2 parents a7824be + 2e82277 commit f6cacdd

13 files changed

+240
-24
lines changed

.vsts.pipelines/builds/matrix.yml

+23
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,7 @@ stages:
5353
name: debian9
5454
jobParameters:
5555
imageName: mcr.microsoft.com/dotnet-buildtools/prereqs:debian-stretch-d61254f-20190807161114
56+
cleanAptGet: true
5657
matrix:
5758
Production: {}
5859
Online: { type: Online }
@@ -75,6 +76,7 @@ stages:
7576
name: ubuntu1804
7677
jobParameters:
7778
imageName: mcr.microsoft.com/dotnet-buildtools/prereqs:ubuntu-18.04-20200918145614-047508b
79+
cleanAptGet: true
7880

7981
- template: ../stages/stage-jobs-matrix.yml
8082
parameters:
@@ -86,6 +88,8 @@ stages:
8688
scriptPrefix: ./
8789
scriptSuffix: .sh
8890
setupMac: true
91+
matrix:
92+
Production: {}
8993

9094
# Prepare artifacts in all situations but public PR validation.
9195
- ${{ if not(and(eq(variables['System.TeamProject'], 'public'), in(variables['Build.Reason'], 'PullRequest'))) }}:
@@ -97,4 +101,23 @@ stages:
97101
- job: centos8_Offline
98102
- job: debian9_Online
99103
- job: fedora30_Offline
104+
- job: rhel8_arm64_Offline
100105
gatherPortableJob: centos71_Offline_Portable
106+
107+
# RHEL builds only internal
108+
- ${{ if not(and(eq(variables['System.TeamProject'], 'public'), in(variables['Build.Reason'], 'PullRequest'))) }}:
109+
- template: ../stages/stage-jobs-matrix.yml
110+
parameters:
111+
jobTemplateName: ../jobs/ci-local.yml
112+
name: rhel8_arm64
113+
jobParameters:
114+
pool:
115+
name: DotNet-SourceBuild-Internal
116+
demands:
117+
- Agent.OSArchitecture -equals ARM64
118+
- rhel -equals 8
119+
scriptPrefix: ./
120+
scriptSuffix: .sh
121+
matrix:
122+
Production: {}
123+
Offline: { type: Offline }

.vsts.pipelines/jobs/ci-linux.yml

+3
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ parameters:
66
reportPrebuiltLeaks: false
77
generatePrebuiltBurndown: false
88
runUnitTests: false
9+
cleanAptGet: false
910

1011
jobs:
1112
- job: ${{ parameters.job }}
@@ -51,6 +52,8 @@ jobs:
5152
5253
steps:
5354
- template: ../steps/cleanup-unneeded-files.yml
55+
parameters:
56+
cleanAptGet: ${{ parameters.cleanAptGet }}
5457
- template: ../steps/docker-cleanup-linux.yml
5558
- template: ../steps/calculate-config-flags.yml
5659

.vsts.pipelines/jobs/ci-linux_bootstrap.yml

+3
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ parameters:
33
pool:
44
name: Hosted Ubuntu 1604
55
imageName: null
6+
cleanAptGet: false
67

78
jobs:
89
- job: ${{ parameters.job }}
@@ -30,6 +31,8 @@ jobs:
3031

3132
steps:
3233
- template: ../steps/cleanup-unneeded-files.yml
34+
parameters:
35+
cleanAptGet: ${{ parameters.cleanAptGet }}
3336
- template: ../steps/docker-cleanup-linux.yml
3437

3538
- task: DownloadBuildArtifacts@0

.vsts.pipelines/jobs/ci-local.yml

+155-10
Original file line numberDiff line numberDiff line change
@@ -1,43 +1,51 @@
11
parameters:
22
job: null
3-
matrix:
4-
Production: {}
53
pool: null
64
scriptPrefix: null
75
scriptSuffix: null
86
setupMac: false
97
setupWindows: false
108
skipSmokeTest: false
119
failOnPrebuiltBaselineError: true
10+
reportPrebuiltLeaks: false
11+
generatePrebuiltBurndown: false
12+
runUnitTests: false
13+
cleanAptGet: false
1214

1315
jobs:
1416
- job: ${{ parameters.job }}
15-
strategy:
16-
matrix: ${{ parameters.matrix }}
1717
pool: ${{ parameters.pool }}
18-
timeoutInMinutes: 240
18+
timeoutInMinutes: 300
1919
variables:
20+
rootDirectory: $(Build.SourcesDirectory)/..
21+
tarballDirectory: $(rootDirectory)/tb
22+
stagingDirectory: $(rootDirectory)/staging
23+
dropDirectory: $(stagingDirectory)/drop
24+
logsDirectory: $(Build.ArtifactStagingDirectory)/logs
25+
tarballName: tarball_$(Build.BuildId)
2026
args.build: >-
2127
/p:Configuration=$(sb.configuration)
2228
/p:PortableBuild=$(sb.portable)
2329
/p:FailOnPrebuiltBaselineError=$(failOnPrebuiltBaselineError)
2430
/p:ProdConBlobFeedUrlPrefix=$(prodConBlobFeedUrlPrefix)
2531
/p:AzDoPat=$(System.AccessToken)
32+
/p:ArchiveDownloadedPackages=$(sb.tarball)
2633
$(tarballDownloadArgs)
2734
args.smokeTest: >
2835
--run-smoke-test
2936
/p:Configuration=$(sb.configuration)
3037
/p:ProdConBlobFeedUrlPrefix=$(prodConBlobFeedUrlPrefix)
3138
# Prefix to distinguish artifacts from different legs.
32-
artifactName: ${{ format('{0} $(type)', parameters.job) }}
39+
artifactName: ${{ parameters.job }}
3340
failOnPrebuiltBaselineError: ${{ parameters.failOnPrebuiltBaselineError }}
34-
logsDirectory: $(Build.ArtifactStagingDirectory)/logs
41+
reportPrebuiltLeaks: ${{ parameters.reportPrebuiltLeaks }}
42+
systemLibunwind: ${{ parameters.systemLibunwind }}
3543
tarballDownloadArgs: >-
36-
/p:SkipDownloadingReferencePackages=true
37-
/p:SkipDownloadingPreviouslySourceBuiltPackages=true
44+
/p:DownloadSourceBuildReferencePackagesTimeoutSeconds=600
45+
/p:DownloadSourceBuiltArtifactsTimeoutSeconds=1500
3846
SOURCE_BUILD_SKIP_SUBMODULE_CHECK: true
3947
# Default type, can be overridden by matrix legs.
40-
type: Production
48+
type: ${{ coalesce(parameters.type, 'Production') }}
4149

4250
${{ if not(and(ne(variables['System.TeamProject'], 'public'), notin(variables['Build.Reason'], 'PullRequest'))) }}:
4351
SetInternalPackageFeedPatBashCommand: ''
@@ -53,6 +61,9 @@ jobs:
5361
clean: true
5462

5563
- template: ../steps/cleanup-unneeded-files.yml
64+
parameters:
65+
cleanAptGet: ${{ parameters.cleanAptGet }}
66+
- template: ../steps/calculate-config-flags.yml
5667

5768
# Make sure submodules from other branches are removed: pass extra f.
5869
- script: git clean -xdff
@@ -95,6 +106,125 @@ jobs:
95106
${{ format('{0}build{1} $(args.smokeTest)', parameters.scriptPrefix, parameters.scriptSuffix) }}
96107
displayName: Run smoke-test
97108
109+
# Create tarball.
110+
- script: |
111+
set -ex
112+
df -h
113+
args="--skip-prebuilt-check --skip-build --minimize-disk-usage"
114+
if [ "$(reportPrebuiltLeaks)" = "true" ]; then
115+
args="$args --enable-leak-detection"
116+
fi
117+
./build-source-tarball.sh \
118+
"$(tarballDirectory)/$(tarballName)" \
119+
$args
120+
du -h $(rootDirectory) | sort -h | tail -n 50
121+
displayName: Create tarball
122+
condition: and(succeeded(), eq(variables['sb.tarball'], true))
123+
124+
# Copy logs from the production build
125+
- bash: |
126+
set -ex
127+
df -h
128+
mkdir -p "$(logsDirectory)"
129+
find . \( \
130+
-path './artifacts/*-report/*' -o \
131+
-path './artifacts/msbuild-debug/*' -o \
132+
-path './artifacts/roslyn-debug/*' -o \
133+
-path './artifacts/aspnet-debug/*' -o \
134+
-iname '*.binlog' -o \
135+
-iname '*.log' \) \
136+
-exec cp {} --parents "$(logsDirectory)" \;
137+
du -h $(rootDirectory) | sort -h | tail -n 50
138+
displayName: Copy source-build production build logs
139+
condition: always()
140+
continueOnError: true
141+
142+
# Delete key directories from local copy of repo to save space
143+
- bash: |
144+
set -ex
145+
df -h
146+
sudo rm -rf $(rootDirectory)/source-build/artifacts/src
147+
sudo rm -rf $(rootDirectory)/source-build/artifacts/obj
148+
sudo rm -rf $(rootDirectory)/source-build/.git
149+
sudo rm -rf $(rootDirectory)/source-build/packages
150+
du -h $(rootDirectory) | sort -h | tail -n 50
151+
displayName: Delete key directories from source copy of repo to save space
152+
153+
# tar the tarball directory into the drop directory.
154+
- bash: |
155+
set -ex
156+
df -h
157+
mkdir -p $(dropDirectory)/tarball/
158+
smokeTestPackages="$(tarballDirectory)/$(tarballName)/packages/smoke-test-packages"
159+
# smokeTestPackages is a package cache, with redundant data and unnecessary structure. E.g.
160+
# $smokeTestPackages/name/version/name.version.nupkg <- We want this.
161+
# $smokeTestPackages/name/version/lib/net46/name.dll <- This is already in the nupkg.
162+
# This find moves the nupkg files into $smokeTestPackages:
163+
find "$smokeTestPackages" -iname "*.nupkg" -exec mv {} "$smokeTestPackages" \;
164+
# This find removes all non-nupkg files, which are not wanted:
165+
find "$smokeTestPackages" -mindepth 1 -not -iname "*.nupkg" -delete
166+
# Make one .tar.gz for build, another for extras necessary to smoke test:
167+
tar --numeric-owner "--exclude=$smokeTestPackages" -zcf "$(dropDirectory)/tarball/$(tarballName).tar.gz" -C "$(tarballDirectory)" "$(tarballDirectory)/$(tarballName)"
168+
tar --numeric-owner -zcf "$(dropDirectory)/tarball/$(tarballName)-smoke-test-prereqs.tar.gz" "$smokeTestPackages"
169+
du -h $(rootDirectory) | sort -h | tail -n 50
170+
displayName: Copy tarball to output
171+
condition: and(succeeded(), eq(variables['sb.tarball'], true))
172+
173+
# Build tarball.
174+
- script: |
175+
set -ex
176+
df -h
177+
networkArg=
178+
if [ "$(sb.tarballOffline)" = "true" ]; then
179+
networkArg="sudo unshare -n"
180+
fi
181+
poisonArg=
182+
if [ "$(reportPrebuiltLeaks)" = "true" ]; then
183+
poisonArg="/p:EnablePoison=true"
184+
fi
185+
$networkArg "$(tarballDirectory)/$(tarballName)/build.sh" -- \
186+
/p:Configuration=$(sb.configuration) \
187+
/p:PortableBuild=$(sb.portable) \
188+
/p:UseSystemLibunwind=$(systemLibunwind) \
189+
/p:FailOnPrebuiltBaselineError=true \
190+
$poisonArg
191+
du -h $(rootDirectory) | sort -h | tail -n 50
192+
displayName: Build tarball
193+
timeoutInMinutes: 150
194+
condition: and(succeeded(), eq(variables['sb.tarball'], true))
195+
196+
# Run smoke tests.
197+
- script: |
198+
set -ex
199+
df -h
200+
sudo chown -R "$(id -u):$(id -g)" "$(tarballDirectory)/$(tarballName)"
201+
"$(tarballDirectory)/$(tarballName)/smoke-test.sh" \
202+
--minimal \
203+
--projectOutput \
204+
--configuration $(sb.configuration)
205+
du -h $(rootDirectory) | sort -h | tail -n 50
206+
displayName: Run smoke-test in tarball
207+
condition: and(succeeded(), eq(variables['sb.tarball'], true))
208+
209+
- script: df -h
210+
displayName: Check space (df -h)
211+
condition: always()
212+
continueOnError: true
213+
214+
# Copy source-built artifacts tarball to drop directory.
215+
- bash: |
216+
set -ex
217+
df -h
218+
mkdir -p "$(dropDirectory)/tarball/"
219+
cd "$(tarballDirectory)/$(tarballName)"
220+
find ./artifacts \( \
221+
-iname 'Private.SourceBuilt.Artifacts*.tar.gz' \) \
222+
-exec cp {} "$(dropDirectory)/tarball/" \;
223+
du -h $(rootDirectory) | sort -h | tail -n 50
224+
displayName: Copy source-built artifacts tarball
225+
condition: eq(variables['sb.tarball'], true)
226+
continueOnError: true
227+
98228
# Gather artifacts. Uses git bash on Windows.
99229
- bash: |
100230
set -ex
@@ -128,3 +258,18 @@ jobs:
128258
PathtoPublish: $(logsDirectory)
129259
ArtifactName: Logs $(artifactName)
130260
ArtifactType: Container
261+
- task: PublishBuildArtifacts@1
262+
displayName: Publish Tarball artifact
263+
condition: eq(variables['sb.tarball'], true)
264+
continueOnError: true
265+
inputs:
266+
PathtoPublish: $(dropDirectory)/tarball
267+
ArtifactName: Tarball $(artifactName)
268+
ArtifactType: Container
269+
270+
- bash: |
271+
set -ex
272+
rm -rf "$(tarballDirectory)" "$(stagingDirectory)" "$(dropDirectory)" "$(logsDirectory)"
273+
displayName: Cleanup extra staging directories
274+
condition: always()
275+
continueOnError: true

.vsts.pipelines/steps/cleanup-unneeded-files.yml

+6-1
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,15 @@
11
# Delete some files from the default image since we're tight on disk space.
22
# List is from https://github.com/microsoft/azure-pipelines-image-generation/pull/1231#issuecomment-537174621
33

4+
parameters:
5+
- name: cleanAptGet
6+
type: boolean
7+
default: false
8+
49
steps:
510
- script: sudo apt-get clean
611
displayName: Clean apt-get cache
7-
condition: ne(variables['Agent.OS'], 'Darwin')
12+
condition: ${{ eq(parameters.cleanAptGet, true) }}
813
continueOnError: true
914

1015
- script: sudo rm -rf /usr/local/lib/android

Directory.Build.props

+2-2
Original file line numberDiff line numberDiff line change
@@ -133,8 +133,8 @@
133133
<AspNetRazorBuildServerLogDir>$(BaseOutputPath)aspnet-debug</AspNetRazorBuildServerLogDir>
134134
<AspNetRazorBuildServerLogFile>$(AspNetRazorBuildServerLogDir)razor-build-server.log</AspNetRazorBuildServerLogFile>
135135
<IlasmPath Condition="'$(OfflineBuild)' != 'true'">invalid: ILAsm is not expected to be needed in the online build</IlasmPath>
136-
<IlasmPath Condition="'$(OfflineBuild)' == 'true'">$(PrebuiltSourceBuiltPackagesPath)coreclr-tools/ilasm</IlasmPath>
137-
<IldasmPath Condition="'$(OfflineBuild)' != 'true'">$(ToolPackageExtractDir)coreclr-tools/ildasm</IldasmPath>
136+
<IlasmPath Condition="'$(OfflineBuild)' == 'true'">$(PrebuiltSourceBuiltPackagesPath)coreclr-tools/$(BuildArchitecture)/ilasm</IlasmPath>
137+
<IldasmPath Condition="'$(OfflineBuild)' != 'true'">$(ToolPackageExtractDir)coreclr-tools/$(BuildArchitecture)/ildasm</IldasmPath>
138138
<IldasmPath Condition="'$(OfflineBuild)' == 'true'">invalid: ILDasm is not expected to be needed in the offline build</IldasmPath>
139139
<!-- Dir where git info is generated during online builds. -->
140140
<GitInfoOutputDir>$(BaseOutputPath)git-info/</GitInfoOutputDir>

build-source-tarball.sh

+10-2
Original file line numberDiff line numberDiff line change
@@ -108,13 +108,21 @@ if [ $MINIMIZE_DISK_USAGE -eq 1 ]; then
108108
sleep 10
109109
fi
110110

111-
export FULL_TARBALL_ROOT=$(readlink -f $TARBALL_ROOT)
111+
export SCRIPT_ROOT="$(cd -P "$( dirname "$0" )" && pwd)"
112+
fullTarballRoot="$TARBALL_ROOT"
113+
while [[ -h $fullTarballRoot ]]; do
114+
fullTarballRoot="$(readlink "$fullTarballRoot")"
115+
116+
# if $source was a relative symlink, we need to resolve it relative to the path where the
117+
# symlink file was located
118+
[[ $fullTarballRoot != /* ]] && fullTarballRoot="$SCRIPT_ROOT/$fullTarballRoot"
119+
done
120+
export FULL_TARBALL_ROOT="$fullTarballRoot"
112121

113122
if [ -e "$TARBALL_ROOT" ]; then
114123
echo "info: '$TARBALL_ROOT' already exists"
115124
fi
116125

117-
export SCRIPT_ROOT="$(cd -P "$( dirname "$0" )" && pwd)"
118126
if [ -d "$CUSTOM_SDK_DIR" ]; then
119127
export SDK_VERSION=`"$CUSTOM_SDK_DIR/dotnet" --version`
120128
echo "Using custom bootstrap SDK from '$CUSTOM_SDK_DIR', version $SDK_VERSION"

eng/Versions.props

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,6 @@
88
<!-- Production Dependencies -->
99
<PropertyGroup>
1010
<PrivateSourceBuildReferencePackagesPackageVersion>1.0.0-beta.20374.1</PrivateSourceBuildReferencePackagesPackageVersion>
11-
<PrivateSourceBuiltArtifactsPackageVersion>0.1.0-3.1.112</PrivateSourceBuiltArtifactsPackageVersion>
11+
<PrivateSourceBuiltArtifactsPackageVersion>0.1.0-3.1.113.3</PrivateSourceBuiltArtifactsPackageVersion>
1212
</PropertyGroup>
1313
</Project>

repos/Directory.Build.targets

+3
Original file line numberDiff line numberDiff line change
@@ -174,6 +174,9 @@
174174
<LegacyFeedMapping
175175
Include="https://dotnet.myget.org/F/dotnet-buildtools/api/v3/index.json"
176176
NewFeed="https://pkgs.dev.azure.com/dnceng/public/_packaging/myget-legacy/nuget/v3/index.json" />
177+
<LegacyFeedMapping
178+
Include="https://dotnet.myget.org/F/nuget-volatile/api/v3/index.json"
179+
NewFeed="https://pkgs.dev.azure.com/dnceng/public/_packaging/myget-legacy/nuget/v3/index.json" />
177180
</ItemGroup>
178181

179182
<ReplaceFeedsInNugetConfig InputFile="%(NuGetConfigFiles.Identity)"

repos/coreclr-portable.proj

+1-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
Inputs="$(MSBuildProjectFullPath)"
2020
Outputs="$(RepoCompletedSemaphorePath)CopyTools.complete">
2121
<PropertyGroup>
22-
<CoreClrDestinationDir>$(ToolPackageExtractDir)coreclr-tools</CoreClrDestinationDir>
22+
<CoreClrDestinationDir>$(ToolPackageExtractDir)coreclr-tools/$(BuildArchitecture)</CoreClrDestinationDir>
2323
<AssemblyExtension Condition="'$(TargetOS)' == 'Linux'">so</AssemblyExtension>
2424
<AssemblyExtension Condition="'$(TargetOS)' == 'FreeBSD'">so</AssemblyExtension>
2525
<AssemblyExtension Condition="'$(TargetOS)' == 'OSX'">dylib</AssemblyExtension>

0 commit comments

Comments
 (0)