Helper image for Windows container execution
We need to provide a process for setting up a helper image for Windows container execution in order for #2609 (closed) to be fully functional.
Choose base image
There are few available windows base image that some research needs to be done which one should be used, if we should only use one of them or use multiple ones, like we already do for the linux helper images. The most interesting one that can be supported is windows/servercore and windows/nanoserver
Setup GitLab runner on windows environment
To start building the helper image on windows we need infrastructure to do so. We would need a windows machine with the following software installed; Docker & gitlab-runner running as shell executor with powershell so that we can start building the containers. GCP provides windows machine which has the following pricing which costs need to be calculated. This machine should not be provisioned manually as it would be second class from the beginning since all our linux environment is already automated. We can use a mixture of terraform and chef to provision and configure the machine. This part hand in hand with #3757 (closed) since it also requires infrastructure with windows server installed to run that tests. So it might be smart to do either #3757 (closed) or this issue first whilst keeping the other issue in mind.
This was moved to a separate issue gitlab-com/gl-infra/infrastructure#5952 (closed) since it's needed for two issues
Update our CI to start building the helper image for windows
Currently, the helper image is created through our CI with the following job which currently uses docker in docker to build the image. As of this point windows docker is not supported in windows so we need to create a new job (this had to be done even if it was supported) that will use powershell with the runner created from the previous step. Please note that as pointed out in #3755 (comment 133677989) this requires us to build multiple versions of the base image so that we can support multiple docker versions.
Deprecation of old helper commands
Create dockerfiles for windows, specifically under
./dockerfiles/: !1167 (merged)
make dockercommand and split it like the following:
Create new command
make helperwhich will build the binaries for
GitLab Runner Helperfor the supported OSes !1174 (merged) reverted check !1180 (merged) Second MR to fix this !1188 (merged)
- Create PowerShell files to create windows docker containers !1178 (merged)
.gitlab-ci.ymlto build and publish windows helper images as part of the
releasestage !1178 (merged)
- Create new command
The reason the split needs to happen is, we want to keep the same build command for when building the binaries since it deals with all the versioning and ldflags, but have different logic when it comes to building the docker image itself since, each image needs to be build on a different os.
Migrate scripts to the
gitlab-runner-helperbinary for cross OS compatability.
- gitlab-runner-service !1195 (merged)
- gitlab-runner-cache !1201 (merged)
gitlab-runner-buildDoes not make sense to migrate this since its very bash specific and windows does not have
umask. https://www.reddit.com/r/sysadmin/comments/5fm9lg/windows_equivalent_of_umask/ This is also used as the default command when running the linux helper image which windows will not have.
- Feature flag to to start using the new binary on linux containers !1218 (merged)