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

Nix Entry Shell with TTY #132

Closed
toddpi314 opened this issue Apr 29, 2017 · 7 comments
Closed

Nix Entry Shell with TTY #132

toddpi314 opened this issue Apr 29, 2017 · 7 comments

Comments

@toddpi314
Copy link

toddpi314 commented Apr 29, 2017

A major weak spot right now for Windows Containers is the support for a POSIX shell that supports TTY.

Installing a POSIX-compliant runtime and SHELL statement pointing at an installed shell (bash, sh, zsh) doesn't offer TTY and stdout is only capable on docker without the -t option. You essentially have to either issue commands with no stdout or not be able to interact.

Additionally, the Windows Subsystem for Linux doesn't install on containers.

Real world example of why this is important:

Jenkins v2 Swarm can't light up Windows Container support because executors expect to be able to issue the id and cat commands with TTY with build containers

With AWS bringing Windows Containers into Beta (http://docs.aws.amazon.com/AmazonECS/latest/developerguide/ECS_Windows.html), this seems like a huge win for MS to sell Cloud Lic for Jenkins users.

BTW, Fantastic work on this container digest. We have all been cultivating this stuff since last fall, but good to see some MVPs organizing the public effort.

@StefanScherer
Copy link
Owner

Thanks @toddpi314, my journey with Windows containers began long before I became a MVP.

I agree, a Jenkins swarm working with Windows Containers would help a lot of people. I wonder why they depend on third-party tools like id and cat as they are not part of vanilla Windows. So here the problem begins as neither Cloudbees nor Microsoft really can help to make it work. I only can suggest to start a discussion about removing that dependency in the Jenkins swarm and use Windows native commands instead. Are there any open issues in the Jenkins / Jenkins swarm repos?

I only know these issues arround MSYS / Cygwin:

@toddpi314
Copy link
Author

Adding this to the fun: https://issues.jenkins-ci.org/browse/JENKINS-36776

@toddpi314
Copy link
Author

toddpi314 commented May 23, 2017

I made some progress on this:

  1. The Swarm Node Host needs to have basic *nix tools on the path in order for Jenkins Swarm plugin to honor basic pipeline commands. That is, install Cygwin and Git for Windows on the Windows Server 2016 host and export tools to PATH.
    • Run the Swarm Node Plugin with tools setup for at least the git.exe
  2. Build a microsoft/windowsservercore container that supports basic *nix operations on the PATH as well. Here is a base image: https://github.com/DeepElement/docker-winservercore-jenkins-pipeline
  3. Download sources from SCM, build the workspace container in the Jenkinsfile and attempt to issue a bat command inside of the container.

As Cody D reports on thread https://issues.jenkins-ci.org/browse/JENKINS-36776, step #3 stalls where the BAT command doesn't seem to return anything when Jenkins Pipeline calls --entrypoint cat and expects commands to pipe via TTY.

The good news is this approach makes things get to #3 without alteration to the stock plugins.

Maybe this help us focus on which cat implementation we are using.

@toddpi314
Copy link
Author

@StefanScherer
Copy link
Owner

@toddpi314 have you seen this pull request? jenkinsci/docker-plugin#465

@StefanScherer
Copy link
Owner

And a very interesting Jenkins setup https://github.com/i-net-software/docker-boxes, with some Windows Docker images as well.

@StefanScherer
Copy link
Owner

I'll close this issue here as it has to be resolve probably in cygwin / mingw. We have collected a lot of links to other issues to follow the progress there.

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

No branches or pull requests

2 participants