From 3f12cfcb6ecef8fbc20b3b19dfa36335ef598882 Mon Sep 17 00:00:00 2001 From: Andrey Koltsov Date: Thu, 27 Jun 2024 12:44:51 +0300 Subject: [PATCH] [TW-87124] Windows 2022-based Agent Images become incompatible with some runners after restart (#164) * Remove 'plugins' folder during the build of the container. * Add removal of 'plugins' directory from Windows 2022 images into source Dockerfile. * Remove SHELL instruction which is no longer needed. --- .../MinimalAgent/nanoserver/NanoServer2022.Dockerfile | 10 ++++++---- .../windows/MinimalAgent/nanoserver/2022/Dockerfile | 10 ++++++---- 2 files changed, 12 insertions(+), 8 deletions(-) diff --git a/configs/windows/MinimalAgent/nanoserver/NanoServer2022.Dockerfile b/configs/windows/MinimalAgent/nanoserver/NanoServer2022.Dockerfile index af60e298..90b52007 100644 --- a/configs/windows/MinimalAgent/nanoserver/NanoServer2022.Dockerfile +++ b/configs/windows/MinimalAgent/nanoserver/NanoServer2022.Dockerfile @@ -28,12 +28,14 @@ USER ContainerAdministrator COPY scripts/*.cs /scripts/ SHELL ["pwsh", "-Command", "$ErrorActionPreference = 'Stop'; $ProgressPreference = 'SilentlyContinue';"] -# CaseSensitivity is essential for the agent => enforcing it. SHELL usage is mandatory (pwsh or other won't work) -RUN mkdir C:\\BuildAgent -SHELL ["pwsh", "-Command", "fsutil.exe", "file", "SetCaseSensitiveInfo", "C:\\BuildAgent", "enable"] - # Prepare build agent distribution +RUN mkdir C:\\BuildAgent COPY TeamCity/buildAgent C:/BuildAgent + +# Workaround for TW-87124 - Windows 2022-based plugin directories receive incorrect case, causing their inability ... +# ... to load. The directory will be fetched from the server upon the first update with proper case. +RUN Remove-Item -Recurse -Force C:/BuildAgent/plugins + COPY run-agent.ps1 /BuildAgent/run-agent.ps1 # JDK diff --git a/context/generated/windows/MinimalAgent/nanoserver/2022/Dockerfile b/context/generated/windows/MinimalAgent/nanoserver/2022/Dockerfile index 7e624093..4dab7a49 100644 --- a/context/generated/windows/MinimalAgent/nanoserver/2022/Dockerfile +++ b/context/generated/windows/MinimalAgent/nanoserver/2022/Dockerfile @@ -22,12 +22,14 @@ USER ContainerAdministrator COPY scripts/*.cs /scripts/ SHELL ["pwsh", "-Command", "$ErrorActionPreference = 'Stop'; $ProgressPreference = 'SilentlyContinue';"] -# CaseSensitivity is essential for the agent => enforcing it. SHELL usage is mandatory (pwsh or other won't work) -RUN mkdir C:\\BuildAgent -SHELL ["pwsh", "-Command", "fsutil.exe", "file", "SetCaseSensitiveInfo", "C:\\BuildAgent", "enable"] - # Prepare build agent distribution +RUN mkdir C:\\BuildAgent COPY TeamCity/buildAgent C:/BuildAgent + +# Workaround for TW-87124 - Windows 2022-based plugin directories receive incorrect case, causing their inability ... +# ... to load. The directory will be fetched from the server upon the first update with proper case. +RUN Remove-Item -Recurse -Force C:/BuildAgent/plugins + COPY run-agent.ps1 /BuildAgent/run-agent.ps1 # JDK