Concourse with Windows Containers Concourse with Windows Containers windows windows

Concourse with Windows Containers


Unfortunately, there is just a page I am able to find. I also tried it with simplier pipelines like hello world, but could not get it work. Just sharing maybe someone can benefit from it.

I left out parts like generating ssh key, preparing TSA.

Preparing The Windows Worker

Now we turn our attention to our Windows server that we'll be turning in to a Concourse worker.

First we'll want to establish a directory to house our binaries for the worker service and its data i.e. C:\concourse

C:\> mkdir concourseC:\> cd concourseC:\concourse>

Now download the Windows concourse binary (named something like "concourse_windows_amd64.exe") from the Concourse download page and place it in our working directory. Also, we'll want to copy the "tsakey.pub" and "workerkey" files there as well.

The fact that we'll provide our local concourse binary with "tsakey.pub" establishes that we cryptographically trust the TSA server from our deployment.

We're now ready to start the worker and have it register itself with the TSA.

C:\concourse> .\concourse_windows_amd64.exe worker \/work-dir .\work /tsa-host <IP of the TSA> \/tsa-public-key .\tsakey.pub \/tsa-worker-private-key .\workerkey

If all goes well we should see output similar to:

{"timestamp":"1478361158.394949198","source":"tsa","message":"tsa.connection.forward-worker.register.done","log_level":1,"data":{"remote":"<IP:SOURCE-PORT of the TSA>","session":"3.1.4","worker-address":"<IP:PORT of this worker>","worker-platform":"windows","worker-tags":""}}

and the new worker should appear in the list via the Concourse CLI as such:

~/  $ fly -t ci workersname            containers  platform  tags  team2a334e70-c75c   3           linux     none  noneWORKERSHOSTNAME 0           windows   none  none

Testing Things Out

Assuming the .NET framework is present on our Worker with the build tools in the path we could test this out by building this simple .NET Console app project: https://github.com/chrisumbel/DatDotNet.git.

Consider the pipeline:

resources:    - name: code      type: git      source:        uri: https://github.com/chrisumbel/DatDotNet.git        branch: master  jobs:    - name: build      plan:      - aggregate:        - get: code          trigger: true      - task: compile        privileged: true        file: code/Pipeline/compile.yml

with the build task:

platform: windows      inputs:    - name: code  run:    dir: code    path: msbuild

Note that the platform specified in the build task is "windows". That instructs concourse to place the task on a Windows worker.

If all went well we should see a successful build with output similar to:

~/ $ fly -t ci trigger-job -j datdotnet/build --watchstarted datdotnet/build #8using version of resource found in cacheinitializingrunning msbuildMicrosoft (R) Build Engine version 4.6.1085.0[Microsoft .NET Framework, version 4.0.30319.42000]Copyright (C) Microsoft Corporation. All rights reserved.Building the projects in this solution one at a time. To enable parallel build, please add the "/m" switch.Build started 11/5/2016 4:04:00 PM....nces, or take a dependency on references with a processor architecture that matches the targeted processor architecture of your project. [C:\concourse\work\containers\00000arl2se\tmp\build\36d0981b\code\DatDotNet\DatDotNet.csproj]    3 Warning(s)    0 Error(s)Time Elapsed 00:00:00.22succeeded


In theory it should be possible to do this through Garden-Windows, since Concourse delegates all containerising to the Garden API.

Having never done this before, I'd have no clue where to begin.