From f747c94658a17ebc1f7c8b63920b406ad19e556a Mon Sep 17 00:00:00 2001 From: George Adams Date: Tue, 15 Oct 2024 16:26:16 +0100 Subject: [PATCH] skip more OpenJ9 roles --- .github/workflows/build_windows.yml | 6 +----- ansible/docker/Dockerfile.win2022 | 19 ++++++++++++------- .../AdoptOpenJDK_Windows_Playbook/main.yml | 16 ++++++++-------- .../roles/Incredibuild/tasks/main.yml | 6 +++--- .../roles/MSVS_2022_REDIST/tasks/main.yml | 4 ++-- 5 files changed, 26 insertions(+), 25 deletions(-) diff --git a/.github/workflows/build_windows.yml b/.github/workflows/build_windows.yml index 5f5139d10d..4425aad3da 100644 --- a/.github/workflows/build_windows.yml +++ b/.github/workflows/build_windows.yml @@ -39,11 +39,7 @@ jobs: subscription-id: ${{ secrets.AZURE_SUBSCRIPTION_ID }} - name: Build container image - run: docker build \ - -t adoptium.azurecr.io/windows2022_build_image:latest \ - --build-arg SOURCE_DIR=. \ - -f ansible/docker/Dockerfile.win2022 . \ - --output 'type=local,dest=C:\infrastructure' + run: docker build -t adoptium.azurecr.io/windows2022_build_image:latest --build-arg git_ref=${{ github.ref }} -f ansible/docker/Dockerfile.win2022 . - name: Push container image to ACR if: github.ref == 'refs/heads/master' diff --git a/ansible/docker/Dockerfile.win2022 b/ansible/docker/Dockerfile.win2022 index a684bc68a3..f61880c218 100644 --- a/ansible/docker/Dockerfile.win2022 +++ b/ansible/docker/Dockerfile.win2022 @@ -2,6 +2,7 @@ FROM mcr.microsoft.com/windows/servercore:ltsc2022 # Specify this with --build-arg PW=SomePassword ARG PW=T3mp=Passwd +ARG git_ref=master # Download Cygwin Bootstrapper & Verify Its Checksum RUN powershell -Command \ @@ -16,8 +17,9 @@ RUN powershell -Command \ Write-Host 'Checksum verification succeeded!' -ForegroundColor Green; \ }" -# Set up cygwin with ansible as a bootstrap, and add to system default path -RUN setup-x86_64.exe --packages ansible --download --local-install --delete-orphans --site https://mirrors.kernel.org/sourceware/cygwin --local-package-dir c:\cygwin_packages --root C:\cygwin64 --wait --quiet-mode && \ +# Set up cygwin with git and ansible as a bootstrap, and add to system default path +RUN setup-x86_64.exe --packages git,ansible --download --local-install --delete-orphans --site https://mirrors.kernel.org/sourceware/cygwin --local-package-dir c:\cygwin_packages --root C:\cygwin64 --wait --quiet-mode && \ + C:\cygwin64\bin\git config --system core.autocrlf false && \ del setup-x86_64.exe && \ setx PATH "c:\cygwin64\bin;%PATH%" && \ mkdir c:\temp @@ -45,11 +47,14 @@ RUN PowerShell .\ConfigureRemotingForAnsible.ps1 -CertValidityDays 9999 & \ ENV TERM=dumb RUN net user ansible %PW% /ADD & net localgroup "Administrators" ansible /ADD & net localgroup "Remote Management Users" ansible /ADD && \ - sed -i -e 's/hosts: .*/hosts: localhost/' infrastructure/ansible/playbooks/AdoptOpenJDK_Windows_Playbook/main.yml && \ - echo localhost ansible_connection=winrm > infrastructure/ansible/hosts && \ - cd C:\infrastructure\ansible && \ - C:\cygwin64\bin\python3.7m.exe /usr/bin/ansible-playbook -e git_sha=00000000 -e ansible_user=ansible -e ansible_password=%PW% -i hosts \ - --skip-tags=adoptopenjdk,reboot,Windows_Updates,NTP_TIME,MSVS_2013,MSVS_2017,MSVS_2019 playbooks/AdoptOpenJDK_Windows_Playbook/main.yml && \ + C:\cygwin64\bin\git clone https://github.com/adoptium/infrastructure c:/infrastructure && \ + cd infrastructure && C:\cygwin64\bin\git fetch origin %git_ref% && C:\cygwin64\bin\git checkout FETCH_HEAD && \ + sed -i -e 's/hosts: .*/hosts: localhost/' ansible/playbooks/AdoptOpenJDK_Windows_Playbook/main.yml && \ + echo localhost ansible_connection=winrm > ansible/hosts && \ + cd ansible && \ + C:\cygwin64\bin\python3.7m.exe /usr/bin/ansible-playbook -e git_sha=000000 -e ansible_user=ansible -e ansible_password=%PW% -i hosts \ + --skip-tags=adoptopenjdk,reboot,Windows_Updates,NTP_TIME,MSVS_2013,Rust,IcedTea-Web playbooks/AdoptOpenJDK_Windows_Playbook/main.yml && \ + rmdir /s /q c:\infrastructure && \ net user ansible /DELETE ENTRYPOINT ["C:\\Program Files (x86)\\Microsoft Visual Studio\\2022\\BuildTools\\Common7\\Tools\\VsDevCmd.bat", "&&", "powershell.exe", "-NoLogo", "-ExecutionPolicy", "Bypass"] diff --git a/ansible/playbooks/AdoptOpenJDK_Windows_Playbook/main.yml b/ansible/playbooks/AdoptOpenJDK_Windows_Playbook/main.yml index 78d07893e6..8685f5143e 100644 --- a/ansible/playbooks/AdoptOpenJDK_Windows_Playbook/main.yml +++ b/ansible/playbooks/AdoptOpenJDK_Windows_Playbook/main.yml @@ -70,19 +70,19 @@ - ANT # Testing - role: MSVS_2013 when: ansible_architecture == "64-bit" - - role: MSVS_2017 # OpenJ9 - when: ansible_architecture == "64-bit" - - role: MSVS_2019 # OpenJ9 - tags: MSVS_2019 + # - role: MSVS_2017 # OpenJ9 + # when: ansible_architecture == "64-bit" + # - role: MSVS_2019 # OpenJ9 + # tags: MSVS_2019 - role: MSVS_2022 tags: MSVS_2022 - role: MSVS_2022_REDIST tags: MSVS_2022_REDIST - - NVidia_Cuda_Toolkit # OpenJ9 + # - NVidia_Cuda_Toolkit # OpenJ9 - NTP_TIME - - Clang_64bit # OpenJ9 - - Clang_32bit # OpenJ9 - - nasm # OpenJ9 + # - Clang_64bit # OpenJ9 + # - Clang_32bit # OpenJ9 + # - nasm # OpenJ9 - Rust # IcedTea-Web - IcedTea-Web # For Jenkins webstart - WiX # For creating installers diff --git a/ansible/playbooks/AdoptOpenJDK_Windows_Playbook/roles/Incredibuild/tasks/main.yml b/ansible/playbooks/AdoptOpenJDK_Windows_Playbook/roles/Incredibuild/tasks/main.yml index 598e006981..ebadc1bc71 100644 --- a/ansible/playbooks/AdoptOpenJDK_Windows_Playbook/roles/Incredibuild/tasks/main.yml +++ b/ansible/playbooks/AdoptOpenJDK_Windows_Playbook/roles/Incredibuild/tasks/main.yml @@ -4,12 +4,12 @@ ####################################### - name: Check if the ibxbuild service exists - ansible.windows.win_service_info: + win_service_info: name: IBXDashboard register: service_info - name: Stop the IBX Dashboard service if it exists - ansible.windows.win_service: + win_service: name: IBXDashboard state: stopped when: service_info.exists @@ -28,7 +28,7 @@ when: incredibuild_conf_file.stat.exists - name: Start the IBX Dashboard service if it exists - ansible.windows.win_service: + win_service: name: IBXDashboard state: started when: service_info.exists diff --git a/ansible/playbooks/AdoptOpenJDK_Windows_Playbook/roles/MSVS_2022_REDIST/tasks/main.yml b/ansible/playbooks/AdoptOpenJDK_Windows_Playbook/roles/MSVS_2022_REDIST/tasks/main.yml index ff4805b2e3..641e56fff4 100644 --- a/ansible/playbooks/AdoptOpenJDK_Windows_Playbook/roles/MSVS_2022_REDIST/tasks/main.yml +++ b/ansible/playbooks/AdoptOpenJDK_Windows_Playbook/roles/MSVS_2022_REDIST/tasks/main.yml @@ -19,13 +19,13 @@ tags: MSVS_2022_REDIST - name: Check if C:\openjdk\devkit exists - ansible.windows.win_stat: + win_stat: path: 'c:\openjdk\devkit' register: directory_status tags: MSVS_2022_REDIST - name: Create C:\openjdk\devkit if it does not exist - ansible.windows.win_file: + win_file: path: 'c:\openjdk\devkit\' state: directory when: not directory_status.stat.exists