1+ # https://learn.microsoft.com/en-us/visualstudio/install/build-tools-container?view=vs-2022
2+
3+ # Use the Windows Server Core 2019 image.
4+ FROM mcr.microsoft.com/windows/servercore:ltsc2022 AS devel
5+
6+ SHELL ["powershell" , "-Command" , "$ErrorActionPreference = 'Stop'; $ProgressPreference = 'SilentlyContinue';" ]
7+
8+ # -----------------------------------------------------------------------------
9+ # Create a working directory
10+
11+ WORKDIR "C:\\\\ workspace"
12+
13+ # -----------------------------------------------------------------------------
14+ # Install runtime dependencies
15+
16+ COPY setup_env.ps1 C:\\ workspace\\ setup_env.ps1
17+ # TRT is installed along with build-time dependencies
18+ RUN C:\w orkspace\s etup_env.ps1 -skipTRT -skipCUDNN
19+ RUN Remove-Item "C:\w orkspace\s etup_env.ps1" -Force
20+ # If enabling CUDNN, CUDNN paths are populated in the env variable CUDNN, add it to PATH
21+ # RUN [Environment]::SetEnvironmentVariable('Path', $Env:Path + ';' + $Env:CUDNN, [EnvironmentVariableTarget]::Machine)
22+
23+ # -----------------------------------------------------------------------------
24+ # Install build-time dependencies
25+
26+ COPY setup_build_env.ps1 C:\\ workspace\\ setup_build_env.ps1
27+ # TRT is installed in workspace
28+ RUN C:\w orkspace\s etup_build_env.ps1 -TRTPath 'C:\\ workspace'
29+ RUN Remove-Item "C:\w orkspace\s etup_build_env.ps1" -Force
30+
31+ # Add binaries to Path
32+ RUN [Environment]::SetEnvironmentVariable('Path' , $Env:Path + ';C:\P rogram Files\C Make\b in' , [EnvironmentVariableTarget]::Machine)
33+
34+ # -----------------------------------------------------------------------------
35+
36+ # Install Vim (can delete this but it's nice to have)
37+ # and add binaries to Path
38+
39+ RUN Invoke-WebRequest -Uri https://ftp.nluug.nl/pub/vim/pc/gvim90.exe \
40+ -OutFile "install_vim.exe" ; \
41+ Start-Process install_vim.exe -Wait -ArgumentList '/S' ; \
42+ Remove-Item install_vim.exe -Force ; \
43+ [Environment]::SetEnvironmentVariable('Path' , $Env:Path + ';C:\P rogram Files (x86)\V im\v im90' , [EnvironmentVariableTarget]::Machine)
44+ # -----------------------------------------------------------------------------
45+
46+ # Install Chocolatey
47+ # Chocolatey is a package manager for Windows
48+
49+ # If you try to install Chocolatey 2.0.0, it fails on .NET Framework 4.8 installation
50+ # https://stackoverflow.com/a/76470753
51+ ENV chocolateyVersion=1.4.0
52+
53+ # https://docs.chocolatey.org/en-us/choco/setup#install-with-powershell.exe
54+ RUN Set-ExecutionPolicy Bypass -Scope Process -Force; \
55+ [System.Net.ServicePointManager]::SecurityProtocol = [System.Net.ServicePointManager]::SecurityProtocol -bor 3072; \
56+ iex ((New-Object System.Net.WebClient).DownloadString('https://community.chocolatey.org/install.ps1' ))
57+
58+ # -----------------------------------------------------------------------------
59+
60+ # Install Git via Chocolatey
61+ RUN choco install git -y
62+
63+ # -----------------------------------------------------------------------------
64+ # Install CUDA 11.8 NVTX
65+ RUN Invoke-WebRequest -Uri https://developer.download.nvidia.com/compute/cuda/11.8.0/network_installers/cuda_11.8.0_windows_network.exe \
66+ -OutFile cuda_11.8.0_windows_network.exe; \
67+ Invoke-WebRequest -Uri https://7-zip.org/a/7zr.exe \
68+ -OutFile 7zr.exe
69+
70+ RUN .\7 zr.exe e -i!'nsight_nvtx\n sight_nvtx\N VIDIA NVTX Installer.x86_64.Release.v1.21018621.Win64.msi' cuda_11.8.0_windows_network.exe ;
71+
72+ RUN cmd.exe /S /C "msiexec.exe /i 'NVIDIA NVTX Installer.x86_64.Release.v1.21018621.Win64.msi' /norestart /quiet"
73+
74+ RUN Remove-Item 'NVIDIA NVTX Installer.x86_64.Release.v1.21018621.Win64.msi' -Force ; \
75+ Remove-Item 7zr.exe -Force ; \
76+ Remove-Item cuda_11.8.0_windows_network.exe -Force
77+
78+ # -----------------------------------------------------------------------------
79+
80+ # Define the entry point for the docker container.
81+ # This entry point launches the 64-bit PowerShell developer shell.
82+ # We need to launch with amd64 arch otherwise Powershell defaults to x86 32-bit build commands which don't jive with CUDA
83+ ENTRYPOINT ["C:\\ Program Files (x86)\\ Microsoft Visual Studio\\ 2022\\ BuildTools\\ Common7\\ Tools\\ VsDevCmd.bat" , "-arch=amd64" , "&&" , "powershell.exe" , "-NoLogo" , "-ExecutionPolicy" , "Bypass" ]
84+
85+ # -----------------------------------------------------------------------------
86+ # COPY requirements-windows.txt C:\\workspace\\requirements-windows.txt
87+ # COPY requirements-dev-windows.txt C:\\workspace\\requirements-dev-windows.txt
88+ # RUN python3 -m pip --no-cache-dir install -r C:\workspace\requirements-dev-windows.txt
89+ # RUN Remove-Item "C:\workspace\requirements-windows.txt" -Force
90+ # RUN Remove-Item "C:\workspace\requirements-dev-windows.txt" -Force
91+
92+ ADD ./requirements-dev-windows.txt ./requirements-dev-windows.txt
93+ ADD ./requirements-windows.txt ./requirements-windows.txt
94+
95+ RUN python3 -m pip install --no-cache-dir -r .\r equirements-dev-windows.txt
96+
97+
98+ ARG RUNNER_VERSION=2.317.0
99+
100+ # Define the entry point for the docker container.
101+ # This entry point launches the 64-bit PowerShell developer shell.
102+ # We need to launch with amd64 arch otherwise Powershell defaults to x86 32-bit build commands which don't jive with CUDA
103+ # ENTRYPOINT ["C:\\Program Files (x86)\\Microsoft Visual Studio\\2022\\BuildTools\\Common7\\Tools\\VsDevCmd.bat", "-arch=amd64", "&&", "powershell.exe", "-NoLogo", "-ExecutionPolicy", "Bypass"]
104+
105+ RUN Invoke-WebRequest \
106+ -Uri https://github.com/actions/runner/releases/download/v$env:RUNNER_VERSION/actions-runner-win-x64-$env:RUNNER_VERSION.zip \
107+ -OutFile runner.zip; \
108+ Expand-Archive -Path ./runner.zip -DestinationPath ./actions-runner; \
109+ Remove-Item -Path .\r unner.zip;
110+
111+ ADD runner.ps1 ./runner.ps1
112+
113+ RUN powershell -Command New-ItemProperty -Path "HKLM:\S YSTEM\C urrentControlSet\C ontrol\F ileSystem" -Name "LongPathsEnabled" -Value 1 -PropertyType DWORD -Force
114+
115+ CMD ["powershell.exe" , "-ExecutionPolicy" , "Unrestricted" , "-File" , ".\\ runner.ps1" ]
0 commit comments