Skip to content

Commit 5739887

Browse files
shamil-mubarakshinsergei-pyshnoigithub-actions[bot]459680Actions service account
authored
Sync changes to ubuntu-new-folder-structure branch (#8764)
* Update folder structure * Adjust packer templates and debug * Fix issues in ubuntu2204 template * Remove Debug steps * Rename template, sync pipelines and adjust resource gen script * fix post-gen path in ubuntu-minimal * fix shebang linter, workflow paths and adjust readme * update preimagedata * [MacOS] Add xcode 15.0.1 (#8604) * Updating readme file for macos-13 version 20231018.14 (#8601) Co-authored-by: Image generation service account <no-reply@microsoft.com> Co-authored-by: Actions service account <no-reply@github.com> * Updating readme file for macos-13-arm64 version 20231017.1 (#8586) Co-authored-by: Image generation service account <no-reply@microsoft.com> * [MacOS] improve errexit option handling (#8432) * [MacOS] improve errexit option handling * Prevent prompting for override when unzipping * Explicitly allow failing when installing virtualbox * Remove libtcl symlinks * Add debug output * Updating readme file for ubuntu20 version 20231022.1.1 (#8637) Co-authored-by: Image generation service account <no-reply@microsoft.com> * Updating readme file for ubuntu22 version 20231022.1.1 (#8636) Co-authored-by: Image generation service account <no-reply@microsoft.com> * Updating readme file for win19 version 20231023.1.1 (#8644) Co-authored-by: Image generation service account <no-reply@microsoft.com> Co-authored-by: Actions service account <no-reply@github.com> * Updating readme file for win22 version 20231023.1.1 (#8643) Co-authored-by: Image generation service account <no-reply@microsoft.com> Co-authored-by: Actions service account <no-reply@github.com> * [macos] simplify "brew_smart_install" helper (#8639) * [macos] homebrew: use hardcoded condition for jq installation we cannot use "jq" if we are asked to install "jq" * [macos] always use "brew install" * [macos] add retries to "get_github_package_download_url" helper * [macos] add retries to chrome install script * [macos] add retries to OpenJDK install script * [macos] add retries to miniconda installer * Update images/macos/provision/core/openjdk.sh Co-authored-by: Vasilii Polikarpov <126792224+vpolikarpov-akvelon@users.noreply.github.com> * fix copy-paste error * Update images/macos/provision/core/openjdk.sh Co-authored-by: Vasilii Polikarpov <126792224+vpolikarpov-akvelon@users.noreply.github.com> * Update images/macos/provision/core/openjdk.sh Co-authored-by: Vasilii Polikarpov <126792224+vpolikarpov-akvelon@users.noreply.github.com> --------- Co-authored-by: Vasilii Polikarpov <126792224+vpolikarpov-akvelon@users.noreply.github.com> * Updating readme file for ubuntu22 version 20231025.1.1 (#8663) Co-authored-by: Image generation service account <no-reply@microsoft.com> Co-authored-by: Actions service account <no-reply@github.com> * Updating readme file for ubuntu20 version 20231025.1.1 (#8664) Co-authored-by: Image generation service account <no-reply@microsoft.com> Co-authored-by: Actions service account <no-reply@github.com> * Updating readme file for win22 version 20231024.1.1 (#8668) Co-authored-by: Image generation service account <no-reply@microsoft.com> Co-authored-by: Actions service account <no-reply@github.com> * Windows Server 2019 (20231025) Image Update (#8667) * Updating readme file for win19 version 20231025.2.1 * Update Windows2019-Readme.md --------- Co-authored-by: Image generation service account <no-reply@microsoft.com> Co-authored-by: Mikhail Koliada <88318005+mikhailkoliada@users.noreply.github.com> Co-authored-by: Actions service account <no-reply@github.com> * [Mac OS] Fix logic for retrying AppleScript execution (#8662) * [Ubuntu] Add PGP validation for swift (#8652) * [Windows] Remove out-of-support vs components (#8678) * [MacOS] Unpin Virtualbox (#8653) * [MacOS] Unpin Virtualbox * Remove obsolete virtualbox kext pester test * [Ubuntu] Update apt repos list in documentation (#8634) * fix: bump libssl version to ubuntu2.20 (#8682) Signed-off-by: Jakub Oskera <iam@jakuboskera.dev> Co-authored-by: Jakub Oskera <jakub.oskera@rws.com> * [macOS] increase timeout for the macOS ci (#8692) * Updating readme file for macos-13-arm64 version 20231024.2 (#8673) Co-authored-by: Image generation service account <no-reply@microsoft.com> Co-authored-by: Actions service account <no-reply@github.com> * Escape quotes when running in PowerShell 7.0-7.2 (#8705) * fix: checksum search for Kotlin (#8704) * [Ubuntu] Fix checksum search for Kotlin * [Windows] Fixed checksum search for Kotlin * [Ubuntu] Pin bindgen cli version to avoid bug (#8714) * [Ubuntu] Add more checksum validations (#8660) * [Windows] Pin bindgen cli version to avoid bug (#8713) * Updating readme file for ubuntu22 version 20231030.2.1 (#8691) Co-authored-by: Image generation service account <no-reply@microsoft.com> Co-authored-by: Actions service account <no-reply@github.com> * Updating readme file for ubuntu20 version 20231030.2.1 (#8690) Co-authored-by: Image generation service account <no-reply@microsoft.com> Co-authored-by: Actions service account <no-reply@github.com> * Updating readme file for win19 version 20231029.1.1 (#8687) Co-authored-by: Image generation service account <no-reply@microsoft.com> Co-authored-by: Actions service account <no-reply@github.com> * Revert "[Windows] Pin bindgen cli version to avoid bug (#8713)" (#8719) This reverts commit 1dac9b9. * Revert "[Ubuntu] Pin bindgen cli version to avoid bug (#8714)" (#8720) This reverts commit 3146c70. * [Mac OS] Temporary disable VNC for Mac OS 14 (#8717) * Updating readme file for win22 version 20231029.1.1 (#8686) Co-authored-by: Image generation service account <no-reply@microsoft.com> Co-authored-by: Actions service account <no-reply@github.com> * Updating readme file for macOS-11 version 20231030.1 (#8694) Co-authored-by: Image generation service account <no-reply@microsoft.com> Co-authored-by: Actions service account <no-reply@github.com> * [Mac OS] Add template for Mac OS 14 image (#8733) * Add gfortran-13 (#8702) * Revert "[MacOS] Unpin Virtualbox" (#8731) * Revert "[MacOS] Unpin Virtualbox (#8653)" This reverts commit f3d011e. * Add more info * [ubuntu] split git and git-lfs into separate install scripts (#8711) for better observability of integrity validation let us split install script into two * Updating readme file for macOS-12 version 20231029.1 (#8695) Co-authored-by: Image generation service account <no-reply@microsoft.com> Co-authored-by: Actions service account <no-reply@github.com> * [Windows] Remove Android SDK Patch applier v4 (#8750) * remove ndk 23 from macos images (#8747) * [Mac OS] Remove 'LTS' suffix from OpenJDK version (#8751) * [windows] split docker install into 3 scripts (#8688) * [windows] split docker install into 3 scripts the idea is to end with 1 script per 1 component for better observability * Update images/win/scripts/Installers/Install-Docker-Compose.ps1 Co-authored-by: Erik Bershel <110455084+erik-bershel@users.noreply.github.com> * Update images/win/scripts/Installers/Install-Docker-WinCred.ps1 Co-authored-by: Vasilii Polikarpov <126792224+vpolikarpov-akvelon@users.noreply.github.com> * fix test --------- Co-authored-by: Erik Bershel <110455084+erik-bershel@users.noreply.github.com> Co-authored-by: Vasilii Polikarpov <126792224+vpolikarpov-akvelon@users.noreply.github.com> * remove ndk 23 from ubuntu images (#8745) * [macos] add android SDK to SW report on Ventura ARM64 (#8715) * [Mac OS] Update Anka Helpers to build Mac OS 14 ARM image (#8757) * Update Anka Helpers to build Mac OS 14 ARM image * Drop Powershell 5 support * [Mac OS] Add missing macOS Sonoma selector (#8759) * remove ndk23 from windows images (#8746) * Updating readme file for macos-13 version 20231025.2 (#8672) Co-authored-by: Image generation service account <no-reply@microsoft.com> --------- Signed-off-by: Jakub Oskera <iam@jakuboskera.dev> Co-authored-by: sergei-pyshnoi <121864472+sergei-pyshnoi@users.noreply.github.com> Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> Co-authored-by: Image generation service account <no-reply@microsoft.com> Co-authored-by: Actions service account <no-reply@github.com> Co-authored-by: Vasilii Polikarpov <126792224+vpolikarpov-akvelon@users.noreply.github.com> Co-authored-by: ilia-shipitsin <125650415+ilia-shipitsin@users.noreply.github.com> Co-authored-by: Mikhail Koliada <88318005+mikhailkoliada@users.noreply.github.com> Co-authored-by: Jakub Oskera <iam@jakuboskera.dev> Co-authored-by: Jakub Oskera <jakub.oskera@rws.com> Co-authored-by: Luke Fritts <luketfritts@gmail.com> Co-authored-by: Erik Bershel <110455084+erik-bershel@users.noreply.github.com> Co-authored-by: Harmen Stoppels <harmenstoppels@gmail.com>
1 parent 48a3da7 commit 5739887

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

43 files changed

+843
-437
lines changed

images.CI/macos/anka/CreateCleanAnkaTemplate.ps1

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -182,6 +182,12 @@ Write-Host "`n[#2] Create a VM template:"
182182
Write-Host "`t[*] Deleting existed template with name '$TemplateName' before creating a new one"
183183
Remove-AnkaVM -VMName $TemplateName
184184

185+
# Temporary disable VNC for macOS 14
186+
# It's probably Anka's bug fixed in 3.3.2
187+
if ($shortMacOSVersion -eq "14") {
188+
$env:ANKA_CREATE_VNC = 0
189+
}
190+
185191
Write-Host "`t[*] Creating Anka VM template with name '$TemplateName' and '$TemplateUsername' user"
186192
Write-Host "`t[*] CPU Count: $CPUCount, RamSize: ${RamSizeGb}G, DiskSizeGb: ${DiskSizeGb}G, InstallerPath: $macOSInstaller, TemplateName: $TemplateName"
187193
New-AnkaVMTemplate -InstallerPath "$macOSInstaller" `

images.CI/macos/anka/Service.Helpers.psm1

Lines changed: 29 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -63,24 +63,24 @@ function Get-AvailableIPSWVersions {
6363
)
6464

6565
if ($IsBeta) {
66-
$command = { mist list firmware "$MacOSCodeNameOrVersion" --include-betas --latest --export "/Applications/export.json"}
66+
$command = { mist list firmware "$MacOSCodeNameOrVersion" --compatible --include-betas --latest --export "/Applications/export.json" }
6767
} elseif ($IsLatest) {
68-
$command = { mist list firmware "$MacOSCodeNameOrVersion" --latest --export "/Applications/export.json" }
68+
$command = { mist list firmware "$MacOSCodeNameOrVersion" --compatible --latest --export "/Applications/export.json" }
6969
} else {
70-
$command = { mist list firmware "$MacOSCodeNameOrVersion" --export "/Applications/export.json" }
70+
$command = { mist list firmware "$MacOSCodeNameOrVersion" --compatible --export "/Applications/export.json" }
7171
}
7272

7373
$condition = { $LASTEXITCODE -eq 0 }
7474
Invoke-WithRetry -Command $command -BreakCondition $condition | Out-Null
7575
$softwareList = get-content -Path "/Applications/export.json"
76-
$turgetVersion = ($softwareList | ConvertFrom-Json).version
77-
if ($null -eq $turgetVersion) {
76+
$availableBuilds = ($softwareList | ConvertFrom-Json).build
77+
if ($null -eq $availableBuilds) {
7878
Write-Host "Requested macOS '$MacOSCodeNameOrVersion' version not found in the list of available installers."
7979
$command = { mist list firmware "$($MacOSCodeNameOrVersion.split('.')[0])" }
8080
Invoke-WithRetry -Command $command -BreakCondition $condition
8181
exit 1
8282
}
83-
return $turgetVersion
83+
return $availableBuilds
8484
}
8585

8686
function Get-MacOSIPSWInstaller {
@@ -96,21 +96,26 @@ function Get-MacOSIPSWInstaller {
9696
$MacOSName = "macOS Monterey"
9797
} elseif ($MacOSVersion -eq [version] "13.0") {
9898
$MacOSName = "macOS Ventura"
99+
} elseif ($MacOSVersion -eq [version] "14.0") {
100+
$MacOSName = "macOS Sonoma"
99101
} else {
100102
$MacOSName = $MacOSVersion.ToString()
101103
}
102104

103-
104105
Write-Host "`t[*] Finding available full installers"
105106
if ($DownloadLatestVersion -eq $true) {
106-
$targetVersion = Get-AvailableIPSWVersions -IsLatest $true -MacOSCodeNameOrVersion $MacOSName
107-
Write-host "`t[*] The 'DownloadLatestVersion' flag is set to true. Latest macOS version is '$MacOSName' - '$targetVersion' now"
107+
$targetBuild = Get-AvailableIPSWVersions -IsLatest $true -MacOSCodeNameOrVersion $MacOSName
108+
Write-Host "`t[*] The 'DownloadLatestVersion' flag is set to true. Latest compatible macOS build of '$MacOSName' is '$targetBuild'"
108109
} elseif ($BetaSearch -eq $true) {
109-
$targetVersion = Get-AvailableIPSWVersions -IsBeta $true -MacOSCodeNameOrVersion $MacOSName
110-
Write-host "`t[*] The 'BetaSearch' flag is set to true. Latestbeta macOS version is '$MacOSName' - '$targetVersion' now"
110+
$targetBuild = Get-AvailableIPSWVersions -IsBeta $true -MacOSCodeNameOrVersion $MacOSName
111+
Write-Host "`t[*] The 'BetaSearch' flag is set to true. Latest compatible beta macOS build of '$MacOSName' is '$targetBuild'"
111112
} else {
112-
$targetVersion = Get-AvailableIPSWVersions -MacOSCodeNameOrVersion $MacOSName -IsLatest $false
113-
Write-host "`t[*] The exact version was specified - '$MacOSName' "
113+
$targetBuild = Get-AvailableIPSWVersions -MacOSCodeNameOrVersion $MacOSName -IsLatest $false
114+
Write-Host "`t[*] Available compatible macOS builds of '$MacOSName' are: $($targetBuild -join ', ')"
115+
if ($targetBuild.Count -gt 1) {
116+
Write-Error "`t[*] Please specify the exact build number of macOS you want to install"
117+
exit 1
118+
}
114119
}
115120

116121
$installerPathPattern = "/Applications/Install ${macOSName}*.ipsw"
@@ -123,12 +128,12 @@ function Get-MacOSIPSWInstaller {
123128
# Download macOS installer
124129
$installerDir = "/Applications/"
125130
$installerName = "Install ${macOSName}.ipsw"
126-
Write-Host "`t[*] Requested macOS '$targetVersion' version installer found, fetching it from mist database"
127-
Invoke-WithRetry { mist download firmware "$targetVersion" --output-directory $installerDir --firmware-name "$installerName" } {$LASTEXITCODE -eq 0} | Out-Null
131+
Write-Host "`t[*] Requested macOS '$targetBuild' version installer found, fetching it from mist database"
132+
Invoke-WithRetry { mist download firmware "$targetBuild" --output-directory $installerDir --firmware-name "$installerName" } { $LASTEXITCODE -eq 0 } | Out-Null
128133
if (Test-Path "$installerDir$installerName") {
129134
$result = "$installerDir$installerName"
130135
} else {
131-
Write-host "`t[*] Requested macOS '$targetVersion' version installer failed to download"
136+
Write-Error "`t[*] Requested macOS '$targetBuild' version installer failed to download"
132137
exit 1
133138
}
134139
return $result
@@ -169,7 +174,7 @@ function Get-MacOSInstaller {
169174
exit 1
170175
}
171176
Show-StringWithFormat $filteredVersions
172-
$osVersions = $filteredVersions.OSVersion | Sort-Object {[version]$_}
177+
$osVersions = $filteredVersions.OSVersion | Sort-Object { [version]$_ }
173178
$MacOSVersion = $osVersions | Select-Object -Last 1
174179
Write-Host "`t[*] The 'DownloadLatestVersion' flag is set. Latest macOS version is '$MacOSVersion' now"
175180
}
@@ -248,15 +253,15 @@ function Install-SoftwareUpdate {
248253
$command = "sw_vers"
249254
$guestMacosVersion = Invoke-SSHPassCommand -HostName $HostName -Command $command
250255
if ($guestMacosVersion[1] -match "12") {
251-
foreach ($update in $listOfUpdates){
256+
foreach ($update in $listOfUpdates) {
252257
# Filtering updates that contain "Ventura" word
253258
if ($update -notmatch "Ventura") {
254259
$command = "sudo /usr/sbin/softwareupdate --restart --verbose --install '$($update.trim())'"
255260
Invoke-SSHPassCommand -HostName $HostName -Command $command
256261
}
257262
}
258263
} elseif ($guestMacosVersion[1] -match "13") {
259-
foreach ($update in $listOfUpdates){
264+
foreach ($update in $listOfUpdates) {
260265
# Filtering updates that contain "Sonoma" word
261266
if ($update -notmatch "Sonoma") {
262267
$command = "sudo /usr/sbin/softwareupdate --restart --verbose --install '$($update.trim())'"
@@ -302,7 +307,11 @@ function Invoke-SSHPassCommand {
302307
"${env:SSHUSER}@${HostName}"
303308
)
304309
$sshPassOptions = $sshArg -join " "
305-
$result = bash -c "$sshPassOptions \""$Command\"" 2>&1"
310+
if ($PSVersionTable.PSVersion.Major -eq 7 -and $PSVersionTable.PSVersion.Minor -le 2) {
311+
$result = bash -c "$sshPassOptions \""$Command\"" 2>&1"
312+
} else {
313+
$result = bash -c "$sshPassOptions `"$Command`" 2>&1"
314+
}
306315
if ($LASTEXITCODE -ne 0) {
307316
Write-Error "There is an error during command execution:`n$result"
308317
exit 1

0 commit comments

Comments
 (0)