-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
Create a docker image #24
Open
frankcarey
wants to merge
2
commits into
google-deepmind:master
Choose a base branch
from
frankcarey:dev-22-dockerfile
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
#!/bin/bash | ||
|
||
# Remove VNC lock (if process already killed) | ||
rm -f /tmp/.X1-lock /tmp/.X11-unix/X1 | ||
|
||
# Set the DISPLAY that will be used by default. Makes lab show up in our xvfb display | ||
export DISPLAY=:1 | ||
|
||
# Start the X virtual frame buffer which uses memory instead of an actual device. | ||
# Allows lab to be run headless. | ||
Xvfb "$DISPLAY" -screen 0 "$XVFB_RESOLUTION" & | ||
|
||
# Run a lightweight Window Manager (fluxbox is smaller than lxdm, gnome, unity, kde, etc) | ||
# (pretty sure this is required.) | ||
fluxbox & | ||
|
||
# Run the x11vnc server | ||
# Explanation of options: | ||
# -display : This needs to match the xvfb display number | ||
# -passwd : Use the password from an ENV var here instead of using ~/.vnc/passwd | ||
# -o : Specifies where to send the log output. | ||
# -noipv6 : Skip trying to serve vnc on ipv6 (avoids warnings) | ||
# -bg : Run in the background | ||
# -forever : Don't die when the first user disconnects from vnc (which is the default) | ||
# -N : Makes it use port 5900+N where N is the display.. so 5901. (default is 5900) | ||
x11vnc \ | ||
-display "$DISPLAY" \ | ||
-passwd "$VNC_PASSWORD" \ | ||
-o /dev/stderr \ | ||
-noipv6 \ | ||
-bg \ | ||
-forever \ | ||
-N |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
docs | ||
.git |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,106 @@ | ||
FROM ubuntu:14.04 | ||
|
||
MAINTAINER [email protected] | ||
|
||
# Temporarily shut up warnings. | ||
ENV DISPLAY :0 | ||
ENV TERM xterm | ||
|
||
# Basic Dependencies | ||
RUN apt-get update && apt-get install -y \ | ||
curl \ | ||
zip \ | ||
unzip \ | ||
software-properties-common \ | ||
python-software-properties && \ | ||
apt-get clean && \ | ||
rm -rf /var/lib/apt/lists/* | ||
|
||
# Dependencies for vnc setup. | ||
RUN apt-get update && apt-get install -y \ | ||
xvfb \ | ||
fluxbox \ | ||
x11vnc && \ | ||
apt-get clean && \ | ||
rm -rf /var/lib/apt/lists/* | ||
|
||
|
||
# We need to add a custom PPA to pick up JDK8, since trusty doesn't | ||
# have an openjdk8 backport. openjdk-r is maintained by a reliable contributor: | ||
# Matthias Klose (https://launchpad.net/~doko). It will do until | ||
# we either update the base image beyond 14.04 or openjdk-8 is | ||
# finally backported to trusty; see e.g. | ||
# https://bugs.launchpad.net/trusty-backports/+bug/1368094 | ||
RUN add-apt-repository -y ppa:openjdk-r/ppa && \ | ||
apt-get update && apt-get install -y \ | ||
openjdk-8-jdk \ | ||
openjdk-8-jre-headless && \ | ||
apt-get clean && \ | ||
rm -rf /var/lib/apt/lists/* && \ | ||
which java && \ | ||
java -version && \ | ||
update-ca-certificates -f | ||
|
||
# Running bazel inside a `docker build` command causes trouble, cf: | ||
# https://github.com/bazelbuild/bazel/issues/134 | ||
# The easiest solution is to set up a bazelrc file forcing --batch. | ||
# RUN echo "startup --batch" >>/root/.bazelrc | ||
# Similarly, we need to workaround sandboxing issues: | ||
# https://github.com/bazelbuild/bazel/issues/418 | ||
# RUN echo "build --spawn_strategy=standalone --genrule_strategy=standalone" \ | ||
# >>/root/.bazelrc | ||
# ENV BAZELRC /root/.bazelrc | ||
# Install the most recent bazel release. | ||
ENV BAZEL_VERSION 0.4.3 | ||
RUN mkdir /bazel && \ | ||
cd /bazel && \ | ||
curl -fSsL -O https://github.com/bazelbuild/bazel/releases/download/$BAZEL_VERSION/bazel-$BAZEL_VERSION-installer-linux-x86_64.sh && \ | ||
curl -fSsL -o /bazel/LICENSE.txt https://raw.githubusercontent.com/bazelbuild/bazel/master/LICENSE.txt && \ | ||
chmod +x bazel-*.sh && \ | ||
./bazel-$BAZEL_VERSION-installer-linux-x86_64.sh && \ | ||
cd / && \ | ||
rm -f /bazel/bazel-$BAZEL_VERSION-installer-linux-x86_64.sh | ||
|
||
# Install deepmind-lab dependencies | ||
RUN apt-get update && apt-get install -y \ | ||
lua5.1 \ | ||
liblua5.1-0-dev \ | ||
libffi-dev \ | ||
gettext \ | ||
freeglut3-dev \ | ||
libsdl2-dev \ | ||
libosmesa6-dev \ | ||
python-dev \ | ||
python-numpy \ | ||
realpath \ | ||
build-essential && \ | ||
apt-get clean && \ | ||
rm -rf /var/lib/apt/lists/* | ||
|
||
|
||
# Set the default X11 Display. | ||
ENV DISPLAY :1 | ||
ENV VNC_PASSWORD=password | ||
ENV XVFB_RESOLUTION=800x600x16 | ||
|
||
# Set up deepmind-lab folder and copy in the code. | ||
ENV lab_dir /lab | ||
RUN mkdir /$lab_dir | ||
COPY . /$lab_dir | ||
WORKDIR $lab_dir | ||
|
||
# Run an actual (headless) build since this should make subsequent builds much faster. | ||
# Alternative commands based on the Documentation: | ||
# RUN bazel run :random_agent --define headless=false | ||
# RUN bazel build :deepmind_lab.so --define headless=osmesa | ||
RUN bazel run :python_module_test --define headless=osmesa | ||
|
||
# This port is the default for connecting to VNC display :1 | ||
EXPOSE 5901 | ||
|
||
# Copy VNC script that handles restarts and make it executable. | ||
COPY ./.docker/startup.sh /opt/ | ||
RUN chmod u+x /opt/startup.sh | ||
|
||
# Finally, start VNC using our script. | ||
CMD ["/opt/startup.sh"] |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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 should probably add python-pil, now that we sort of depend on it.