This repository has been archived by the owner. It is now read-only.
Permalink
Browse files

#15 Update main readme to assist Windows users with getting started (#…

…169)

* Install pytest in the docker image, and clean up and python cache files

* #15 Update main readme to assist Windows users with getting started

* #15 Update main readme to assist Windows users with getting started

* #15 Update main readme to assist Windows users with getting started

* #15 Update main readme to assist Windows users with getting started
  • Loading branch information...
jamesweakley authored and tlbtlbtlb committed Mar 31, 2017
1 parent a4f78eb commit c32f2aeaf9bb8fe343f5f218b88821ccdcaa5b17
Showing with 56 additions and 1 deletion.
  1. +6 −0 Dockerfile
  2. +50 −1 README.rst
View
@@ -35,6 +35,9 @@ RUN pip install gym[all]
# Get the faster VNC driver
RUN pip install go-vncdriver>=0.4.0
# Install pytest (for running test cases)
RUN pip install pytest
# Force the container to use the go vnc driver
ENV UNIVERSE_VNCDRIVER='go'
@@ -48,3 +51,6 @@ RUN pip install -e .
# Upload our actual code
COPY . ./
# Just in case any python cache files were carried over from the source directory, remove them
RUN py3clean .
View
@@ -121,13 +121,62 @@ run ``docker ps`` and get something like this:
$ docker ps
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
Alternate configuration - running the agent in docker
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
The above instructions result in an agent that runs as a regular python process in your OS, and launches docker containers as needed for the remotes.
Alternatively, you can build a docker image for the agent and run it as a container as well.
You can do this in any operating system that has a recent version of docker installed, and the git client.
To get started, clone the ``universe`` repo:
.. code:: shell
git clone https://github.com/openai/universe.git
cd universe
Build a docker image, tag it as 'universe':
.. code:: shell
docker build -t universe .
This may take a while the first time, as the docker image layers are pulled from docker hub.
Once the image is built, you can do a quick run of the test cases to make sure everything is working:
.. code:: shell
docker run --privileged --rm -e DOCKER_NET_HOST=172.17.0.1 -v /var/run/docker.sock:/var/run/docker.sock universe pytest
Here's a breakdown of that command:
* ``docker run`` - launch a docker container
* ``--rm`` - delete the container once the launched process finishes
* ``-e DOCKER_NET_HOST=172.17.0.1`` - tells the universe remote (when launched) to make its VNC connection back to this docker-allocated IP
* ``-v /var/run/docker.sock:/var/run/docker.sock`` - makes the docker unix socket from the host available to the container. This is a common technique used to allow containers to launch other containers alongside itself.
* ``universe`` - use the imaged named 'universe' built above
* ``pytest`` - run 'pytest' in the container, which runs all the tests
At this point, you'll see a bunch of tests run and hopefully all pass.
To do some actual development work, you probably want to do another volume map from the universe repo on your host into the container, then shell in interactively:
.. code:: shell
docker run --privileged --rm -it -e DOCKER_NET_HOST=172.17.0.1 -v /var/run/docker.sock:/var/run/docker.sock -v (full path to cloned repo above):/usr/local/universe universe python
As you edit the files in your cloned git repo, they will be changed in your docker container and you'll be able to run them in python.
Note if you are using docker for Windows, you'll need to enable the relevant shared drive for this to work.
Notes on installation
~~~~~~~~~~~~~~~~~~~~~
* When installing ``universe``, you may see ``warning`` messages. These lines occur when installing numpy and are normal.
* You'll need a ``go version`` of at least 1.5. Ubuntu 14.04 has an older Go, so you'll need to `upgrade <https://golang.org/doc/install>`_ your Go installation.
* We run Python 3.5 internally, so the Python 3.5 variants will be much more thoroughly performance tested. Please let us know if you see any issues on 2.7.
* While we don't officially support Windows, we expect our code to be very close to working there. We'd be happy to take pull requests that take our Windows compatibility to 100%.
* While we don't officially support Windows, we expect our code to be very close to working there. We'd be happy to take pull requests that take our Windows compatibility to 100%. In the meantime, the easiest way for Windows users to run universe is to use the alternate configuration described above.
System overview
---------------

2 comments on commit c32f2ae

@virtualdesigner

This comment has been minimized.

Show comment
Hide comment
@virtualdesigner

virtualdesigner Dec 9, 2017

How can i enable a relevant shared drive in windows for using docker because whenever i use docker build -t universe it says - " 'docker' is not recognized as an internal or external command,
operable program or batch file" , please help me...
Note : docker was already installed.

virtualdesigner replied Dec 9, 2017

How can i enable a relevant shared drive in windows for using docker because whenever i use docker build -t universe it says - " 'docker' is not recognized as an internal or external command,
operable program or batch file" , please help me...
Note : docker was already installed.

@virtualdesigner

This comment has been minimized.

Show comment
Hide comment
@virtualdesigner

virtualdesigner Dec 9, 2017

Please explain the installation way of universe for windows...

virtualdesigner replied Dec 9, 2017

Please explain the installation way of universe for windows...

Please sign in to comment.