openai / universe

Universe: a software platform for measuring and training an AI's general intelligence across the world's supply of games, websites and other applications.
https://universe.openai.com
MIT License
7.45k stars 956 forks source link

pytest fails due to docker 502 (bad gateway) #192

Closed TueChristensen closed 6 years ago

TueChristensen commented 7 years ago

Expected behavior

pytest should run through with no failed tests (22 tests success).

Actual behavior

pytest gives 6 failed instances.

First, more of an FYI. Two of these seems to be related to the tests requiring v3 of a game instance, but v0/v4 are the only accepted instances now, e.g.

 DeprecatedEnv: Env PongDeterministic-v3 not found (valid versions include ['PongDeterministic-v4', 'PongDeterministic-v0'])

../gym/gym/envs/registration.py:145: DeprecatedEnv

I suspect the that is "simply" solved by updating the tests to use v4 (or v0 even?).

What really puzzles me is the following error which means I am not able to use anything in the universe package.

self = <docker.client.Client object at 0x107d62510>, response = <Response [502]>, explanation = None

    def _raise_for_status(self, response, explanation=None):
        """Raises stored :class:`APIError`, if one occurred."""
        try:
            response.raise_for_status()
        except requests.exceptions.HTTPError as e:
            if e.response.status_code == 404:
                raise errors.NotFound(e, response, explanation=explanation)
>           raise errors.APIError(e, response, explanation=explanation)
E           APIError: 502 Server Error: Bad Gateway ("ContainerInspect failed")

/usr/local/lib/python2.7/site-packages/docker/client.py:174: APIError

Running on MacOS and using Docker for MacOS (see next section) and is able to verify the installation by

>docker run hello-world
> 
> Hello from Docker!
> This message shows that your installation appears to be working correctly.
> 
> 

Clearly the above failed test relates to the fact that

docker run -p 5900:5900 -p 15900:15900 --cap-add SYS_ADMIN --ipc host --privileged quay.io/openai/universe.flashgames:0.20.28
docker: Error response from daemon: ContainerInspect failed.
ERRO[0000] error waiting for container: context canceled 

There are a couple of other errors, but they may be related to these so I will create a separate issue if fixing these doesn't solve them as well.

Versions

Change the username to xxx


Darwin xxx-MacBook-Pro.local 16.6.0 Darwin Kernel Version 16.6.0: Fri Apr 14 16:21:16 PDT 2017; root:xnu-3789.60.24~6/RELEASE_X86_64 x86_64
Python 2.7.13
Name: universe
Version: 0.21.5
Summary: Universe: a software platform for measuring and training an AI's general intelligence across the world's supply of games, websites and other applications.
Home-page: https://github.com/openai/universe
Author: OpenAI
Author-email: universe@openai.com
License: UNKNOWN
Location: /Users/xxx/Documents/Code/GameAI/universe
Requires: autobahn, docker-py, docker-pycreds, fastzbarlight, go-vncdriver, gym, Pillow, PyYAML, six, twisted, ujson
---
Name: gym
Version: 0.9.2
Summary: The OpenAI Gym: A toolkit for developing and comparing your reinforcement learning agents.
Home-page: https://github.com/openai/gym
Author: OpenAI
Author-email: gym@openai.com
License: UNKNOWN
Location: /Users/xxx/Documents/Code/GameAI/gym
Requires: numpy, requests, six, pyglet
---
Name: tensorflow
Version: 1.2.0
Summary: TensorFlow helps the tensors flow
Home-page: http://tensorflow.org/
Author: Google Inc.
Author-email: opensource@google.com
License: Apache 2.0
Location: /usr/local/lib/python2.7/site-packages
Requires: wheel, backports.weakref, protobuf, numpy, bleach, werkzeug, html5lib, mock, markdown, six
---
Name: numpy
Version: 1.13.0
Summary: NumPy: array processing for numbers, strings, records, and objects.
Home-page: http://www.numpy.org
Author: NumPy Developers
Author-email: numpy-discussion@python.org
License: BSD
Location: /usr/local/lib/python2.7/site-packages
Requires: 
---
Name: go-vncdriver
Version: 0.4.19
Summary: UNKNOWN
Home-page: UNKNOWN
Author: UNKNOWN
Author-email: UNKNOWN
License: UNKNOWN
Location: /usr/local/lib/python2.7/site-packages
Requires: numpy
---
Name: Pillow
Version: 4.1.1
Summary: Python Imaging Library (Fork)
Home-page: https://python-pillow.org
Author: Alex Clark (Fork Author)
Author-email: aclark@aclark.net
License: Standard PIL License
Location: /usr/local/lib/python2.7/site-packages
Requires: olefile
TueChristensen commented 7 years ago

It might be worth mentioning that I can get the docker images


docker pull quay.io/openai/universe.flashgames:0.20.28
0.20.28: Pulling from openai/universe.flashgames
aed15891ba52: Already exists 
773ae8583d14: Already exists 
d1d48771f782: Already exists 
cd3d6cd6c0cf: Already exists 
8ff6f8a9120c: Already exists 
dd8b54e91746: Already exists 
2e5cb956f982: Already exists 
0c93ba10c511: Already exists 
39d8cf200333: Already exists 
7f890b5c2ffb: Already exists 
376798e834f8: Already exists 
e0bf4006396b: Already exists 
f7ab06525008: Already exists 
3906ec9156e2: Already exists 
9e15b01284c5: Already exists 
bd51ef3532c1: Already exists 
35942670c413: Already exists 
68f2958ec854: Already exists 
16c5a38bc1e6: Already exists 
72d0d0234a6f: Already exists 
29ab8bfac8ec: Already exists 
1ffcc9378fb7: Already exists 
77841c2a13d8: Already exists 
574cb7190254: Already exists 
0500c490d3fc: Already exists 
204a3ebf8394: Already exists 
8539a95410fb: Already exists 
09a7bfc2e974: Already exists 
eca301967f46: Already exists 
76437fadd1e0: Already exists 
6e9da982ddd3: Already exists 
199cc962635e: Already exists 
35da256c6da2: Already exists 
c95cc04a41af: Already exists 
9ef3827e8abc: Already exists 
d09e875f3fbb: Already exists 
c07170a16af8: Already exists 
2ddc2ee56600: Already exists 
e6f27c86280b: Already exists 
c275f5b5ffc5: Already exists 
18e64f9f2055: Already exists 
76241e684590: Already exists 
6a72ff0486be: Already exists 
Digest: sha256:8eb98edf86d4c75e153760cd30635f04196ec4dccf287a7768df53b9a04e282c
Status: Image is up to date for quay.io/openai/universe.flashgames:0.20.28
TueChristensen commented 7 years ago

Being new to docker I started "debuging" (Googling) this part. It turns out that the current stable release of Docker For Mac has some sort of issue (see this post).

I installed the Docker For Mac Edge version instead and can the containerinspect error is gone. Will try to run pytest on universe again to see if there are more issues and report back.