From ef6d97a77e0f59cf10d28ff99c339022d1eba7d0 Mon Sep 17 00:00:00 2001 From: Fedor Korotkov Date: Tue, 10 Sep 2024 10:18:11 -0400 Subject: [PATCH] Build more images (#178) Build Sequoia 15.0 and 15.1 separately since 15.0 is RC and about ot be released and 15.1 is still in beta. Plus added Xcode 16 RC to the big runner image. But since it's RC put it first in the list so it's not default. --- .cirrus.yml | 27 +++++- templates/vanilla-sequoia-beta.pkr.hcl | 121 +++++++++++++++++++++++++ templates/vanilla-sequoia.pkr.hcl | 2 +- 3 files changed, 144 insertions(+), 6 deletions(-) create mode 100644 templates/vanilla-sequoia-beta.pkr.hcl diff --git a/.cirrus.yml b/.cirrus.yml index de9caea..6c37664 100644 --- a/.cirrus.yml +++ b/.cirrus.yml @@ -30,7 +30,7 @@ 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.6 + - tart push sonoma-vanilla ghcr.io/cirruslabs/macos-sonoma-vanilla:latest ghcr.io/cirruslabs/macos-sonoma-vanilla:14.6.1 always: cleanup_script: - tart delete sonoma-vanilla @@ -45,7 +45,22 @@ task: 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.0-beta-8 + - tart push sequoia-vanilla ghcr.io/cirruslabs/macos-sequoia-vanilla:latest ghcr.io/cirruslabs/macos-sequoia-vanilla:15.0-rc + always: + cleanup_script: + - tart delete sequoia-vanilla + +task: + name: "Update Vanilla Sequoia Beta Image" + only_if: $CIRRUS_BRANCH == $CIRRUS_DEFAULT_BRANCH && changesInclude("templates/vanilla-sequoia-beta.pkr.hcl") + <<: *defaults + build_script: + - packer init templates/vanilla-sequoia-beta.pkr.hcl + - packer build templates/vanilla-sequoia-beta.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:15.1-beta-3 always: cleanup_script: - tart delete sequoia-vanilla @@ -82,6 +97,8 @@ task: XCODE_VERSION: 15.3 - MACOS_VERSION: sonoma XCODE_VERSION: 15.2 + - MACOS_VERSION: sonoma + XCODE_VERSION: 16 <<: *defaults pull_base_script: - tart pull ghcr.io/cirruslabs/macos-$MACOS_VERSION-base:latest @@ -104,14 +121,14 @@ task: env: matrix: - MACOS_VERSION: sonoma - XCODE_VERSIONS: 15.2,15.3,15.4 - only_if: ($CIRRUS_TAG != "" && $CIRRUS_TAG !=~ '.*beta.*') || $CIRRUS_CRON == "weekly" # Every Sunday at 14 UTC + XCODE_VERSIONS: 16,15.2,15.3,15.4 + only_if: $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=250 -var disk_free_mb=100000 -var macos_version="$MACOS_VERSION" -var xcode_version="[$XCODE_VERSIONS]" templates/xcode.pkr.hcl + - packer build -var tag=runner -var disk_size=300 -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: diff --git a/templates/vanilla-sequoia-beta.pkr.hcl b/templates/vanilla-sequoia-beta.pkr.hcl new file mode 100644 index 0000000..2d1d6a1 --- /dev/null +++ b/templates/vanilla-sequoia-beta.pkr.hcl @@ -0,0 +1,121 @@ +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-74506/D50AC8F9-4795-4711-9C1A-907B6EB829A2/UniversalMac_15.1_24B5035e_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. + "", + # 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 🤷 + "italianoenglish", + # Select Your Country and Region + "united states", + # Written and Spoken Languages + "", + # Accessibility + "", + # Data & Privacy + "", + # Migration Assistant + "", + # Sign In with Your Apple ID + "", + # Are you sure you want to skip signing in with an Apple ID? + "", + # Terms and Conditions + "", + # I have read and agree to the macOS Software License Agreement + "", + # Create a Computer Account + "adminadminadmin", + # Enable Location Services + "", + # Are you sure you don't want to use Location Services? + "", + # Select Your Time Zone + "UTC", + # Analytics + "", + # Screen Time + "", + # Siri + "", + # Choose Your Look + "", + # Welcome to Mac + "", + # Enable Keyboard navigation + # This is so that we can navigate the System Settings app using the keyboard + "Terminal", + "defaults write NSGlobalDomain AppleKeyboardUIMode -int 3", + "q", + # Now that the installation is done, open "System Settings" + "System Settings", + # Navigate to "Sharing" + "fsharing", + # Navigate to "Screen Sharing" and enable it + "", + # Navigate to "Remote Login" and enable it + "", + # Quit System Settings + "q", + ] + + // 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 -setsleep 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", + ] + } +} diff --git a/templates/vanilla-sequoia.pkr.hcl b/templates/vanilla-sequoia.pkr.hcl index 2d1d6a1..9bfde4c 100644 --- a/templates/vanilla-sequoia.pkr.hcl +++ b/templates/vanilla-sequoia.pkr.hcl @@ -8,7 +8,7 @@ packer { } source "tart-cli" "tart" { - from_ipsw = "https://updates.cdn-apple.com/2024SummerSeed/fullrestores/062-74506/D50AC8F9-4795-4711-9C1A-907B6EB829A2/UniversalMac_15.1_24B5035e_Restore.ipsw" + from_ipsw = "https://updates.cdn-apple.com/2024FallFCS/fullrestores/062-78489/BDA44327-C79E-4608-A7E0-455A7E91911F/UniversalMac_15.0_24A335_Restore.ipsw" vm_name = "sequoia-vanilla" cpu_count = 4 memory_gb = 8