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

Add documentation for Wallaroo in Docker on Windows #2177

Merged
merged 1 commit into from
May 2, 2018

Conversation

JONBRWN
Copy link
Contributor

@JONBRWN JONBRWN commented May 1, 2018

Updates "Choosing an Installation Option", "Run A Wallaroo Application
in Docker", and "Docker Setup" to add documentation for Windows support.

@SeanTAllen I'm opening this against the current release branch as there were no changes other than documentation

@strmpnk since you're the only other person with a Windows machine, can you confirm that you can start the Wallaroo docker image via the Powershell and Command Prompt commands provided and that you can successfully run

Documentation can be found here: https://wallaroo-docs-rc.netlify.com

@JONBRWN JONBRWN requested review from cararemixed and SeanTAllen and removed request for SeanTAllen May 1, 2018 21:02
@cararemixed
Copy link
Contributor

I wonder if we should show how to use WSL with docker. This would allow us to keep the examples unified across all platforms.

docker run --rm -it --privileged -p 4000:4000 |
-v /tmp/wallaroo-docker/wallaroo-src:/src/wallaroo |
-v /tmp/wallaroo-docker/python-virtualenv:/src/python-virtualenv |
--name wally |
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You'll want to add --platform=linux. Windows containers are set as default in newer versions of Docker for Windows. This will ensure it finds the appropriate image for the Hyper-V machine running linux.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

On second thought, the virtual env probably can't be mapped. The execute flag won't be preserved in this case (it would be via WSL but we're using docker.exe instead of linux docker over a unix socket). I can add a note on how to use WSL (recommended when using docker to avoid the flag issues above since the bash example "just works").

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also keep in mind the permissions on the wallaroo directory will also have issues. I'm wondering if we should show how to setup WSL docker to connect to docker for windows?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@strmpnk what version requires the --platform=linux? I tested with 18.03.1 and it wasn't required

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is required anytime windows containers are enabled (platform=windows becomes the default), which is default in the current beta release (18.05.0-cd-rc1, and about 2 months prior to this version so this isn't new) and can't easily be changed. Docker is not clear on when that will roll out to stable but I'd expect it sometime this summer.

{%- language name="Windows Powershell", type="bash" -%}
docker run --rm -it --privileged -p 4000:4000 |
-v /tmp/wallaroo-docker/wallaroo-src:/src/wallaroo |
-v /tmp/wallaroo-docker/python-virtualenv:/src/python-virtualenv |
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These volume specifiers don't work. You'll want to map them to an existing directory. It might be best to have the user create a workspace like:

mkdir wallaroo-application
cd wallaroo-application
mkdir python-virtualenv

and then use:

...
-v %CD%:/src/wallaroo
-v %CD%\python-virtualenv:/src/python-virtualenv
... 

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'll split the container start command into 2 sections at this point for additional help around the volume mounting on Windows

docker run --rm -it --privileged -p 4000:4000 \
-v /tmp/wallaroo-docker/wallaroo-src:/src/wallaroo \
-v /tmp/wallaroo-docker/python-virtualenv:/src/python-virtualenv \
--name wally \
wallaroo-labs-docker-wallaroolabs.bintray.io/{{ docker_version_url }}
```
{%- language name="Windows Powershell", type="bash" -%}
docker run --rm -it --privileged -p 4000:4000 |
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Windows does not support the privileged flag.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@strmpnk not sure if it's a quirk with Bootcamp but I needed the --privileged flag in order for mbind and set_mempolicy to be called when running Wallaroo apps

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Docker flat-out refuses to start with this flag on windows for me.

@JONBRWN
Copy link
Contributor Author

JONBRWN commented May 2, 2018

@strmpnk I updated the documentation to include additional setup steps for drive sharing and the creation of the needed directories and proper mounting in the commands for Windows. I made some earlier comments in the outdated diffs regarding --platform=linux and --privileged. Feedback on that will help

I think holding off on adding WSL documentation makes sense if this works as expected.

--name wally |
docker run --rm -it --privileged -p 4000:4000 `
-v c:/wallaroo-docker/wallaroo-src:/src/wallaroo `
-v c:/wallaroo-docker/python-virtualenv:/src/python-virtualenv `
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We still can't map virtualenv as it will fail to run the setup-env entrypoint (python won't have an execute flag on it). The wallaroo source should be fine since our machida and utlitiy executables come form outside that directory.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@strmpnk did this specifically fail for you? when I run which python I get /src/python-virtualenv/bin/python and can install a module with pip, kill the container, start a new one and have the module persist. Not sure what specifically can fail with this but if you had a specific error, let me know

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

When you map the volume to C:... the pip installation will be using that directory on NTFS, which won't preserve execute permission bits. So that python stub script will fail to run.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It seems like the issue I see is related to newer versions of docker vs the current stable release. I'm worried that we might have issues in upcoming releases. We'll need to monitor this over time but keeping the flags that work with the stable release is probably best.

Updates "Choosing an Installation Option", "Run A Wallaroo Application
in Docker", and "Docker Setup" to add documentation for Windows support.

Add additional Docker for Windows setup steps

Includes steps for sharing drive and creating directories
for Wallaroo source code and Python virtual environment.

Updates path for the above directories and switches Powershell
command to use backticks for new line character.
@JONBRWN JONBRWN force-pushed the add-docker-windows-docs branch from 5c8f87a to f57bcbf Compare May 2, 2018 19:44
@JONBRWN JONBRWN merged commit 119c67a into release May 2, 2018
@JONBRWN JONBRWN deleted the add-docker-windows-docs branch May 2, 2018 21:06
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

Successfully merging this pull request may close these issues.

2 participants