Skip to content

Commit

Permalink
[devops] Unify and simplify provisionator provisioning. (#21268)
Browse files Browse the repository at this point in the history
This should speed up getting bots ready, since now we only run the
provisionator once for each bot, and we also don't try to provision the
same thing multiple times.
  • Loading branch information
rolfbjarne authored Sep 27, 2024
1 parent 3790cbd commit fc9d73b
Show file tree
Hide file tree
Showing 14 changed files with 142 additions and 297 deletions.
4 changes: 1 addition & 3 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,7 @@ tests/bcl-test/SystemCoreXunit*.csproj
tests/bcl-test/SystemXunit.csproj
global.json
.idea
device-tests-provisioning.csx
build-provisioning.csx
provision-xcode.csx
provision-shared.csx
mono_crash.*.json
*.binlog
.vscode
39 changes: 4 additions & 35 deletions tools/devops/Makefile
Original file line number Diff line number Diff line change
@@ -1,44 +1,13 @@
TOP=../..
include $(TOP)/Make.config

device-tests-provisioning.csx: device-tests-provisioning.csx.in Makefile $(TOP)/Make.config
$(Q_GEN) sed \
-e 's#@XCODE_XIP_NAME@#$(notdir $(XCODE_URL))#g' \
-e 's#@MONO_PACKAGE@#$(MIN_MONO_URL)#g' \
-e 's#@MIN_SHARPIE_URL@#$(MIN_SHARPIE_URL)#g' \
-e 's#@INCLUDE_MAC@#$(INCLUDE_MAC)#g' \
-e 's#@INCLUDE_IOS@#$(INCLUDE_IOS)#g' \
-e 's#@INCLUDE_TVOS@#$(INCLUDE_TVOS)#g' \
-e 's#@INCLUDE_WATCH@#$(INCLUDE_WATCH)#g' \
$< > $@;
@echo "Generated $@:"
@cat $@

build-provisioning.csx: build-provisioning.csx.in Makefile $(TOP)/Make.config
provision-shared.csx: provision-shared.in.csx Makefile $(TOP)/Make.config
$(Q_GEN) sed \
-e 's#@XCODE_XIP_NAME@#$(notdir $(XCODE_URL))#g' \
-e 's#@XCODE_ROOT_PATH@#$(XCODE_DEVELOPER_ROOT)#g' \
-e 's#@MONO_PACKAGE@#$(MIN_MONO_URL)#g' \
-e 's#@MIN_SHARPIE_URL@#$(MIN_SHARPIE_URL)#g' \
$< > $@;
@echo "Generated $@:"
@cat $@

mac-tests-provisioning.csx: mac-tests-provisioning.csx.in Makefile $(TOP)/Make.config
$(Q_GEN) sed \
-e 's#@MONO_PACKAGE@#$(MIN_MONO_URL)#g' \
-e 's#@INCLUDE_MAC@#$(INCLUDE_MAC)#g' \
-e 's#@INCLUDE_IOS@#$(INCLUDE_IOS)#g' \
$< > $@;
@echo "Generated $@:"
@cat $@

provision-xcode.csx: provision-xcode.csx.in Makefile $(TOP)/Make.config
$(Q_GEN) sed \
-e 's#@XCODE_XIP_NAME@#$(notdir $(XCODE_URL))#g' \
-e 's#@XCODE_ROOT_PATH@#$(XCODE_DEVELOPER_ROOT)#g' \
$< > $@;
@echo "Generated $@:"
@cat $@
$< > $@

LocProject.json: LocProject.json.in Makefile $(TOP)/Make.config
$(Q_GEN) sed \
Expand All @@ -65,4 +34,4 @@ print-variable:
print-variable-value-to-file:
@echo $($(VARIABLE)) > "$(FILE)"

provisioning: build-provisioning.csx device-tests-provisioning.csx provision-xcode.csx
provisioning: provision-shared.csx
12 changes: 1 addition & 11 deletions tools/devops/automation/templates/build/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -64,18 +64,8 @@ steps:
MacDeveloper: $(mac-developer)
HostedMacKeychainPassword: ${{ parameters.keyringPass }}

- task: xamops.azdevex.provisionator-task.provisionator@2
displayName: 'Provision Brew components'
inputs:
provisioning_script: $(Build.SourcesDirectory)/xamarin-macios/tools/devops/provision-brew-packages.csx
provisioning_extra_args: '-vvvv'
github_token: ${{ parameters.gitHubToken }}
timeoutInMinutes: 30
enabled: true
continueOnError: true # brew installation can be temperamental, and things usually work even if the installation fail.

- bash: |
make -C $(Build.SourcesDirectory)/xamarin-macios/tools/devops build-provisioning.csx
make -C $(Build.SourcesDirectory)/xamarin-macios/tools/devops provisioning
displayName: 'Generate provisionator files.'
- task: xamops.azdevex.provisionator-task.provisionator@2
Expand Down
16 changes: 2 additions & 14 deletions tools/devops/automation/templates/tests/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -220,7 +220,7 @@ steps:
timeoutInMinutes: 5

- bash: |
make -C $(System.DefaultWorkingDirectory)/xamarin-macios/tools/devops/ device-tests-provisioning.csx
make -C $(System.DefaultWorkingDirectory)/xamarin-macios/tools/devops/ provisioning
displayName: 'Generate Provisionator csx file'

# Executed ONLY if we want to clear the provisionator cache.
Expand All @@ -234,19 +234,7 @@ steps:
- task: xamops.azdevex.provisionator-task.provisionator@2
displayName: 'Provision dependencies'
inputs:
provisioning_script: $(System.DefaultWorkingDirectory)/xamarin-macios/tools/devops/device-tests-provisioning.csx
provisioning_extra_args: '-vvvv'
github_token: ${{ parameters.gitHubToken }}
timeoutInMinutes: 250

- bash: |
make -C $(System.DefaultWorkingDirectory)/xamarin-macios/tools/devops/ mac-tests-provisioning.csx
displayName: 'Generate Provisionator csx file for macOS'

- task: xamops.azdevex.provisionator-task.provisionator@2
displayName: 'Provision Xamarin.Mac'
inputs:
provisioning_script: $(Build.SourcesDirectory)/xamarin-macios/tools/devops/mac-tests-provisioning.csx
provisioning_script: $(System.DefaultWorkingDirectory)/xamarin-macios/tools/devops/build-provisioning.csx
provisioning_extra_args: '-vvvv'
github_token: ${{ parameters.gitHubToken }}
timeoutInMinutes: 250
Expand Down
2 changes: 1 addition & 1 deletion tools/devops/automation/templates/windows/reserve-mac.yml
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ steps:
$vsts.Agents.SetEnabled($pool, $agent, $False)
displayName: "Disable macOS bot from pool"

- bash: make -C $(Build.SourcesDirectory)/xamarin-macios/tools/devops provision-xcode.csx
- bash: make -C $(Build.SourcesDirectory)/xamarin-macios/tools/devops provisioning
displayName: 'Generate Xcode provisioning csx file'

- task: xamops.azdevex.provisionator-task.provisionator@2
Expand Down
8 changes: 8 additions & 0 deletions tools/devops/build-provisioning.csx
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
#load "provision-shared.csx"

if (!ProvisionXcode ())
return 1;
ProvisionMono ();
ProvisionSharpie ();
ProvisionBrewPackages ();
SetDefaultXcodeInVSMac ();
38 changes: 0 additions & 38 deletions tools/devops/build-provisioning.csx.in

This file was deleted.

15 changes: 0 additions & 15 deletions tools/devops/device-tests-provisioning.csx.in

This file was deleted.

34 changes: 0 additions & 34 deletions tools/devops/mac-tests-provisioning.csx.in

This file was deleted.

12 changes: 3 additions & 9 deletions tools/devops/provision-brew-packages.csx
Original file line number Diff line number Diff line change
@@ -1,9 +1,3 @@
BrewPackages (
"shellcheck",
"yamllint",
"cmake",
"p7zip",
"msitools",
"wget",
"azure-cli"
);
#load "provision-shared.csx"

ProvisionBrewPackages ();
103 changes: 0 additions & 103 deletions tools/devops/provision-shared.csx

This file was deleted.

Loading

10 comments on commit fc9d73b

@vs-mobiletools-engineering-service2
Copy link
Collaborator

Choose a reason for hiding this comment

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

📚 [CI Build] Artifacts 📚

Artifacts were not provided.

Pipeline on Agent
Hash: [CI build]

@vs-mobiletools-engineering-service2
Copy link
Collaborator

Choose a reason for hiding this comment

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

🔥 Failed to compare API and create generator diff 🔥

Error: 'make' failed for the hash 3790cbd.

Pipeline on Agent
Hash: fc9d73b76170631adeff5cc06d8ba73516e3bde6 [CI build]

@vs-mobiletools-engineering-service2
Copy link
Collaborator

Choose a reason for hiding this comment

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

💻 [CI Build] Windows Integration Tests passed 💻

All Windows Integration Tests passed.

Pipeline on Agent
Hash: fc9d73b76170631adeff5cc06d8ba73516e3bde6 [CI build]

@vs-mobiletools-engineering-service2
Copy link
Collaborator

Choose a reason for hiding this comment

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

💻 [CI Build] Windows Integration Tests passed 💻

All Windows Integration Tests passed.

Pipeline on Agent
Hash: fc9d73b76170631adeff5cc06d8ba73516e3bde6 [CI build]

@vs-mobiletools-engineering-service2
Copy link
Collaborator

Choose a reason for hiding this comment

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

💻 [CI Build] Tests on macOS X64 - Mac Sonoma (14) passed 💻

All tests on macOS X64 - Mac Sonoma (14) passed.

Pipeline on Agent
Hash: fc9d73b76170631adeff5cc06d8ba73516e3bde6 [CI build]

@vs-mobiletools-engineering-service2
Copy link
Collaborator

Choose a reason for hiding this comment

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

💻 [CI Build] Tests on macOS M1 - Mac Monterey (12) passed 💻

All tests on macOS M1 - Mac Monterey (12) passed.

Pipeline on Agent
Hash: fc9d73b76170631adeff5cc06d8ba73516e3bde6 [CI build]

@vs-mobiletools-engineering-service2
Copy link
Collaborator

Choose a reason for hiding this comment

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

💻 [CI Build] Tests on macOS M1 - Mac Ventura (13) passed 💻

All tests on macOS M1 - Mac Ventura (13) passed.

Pipeline on Agent
Hash: fc9d73b76170631adeff5cc06d8ba73516e3bde6 [CI build]

@vs-mobiletools-engineering-service2
Copy link
Collaborator

Choose a reason for hiding this comment

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

💻 [CI Build] Tests on macOS M1 - Mac Big Sur (11) passed 💻

All tests on macOS M1 - Mac Big Sur (11) passed.

Pipeline on Agent
Hash: fc9d73b76170631adeff5cc06d8ba73516e3bde6 [CI build]

@vs-mobiletools-engineering-service2
Copy link
Collaborator

Choose a reason for hiding this comment

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

🔥 [CI Build] Test results 🔥

Test results

❌ Tests failed on VSTS: test results

1 tests crashed, 0 tests failed, 90 tests passed.

Failures

❌ monotouch tests (MacCatalyst)

🔥 Failed catastrophically on VSTS: test results - monotouch_maccatalyst (no summary found).

Html Report (VSDrops) Download

Successes

✅ cecil: All 1 tests passed. Html Report (VSDrops) Download
✅ dotnettests (iOS): All 1 tests passed. Html Report (VSDrops) Download
✅ dotnettests (MacCatalyst): All 1 tests passed. Html Report (VSDrops) Download
✅ dotnettests (macOS): All 1 tests passed. Html Report (VSDrops) Download
✅ dotnettests (Multiple platforms): All 1 tests passed. Html Report (VSDrops) Download
✅ dotnettests (tvOS): All 1 tests passed. Html Report (VSDrops) Download
✅ framework: All 2 tests passed. Html Report (VSDrops) Download
✅ fsharp: All 4 tests passed. Html Report (VSDrops) Download
✅ generator: All 1 tests passed. Html Report (VSDrops) Download
✅ interdependent-binding-projects: All 4 tests passed. Html Report (VSDrops) Download
✅ introspection: All 4 tests passed. Html Report (VSDrops) Download
✅ linker: All 40 tests passed. Html Report (VSDrops) Download
✅ monotouch (iOS): All 7 tests passed. Html Report (VSDrops) Download
✅ monotouch (macOS): All 8 tests passed. Html Report (VSDrops) Download
✅ monotouch (tvOS): All 7 tests passed. Html Report (VSDrops) Download
✅ msbuild: All 2 tests passed. Html Report (VSDrops) Download
✅ xcframework: All 4 tests passed. Html Report (VSDrops) Download
✅ xtro: All 1 tests passed. Html Report (VSDrops) Download

Pipeline on Agent
Hash: fc9d73b76170631adeff5cc06d8ba73516e3bde6 [CI build]

@vs-mobiletools-engineering-service2
Copy link
Collaborator

Choose a reason for hiding this comment

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

🔥 [CI Build] Test results 🔥

Test results

❌ Tests failed on VSTS: test results

2 tests crashed, 0 tests failed, 56 tests passed.

Failures

❌ dotnettests tests (iOS)

🔥 Failed catastrophically on VSTS: test results - dotnettests_ios (no summary found).

Html Report (VSDrops) Download

❌ linker tests

🔥 Failed catastrophically on VSTS: test results - linker (no summary found).

Html Report (VSDrops) Download

Successes

✅ cecil: All 1 tests passed. Html Report (VSDrops) Download
✅ dotnettests (MacCatalyst): All 1 tests passed. Html Report (VSDrops) Download
✅ dotnettests (macOS): All 1 tests passed. Html Report (VSDrops) Download
✅ dotnettests (Multiple platforms): All 1 tests passed. Html Report (VSDrops) Download
✅ dotnettests (tvOS): All 1 tests passed. Html Report (VSDrops) Download
✅ framework: All 2 tests passed. Html Report (VSDrops) Download
✅ fsharp: All 4 tests passed. Html Report (VSDrops) Download
✅ generator: All 1 tests passed. Html Report (VSDrops) Download
✅ interdependent-binding-projects: All 4 tests passed. Html Report (VSDrops) Download
✅ introspection: All 4 tests passed. Html Report (VSDrops) Download
✅ monotouch (iOS): All 7 tests passed. Html Report (VSDrops) Download
✅ monotouch (MacCatalyst): All 7 tests passed. Html Report (VSDrops) Download
✅ monotouch (macOS): All 8 tests passed. Html Report (VSDrops) Download
✅ monotouch (tvOS): All 7 tests passed. Html Report (VSDrops) Download
✅ msbuild: All 2 tests passed. Html Report (VSDrops) Download
✅ xcframework: All 4 tests passed. Html Report (VSDrops) Download
✅ xtro: All 1 tests passed. Html Report (VSDrops) Download

Pipeline on Agent
Hash: fc9d73b76170631adeff5cc06d8ba73516e3bde6 [CI build]

Please sign in to comment.