Skip to content

Commit 1b71da0

Browse files
authored
[ci] Use new 1ES Hosted Ubuntu Pools (#6061)
Context: https://www.1eswiki.com/wiki/1ES_hosted_AzureDevOps_Agents We've been tasked with migrating away from our scale set agent pools to a new 1ES service. There are a couple of benefits to using 1ES agent pools. We should now be able to use customizable versions of the [Microsoft-hosted agent images][0] which come preloaded with some of our dependencies. These images are also updated regularly which should hopefully reduce maintenance costs. Overall, the process for creating, updating, and rolling out image changes to our scale set agent pools should now be dramatically simplified over [the existing workflow][1]. Our internal and OSS Linux builds will now use the same Ubuntu 20.04 base image, so setup tasks can be shared. A couple of workarounds have been added to avoid some open issues in these new images. [0]: https://docs.microsoft.com/en-us/azure/devops/pipelines/agents/hosted?view=azure-devops&tabs=yaml [1]: https://github.com/xamarin/monodroid/wiki/Azure-Pipelines-and-DevOps#windows-scale-set-agent-pool-management
1 parent 24f272b commit 1b71da0

File tree

4 files changed

+31
-50
lines changed

4 files changed

+31
-50
lines changed

build-tools/automation/azure-pipelines-oss.yaml

Lines changed: 2 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -163,7 +163,7 @@ stages:
163163
jobs:
164164
- job: linux_build_package
165165
displayName: Linux Build
166-
pool: Xamarin-Android-Ubuntu-Public
166+
pool: android-public-ubuntu-vmss
167167
timeoutInMinutes: 180
168168
cancelTimeoutInMinutes: 5
169169
workspace:
@@ -172,36 +172,7 @@ stages:
172172
- checkout: self
173173
submodules: recursive
174174

175-
- template: yaml-templates/use-dot-net.yaml
176-
177-
- template: yaml-templates/use-dot-net.yaml
178-
parameters:
179-
version: $(DotNetCoreVersion)
180-
181-
- task: NuGetToolInstaller@1
182-
displayName: 'Use NuGet 5.x'
183-
inputs:
184-
versionSpec: 5.x
185-
186-
- script: >
187-
sudo apt remove -y --purge --auto-remove mono-devel &&
188-
sudo apt install -y gnupg ca-certificates &&
189-
sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 3FA7E0328081BFF6A14DA29AA6A19B38D3D831EF &&
190-
(echo "deb https://download.mono-project.com/repo/ubuntu preview-bionic main" | sudo tee /etc/apt/sources.list.d/mono-official-preview.list) &&
191-
sudo apt update &&
192-
sudo apt install -y mono-devel
193-
displayName: install mono preview
194-
195-
- script: >
196-
sudo apt remove -y --purge --auto-remove cmake &&
197-
wget -O - https://apt.kitware.com/keys/kitware-archive-latest.asc 2>/dev/null | gpg --dearmor - | sudo tee /etc/apt/trusted.gpg.d/kitware.gpg >/dev/null &&
198-
sudo apt-add-repository 'deb https://apt.kitware.com/ubuntu/ bionic main' &&
199-
sudo apt-get update &&
200-
sudo apt install -y cmake
201-
displayName: install updated version of cmake
202-
203-
- script: echo "##vso[task.setvariable variable=PATH]$PATH:$HOME/android-toolchain/$(XA.Jdk11.Folder)/bin"
204-
displayName: append jdk tools to PATH
175+
- template: yaml-templates/setup-ubuntu.yaml
205176

206177
- script: make jenkins V=1 PREPARE_CI_PR=1 PREPARE_AUTOPROVISION=1 CONFIGURATION=$(XA.Build.Configuration)
207178
displayName: make jenkins

build-tools/automation/azure-pipelines.yaml

Lines changed: 2 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -401,7 +401,7 @@ stages:
401401
jobs:
402402
- job: linux_build_test
403403
displayName: Build and Smoke Test
404-
pool: Xamarin-Android-Ubuntu20.04
404+
pool: android-devdiv-ubuntu-vmss
405405
timeoutInMinutes: 240
406406
cancelTimeoutInMinutes: 2
407407
workspace:
@@ -421,30 +421,13 @@ stages:
421421
workingDirectory: $(System.DefaultWorkingDirectory)/xamarin-android
422422
displayName: delete external xamarin-android submodule
423423

424-
- template: yaml-templates/use-dot-net.yaml
425-
426-
- template: yaml-templates/use-dot-net.yaml
427-
parameters:
428-
version: $(DotNetCoreVersion)
424+
- template: yaml-templates/setup-ubuntu.yaml
429425

430426
- task: NuGetAuthenticate@0
431427
displayName: authenticate with azure artifacts
432428
inputs:
433429
forceReinstallCredentialProvider: true
434430

435-
- script: >
436-
sudo apt remove -y --purge --auto-remove mono-complete &&
437-
sudo apt remove -y --purge --auto-remove mono-devel &&
438-
sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 3FA7E0328081BFF6A14DA29AA6A19B38D3D831EF &&
439-
echo "deb https://download.mono-project.com/repo/ubuntu preview-focal main" | sudo tee /etc/apt/sources.list.d/mono-official-preview.list &&
440-
sudo apt update &&
441-
sudo apt install -y mono-devel
442-
displayName: install mono preview
443-
444-
- task: NuGetToolInstaller@0
445-
inputs:
446-
versionSpec: 5.x
447-
448431
- script: make prepare-external-git-dependencies PREPARE_CI=1 CONFIGURATION=$(XA.Build.Configuration)
449432
workingDirectory: $(System.DefaultWorkingDirectory)/xamarin-android
450433
displayName: make prepare-external-git-dependencies
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
steps:
2+
- template: use-dot-net.yaml
3+
4+
- template: use-dot-net.yaml
5+
parameters:
6+
version: $(DotNetCoreVersion)
7+
8+
- script: sudo rm /etc/apt/sources.list.d/treasure-data.list || true
9+
displayName: remove invalid treasure-data source
10+
11+
- script: >
12+
sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 3FA7E0328081BFF6A14DA29AA6A19B38D3D831EF &&
13+
echo "deb https://download.mono-project.com/repo/ubuntu preview-focal main" | sudo tee /etc/apt/sources.list.d/mono-official-preview.list &&
14+
sudo apt update &&
15+
sudo apt install -y --no-install-recommends mono-complete nuget msbuild
16+
displayName: install mono preview
17+
18+
- task: NuGetToolInstaller@1
19+
displayName: Use NuGet 5.x
20+
inputs:
21+
versionSpec: 5.x
22+
23+
- script: echo "##vso[task.setvariable variable=XDG_CONFIG_HOME]$HOME/.config"
24+
displayName: update XDG_CONFIG_HOME

build-tools/debian-metadata/rules

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ override_dh_install:
2222
rm -f bin/*/lib/xamarin.android/xbuild/Xamarin/Android/aapt2.exe
2323
rm -f bin/*/lib/xamarin.android/xbuild/Xamarin/Android/libwinpthread-1.dll
2424
rm -f bin/*/lib/xamarin.android/xbuild/Xamarin/Android/libZipSharpNative.dll
25+
rm -f bin/*/lib/xamarin.android/xbuild/Xamarin/Android/runtimes/*/libMono.Unix.so
2526

2627
dh_install
2728

@@ -40,7 +41,9 @@ override_dh_clideps:
4041
--exclude-moduleref=libfam.so.0 \
4142
--exclude-moduleref=libgamin-1.so.0 \
4243
--exclude-moduleref=libmono-btls-shared \
44+
--exclude-moduleref=libZipSharpNative \
4345
--exclude-moduleref=lzo.dll \
46+
--exclude-moduleref=Microsoft.VisualStudio.Setup.Configuration.Native.dll \
4447
--exclude-moduleref=mscoree.dll \
4548
--exclude-moduleref=mscorwks.dll \
4649
--exclude-moduleref=msvcrt \

0 commit comments

Comments
 (0)