ci: migrate macOS jobs to tart VM runner - #1335
Conversation
🎉 All green!🧪 All tests passed 🔗 Commit SHA: 98a5272 | Docs | Datadog PR Page | Give us feedback! |
There was a problem hiding this comment.
Pull request overview
Migrates the repository’s macOS GitLab CI workloads from dedicated macos:sonoma runners to macos:tart virtualized runners, pinning jobs to the repo-specific tart VM image to ensure consistent toolchains and isolation.
Changes:
- Switch macOS CI jobs to
macos:tartand pin the tart VM image fortest:*jobs and the benchmarksbuild-and-upload:appjob. - Update Android SDK install snippets to set
JAVA_HOMEand prepend the JDK toPATH(for SDK manager / tooling). - Update benchmarks secret retrieval to export AWS credentials in CI before Vault AWS auth.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
benchmarks/scripts/secrets/get-secret.sh |
Exports AWS credentials in CI prior to Vault AWS login. |
benchmarks/.benchmarks-ci.yml |
Moves benchmarks build job to tart runner + pinned VM image; updates Android SDK snippet JAVA env. |
.gitlab-ci.yml |
Moves all test:* macOS jobs to tart runner + pinned VM image; updates Android SDK snippet JAVA env. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
- Fix JAVA_HOME/install-jdk-17 ordering in test:native-android and build-and-upload:app so JDK 17 is installed before the Android SDK snippet relies on it - Centralize the duplicated tart VM image string into a TART_VM_IMAGE variable in .gitlab-ci.yml and benchmarks/.benchmarks-ci.yml - Check the exit status of `aws configure export-credentials` before eval'ing its output in get-secret.sh, instead of failing silently
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
The test:native-android job (and benchmarks build-and-upload:app) failed with "Unable to locate a Java Runtime" when running sdkmanager. Java 17 is installed in the tart VM image, but openjdk@17 is keg-only and the image only exports JAVA_HOME/PATH in ~/.zshrc — which the tart runner's non-interactive shell does not source. Export JAVA_HOME/PATH in the install-android-sdk snippet so sdkmanager can find Java. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
vault's aws auth does not honor AWS_EC2_METADATA_SERVICE_ENDPOINT on the tart VMs, so it cannot reach the IAM-proxy creds. The AWS CLI does; export the resolved creds so vault's credential chain picks them up. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
- Fix JAVA_HOME/install-jdk-17 ordering in test:native-android and build-and-upload:app so JDK 17 is installed before the Android SDK snippet relies on it - Centralize the duplicated tart VM image string into a TART_VM_IMAGE variable in .gitlab-ci.yml and benchmarks/.benchmarks-ci.yml - Check the exit status of `aws configure export-credentials` before eval'ing its output in get-secret.sh, instead of failing silently
07aaa09 to
98a5272
Compare
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 3 out of 3 changed files in this pull request and generated no new comments.
Suppressed comments (2)
.gitlab-ci.yml:34
install-android-sdkdownloadscommandlinetools.zipbut unzipscommandlinetools(missing the.zipsuffix). This will fail because the downloaded archive name doesn’t match the unzip target.
- export PATH="$JAVA_HOME/bin:$PATH"
- curl -sSL -o commandlinetools.zip https://dl.google.com/android/repository/$ANDROID_SDK_VERSION.zip
- rm -rf ~/android_sdk
- rm -rf ~/cmdline-tools
- unzip -q commandlinetools -d ~/
benchmarks/.benchmarks-ci.yml:45
install-android-sdkdownloadscommandlinetools.zipbut unzipscommandlinetools(missing the.zipsuffix). This will fail because the downloaded archive name doesn’t match the unzip target.
- export PATH="$JAVA_HOME/bin:$PATH"
- curl -sSL -o commandlinetools.zip https://dl.google.com/android/repository/$ANDROID_SDK_VERSION.zip
- rm -rf ~/android_sdk
- rm -rf ~/cmdline-tools
- unzip -q commandlinetools -d ~/
cdn34dd
left a comment
There was a problem hiding this comment.
For reference I've recently merged a PR to update the runners from Sonoma to Sequoia, and according to a comment on that same PR (https://github.com/ddoghq/ci-platform-machine-images/pull/840#issuecomment-5049995937) , Sequoia VMs are not yet supported. So unless something has changed in the mean time we should maybe delay this for a bit.
@cdn34dd ah, yes, we don't support sequoia vms just yet. I'm planning to upgrade the tart runners to support sequoia on VMs next week. I'll revisit this PR in a week or two then. |
Summary
Migrate the macOS GitLab CI jobs from dedicated
macos:sonoma/specific:truerunners to virtualizedmacos:tartrunners, using the repo-specific tart VM image (dd-sdk-reactnative-sonoma).Migrated jobs:
test:lint,test:js,test:build,test:native-android,test:native-ios,test:native-ios-sr,test:native-ios-newarch, andbuild-and-upload:app(benchmarks pipeline).VM image:
packer/macos-vm/team/dd-sdk-reactnative-sonoma.pkr.hcl→486234852809.dkr.ecr.us-east-1.amazonaws.com/ci/ci-platform-machine-images/tart-vm:dd-sdk-reactnative-sonoma-latestMotivation
The virtualized tart runners have a number of benefits over dedicated macOS runners:
mac2.metalhostmac2.metalhosts → cost reduction from needing fewer instancesChanges
.gitlab-ci.ymltest:*job tags frommacos:sonoma/specific:truetomacos:tartand pin the repo-specific tart VM imagebenchmarks/.benchmarks-ci.ymlbuild-and-upload:apptags tomacos:tartand pin the repo-specific tart VM imageTest plan
test:*jobs pass on the tart runnerbuild-and-upload:apppasses on the tart runner🤖 Generated with Claude Code
Passing build job
https://gitlab.ddbuild.io/DataDog/dd-sdk-reactnative/-/jobs/1871065405