Skip to content

Commit 2d15441

Browse files
author
Frank Carey
committed
* Creates an Ubuntu 14.04, tightvnc, bazel image with all the dependencies for
building and running lab. * Does an initial compile using 'bazel build :deepmind_lab.so --define headless=osmesa' * Run headless with 'bazel run :random_agent --define headless=osmesa' Issues: * OpenGL currently doesn't work properly for some reason, so running the non-headless version doesn't work. See https://ubuntuforums.org/archive/index.php/t-2257096.html
1 parent d6b1afc commit 2d15441

File tree

3 files changed

+89
-0
lines changed

3 files changed

+89
-0
lines changed

Diff for: .dockerignore

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
docs
2+
.git

Diff for: Dockerfile

+81
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,81 @@
1+
FROM kaixhin/vnc
2+
3+
4+
5+
RUN apt-get update && apt-get install -y \
6+
curl \
7+
zip \
8+
unzip \
9+
software-properties-common \
10+
python-software-properties && \
11+
apt-get clean && \
12+
rm -rf /var/lib/apt/lists/*
13+
14+
# We need to add a custom PPA to pick up JDK8, since trusty doesn't
15+
# have an openjdk8 backport. openjdk-r is maintained by a reliable contributor:
16+
# Matthias Klose (https://launchpad.net/~doko). It will do until
17+
# we either update the base image beyond 14.04 or openjdk-8 is
18+
# finally backported to trusty; see e.g.
19+
# https://bugs.launchpad.net/trusty-backports/+bug/1368094
20+
RUN add-apt-repository -y ppa:openjdk-r/ppa && \
21+
apt-get update && \
22+
apt-get install -y openjdk-8-jdk openjdk-8-jre-headless && \
23+
apt-get clean && \
24+
rm -rf /var/lib/apt/lists/* && \
25+
which java && \
26+
java -version && \
27+
update-ca-certificates -f
28+
29+
# Running bazel inside a `docker build` command causes trouble, cf:
30+
# https://github.com/bazelbuild/bazel/issues/134
31+
# The easiest solution is to set up a bazelrc file forcing --batch.
32+
# RUN echo "startup --batch" >>/root/.bazelrc
33+
# Similarly, we need to workaround sandboxing issues:
34+
# https://github.com/bazelbuild/bazel/issues/418
35+
# RUN echo "build --spawn_strategy=standalone --genrule_strategy=standalone" \
36+
# >>/root/.bazelrc
37+
# ENV BAZELRC /root/.bazelrc
38+
# Install the most recent bazel release.
39+
ENV BAZEL_VERSION 0.4.3
40+
RUN mkdir /bazel && \
41+
cd /bazel && \
42+
curl -fSsL -O https://github.com/bazelbuild/bazel/releases/download/$BAZEL_VERSION/bazel-$BAZEL_VERSION-installer-linux-x86_64.sh && \
43+
curl -fSsL -o /bazel/LICENSE.txt https://raw.githubusercontent.com/bazelbuild/bazel/master/LICENSE.txt && \
44+
chmod +x bazel-*.sh && \
45+
./bazel-$BAZEL_VERSION-installer-linux-x86_64.sh && \
46+
cd / && \
47+
rm -f /bazel/bazel-$BAZEL_VERSION-installer-linux-x86_64.sh
48+
49+
# Install deepmind-lab dependencies
50+
RUN apt-get update && apt-get install -y \
51+
lua5.1 \
52+
liblua5.1-0-dev \
53+
libffi-dev \
54+
gettext \
55+
freeglut3-dev \
56+
libsdl2-dev \
57+
libosmesa6-dev \
58+
python-dev \
59+
python-numpy \
60+
realpath \
61+
build-essential
62+
63+
#Enable RANDR option for vnc server.
64+
COPY ./vnc.sh /opt/vnc.sh
65+
66+
# Set the default X11 Display.
67+
ENV DISPLAY :1
68+
69+
ENV lab_dir /lab
70+
RUN mkdir /$lab_dir
71+
COPY . /$lab_dir
72+
WORKDIR $lab_dir
73+
74+
RUN bazel build :deepmind_lab.so --define headless=osmesa
75+
76+
# RUN bazel run :python_module_test --define headless=osmesa
77+
78+
#RUN bazel run :random_agent --define headless=false
79+
80+
81+

Diff for: vnc.sh

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
#!/bin/bash
2+
3+
# Remove VNC lock (if process already killed)
4+
rm /tmp/.X1-lock /tmp/.X11-unix/X1
5+
# Run VNC server with tail in the foreground
6+
vncserver :1 -randr -geometry 1280x800 -depth 24 && tail -F /root/.vnc/*.log

0 commit comments

Comments
 (0)