Pulling a Windows Docker image on GitLab.com Shared Windows Runner (beta) takes longer than the 1h runner timeout
Labels:
- Shared Runners::Windows
- group::runner
I'm using the Windows Shared Runners (beta) on GitLab.com. Since it's not possible to use the image keyword, I'm using docker run ... <image> ... instead. The pull of the image however takes more than the allowed MaximumTimeout = 3600.
This is one of the Dockerfiles:
REPOSITORY TAG IMAGE ID CREATED SIZE
graphviz/graphviz windows-x64 f0d57855fc46 6 hours ago 16.2GB
# escape=`
FROM mcr.microsoft.com/dotnet/framework/sdk:4.8-windowsservercore-ltsc2019
# Restore the default Windows shell for correct batch processing.
SHELL ["cmd", "/S", "/C"]
# Chocolatey
ADD https://chocolatey.org/install.ps1 C:\TEMP\install.ps1
RUN powershell C:\TEMP\install.ps1 -Wait `
&& del C:\TEMP\install.ps1
# choco-cleaner
RUN choco install --no-progress -y choco-cleaner `
&& choco-cleaner
# VCTools
RUN choco install -y visualstudio2019-workload-vctools `
&& choco-cleaner
# awk
RUN choco install --no-progress -y gawk `
&& choco-cleaner
# Bison & Flex
RUN choco install --no-progress -y winflexbison3 `
&& choco-cleaner
# git
RUN choco install --no-progress -y git `
&& choco-cleaner
# perl
RUN choco install --no-progress -y activeperl `
&& choco-cleaner
# grep
RUN choco install --no-progress -y grep `
&& choco-cleaner
# vcpkg (including CMake)
RUN git clone --depth 1 https://github.com/microsoft/vcpkg.git `
&& cd vcpkg `
&& bootstrap-vcpkg.bat -disableMetrics
# RxSpencer
RUN vcpkg\vcpkg install --clean-after-build rxspencer:x64-windows
# unzip
RUN choco install --no-progress -y unzip `
&& choco-cleaner
# wget
RUN choco install --no-progress -y wget `
&& choco-cleaner
RUN mkdir libtool `
&& cd libtool `
&& wget https://master.dl.sourceforge.net/project/gnuwin32/libtool/1.5.28/libtool-1.5.26-lib.zip `
&& unzip libtool*.zip `
&& del libtool*.zip `
&& cd ..
# zlib
RUN vcpkg\vcpkg install --clean-after-build zlib:x64-windows
# Setup VCTools
ENTRYPOINT ["C:\\Program Files (x86)\\Microsoft Visual Studio\\2019\\BuildTools\\Common7\\Tools\\VsDevCmd.bat", "&&", "powershell.exe", "-NoLogo", "-ExecutionPolicy", "Bypass"]
My .gitlab-ci.yml:
stages:
- build
.build_template: &windows_build_definition
stage: build
tags:
- windows
- shared-windows
- windows-1809
script:
- pwd
- dir
- dir "env:"
- systeminfo
- docker --version
- $dir="$pwd"
- docker run --rm --mount type=bind,source=$dir,target=C:/graphviz --workdir "C:\graphviz" graphviz/graphviz:$Env:image "ci\build.bat" $Env:build_system $Env:configuration $Env:platform
timeout: 3h
windows-cmake-Win32-release-build:
<<: *windows_build_definition
before_script:
- $Env:image = "windows-x86"
- $Env:platform = "Win32"
- $Env:configuration = "Release"
- $Env:build_system = "cmake"
windows-cmake-Win32-debug-build:
<<: *windows_build_definition
before_script:
- $Env:image = "windows-x86"
- $Env:platform = "Win32"
- $Env:configuration = "Debug"
- $Env:build_system = "cmake"
windows-cmake-x64-release-build:
<<: *windows_build_definition
before_script:
- $Env:image = "windows-x64"
- $Env:platform = "x64"
- $Env:configuration = "Release"
- $Env:build_system = "cmake"
windows-cmake-x64-debug-build:
<<: *windows_build_definition
before_script:
- $Env:image = "windows-x64"
- $Env:platform = "x64"
- $Env:configuration = "Debug"
- $Env:build_system = "cmake"
Ran in this pipeline
Edited by Magnus Jacobsson