From 0b65001185945e35be70cb3a6f7d461356e22724 Mon Sep 17 00:00:00 2001 From: christinalau0 <91564706+christinalau0@users.noreply.github.com> Date: Fri, 18 Oct 2024 18:03:27 -0700 Subject: [PATCH] ci: Output AIB release notes and cgmanifest to customization.log (#263) * Output windows image builder containerd image pull notes and release notes * Add linux release notes and cgmanifest * Clean up * Remove validation from release.yaml, use ADO instead --- .github/workflows/release.yaml | 76 --------------------- vhd/packer/configure-windows-vhd-phase2.ps1 | 8 ++- vhd/packer/install-dependencies.sh | 14 ++++ vhd/packer/write-release-notes-windows.ps1 | 11 +++ 4 files changed, 32 insertions(+), 77 deletions(-) diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index f88538819..09d11c278 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -7,36 +7,8 @@ on: paths: - 'releases/CHANGELOG*.md' -env: - LINUX_NODE_IMAGE_SUBSCRIPTION_ID: ${{ secrets.TEST_AZURE_SUB_ID }} - LINUX_NODE_IMAGE_RESOURCE_GROUP: ${{vars.LINUX_NODE_IMAGE_RESOURCE_GROUP}} - LINUX_NODE_IMAGE_GALLERY: ${{vars.LINUX_NODE_IMAGE_GALLERY}} - LINUX_NODE_IMAGE_NAME: ${{vars.LINUX_NODE_IMAGE_NAME}} - LINUX_NODE_IMAGE_VERSION: 2024.032.1 - WINDOWS_NODE_IMAGE_SUBSCRIPTION_ID: ${{ secrets.TEST_AZURE_SUB_ID }} - WINDOWS_NODE_IMAGE_RESOURCE_GROUP: ${{vars.WINDOWS_NODE_IMAGE_RESOURCE_GROUP}} - WINDOWS_NODE_IMAGE_GALLERY: ${{vars.WINDOWS_NODE_IMAGE_GALLERY}} - WINDOWS_NODE_IMAGE_NAME: ${{vars.WINDOWS_NODE_IMAGE_NAME}} - WINDOWS_NODE_IMAGE_VERSION: 2024.032.1 - jobs: - sig_image_versions: - runs-on: ubuntu-latest - outputs: - LINUX_NODE_IMAGE_VERSION: ${{ env.LINUX_NODE_IMAGE_VERSION }} - WINDOWS_NODE_IMAGE_VERSION: ${{ env.WINDOWS_NODE_IMAGE_VERSION }} - steps: - - run: echo "Exposing sig image version variables" - validate-no-egress: - needs: sig_image_versions - uses: ./.github/workflows/test-vhd-no-egress.yaml - with: - from_branch: '' - LINUX_NODE_IMAGE_VERSION: ${{ needs.sig_image_versions.outputs.LINUX_NODE_IMAGE_VERSION }} - WINDOWS_NODE_IMAGE_VERSION: ${{ needs.sig_image_versions.outputs.WINDOWS_NODE_IMAGE_VERSION }} - secrets: inherit build: - needs: validate-no-egress runs-on: ubuntu-latest permissions: contents: write @@ -80,54 +52,6 @@ jobs: - name: print git status after build run: | git status - - name: Validate 1.27 + containerd E2E - env: - SSH_AUTH_SOCK: /tmp/ssh_agent.sock - ORCHESTRATOR_RELEASE: "1.27" - CLUSTER_DEFINITION: "examples/e2e-tests/kubernetes/release/default/definition.json" - SUBSCRIPTION_ID: ${{ secrets.TEST_AZURE_SUB_ID }} - CLIENT_ID: ${{ secrets.TEST_AZURE_SP_ID }} - CLIENT_SECRET: ${{ secrets.TEST_AZURE_SP_PW }} - LOCATION: "eastus" - TENANT_ID: ${{ secrets.TEST_AZURE_TENANT_ID }} - USE_MANAGED_IDENTITY: true - MSI_USER_ASSIGNED_ID: ${{ secrets.MSI_USER_ASSIGNED_ID_AKS_ENGINE_E2E }} - CREATE_VNET: true - CLEANUP_ON_EXIT: true - CLEANUP_IF_FAIL: true - GINKGO_SKIP: "" - STABILITY_ITERATIONS: "0" - RETAIN_SSH: false - CONTAINER_RUNTIME: "containerd" - BLOCK_SSH: true - SKIP_LOGS_COLLECTION: true - AZURE_CORE_ONLY_SHOW_ERRORS: true - DISTRO: "aks-ubuntu-20.04" - run: make test-kubernetes - - name: Validate 1.28 + containerd E2E - env: - SSH_AUTH_SOCK: /tmp/ssh_agent.sock - ORCHESTRATOR_RELEASE: "1.28" - CLUSTER_DEFINITION: "examples/e2e-tests/kubernetes/release/default/definition.json" - SUBSCRIPTION_ID: ${{ secrets.TEST_AZURE_SUB_ID }} - CLIENT_ID: ${{ secrets.TEST_AZURE_SP_ID }} - CLIENT_SECRET: ${{ secrets.TEST_AZURE_SP_PW }} - LOCATION: "eastus" - TENANT_ID: ${{ secrets.TEST_AZURE_TENANT_ID }} - USE_MANAGED_IDENTITY: true - MSI_USER_ASSIGNED_ID: ${{ secrets.MSI_USER_ASSIGNED_ID_AKS_ENGINE_E2E }} - CREATE_VNET: true - CLEANUP_ON_EXIT: true - CLEANUP_IF_FAIL: true - GINKGO_SKIP: "" - STABILITY_ITERATIONS: "0" - RETAIN_SSH: false - CONTAINER_RUNTIME: "containerd" - BLOCK_SSH: true - SKIP_LOGS_COLLECTION: true - AZURE_CORE_ONLY_SHOW_ERRORS: true - DISTRO: "aks-ubuntu-20.04" - run: make test-kubernetes - name: Remove untracked files created during workflow steps run: git ls-files --others --exclude-standard -z | xargs -0 -r rm - name: Add local tag diff --git a/vhd/packer/configure-windows-vhd-phase2.ps1 b/vhd/packer/configure-windows-vhd-phase2.ps1 index 49ff7408c..72510d551 100644 --- a/vhd/packer/configure-windows-vhd-phase2.ps1 +++ b/vhd/packer/configure-windows-vhd-phase2.ps1 @@ -48,8 +48,14 @@ function Get-ContainerImages { # CSE will configure and register containerd as a service at deployment time Start-Job -Name containerd -ScriptBlock { containerd.exe } foreach ($image in $imagesToPull) { - & ctr.exe -n k8s.io images pull $image > $containerdImagePullNotesFilePath + & ctr.exe -n k8s.io images pull $image >> $containerdImagePullNotesFilePath } + Write-Log "Begin listing containerd images" + $imagesList = & ctr.exe -n k8s.io images list + foreach ($line in $imagesList) { + Write-Output $line + } + Write-Log "End listing containerd images" Stop-Job -Name containerd Remove-Job -Name containerd } diff --git a/vhd/packer/install-dependencies.sh b/vhd/packer/install-dependencies.sh index f614608ff..0c83124d7 100644 --- a/vhd/packer/install-dependencies.sh +++ b/vhd/packer/install-dependencies.sh @@ -443,3 +443,17 @@ apt list --installed \ } )) }' > ${VHD_CG_MANIFEST} + +output_file_contents() { + local filepath=$1 + + if [ -f "$filepath" ]; then + echo "===== Begin contents of $filepath =====" + cat "$filepath" + echo "===== End contents of $filepath =====" + else + echo "File not found: $filepath" + fi +} +output_file_contents "$VHD_LOGS_FILEPATH" +output_file_contents "$VHD_CG_MANIFEST" \ No newline at end of file diff --git a/vhd/packer/write-release-notes-windows.ps1 b/vhd/packer/write-release-notes-windows.ps1 index 1a86b0e29..eef857092 100644 --- a/vhd/packer/write-release-notes-windows.ps1 +++ b/vhd/packer/write-release-notes-windows.ps1 @@ -123,3 +123,14 @@ Log ($displayObjects | Format-Table -Property File, Sha256, SizeBytes | Out-Stri # Ensure proper encoding is set for release notes file [IO.File]::ReadAllText($releaseNotesFilePath) | Out-File -Encoding utf8 $releaseNotesFilePath + +if (Test-Path $releaseNotesFilePath) { + $fileContent = Get-Content $releaseNotesFilePath + Write-Output "===== Begin contents of $releaseNotesFilePath =====" + foreach ($line in $fileContent) { + Write-Output $line + } + Write-Output "===== End contents of $releaseNotesFilePath =====" +} else { + Write-Output "File not found: $releaseNotesFilePath" +}