Skip to content

Commit 69f5f98

Browse files
authored
test dockerfiles for ubuntu 14.04 and 18.04 (openai#1168)
* pass device_id=-1 when rendering mujoco in rgb_array mode * trying ubuntu18.04 build * use travis build matrix * use travis build matrix * use travis build matrix * use fix 18.04 installation steps * use fix 18.04 installation steps * try py3 instead of py35 * trying the 14.04 build; cleaning up the 16.04 package list * fixes to dockerfile.14.04 * fixes to dockerfile.14.04 * fixes to dockerfile.14.04 * fixes to dockerfile.14.04 * fixes to dockerfile.14.04 * fixing system package list for 14.04 * 16.04 build working * clean up test.dockerfile.16.04 * adding python-numpy system package * add patchelf * remove python-numpy from 16.04 dockerfile * 14.04 does not use mujoco (patchelf problem) * cleaning up 18.04 dockerfile * added comment to 14.04 dockerfile * fix syntax in 14.04 dockerfile * being fancy and switching from apt-get to apt command in 18.04 dockerfile * update README.rst to use apt (instead of apt-get) on ubuntu 18.04
1 parent 7bbe486 commit 69f5f98

9 files changed

+126
-69
lines changed

.travis.yml

+6-7
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,12 @@ sudo: required
22
language: python
33
services:
44
- docker
5-
before_install:
6-
- docker build -f test.dockerfile -t gym-test .
5+
env:
6+
- UBUNTU_VER=14.04
7+
- UBUNTU_VER=16.04
8+
- UBUNTU_VER=18.04
9+
710
install: "" # so travis doesn't do pip install requirements.txt
811
script:
12+
- docker build -f test.dockerfile.${UBUNTU_VER} -t gym-test .
913
- docker run -e MUJOCO_KEY=$MUJOCO_KEY gym-test tox
10-
11-
notifications:
12-
slack:
13-
secure: h/Mxm8K+avH/2W0818zCHmLloRPMFN4NJL01+VShvAkH80/acfjeq/+mMdWXXPL/oOB6kSHDk+GDhwR6+s03ZcPMn5INTFvFYqUc6UWmT+NXtOPxGTN0xda6MdYUkWQUKaMyjFrweZQOMOASFBIzPOq4XeVbM5aB8s4EJhnfAcYZhp/idwKbToVihN4KZgxlvZIFc8iEp1o9uSl5qrsaeYYYXRkb6mauacAwOo4/Chu+cOnoLUOnvhBFE3rV3doDNrbnoalO8XiExtgx5CIAYWrlMni7r2Q+LlzgwdyTH19ZtybPxJTZIIWSBQ2UtcoYdIEDcc36GcUwz1VUGg32mLJJnY2xw80CWR4ixFPpLwwP5Y99WTn8v094B4nmFTWOwNWXp3EkqtTN9XcJoRBqXB5ArucIPqrx57dOCljSKx22gL6WaF2p3stSAxIGFektGyGnisaELrFZG1C63aHoUPicj3gUlijmAoUmYaDRf6P1wnpXqBpKDAWWhAMSatvx1ekmEJgR7OQklQnnfjx9kENDUygNUWS4IQwN2qYieuzHFL3of7/30mTM43+Vt/vWN8GI7j01BXu6FNGGloHxjH1pt3bLP/+uj5BJsT2HWF+Z8XR4VE6cyVuKsQAFgCXwOkoDHALbcwsspONDIt/9ixkesgh1oFt4CzU3UuU5wYs=
14-
on_success: change

Dockerfile

-42
This file was deleted.

README.rst

+16-4
Original file line numberDiff line numberDiff line change
@@ -74,25 +74,37 @@ Installing everything
7474

7575
To install the full set of environments, you'll need to have some system
7676
packages installed. We'll build out the list here over time; please let us know
77-
what you end up installing on your platform.
77+
what you end up installing on your platform. Also, take a look at the docker files (test.dockerfile.xx.xx) to
78+
see the composition of our CI-tested images.
7879

7980
On OSX:
8081

8182
.. code:: shell
8283
8384
brew install cmake boost boost-python sdl2 swig wget
8485
85-
On Ubuntu 14.04:
86+
On Ubuntu 14.04 (non-mujoco only):
8687

8788
.. code:: shell
8889
89-
apt-get install -y python-numpy python-dev cmake zlib1g-dev libjpeg-dev xvfb libav-tools xorg-dev python-opengl libboost-all-dev libsdl2-dev swig
90+
apt-get install libjpeg-dev cmake swig python-pyglet python3-opengl libboost-all-dev \
91+
libsdl2-2.0.0 libsdl2-dev libglu1-mesa libglu1-mesa-dev libgles2-mesa-dev \
92+
freeglut3 xfvb libav-tools
93+
94+
95+
On Ubuntu 16.04:
96+
97+
.. code:: shell
98+
apt-get install -y python-pyglet python3-opengl zlib1g-dev libjpeg-dev patchelf \
99+
cmake swig libboost-all-dev libsdl2-dev libosmesa6-dev xvfb ffmpeg
90100
91101
On Ubuntu 18.04:
92102

93103
.. code:: shell
94104
95-
apt-get install -y python-numpy python-dev cmake zlib1g-dev libjpeg-dev xvfb ffmpeg xorg-dev python-opengl libboost-all-dev libsdl2-dev swig
105+
apt install -y python3-dev zlib1g-dev libjpeg-dev cmake swig python-pyglet python3-opengl libboost-all-dev libsdl2-dev \
106+
libosmesa6-dev patchelf ffmpeg xvf
107+
96108
97109
MuJoCo has a proprietary dependency we can't set up for you. Follow
98110
the

bin/docker_entrypoint

+3-1
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,14 @@
11
#!/bin/bash
22
# This script is the entrypoint for our Docker image.
33

4-
set -ex
4+
set -x
55

66
if [[ ! -z "$MUJOCO_KEY" ]]; then
77
echo $MUJOCO_KEY | base64 --decode > /root/.mujoco/mjkey.txt
88
fi
99

10+
set -ex
11+
1012
# Set up display; otherwise rendering will fail
1113
Xvfb -screen 0 1024x768x24 &
1214
export DISPLAY=:0

gym/envs/mujoco/mujoco_env.py

+1-2
Original file line numberDiff line numberDiff line change
@@ -133,10 +133,9 @@ def _get_viewer(self, mode):
133133
if self.viewer is None:
134134
if mode == 'human':
135135
self.viewer = mujoco_py.MjViewer(self.sim)
136-
137136
elif mode == 'rgb_array' or mode == 'depth_array':
138137
self.viewer = mujoco_py.MjRenderContextOffscreen(self.sim, -1)
139-
138+
140139
self.viewer_setup()
141140
self._viewers[mode] = self.viewer
142141
return self.viewer

test.dockerfile.14.04

+46
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
# A Dockerfile that sets up a full Gym install with test dependencies
2+
FROM ubuntu:14.04
3+
# Note that latest version of mujoco-py, 1.5, does not play nicely with ubuntu 14.04 -
4+
# requires patchelf system package not available on 14.04
5+
6+
# Install keyboard-configuration separately to avoid travis hanging waiting for keyboard selection
7+
RUN \
8+
apt-get -y update && \
9+
apt-get install -y keyboard-configuration && \
10+
11+
apt-get install -y \
12+
python-setuptools \
13+
python-pip \
14+
python3-dev \
15+
libjpeg-dev \
16+
cmake \
17+
swig \
18+
python-pyglet \
19+
python3-opengl \
20+
libboost-all-dev \
21+
libsdl2-2.0.0 \
22+
libsdl2-dev \
23+
libglu1-mesa \
24+
libglu1-mesa-dev \
25+
libgles2-mesa-dev \
26+
xvfb \
27+
libav-tools \
28+
freeglut3 \
29+
wget \
30+
unzip && \
31+
32+
apt-get clean && \
33+
rm -rf /var/lib/apt/lists/* && \
34+
pip install tox
35+
36+
37+
ENV LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/root/.mujoco/mjpro150/bin
38+
39+
# install dependencies
40+
COPY . /usr/local/gym/
41+
RUN cd /usr/local/gym && \
42+
tox --notest
43+
44+
WORKDIR /usr/local/gym/
45+
ENTRYPOINT ["/usr/local/gym/bin/docker_entrypoint"]
46+
CMD ["tox"]

test.dockerfile test.dockerfile.16.04

+5-11
Original file line numberDiff line numberDiff line change
@@ -15,27 +15,21 @@ RUN \
1515
apt-get install -y \
1616
python-setuptools \
1717
python-pip \
18-
libpq-dev \
18+
python3-dev \
19+
python-pyglet \
20+
python3-opengl \
1921
zlib1g-dev \
2022
libjpeg-dev \
21-
curl \
2223
cmake \
2324
swig \
24-
python-opengl \
25-
python-numpy \
26-
python-pyglet \
27-
python3-opengl \
2825
libboost-all-dev \
2926
libsdl2-dev \
3027
libosmesa6-dev \
3128
patchelf \
32-
wget \
33-
unzip \
34-
git \
35-
vim \
3629
xvfb \
3730
ffmpeg \
38-
python3-dev && \
31+
wget \
32+
unzip && \
3933

4034
apt-get clean && \
4135
rm -rf /var/lib/apt/lists/* && \

test.dockerfile.18.04

+47
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
# A Dockerfile that sets up a full Gym install with test dependencies
2+
FROM ubuntu:18.04
3+
4+
# Install keyboard-configuration separately to avoid travis hanging waiting for keyboard selection
5+
RUN \
6+
apt -y update && \
7+
apt install -y keyboard-configuration && \
8+
9+
apt install -y \
10+
python-setuptools \
11+
python-pip \
12+
python3-dev \
13+
python-pyglet \
14+
python3-opengl \
15+
zlib1g-dev \
16+
libjpeg-dev \
17+
cmake \
18+
swig \
19+
libboost-all-dev \
20+
libsdl2-dev \
21+
libosmesa6-dev \
22+
patchelf \
23+
ffmpeg \
24+
xvfb \
25+
wget \
26+
unzip && \
27+
28+
apt clean && \
29+
rm -rf /var/lib/apt/lists/* && \
30+
pip install tox && \
31+
32+
# Download mujoco
33+
mkdir /root/.mujoco && \
34+
cd /root/.mujoco && \
35+
wget https://www.roboti.us/download/mjpro150_linux.zip && \
36+
unzip mjpro150_linux.zip
37+
38+
ENV LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/root/.mujoco/mjpro150/bin
39+
40+
# install dependencies
41+
COPY . /usr/local/gym/
42+
RUN cd /usr/local/gym && \
43+
tox --notest
44+
45+
WORKDIR /usr/local/gym/
46+
ENTRYPOINT ["/usr/local/gym/bin/docker_entrypoint"]
47+
CMD ["tox"]

tox.ini

+2-2
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,9 @@
44
# and then run "tox" from this directory.
55

66
[tox]
7-
envlist = py35
7+
envlist = py3
88

9-
[testenv:py35]
9+
[testenv:py3]
1010
whitelist_externals=make
1111
passenv=DISPLAY TRAVIS*
1212
deps =

0 commit comments

Comments
 (0)