Skip to content

Helper image for Windows container execution

Description

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.

Proposal

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 https://gitlab.com/gitlab-com/gl-infra/infrastructure/issues/5952 since it's needed for two issues

Taging stragey

#3755 (comment 136096327)

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

#4013 (closed)

To Do

  • Create dockerfiles for windows, specifically under ./dockerfiles/: !1167 (merged)
  • Remove make docker command and split it like the following:
    • Create new command make helper which will build the binaries for GitLab Runner Helper for 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)
    • Update .gitlab-ci.yml to build and publish windows helper images as part of the release stage !1178 (merged)

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.

Links to related issues and merge requests / references

Edited by Steve Xuereb