Compare commits

...
21 Commits
Author SHA1 Message Date
Fedor Korotkov 24ff639c4d Update .cirrus.yml
Don't build runner on beta
2024-08-12 16:06:31 -04:00
Fedor Korotkov 0be36e7056 Update .cirrus.yml 2024-08-12 15:31:28 -04:00
Fedor Korotkov ed0b1e4c15 sequoia 15.1 beta 2 2024-08-12 15:30:03 -04:00
Fedor Korotkov 489255bec4 Sonoma 14.6.1 (#170) 2024-08-07 14:12:46 -04:00
fedor 92c70a2e79 Proper Tags 2024-07-30 15:22:35 -04:00
fedor 5de5e0997b Sonoma 14.6 and Sequoia 15.1 2024-07-30 15:21:21 -04:00
Fedor Korotkov 127683c285 Sequoia Beta 3 (#166) 2024-07-11 09:36:31 -04:00
leavesster 98a8ed97a4 Update README.md (#165) 2024-07-05 22:06:22 -04:00
Fedor Korotkov 3d76cfe25e Do not use Sequoia hosts
Fixes https://github.com/cirruslabs/tart/issues/851
2024-07-01 11:31:47 -04:00
Fedor Korotkov 4a45e89e9f Update .cirrus.yml 2024-06-28 15:34:57 -04:00
Fedor Korotkov f887c42ab1 Don't use experimental yet 2024-06-28 15:20:03 -04:00
Fedor Korotkov cabda00d2a Sequoia Beta 2 (#164) 2024-06-24 15:45:08 -04:00
Fedor Korotkov 118270dd45 Use dev-mini-experimental for Sequoia images (#163) 2024-06-24 09:09:43 -04:00
fedor c80a91a5bf Longer SSH timeout 2024-06-17 16:14:12 -04:00
fedor da6beb5b44 Account for an extra screen and long user creation 2024-06-17 15:44:35 -04:00
Fedor Korotkov 7a36c811f9 macOS Sequoia (#161)
* macOS Sequoia

* Sequoia cadence and base/xcode variants
2024-06-17 10:56:57 -04:00
Fedor Korotkov 07be5a66be Update xcode.pkr.hcl 2024-06-10 16:42:24 -04:00
Fedor Korotkov 61f4dee507 Guarantee runner variant to have 100GB free disk space (#159)
Some of the clients require it and hence we use sparsed files it won't be actually 250GB images.
2024-06-05 08:37:35 -04:00
Fedor Korotkov fbcbf4cbfe Align Xcode location with GHA images (#157) 2024-05-17 16:59:24 -04:00
Fedor Korotkov c90679131d Install yq (#156)
fixes #155
2024-05-16 11:21:21 -04:00
Fedor Korotkov c9a92d7a31 Bump runner disk size
Due to all three latest Xcode have different version of simulators
2024-05-14 06:14:33 -04:00
6 changed files with 191 additions and 33 deletions
+29 -16
View File
@@ -21,7 +21,7 @@ defaults: &defaults
- packer --version
task:
name: "Update Vanilla Images"
name: "Update Vanilla Sonoma Image"
only_if: $CIRRUS_BRANCH == $CIRRUS_DEFAULT_BRANCH && changesInclude("templates/vanilla-sonoma.pkr.hcl")
<<: *defaults
build_script:
@@ -30,18 +30,35 @@ task:
disable_sip_script:
- packer build -var vm_name=sonoma-vanilla templates/disable-sip.pkr.hcl
push_script:
- tart push sonoma-vanilla ghcr.io/cirruslabs/macos-sonoma-vanilla:latest ghcr.io/cirruslabs/macos-sonoma-vanilla:14.4.1
- tart push sonoma-vanilla ghcr.io/cirruslabs/macos-sonoma-vanilla:latest ghcr.io/cirruslabs/macos-sonoma-vanilla:14.6
always:
cleanup_script:
- tart delete sonoma-vanilla
task:
name: "Update Vanilla Sequoia Image"
persistent_worker:
labels:
name: dev-mini-experimental
only_if: $CIRRUS_BRANCH == $CIRRUS_DEFAULT_BRANCH && changesInclude("templates/vanilla-sequoia.pkr.hcl")
<<: *defaults
build_script:
- packer init templates/vanilla-sequoia.pkr.hcl
- packer build templates/vanilla-sequoia.pkr.hcl
disable_sip_script:
- packer build -var vm_name=sequoia-vanilla templates/disable-sip.pkr.hcl
push_script:
- tart push sequoia-vanilla ghcr.io/cirruslabs/macos-sequoia-vanilla:latest ghcr.io/cirruslabs/macos-sequoia-vanilla:15.1 ghcr.io/cirruslabs/macos-sequoia-vanilla:15.1-beta-2
always:
cleanup_script:
- tart delete sequoia-vanilla
task:
name: "Update Base Images ($MACOS_VERSION)"
alias: update-base
env:
matrix:
MACOS_VERSION: sonoma
MACOS_VERSION: ventura
matrix:
- env:
MACOS_VERSION: sonoma
only_if: $CIRRUS_CRON == "monthly"
<<: *defaults
pull_vanilla_script:
@@ -68,11 +85,6 @@ task:
XCODE_VERSION: 15.3
- MACOS_VERSION: sonoma
XCODE_VERSION: 15.2
- MACOS_VERSION: ventura
XCODE_VERSION: 14.3.1
LATEST: true
- MACOS_VERSION: ventura
XCODE_VERSION: 14.2
<<: *defaults
pull_base_script:
- tart pull ghcr.io/cirruslabs/macos-$MACOS_VERSION-base:latest
@@ -96,13 +108,13 @@ task:
matrix:
- MACOS_VERSION: sonoma
XCODE_VERSIONS: 15.2,15.3,15.4
only_if: $CIRRUS_TAG != "" || $CIRRUS_CRON == "weekly" # Every Sunday at 14 UTC
only_if: ($CIRRUS_TAG != "" && $CIRRUS_TAG !=~ '.*beta.*') || $CIRRUS_CRON == "weekly" # Every Sunday at 14 UTC
<<: *defaults
pull_base_script:
- tart pull ghcr.io/cirruslabs/macos-$MACOS_VERSION-base:latest
build_xcode_script:
- packer init templates/xcode.pkr.hcl
- packer build -var tag=runner -var disk_size=130 -var macos_version="$MACOS_VERSION" -var xcode_version="[$XCODE_VERSIONS]" templates/xcode.pkr.hcl
- packer build -var tag=runner -var disk_size=250 -var disk_free_mb=100000 -var macos_version="$MACOS_VERSION" -var xcode_version="[$XCODE_VERSIONS]" templates/xcode.pkr.hcl
push_script: |
tart push "$MACOS_VERSION-xcode:runner" ghcr.io/cirruslabs/macos-runner:$MACOS_VERSION
always:
@@ -110,10 +122,11 @@ task:
- tart delete "$MACOS_VERSION-xcode:runner"
task:
name: "Release Xcode $CIRRUS_TAG"
name: "Release Xcode $CIRRUS_TAG ($MACOS_VERSION)"
only_if: $CIRRUS_TAG != ""
env:
MACOS_VERSION: sonoma
matrix:
- env:
MACOS_VERSION: sonoma
<<: *defaults
pull_base_script:
- tart pull ghcr.io/cirruslabs/macos-$MACOS_VERSION-base:latest
+7 -7
View File
@@ -1,12 +1,12 @@
## macOS Packer Templates for Tart
Repository with Packer templates to build macOS [Tart](https://tart.app/) virtual machines to use with [Cirrus Runners](https://cirrus-runners.app/),
Repository with Packer templates to build macOS [Tart](https://tart.run/) virtual machines to use with [Cirrus Runners](https://cirrus-runners.app/),
[Cirrus CI](https://cirrus-ci.org/guide/macOS/) or [any other automation](https://tart.run/integrations/cirrus-cli/).
The following image variants are currently available:
* `macos-{ventura,sonoma}-base` image has only `brew` pre-installed and the latest version of `macOS` available
* `macos-{ventura,sonoma}-xcode:N` image is based on `macos-{monterey,ventura}-base` image and has `Xcode N` with [`Flutter`](https://flutter.dev/) pre-installed
* `macos-{sequoia,sonoma}-base` image has only `brew` pre-installed and the latest version of `macOS` available
* `macos-{sequoia,sonoma}-xcode:N` image is based on `macos-{sequoia,sonoma}-base` image and has `Xcode N` with [`Flutter`](https://flutter.dev/) pre-installed
* `macos-runner:sonoma` image is a variant of `xcode:N` with 3 latest versions of `Xcode` pre-installed and [`xcodes` tool](https://github.com/XcodesOrg/xcodes) to switch between them.
See a full list of VMs available [here](https://github.com/orgs/cirruslabs/packages?tab=packages&q=macos-).
@@ -14,7 +14,7 @@ See a full list of VMs available [here](https://github.com/orgs/cirruslabs/packa
## Release Cadence
Once a new version of Xcode is released, we will initiate a GitHub release which will automatically build and push
a new version of the `macos-sonoma-xcode:N` image as well as `macos-runner:sonoma`. This generally happens within 24 hours
a new version of the `macos-{sequoia,sonoma}-xcode:N` image as well as `macos-runner:sonoma`. This generally happens within 24 hours
of a release. Please watch this repository releases to get notified about new images.
## Update Cadence
@@ -22,9 +22,9 @@ of a release. Please watch this repository releases to get notified about new im
Some of the images are regularly getting rebuild in order to update the pre-installed packages. The following images are updated
monthly on the first Saturday of the month:
* `ghcr.io/cirruslabs/macos-{ventura,sonoma}-base`
* `ghcr.io/cirruslabs/macos-ventura-xcode:{latest,14.3.1,14.2}`
* `ghcr.io/cirruslabs/macos-sonoma-xcode:{latest,15.4,15.3,15.2}`
* `ghcr.io/cirruslabs/macos-{sequoia,sonoma}-base`
* `ghcr.io/cirruslabs/macos-sonoma-xcode:{16-beta,latest,15.4,15.3,15.2}`
* `ghcr.io/cirruslabs/macos-sequoia-xcode:{16-beta}`
Note that `ghcr.io/cirruslabs/macos-runner:sonoma` is updated every Sunday and this image is [optimised for startup](https://cirrus-runners.app/blog/2024/04/11/optimizing-startup-time-of-cirrus-runners/)
on Cirrus Runners and Cirrus CI services.
+1 -1
View File
@@ -59,7 +59,7 @@ build {
"source ~/.zprofile",
"brew --version",
"brew update",
"brew install curl wget unzip zip ca-certificates cmake gcc git-lfs jq gh gitlab-runner",
"brew install curl wget unzip zip ca-certificates cmake gcc git-lfs jq yq gh gitlab-runner",
"brew install --cask git-credential-manager",
"git lfs install",
"sudo softwareupdate --install-rosetta --agree-to-license"
+120
View File
@@ -0,0 +1,120 @@
packer {
required_plugins {
tart = {
version = ">= 1.12.0"
source = "github.com/cirruslabs/tart"
}
}
}
source "tart-cli" "tart" {
from_ipsw = "https://updates.cdn-apple.com/2024SummerSeed/fullrestores/062-53173/D1CAA2F8-CBC1-4D27-9F29-9C3BD47CD57C/UniversalMac_15.1_24B5024e_Restore.ipsw"
vm_name = "sequoia-vanilla"
cpu_count = 4
memory_gb = 8
disk_size_gb = 40
ssh_password = "admin"
ssh_username = "admin"
ssh_timeout = "300s"
boot_command = [
# hello, hola, bonjour, etc.
"<wait60s><spacebar>",
# Language: most of the times we have a list of "English"[1], "English (UK)", etc. with
# "English" language already selected. If we type "english", it'll cause us to switch
# to the "English (UK)", which is not what we want. To solve this, we switch to some other
# language first, e.g. "Italiano" and then switch back to "English". We'll then jump to the
# first entry in a list of "english"-prefixed items, which will be "English".
#
# [1]: should be named "English (US)", but oh well 🤷
"<wait30s>italiano<esc>english<enter>",
# Select Your Country and Region
"<wait30s>united states<leftShiftOn><tab><leftShiftOff><spacebar>",
# Written and Spoken Languages
"<wait10s><leftShiftOn><tab><leftShiftOff><spacebar>",
# Accessibility
"<wait10s><leftShiftOn><tab><leftShiftOff><spacebar>",
# Data & Privacy
"<wait10s><leftShiftOn><tab><leftShiftOff><spacebar>",
# Migration Assistant
"<wait10s><tab><tab><tab><spacebar>",
# Sign In with Your Apple ID
"<wait10s><leftShiftOn><tab><leftShiftOff><leftShiftOn><tab><leftShiftOff><spacebar>",
# Are you sure you want to skip signing in with an Apple ID?
"<wait10s><tab><spacebar>",
# Terms and Conditions
"<wait10s><leftShiftOn><tab><leftShiftOff><spacebar>",
# I have read and agree to the macOS Software License Agreement
"<wait10s><tab><spacebar>",
# Create a Computer Account
"<wait10s>admin<tab><tab>admin<tab>admin<tab><tab><tab><spacebar>",
# Enable Location Services
"<wait120s><leftShiftOn><tab><leftShiftOff><spacebar>",
# Are you sure you don't want to use Location Services?
"<wait10s><tab><spacebar>",
# Select Your Time Zone
"<wait10s><tab>UTC<enter><leftShiftOn><tab><leftShiftOff><spacebar>",
# Analytics
"<wait10s><leftShiftOn><tab><leftShiftOff><spacebar>",
# Screen Time
"<wait10s><tab><spacebar>",
# Siri
"<wait10s><tab><spacebar><leftShiftOn><tab><leftShiftOff><spacebar>",
# Choose Your Look
"<wait10s><leftShiftOn><tab><leftShiftOff><spacebar>",
# Welcome to Mac
"<wait10s><tab><spacebar>",
# Enable Voice Over
"<wait10s><leftAltOn><f5><leftAltOff><wait5s>v",
# Now that the installation is done, open "System Settings"
"<wait10s><leftAltOn><spacebar><leftAltOff>System Settings<enter>",
# Navigate to "Sharing"
"<wait10s><leftAltOn>f<leftAltOff>sharing<enter>",
# Navigate to "Screen Sharing" and enable it
"<wait10s><tab><tab><tab><tab><tab><spacebar>",
# Navigate to "Remote Login" and enable it
"<wait10s><tab><tab><tab><tab><tab><tab><tab><tab><tab><tab><tab><tab><spacebar>",
# Disable Voice Over
"<leftAltOn><f5><leftAltOff>",
]
// A (hopefully) temporary workaround for Virtualization.Framework's
// installation process not fully finishing in a timely manner
create_grace_time = "30s"
}
build {
sources = ["source.tart-cli.tart"]
provisioner "shell" {
inline = [
// Enable passwordless sudo
"echo admin | sudo -S sh -c \"mkdir -p /etc/sudoers.d/; echo 'admin ALL=(ALL) NOPASSWD: ALL' | EDITOR=tee visudo /etc/sudoers.d/admin-nopasswd\"",
// Enable auto-login
//
// See https://github.com/xfreebird/kcpassword for details.
"echo '00000000: 1ced 3f4a bcbc ba2c caca 4e82' | sudo xxd -r - /etc/kcpassword",
"sudo defaults write /Library/Preferences/com.apple.loginwindow autoLoginUser admin",
// Disable screensaver at login screen
"sudo defaults write /Library/Preferences/com.apple.screensaver loginWindowIdleTime 0",
// Disable screensaver for admin user
"defaults -currentHost write com.apple.screensaver idleTime 0",
// Prevent the VM from sleeping
"sudo systemsetup -setdisplaysleep Off 2>/dev/null",
"sudo systemsetup -setsleep Off 2>/dev/null",
"sudo systemsetup -setcomputersleep Off 2>/dev/null",
// Launch Safari to populate the defaults
"/Applications/Safari.app/Contents/MacOS/Safari &",
"SAFARI_PID=$!",
"disown",
"sleep 30",
"kill -9 $SAFARI_PID",
// Enable Safari's remote automation
"sudo safaridriver --enable",
// Disable screen lock
//
// Note that this only works if the user is logged-in,
// i.e. not on login screen.
"sysadminctl -screenLock off -password admin",
]
}
}
+1 -1
View File
@@ -8,7 +8,7 @@ packer {
}
source "tart-cli" "tart" {
from_ipsw = "https://updates.cdn-apple.com/2024SpringFCS/fullrestores/062-01897/C874907B-9F82-4109-87EB-6B3C9BF1507D/UniversalMac_14.5_23F79_Restore.ipsw"
from_ipsw = "https://updates.cdn-apple.com/2024SummerFCS/fullrestores/062-52859/932E0A8F-6644-4759-82DA-F8FA8DEA806A/UniversalMac_14.6.1_23G93_Restore.ipsw"
vm_name = "sonoma-vanilla"
cpu_count = 4
memory_gb = 8
+33 -8
View File
@@ -22,7 +22,12 @@ variable "tag" {
variable "disk_size" {
type = number
default = 90
default = 100
}
variable "disk_free_mb" {
type = number
default = 15000
}
variable "android_sdk_tools_version" {
@@ -43,6 +48,26 @@ source "tart-cli" "tart" {
ssh_timeout = "120s"
}
locals {
xcode_install_provisioners = [
for version in var.xcode_version : {
type = "shell"
inline = [
"source ~/.zprofile",
"sudo xcodes install ${version} --experimental-unxip --path /Users/admin/Downloads/Xcode_${version}.xip --select --empty-trash",
// get selected xcode path, strip /Contents/Developer and move to GitHub compatible locations
"INSTALLED_PATH=$(xcodes select -p)",
"CONTENTS_DIR=$(dirname $INSTALLED_PATH)",
"APP_DIR=$(dirname $CONTENTS_DIR)",
"sudo mv $APP_DIR /Applications/Xcode_${version}.app",
"sudo xcode-select -s /Applications/Xcode_${version}.app",
"xcodebuild -downloadAllPlatforms",
"xcodebuild -runFirstLaunch",
]
}
]
}
build {
sources = ["source.tart-cli.tart"]
@@ -101,11 +126,12 @@ build {
// iterate over all Xcode versions and install them
// select the latest one as the default
provisioner "shell" {
inline = [
for version in var.xcode_version :
"source ~/.zprofile && sudo xcodes install ${version} --experimental-unxip --path /Users/admin/Downloads/Xcode_${version}.xip --select --empty-trash && xcodebuild -downloadAllPlatforms && xcodebuild -runFirstLaunch"
]
dynamic "provisioner" {
for_each = local.xcode_install_provisioners
labels = ["shell"]
content {
inline = provisioner.value.inline
}
}
provisioner "shell" {
@@ -147,7 +173,6 @@ build {
provisioner "shell" {
inline = [
"source ~/.zprofile",
"sudo security delete-certificate -Z FF6797793A3CD798DC5B2ABEF56F73EDC9F83A64 /Library/Keychains/System.keychain",
"curl -o AppleWWDRCAG3.cer https://www.apple.com/certificateauthority/AppleWWDRCAG3.cer",
"curl -o DeveloperIDG2CA.cer https://www.apple.com/certificateauthority/DeveloperIDG2CA.cer",
"curl -o add-certificate.swift https://raw.githubusercontent.com/actions/runner-images/fb3b6fd69957772c1596848e2daaec69eabca1bb/images/macos/provision/configuration/add-certificate.swift",
@@ -171,7 +196,7 @@ build {
"source ~/.zprofile",
"df -h",
"export FREE_MB=$(df -m | awk '{print $4}' | head -n 2 | tail -n 1)",
"[[ $FREE_MB -gt 15000 ]] && echo OK || exit 1"
"[[ $FREE_MB -gt ${var.disk_free_mb} ]] && echo OK || exit 1"
]
}