From f221709e849f41695baacabe21a26b70afe9f8af Mon Sep 17 00:00:00 2001 From: Adrian Vladu Date: Fri, 5 Dec 2025 16:06:38 +0200 Subject: [PATCH 1/6] python: add installer option If MSI checksum is set, then the builder will download the Python installer, install Python at a temp location, then move the folder to the known location. At the end, the Python package will be uninstalled. Signed-off-by: Adrian Vladu --- .github/workflows/build_test_cbsinit.yml | 3 ++- BuildAutomation/BuildCloudbaseInitSetup.ps1 | 7 ++++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build_test_cbsinit.yml b/.github/workflows/build_test_cbsinit.yml index b85f3285..dedc626e 100644 --- a/.github/workflows/build_test_cbsinit.yml +++ b/.github/workflows/build_test_cbsinit.yml @@ -29,7 +29,8 @@ jobs: -VCVars "automatic" ^ -VSRedistDir "''" ^ -CloudbaseInitRepoUrl ${{ matrix.cbsinit_repo }} ^ - -CloudbaseInitRepoBranch ${{ matrix.cbsinit_branch }} + -CloudbaseInitRepoBranch ${{ matrix.cbsinit_branch }} ^ + -PythonMsiChecksum "not a real checksum" - uses: actions/upload-artifact@v7 with: name: "CloudbaseInit_${{ matrix.platform }}_${{ matrix.os }}_MSI_${{ matrix.cbsinit_branch }}" diff --git a/BuildAutomation/BuildCloudbaseInitSetup.ps1 b/BuildAutomation/BuildCloudbaseInitSetup.ps1 index ca31d518..99e1582f 100644 --- a/BuildAutomation/BuildCloudbaseInitSetup.ps1 +++ b/BuildAutomation/BuildCloudbaseInitSetup.ps1 @@ -10,7 +10,8 @@ Param( [switch]$ClonePullInstallerRepo = $true, [string]$VSRedistDir = "${ENV:ProgramFiles(x86)}\Common Files\Merge Modules", [string]$SignTimestampUrl = "http://timestamp.digicert.com?alg=sha256", - [string]$VCVars="2019" + [string]$VCVars="2019", + [string]$PythonMsiChecksum = $null ) $ErrorActionPreference = "Stop" @@ -77,6 +78,10 @@ try $python_template_dir = join-path $cloudbaseInitInstallerDir "Python$($pythonversion.replace('.', ''))_${platform}_Template" + if ($PythonMsiChecksum) { + DownloadInstall-PythonMsi $platform $python_template_dir $pythonversion $PythonMsiChecksum + } + CheckCopyDir $python_template_dir $python_dir # Make sure that we don't have temp files from a previous build From 0bc13a27279c33bf1255eb4c20ac11f95bcd3c35 Mon Sep 17 00:00:00 2001 From: Adrian Vladu Date: Mon, 27 Apr 2026 14:01:21 +0300 Subject: [PATCH 2/6] python: if installer is used, do not use the already existing template folder Signed-off-by: Adrian Vladu --- BuildAutomation/BuildCloudbaseInitSetup.ps1 | 1 + 1 file changed, 1 insertion(+) diff --git a/BuildAutomation/BuildCloudbaseInitSetup.ps1 b/BuildAutomation/BuildCloudbaseInitSetup.ps1 index 99e1582f..3077034d 100644 --- a/BuildAutomation/BuildCloudbaseInitSetup.ps1 +++ b/BuildAutomation/BuildCloudbaseInitSetup.ps1 @@ -79,6 +79,7 @@ try $python_template_dir = join-path $cloudbaseInitInstallerDir "Python$($pythonversion.replace('.', ''))_${platform}_Template" if ($PythonMsiChecksum) { + Remove-Item -Recurse -Force $python_template_dir -ErrorAction SilentlyContinue DownloadInstall-PythonMsi $platform $python_template_dir $pythonversion $PythonMsiChecksum } From dd05777ba92b00d9f7b47a4dccefd644b6504312 Mon Sep 17 00:00:00 2001 From: Adrian Vladu Date: Mon, 27 Apr 2026 14:59:17 +0300 Subject: [PATCH 3/6] python: add checksum for py 3.14.4 windows installer Signed-off-by: Adrian Vladu --- .github/workflows/build_test_cbsinit.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build_test_cbsinit.yml b/.github/workflows/build_test_cbsinit.yml index dedc626e..0c7ad82d 100644 --- a/.github/workflows/build_test_cbsinit.yml +++ b/.github/workflows/build_test_cbsinit.yml @@ -30,7 +30,7 @@ jobs: -VSRedistDir "''" ^ -CloudbaseInitRepoUrl ${{ matrix.cbsinit_repo }} ^ -CloudbaseInitRepoBranch ${{ matrix.cbsinit_branch }} ^ - -PythonMsiChecksum "not a real checksum" + -PythonMsiChecksum "C10234D0D9BD89F6F6DD55BAE28EDE0F97EE0DF4" - uses: actions/upload-artifact@v7 with: name: "CloudbaseInit_${{ matrix.platform }}_${{ matrix.os }}_MSI_${{ matrix.cbsinit_branch }}" From 601e9dc70f4ceaef3fdd28af8c6a474b5a53510e Mon Sep 17 00:00:00 2001 From: Adrian Vladu Date: Wed, 6 May 2026 11:47:06 +0300 Subject: [PATCH 4/6] python: use an extra parameter to install Python from the official download link Signed-off-by: Adrian Vladu --- .github/workflows/build_test_cbsinit.yml | 3 ++- BuildAutomation/BuildCloudbaseInitSetup.ps1 | 12 ++++++++---- 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/.github/workflows/build_test_cbsinit.yml b/.github/workflows/build_test_cbsinit.yml index 0c7ad82d..360dad7e 100644 --- a/.github/workflows/build_test_cbsinit.yml +++ b/.github/workflows/build_test_cbsinit.yml @@ -30,7 +30,8 @@ jobs: -VSRedistDir "''" ^ -CloudbaseInitRepoUrl ${{ matrix.cbsinit_repo }} ^ -CloudbaseInitRepoBranch ${{ matrix.cbsinit_branch }} ^ - -PythonMsiChecksum "C10234D0D9BD89F6F6DD55BAE28EDE0F97EE0DF4" + -InstallOfficialPythonMsi:$true ^ + -OfficialPythonMsiChecksum "C10234D0D9BD89F6F6DD55BAE28EDE0F97EE0DF4" - uses: actions/upload-artifact@v7 with: name: "CloudbaseInit_${{ matrix.platform }}_${{ matrix.os }}_MSI_${{ matrix.cbsinit_branch }}" diff --git a/BuildAutomation/BuildCloudbaseInitSetup.ps1 b/BuildAutomation/BuildCloudbaseInitSetup.ps1 index 3077034d..da5579f2 100644 --- a/BuildAutomation/BuildCloudbaseInitSetup.ps1 +++ b/BuildAutomation/BuildCloudbaseInitSetup.ps1 @@ -10,8 +10,9 @@ Param( [switch]$ClonePullInstallerRepo = $true, [string]$VSRedistDir = "${ENV:ProgramFiles(x86)}\Common Files\Merge Modules", [string]$SignTimestampUrl = "http://timestamp.digicert.com?alg=sha256", - [string]$VCVars="2019", - [string]$PythonMsiChecksum = $null + [string]$VCVars = "2019", + [switch]$InstallOfficialPythonMsi = $false, + [string]$OfficialPythonMsiChecksum = "C10234D0D9BD89F6F6DD55BAE28EDE0F97EE0DF4" ) $ErrorActionPreference = "Stop" @@ -78,9 +79,12 @@ try $python_template_dir = join-path $cloudbaseInitInstallerDir "Python$($pythonversion.replace('.', ''))_${platform}_Template" - if ($PythonMsiChecksum) { + if ($InstallOfficialPythonMsi) { + if (!$OfficialPythonMsiChecksum) { + throw "Please set a OfficialPythonMsiChecksum parameter value." + } Remove-Item -Recurse -Force $python_template_dir -ErrorAction SilentlyContinue - DownloadInstall-PythonMsi $platform $python_template_dir $pythonversion $PythonMsiChecksum + DownloadInstall-PythonMsi $platform $python_template_dir $pythonversion $OfficialPythonMsiChecksum } CheckCopyDir $python_template_dir $python_dir From 3abe937f37c11d36ff41e2a15227448f30ad4a79 Mon Sep 17 00:00:00 2001 From: Adrian Vladu Date: Wed, 6 May 2026 12:33:56 +0300 Subject: [PATCH 5/6] python: use the builtin installer folder Signed-off-by: Adrian Vladu --- .github/workflows/build_test_cbsinit.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build_test_cbsinit.yml b/.github/workflows/build_test_cbsinit.yml index 360dad7e..5e7bdef2 100644 --- a/.github/workflows/build_test_cbsinit.yml +++ b/.github/workflows/build_test_cbsinit.yml @@ -30,7 +30,7 @@ jobs: -VSRedistDir "''" ^ -CloudbaseInitRepoUrl ${{ matrix.cbsinit_repo }} ^ -CloudbaseInitRepoBranch ${{ matrix.cbsinit_branch }} ^ - -InstallOfficialPythonMsi:$true ^ + -InstallOfficialPythonMsi:$false ^ -OfficialPythonMsiChecksum "C10234D0D9BD89F6F6DD55BAE28EDE0F97EE0DF4" - uses: actions/upload-artifact@v7 with: From 770359124968d486dcf28d85dadb402f28f6af4a Mon Sep 17 00:00:00 2001 From: Adrian Vladu Date: Wed, 6 May 2026 12:50:48 +0300 Subject: [PATCH 6/6] github_actions: test both scenarios for Python folder source Signed-off-by: Adrian Vladu --- .github/workflows/build_test_cbsinit.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/build_test_cbsinit.yml b/.github/workflows/build_test_cbsinit.yml index 5e7bdef2..882f3bd3 100644 --- a/.github/workflows/build_test_cbsinit.yml +++ b/.github/workflows/build_test_cbsinit.yml @@ -9,6 +9,7 @@ jobs: max-parallel: 100 matrix: os: ['windows-2022'] + download_official_python_msi: ["true", "false"] cbsinit_repo: ['https://github.com/cloudbase/cloudbase-init'] cbsinit_branch: ['master'] python_version: ['3.14_4'] @@ -30,7 +31,7 @@ jobs: -VSRedistDir "''" ^ -CloudbaseInitRepoUrl ${{ matrix.cbsinit_repo }} ^ -CloudbaseInitRepoBranch ${{ matrix.cbsinit_branch }} ^ - -InstallOfficialPythonMsi:$false ^ + -InstallOfficialPythonMsi:$${{ matrix.download_official_python_msi }} ^ -OfficialPythonMsiChecksum "C10234D0D9BD89F6F6DD55BAE28EDE0F97EE0DF4" - uses: actions/upload-artifact@v7 with: