From 41165a296dd394d2074cc5769add635a999169f0 Mon Sep 17 00:00:00 2001 From: Burak Velioglu Date: Thu, 10 Oct 2024 11:09:14 +0300 Subject: [PATCH] Remove build part --- .github/workflows/ubicloud-image.yml | 242 +++++++++--------- .../ubuntu/scripts/build/install-haskell.sh | 2 +- 2 files changed, 122 insertions(+), 122 deletions(-) diff --git a/.github/workflows/ubicloud-image.yml b/.github/workflows/ubicloud-image.yml index 726917976b2a7..e0f98c9c93543 100644 --- a/.github/workflows/ubicloud-image.yml +++ b/.github/workflows/ubicloud-image.yml @@ -46,127 +46,127 @@ jobs: matrix="$(echo $images | jq --argjson selecteds "$selected_images" '{include: .include | map(select(.image_type | IN($selecteds[])))}')" echo "matrix<> "$GITHUB_OUTPUT" - build: - needs: generate-matrix - name: build ${{ matrix.image_type }} - runs-on: ubicloud-standard-4 - strategy: - fail-fast: false - matrix: ${{ fromJson(needs.generate-matrix.outputs.matrix) }} - env: - MANAGED_IMAGE_NAME: "${{ matrix.image_type }}-${{inputs.image_version }}" - steps: - - name: Check out code - uses: actions/checkout@v4 - - - name: Setup packer - uses: hashicorp/setup-packer@main - with: - version: 1.9.4 - - - name: Set variables - shell: pwsh - id: setvars - run: | - $ImageType = "${{ matrix.image_type }}" - $TemplateDirectoryName = if ($ImageType.StartsWith("ubuntu")) { "ubuntu/templates" } else { "windows/templates" } - $TemplateDirectoryPath = Join-Path "images" $TemplateDirectoryName | Resolve-Path - $TemplatePath = Join-Path $TemplateDirectoryPath "$ImageType.pkr.hcl" - "TemplateDirectoryPath=$TemplateDirectoryPath" >> $env:GITHUB_ENV - "TemplatePath=$TemplatePath" >> $env:GITHUB_ENV - - - name: Build VM - shell: pwsh - run: | - ./images.CI/linux-and-win/build-image.ps1 ` - -ClientId "${{ secrets.AZURE_CLIENT_ID }}" ` - -ClientSecret "${{ secrets.AZURE_CLIENT_SECRET }}" ` - -TemplatePath "$env:TemplatePath" ` - -ImageName "${{ env.MANAGED_IMAGE_NAME }}" ` - -ImageResourceGroupName "${{ secrets.AZURE_RESOURCE_GROUP }}" ` - -TempResourceGroupName "packer-temp-${{ env.MANAGED_IMAGE_NAME }}" ` - -SubscriptionId "${{ secrets.AZURE_SUBSCRIPTION_ID }}" ` - -TenantId "${{ secrets.AZURE_TENANT_ID }}" ` - -Location "${{ env.AZURE_LOCATION }}" ` - -ImageVersion "${{ inputs.image_version }}" - env: - PACKER_LOG: 1 - PACKER_LOG_PATH: "/tmp/packer-log.txt" - - - name: Convert managed image to VHD - shell: pwsh - timeout-minutes: 120 - run: | - ./images.CI/linux-and-win/convert-to-vhd.ps1 ` - -SubscriptionId "${{ secrets.AZURE_SUBSCRIPTION_ID }}" ` - -Location "${{ env.AZURE_LOCATION }}" ` - -ResourceGroupName "${{ secrets.AZURE_RESOURCE_GROUP }}" ` - -ManagedImageName "${{ env.MANAGED_IMAGE_NAME }}" ` - -GalleryName "GitHubRunnerImages" ` - -GalleryImageSku "${{ matrix.image_type }}" ` - -GalleryImageVersion "${{ inputs.image_version }}" ` - -StorageAccountName "${{ secrets.AZURE_STORAGE_ACCOUNT }}" ` - -StorageAccountContainerName "images" ` - -VhdName "${{ env.MANAGED_IMAGE_NAME }}.vhd" ` - -ClientId "${{ secrets.AZURE_CLIENT_ID }}" ` - -ClientSecret "${{ secrets.AZURE_CLIENT_SECRET }}" ` - -TenantId "${{ secrets.AZURE_TENANT_ID }}" ` - -RemoveManagedImage - - - name: Copy image artifacts to the separate directory - shell: pwsh - run: | - $ImageType = "${{ matrix.image_type }}" - $rootDirectoryName = if ($ImageType.StartsWith("ubuntu")) { "ubuntu" } else { "windows" } - $rootDirectoryPath = Join-Path "images" $rootDirectoryName | Resolve-Path - - $readmePath = Join-Path $rootDirectoryPath "${{ matrix.readme }}" - $softwareReportPath = Join-Path $rootDirectoryPath "software-report.json" - - New-Item artifact -ItemType Directory - Copy-Item -Path $readmePath -Destination "artifact/" - if (Test-Path $softwareReportPath) { - Copy-Item -Path $softwareReportPath -Destination "artifact/" - } - - - name: Print markdown software report - shell: pwsh - run: | - Get-Content -Path "artifact/${{ matrix.readme }}" - - - name: Print json software report - shell: pwsh - run: | - $softwareReportPath = "artifact/software-report.json" - if (Test-Path $softwareReportPath) { - Get-Content -Path $softwareReportPath - } - - - name: Publish Artifacts - uses: actions/upload-artifact@v4 - with: - name: "${{ env.MANAGED_IMAGE_NAME }}-artifact" - path: artifact/* - - - name: Print provisioners duration - shell: pwsh - run: | - ./images.CI/measure-provisioners-duration.ps1 ` - -PackerLogPath "/tmp/packer-log.txt" ` - -PrefixToPathTrim "$env:TemplateDirectoryPath" ` - -PrintTopNLongest 25 - - - name: Clean up resources - if: always() - shell: pwsh - run: | - ./images.CI/linux-and-win/cleanup.ps1 ` - -TempResourceGroupName "packer-temp-${{ env.MANAGED_IMAGE_NAME }}" ` - -StorageAccount "${{ secrets.AZURE_STORAGE_ACCOUNT }}" ` - -SubscriptionId "${{ secrets.AZURE_SUBSCRIPTION_ID }}" ` - -ClientId "${{ secrets.AZURE_CLIENT_ID }}" ` - -ClientSecret "${{ secrets.AZURE_CLIENT_SECRET }}" ` - -TenantId "${{ secrets.AZURE_TENANT_ID }}" + # build: + # needs: generate-matrix + # name: build ${{ matrix.image_type }} + # runs-on: ubicloud-standard-4 + # strategy: + # fail-fast: false + # matrix: ${{ fromJson(needs.generate-matrix.outputs.matrix) }} + # env: + # MANAGED_IMAGE_NAME: "${{ matrix.image_type }}-${{inputs.image_version }}" + # steps: + # - name: Check out code + # uses: actions/checkout@v4 + + # - name: Setup packer + # uses: hashicorp/setup-packer@main + # with: + # version: 1.9.4 + + # - name: Set variables + # shell: pwsh + # id: setvars + # run: | + # $ImageType = "${{ matrix.image_type }}" + # $TemplateDirectoryName = if ($ImageType.StartsWith("ubuntu")) { "ubuntu/templates" } else { "windows/templates" } + # $TemplateDirectoryPath = Join-Path "images" $TemplateDirectoryName | Resolve-Path + # $TemplatePath = Join-Path $TemplateDirectoryPath "$ImageType.pkr.hcl" + # "TemplateDirectoryPath=$TemplateDirectoryPath" >> $env:GITHUB_ENV + # "TemplatePath=$TemplatePath" >> $env:GITHUB_ENV + + # - name: Build VM + # shell: pwsh + # run: | + # ./images.CI/linux-and-win/build-image.ps1 ` + # -ClientId "${{ secrets.AZURE_CLIENT_ID }}" ` + # -ClientSecret "${{ secrets.AZURE_CLIENT_SECRET }}" ` + # -TemplatePath "$env:TemplatePath" ` + # -ImageName "${{ env.MANAGED_IMAGE_NAME }}" ` + # -ImageResourceGroupName "${{ secrets.AZURE_RESOURCE_GROUP }}" ` + # -TempResourceGroupName "packer-temp-${{ env.MANAGED_IMAGE_NAME }}" ` + # -SubscriptionId "${{ secrets.AZURE_SUBSCRIPTION_ID }}" ` + # -TenantId "${{ secrets.AZURE_TENANT_ID }}" ` + # -Location "${{ env.AZURE_LOCATION }}" ` + # -ImageVersion "${{ inputs.image_version }}" + # env: + # PACKER_LOG: 1 + # PACKER_LOG_PATH: "/tmp/packer-log.txt" + + # - name: Convert managed image to VHD + # shell: pwsh + # timeout-minutes: 120 + # run: | + # ./images.CI/linux-and-win/convert-to-vhd.ps1 ` + # -SubscriptionId "${{ secrets.AZURE_SUBSCRIPTION_ID }}" ` + # -Location "${{ env.AZURE_LOCATION }}" ` + # -ResourceGroupName "${{ secrets.AZURE_RESOURCE_GROUP }}" ` + # -ManagedImageName "${{ env.MANAGED_IMAGE_NAME }}" ` + # -GalleryName "GitHubRunnerImages" ` + # -GalleryImageSku "${{ matrix.image_type }}" ` + # -GalleryImageVersion "${{ inputs.image_version }}" ` + # -StorageAccountName "${{ secrets.AZURE_STORAGE_ACCOUNT }}" ` + # -StorageAccountContainerName "images" ` + # -VhdName "${{ env.MANAGED_IMAGE_NAME }}.vhd" ` + # -ClientId "${{ secrets.AZURE_CLIENT_ID }}" ` + # -ClientSecret "${{ secrets.AZURE_CLIENT_SECRET }}" ` + # -TenantId "${{ secrets.AZURE_TENANT_ID }}" ` + # -RemoveManagedImage + + # - name: Copy image artifacts to the separate directory + # shell: pwsh + # run: | + # $ImageType = "${{ matrix.image_type }}" + # $rootDirectoryName = if ($ImageType.StartsWith("ubuntu")) { "ubuntu" } else { "windows" } + # $rootDirectoryPath = Join-Path "images" $rootDirectoryName | Resolve-Path + + # $readmePath = Join-Path $rootDirectoryPath "${{ matrix.readme }}" + # $softwareReportPath = Join-Path $rootDirectoryPath "software-report.json" + + # New-Item artifact -ItemType Directory + # Copy-Item -Path $readmePath -Destination "artifact/" + # if (Test-Path $softwareReportPath) { + # Copy-Item -Path $softwareReportPath -Destination "artifact/" + # } + + # - name: Print markdown software report + # shell: pwsh + # run: | + # Get-Content -Path "artifact/${{ matrix.readme }}" + + # - name: Print json software report + # shell: pwsh + # run: | + # $softwareReportPath = "artifact/software-report.json" + # if (Test-Path $softwareReportPath) { + # Get-Content -Path $softwareReportPath + # } + + # - name: Publish Artifacts + # uses: actions/upload-artifact@v4 + # with: + # name: "${{ env.MANAGED_IMAGE_NAME }}-artifact" + # path: artifact/* + + # - name: Print provisioners duration + # shell: pwsh + # run: | + # ./images.CI/measure-provisioners-duration.ps1 ` + # -PackerLogPath "/tmp/packer-log.txt" ` + # -PrefixToPathTrim "$env:TemplateDirectoryPath" ` + # -PrintTopNLongest 25 + + # - name: Clean up resources + # if: always() + # shell: pwsh + # run: | + # ./images.CI/linux-and-win/cleanup.ps1 ` + # -TempResourceGroupName "packer-temp-${{ env.MANAGED_IMAGE_NAME }}" ` + # -StorageAccount "${{ secrets.AZURE_STORAGE_ACCOUNT }}" ` + # -SubscriptionId "${{ secrets.AZURE_SUBSCRIPTION_ID }}" ` + # -ClientId "${{ secrets.AZURE_CLIENT_ID }}" ` + # -ClientSecret "${{ secrets.AZURE_CLIENT_SECRET }}" ` + # -TenantId "${{ secrets.AZURE_TENANT_ID }}" upload: if: ${{ inputs.upload_image }} diff --git a/images/ubuntu/scripts/build/install-haskell.sh b/images/ubuntu/scripts/build/install-haskell.sh index 588164fdf0400..182681ea1c618 100644 --- a/images/ubuntu/scripts/build/install-haskell.sh +++ b/images/ubuntu/scripts/build/install-haskell.sh @@ -17,7 +17,7 @@ set_etc_environment_variable "BOOTSTRAP_HASKELL_NONINTERACTIVE" $BOOTSTRAP_HASKE set_etc_environment_variable "GHCUP_INSTALL_BASE_PREFIX" $GHCUP_INSTALL_BASE_PREFIX # Install GHCup -while ! command -v ghcup > /dev/null 2>&1; do +while ! command -v ghcup; do curl --proto '=https' --tlsv1.2 -fsSL https://get-ghcup.haskell.org | sh > /dev/null 2>&1 || true export PATH="$ghcup_bin:$PATH" prepend_etc_environment_path $ghcup_bin