Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Windows: evaluate CI-ing on Windows Containers and WSL #991

Closed
refack opened this issue Nov 8, 2017 · 8 comments
Closed

Windows: evaluate CI-ing on Windows Containers and WSL #991

refack opened this issue Nov 8, 2017 · 8 comments

Comments

@refack
Copy link
Contributor

refack commented Nov 8, 2017

Windows Container have been GA on Windows Server 2016, for over a year, with both "Windows Server Core" and "NanoServer" as the contained OS.
It might be informative to CI in such containers (we already know of two bugs nodejs/node#8897 and nodejs/node#16603)

WSL went GA with "Windows 10 Fall Creators Update" last month and Has been available on Windows Server 2016 since August. Although WSL is not a production environment many people seem to be using, it at least for development (10 issues labeled WSL)

I'll try to write an ansible script for bootstrapping such environments inside an existing Server2016.

@refack
Copy link
Contributor Author

refack commented Nov 8, 2017

@StefanScherer do you have ansible fu? If not even a list of step for settings up a Windows Container Host and Spinning up a container?
Something like:

  1. PS: Enable-WindowsOptionalFeature -Online -FeatureName Containers
  2. install something
  3. download and tag image
  4. bind some port to the world
  5. Setup Windows RM (as per http://docs.ansible.com/ansible/latest/intro_windows.html)
  6. ...

@refack refack changed the title Windows: evaluate CIing on Windows Containers and WSL Windows: evaluate CI-ing on Windows Containers and WSL Nov 8, 2017
@StefanScherer
Copy link

@refack I don't have an Ansible playbook, but can provide some steps how to install Docker.

With the steps in the docs ( https://store.docker.com/editions/enterprise/docker-ee-server-windows ) there are two relevant steps

Install-Module DockerProvider -Force
Install-Package Docker -ProviderName DockerProvider -Force

This PowerShell module installs the Containers feature, downloads Docker binaries and installs the Windows service.

A reboot is required after installing the Containers feature. After the reboot the docker.exe CLI is available in PATH (C:\Program Files\docker). All Docker relevant data can be found in C:\ProgramData\docker.

There is also a PowerShell module by Microsoft (DockerMsftProvider and DockerMsftProviderInsider), but the most recent versions are found with the module by Docker, Inc. (DockerProvider).
In https://github.com/OneGet/MicrosoftDockerProvider you find some more commands how to use these provider packages, eg. find all versions, install a specific version, update, etc.

In my Packer templates there are similar steps in scripts/docker/2016/ if this two-liner doesn't work directly. The Hyper-V feature is not mandatory, but helps running older Docker images with older kernel versions.

For Windows Server 2016 LTS channel there are two Windows base images:

  • microsoft/windowsservercore:10.0.14393.xxx (xxx=1770 at the moment) or latest
  • microsoft/nanoserver:10.0.14393.xxx (xxx=1770 at the moment) or latest

For the Windows Server 1709 Semi-annual channel there are another two base images that fits the host kernel version:

  • microsoft/windowsservercore:1709
  • microsoft/nanoserver:1709
    But you probably want to start with Windows Server 2016. But enhancing CI landscape to the newer Windows Server version might also be interesting to test with the newer Docker images.

Building and running containers then is straight forward.

docker run -d -p 3000:3000 stefanscherer/hello-stuttgart

Runs a small Node.js web server which listens on port 3000 and can be accessed either from another machine at port 3000 or on the same server with its container IP address. See https://blog.sixeyed.com/published-ports-on-windows-containers-dont-do-loopback/ for details.

Let me know if you need more information.

@StefanScherer
Copy link

StefanScherer commented Nov 9, 2017

To build Node.js images I use these scripts in AppVeyor at the moment:

  1. https://github.com/StefanScherer/dockerfiles-windows/blob/master/node/build.ps1
  2. https://github.com/StefanScherer/dockerfiles-windows/blob/master/node/test.ps1

Step 2 now tests node.exe in nanoserver containers and checks if exit code is fine and expected stdout matches :-)

I will update my PR soon as some PGP keys have to be updated there.

@StefanScherer
Copy link

And yes WSL is coming to more and more developer machines on Windows 10. Microsoft also started to provide WSL on Windows Server 2016 so there might be even more adoption in the future.

@bnoordhuis
Copy link
Member

I've commented on it before but I don't see the point in testing WSL. It's an emulation layer; any issues that come up on WSL but not on native Linux are bugs that MS has to fix, not us.

@joaocgreis
Copy link
Member

Creating a job to test on Windows containers sounds good.

Testing on WSL wouldn't be very useful, issues should be reported in https://github.com/Microsoft/WSL/issues, not here. A WSL job could perhaps be useful for comparison with Linux, but we shouldn't fix issues here.

@Trott
Copy link
Member

Trott commented Jun 27, 2019

Is this something that is likely to get traction and happen at some point? Or should we close this for now? (Containers seems high-value to me, but I could be wrong as I don't know how prevalent containers are in the Windows world.)

@github-actions
Copy link

This issue is stale because it has been open many days with no activity. It will be closed soon unless the stale label is removed or a comment is made.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants