buildbot windows
This commit is contained in:
parent
47d20a3302
commit
c6d092ec94
5 changed files with 161 additions and 0 deletions
1
containers/buildbot-windows/.dockerignore
Normal file
1
containers/buildbot-windows/.dockerignore
Normal file
|
@ -0,0 +1 @@
|
||||||
|
cloudbuild.yaml
|
119
containers/buildbot-windows/Dockerfile
Normal file
119
containers/buildbot-windows/Dockerfile
Normal file
|
@ -0,0 +1,119 @@
|
||||||
|
# escape=`
|
||||||
|
|
||||||
|
# This experimental Windows container is meant to be used in Terraform deployment.
|
||||||
|
|
||||||
|
# Agent image for LLVM org cluster.
|
||||||
|
# maybe mcr.microsoft.com/windows/servercore:ltsc2022?
|
||||||
|
FROM mcr.microsoft.com/dotnet/framework/sdk:4.8-windowsservercore-ltsc2019
|
||||||
|
|
||||||
|
# Restore the default Windows shell for correct batch processing.
|
||||||
|
SHELL ["cmd", "/S", "/C"]
|
||||||
|
|
||||||
|
# Download the Build Tools bootstrapper.
|
||||||
|
ADD https://aka.ms/vs/16/release/vs_buildtools.exe C:\TEMP\vs_buildtools.exe
|
||||||
|
|
||||||
|
# Download channel for fixed install.
|
||||||
|
ARG CHANNEL_URL=https://aka.ms/vs/16/release/channel
|
||||||
|
ADD ${CHANNEL_URL} C:\TEMP\VisualStudio.chman
|
||||||
|
|
||||||
|
# Install Build Tools with C++ workload.
|
||||||
|
# - Documentation for docker installation
|
||||||
|
# https://docs.microsoft.com/en-us/visualstudio/install/build-tools-container?view=vs-2019
|
||||||
|
# - Documentation on workloads
|
||||||
|
# https://docs.microsoft.com/en-us/visualstudio/install/workload-component-id-vs-build-tools?view=vs-2019#c-build-tools
|
||||||
|
# - Documentation on flags
|
||||||
|
# https://docs.microsoft.com/en-us/visualstudio/install/use-command-line-parameters-to-install-visual-studio?view=vs-2019
|
||||||
|
RUN C:\TEMP\vs_buildtools.exe --quiet --wait --norestart --nocache `
|
||||||
|
--channelUri C:\TEMP\VisualStudio.chman `
|
||||||
|
--installChannelUri C:\TEMP\VisualStudio.chman `
|
||||||
|
--installPath C:\BuildTools `
|
||||||
|
--add Microsoft.VisualStudio.Workload.VCTools `
|
||||||
|
--add Microsoft.VisualStudio.Component.VC.ATL `
|
||||||
|
--includeRecommended `
|
||||||
|
|| IF "%ERRORLEVEL%"=="3010" EXIT 0
|
||||||
|
|
||||||
|
# Register DIA dll (Debug Interface Access) so it can be used to symbolize
|
||||||
|
# the stack traces. Register dll for 32 and 64 bit.
|
||||||
|
# see https://developercommunity.visualstudio.com/content/problem/290674/msdia140dll-is-not-registered-on-vs2017-hosts.html
|
||||||
|
RUN regsvr32 /S "C:\BuildTools\DIA SDK\bin\amd64\msdia140.dll" & `
|
||||||
|
regsvr32 /S "C:\BuildTools\DIA SDK\bin\msdia140.dll"
|
||||||
|
|
||||||
|
# install chocolately as package manager
|
||||||
|
RUN powershell -NoProfile -InputFormat None -Command `
|
||||||
|
iex ((new-object net.webclient).DownloadString('https://chocolatey.org/install.ps1')) ; `
|
||||||
|
choco feature disable --name showDownloadProgress
|
||||||
|
|
||||||
|
# install tools as described in https://llvm.org/docs/GettingStartedVS.html
|
||||||
|
# and a few more that were not documented...
|
||||||
|
RUN choco install -y ninja git
|
||||||
|
# Pin an older version of Python; the current Python 3.10 fails when
|
||||||
|
# doing "pip install" for the other dependencies, as it fails to find libxml
|
||||||
|
# while compiling some package.
|
||||||
|
RUN choco install -y python3 --version 3.9.7
|
||||||
|
|
||||||
|
# ActivePerl is currently not installable via Chocolatey, see
|
||||||
|
# http://disq.us/p/2ipditb. Install StrawberryPerl instead. Unfortunately,
|
||||||
|
# StrawberryPerl not only installs Perl, but also a redundant C/C++ compiler
|
||||||
|
# toolchain, and a copy of pkg-config which can cause misdetections for other
|
||||||
|
# built products, see
|
||||||
|
# https://github.com/StrawberryPerl/Perl-Dist-Strawberry/issues/11 for further
|
||||||
|
# details. Remove the redundant and unnecessary parts of the StrawberryPerl
|
||||||
|
# install.
|
||||||
|
RUN choco install -y strawberryperl && `
|
||||||
|
rmdir /q /s c:\strawberry\c && `
|
||||||
|
del /q c:\strawberry\perl\bin\pkg-config*
|
||||||
|
|
||||||
|
# libcxx requires clang(-cl) to be available
|
||||||
|
RUN choco install -y sccache llvm
|
||||||
|
RUN pip install psutil
|
||||||
|
|
||||||
|
RUN curl -LO https://github.com/mstorsjo/llvm-mingw/releases/download/20230320/llvm-mingw-20230320-ucrt-x86_64.zip && `
|
||||||
|
powershell Expand-Archive llvm-mingw-*-ucrt-x86_64.zip -DestinationPath . && `
|
||||||
|
del llvm-mingw-*-ucrt-x86_64.zip && `
|
||||||
|
ren llvm-mingw-20230320-ucrt-x86_64 llvm-mingw
|
||||||
|
|
||||||
|
# configure Python encoding
|
||||||
|
ENV PYTHONIOENCODING=UTF-8
|
||||||
|
|
||||||
|
# update the path variable
|
||||||
|
# C:\Program Files\Git\usr\bin contains a usable bash and other unix tools.
|
||||||
|
# C:\llvm-mingw\bin contains Clang configured for mingw targets and
|
||||||
|
# corresponding sysroots. Both the 'llvm' package (with Clang defaulting
|
||||||
|
# to MSVC targets) and this directory contains executables named
|
||||||
|
# 'clang.exe' - add this last to let the other one have precedence.
|
||||||
|
# To use these compilers, use the triple prefixed form, e.g.
|
||||||
|
# x86_64-w64-mingw32-clang.
|
||||||
|
# C:\buildtools and SDK paths are ones that are set by c:\BuildTools\Common7\Tools\VsDevCmd.bat -arch=amd64 -host_arch=amd64
|
||||||
|
RUN powershell -Command `
|
||||||
|
[System.Environment]::SetEnvironmentVariable('PATH', `
|
||||||
|
[System.Environment]::GetEnvironmentVariable('PATH', 'machine') + ';C:\Program Files\Git\usr\bin;C:\llvm-mingw\bin' `
|
||||||
|
+ ';C:\BuildTools\Common7\IDE\' `
|
||||||
|
+ ';C:\BuildTools\Common7\IDE\CommonExt ensions\Microsoft\TeamFoundation\Team Explorer' `
|
||||||
|
+ ';C:\BuildTools\Common7\IDE\CommonExtensions\Microsoft\CMake\CMake\bin' `
|
||||||
|
+ ';C:\BuildTools\Common7\IDE\CommonExtensions\Microsoft\CMake\Ninja' `
|
||||||
|
+ ';C:\BuildTools\Common7\IDE\CommonExtensions\Microsoft\TeamFoundation\Team Explorer' `
|
||||||
|
+ ';C:\BuildTools\Common7\IDE\CommonExtensions\Microsoft\TestWindow' `
|
||||||
|
+ ';C:\BuildTools\Common7\IDE\VC\VCPackages' `
|
||||||
|
+ ';C:\BuildTools\Common7\Tools\' `
|
||||||
|
+ ';C:\BuildTools\Common7\Tools\devinit' `
|
||||||
|
+ ';C:\BuildTools\MSBuild\Current\Bin' `
|
||||||
|
+ ';C:\BuildTools\MSBuild\Current\bin\Roslyn' `
|
||||||
|
+ ';C:\BuildTools\VC\Tools\MSVC\14.29.30133\bin\HostX64\x64' `
|
||||||
|
+ ';C:\Program Files (x86)\Microsoft SDKs\Windows\v10.0A\bin\NETFX 4.8 Tools\x64\' `
|
||||||
|
+ ';C:\Program Files (x86)\Windows Kits\10\bin\10.0.19041.0\x64' `
|
||||||
|
+ ';C:\Program Files (x86)\Windows Kits\10\bin\x64' `
|
||||||
|
+ ';C:\Windows\Microsoft.NET\Framework64\v4.0.30319' `
|
||||||
|
,'machine')
|
||||||
|
|
||||||
|
# support long file names during git checkout
|
||||||
|
RUN git config --system core.longpaths true & `
|
||||||
|
git config --global core.autocrlf false
|
||||||
|
|
||||||
|
# handle for debugging of files beeing locked by some processes.
|
||||||
|
RUN choco install -y handle
|
||||||
|
|
||||||
|
RUN pip3 install buildbot-worker==2.8.4
|
||||||
|
|
||||||
|
COPY start_agent.ps1 c:\scripts\
|
||||||
|
COPY start.sh c:\scripts\
|
||||||
|
CMD ["bash", "C:\\scripts\\start.sh"]
|
16
containers/buildbot-windows/cloudbuild.yaml
Normal file
16
containers/buildbot-windows/cloudbuild.yaml
Normal file
|
@ -0,0 +1,16 @@
|
||||||
|
#TODO replace network, subnetwork, region, zone and image with the placeholders. Trigger this from the terraform ?
|
||||||
|
#windows-server-2019-dc-core-for-containers-v20230113
|
||||||
|
#windows-server-2019-dc-for-containers-v20230113
|
||||||
|
#TODO get latest image in family
|
||||||
|
#TODO check different machine types and timings
|
||||||
|
steps:
|
||||||
|
- name: 'gcr.io/${PROJECT_ID}/windows-builder'
|
||||||
|
args: ['--image','windows-cloud/global/images/windows-server-2019-dc-core-for-containers-v20230113',
|
||||||
|
'--network', 'vpc-network',
|
||||||
|
'--subnetwork', 'subnetwork',
|
||||||
|
'--region', 'europe-west3',
|
||||||
|
'--zone', 'europe-west3-c',
|
||||||
|
'--machineType', "n2-standard-16",
|
||||||
|
'--diskType', 'pd-ssd',
|
||||||
|
'--command', 'gcloud auth configure-docker --quiet && docker build -t gcr.io/${PROJECT_ID}/buildkite-premerge-windows:latest . && docker push gcr.io/${PROJECT_ID}/buildkite-premerge-windows:latest']
|
||||||
|
timeout: 7200s
|
15
containers/buildbot-windows/start.sh
Normal file
15
containers/buildbot-windows/start.sh
Normal file
|
@ -0,0 +1,15 @@
|
||||||
|
# Checkout path is set to a fixed short value (e.g. c:\ws\src) to keep paths
|
||||||
|
# short as many tools break on Windows with paths longer than 250.
|
||||||
|
|
||||||
|
: ${WORKDIR:=/c/ws}
|
||||||
|
echo "WORKDIR $WORKDIR"
|
||||||
|
mkdir -p "$WORKDIR"
|
||||||
|
|
||||||
|
SCCACHE_DIR="$WORKDIR/sccache"
|
||||||
|
SCCACHE_IDLE_TIMEOUT="0"
|
||||||
|
SCCACHE_CACHE_SIZE=20G
|
||||||
|
sccache --start-server
|
||||||
|
|
||||||
|
whoami
|
||||||
|
env
|
||||||
|
tail -f
|
10
containers/buildbot-windows/start_agent.ps1
Normal file
10
containers/buildbot-windows/start_agent.ps1
Normal file
|
@ -0,0 +1,10 @@
|
||||||
|
# Checkout path is set to a fixed short value (e.g. c:\ws\src) to keep paths
|
||||||
|
# short as many tools break on Windows with paths longer than 250.
|
||||||
|
if ($null -eq $env:WORKDIR) { $env:WORKDIR = 'c:\ws' }
|
||||||
|
|
||||||
|
$env:SCCACHE_DIR="$env:WORKDIR\sccache"
|
||||||
|
$env:SCCACHE_IDLE_TIMEOUT="0"
|
||||||
|
Remove-Item -Recurse -Force -ErrorAction Ignore $env:SCCACHE_DIR
|
||||||
|
sccache --start-server
|
||||||
|
|
||||||
|
bash -c 'whoami && tail -f'
|
Loading…
Reference in a new issue