-
Notifications
You must be signed in to change notification settings - Fork 68
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
Conversation
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 | |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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").
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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 | |
There was a problem hiding this comment.
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
...
There was a problem hiding this comment.
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 | |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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.
@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 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 ` |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
5c8f87a
to
f57bcbf
Compare
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
andCommand Prompt
commands provided and that you can successfully runDocumentation can be found here: https://wallaroo-docs-rc.netlify.com