mirror of
https://github.com/vale981/ray
synced 2025-03-05 10:01:43 -05:00
updated Docker files (#171)
* updated Docker files * single Docker RUN for apt-get installs and cleanup * stylistic cleanup
This commit is contained in:
parent
1616426ccf
commit
8bb87a4f6b
7 changed files with 33 additions and 82 deletions
|
@ -1,5 +1,8 @@
|
|||
#!/bin/bash
|
||||
|
||||
docker build -t ray-project/ray:devel docker/devel
|
||||
docker build -t ray-project/ray:deploy docker/deploy
|
||||
docker build -t ray-project/ray:examples docker/examples
|
||||
docker build -t ray-project/base-deps docker/base-deps
|
||||
|
||||
tar --exclude './docker' -c . > ./docker/deploy/ray.tar
|
||||
docker build --no-cache -t ray-project/deploy docker/deploy
|
||||
rm ./docker/deploy/ray.tar
|
||||
docker build -t ray-project/examples docker/examples
|
||||
|
|
18
docker/base-deps/Dockerfile
Normal file
18
docker/base-deps/Dockerfile
Normal file
|
@ -0,0 +1,18 @@
|
|||
# The deploy Docker image build a self-contained Ray instance suitable
|
||||
# for end users.
|
||||
|
||||
FROM ubuntu:xenial
|
||||
RUN apt-get update \
|
||||
&& apt-get install -y vim git wget \
|
||||
&& apt-get install -y cmake build-essential autoconf curl libtool libboost-all-dev unzip \
|
||||
&& apt-get clean \
|
||||
&& rm -rf /var/lib/apt/lists/*
|
||||
RUN echo 'export PATH=/opt/conda/bin:$PATH' > /etc/profile.d/conda.sh \
|
||||
&& wget --quiet 'https://repo.continuum.io/archive/Anaconda2-4.2.0-Linux-x86_64.sh' -O /tmp/anaconda.sh \
|
||||
&& /bin/bash /tmp/anaconda.sh -b -p /opt/conda \
|
||||
&& rm /tmp/anaconda.sh
|
||||
ENV PATH "/opt/conda/bin:$PATH"
|
||||
RUN conda install libgcc
|
||||
RUN pip install --upgrade pip
|
||||
RUN pip install --upgrade "git+git://github.com/cloudpipe/cloudpickle.git@0d225a4695f1f65ae1cbb2e0bbc145e10167cce4"
|
||||
RUN pip install --upgrade --verbose "git+git://github.com/ray-project/ray.git#egg=numbuf&subdirectory=numbuf"
|
|
@ -1,21 +1,8 @@
|
|||
# The deploy Docker image build a self-contained Ray instance suitable
|
||||
# for end users.
|
||||
|
||||
FROM ubuntu:xenial
|
||||
RUN apt-get update
|
||||
RUN apt-get -y install apt-utils
|
||||
RUN apt-get -y install sudo
|
||||
RUN apt-get install -y git cmake build-essential autoconf curl libtool python-dev python-numpy python-pip libboost-all-dev unzip graphviz
|
||||
RUN pip install ipython funcsigs subprocess32 protobuf colorama graphviz
|
||||
RUN pip install --upgrade git+git://github.com/cloudpipe/cloudpickle.git@0d225a4695f1f65ae1cbb2e0bbc145e10167cce4 # We use the latest version of cloudpickle because it can serialize named tuples.
|
||||
RUN adduser --gecos --ingroup ray-user --disabled-login --gecos ray-user
|
||||
RUN adduser ray-user sudo
|
||||
RUN sed -i "s|%sudo\tALL=(ALL:ALL) ALL|%sudo\tALL=NOPASSWD: ALL|" /etc/sudoers
|
||||
USER ray-user
|
||||
WORKDIR /home/ray-user
|
||||
RUN git clone https://github.com/ray-project/ray
|
||||
WORKDIR /home/ray-user/ray
|
||||
RUN ./setup.sh
|
||||
RUN ./build.sh
|
||||
RUN echo '\n# Ray environment\nsource /home/ray-user/ray/setup-env.sh' >> /home/ray-user/.bashrc
|
||||
ENTRYPOINT bash
|
||||
FROM ray-project/base-deps
|
||||
ADD ray.tar /ray
|
||||
WORKDIR /ray/lib/python
|
||||
RUN python setup.py install
|
||||
WORKDIR /ray
|
||||
|
|
|
@ -1,19 +0,0 @@
|
|||
# The devel Docker image is designed for use with a source checkout
|
||||
# mounted from the local host filesystem.
|
||||
|
||||
FROM ubuntu:xenial
|
||||
RUN apt-get update
|
||||
RUN apt-get -y install apt-utils
|
||||
RUN apt-get -y install sudo
|
||||
RUN apt-get install -y git cmake build-essential autoconf curl libtool python-dev python-numpy python-pip libboost-all-dev unzip graphviz
|
||||
RUN pip install ipython funcsigs subprocess32 protobuf colorama graphviz
|
||||
RUN pip install --upgrade git+git://github.com/cloudpipe/cloudpickle.git@0d225a4695f1f65ae1cbb2e0bbc145e10167cce4 # We use the latest version of cloudpickle because it can serialize named tuples.
|
||||
RUN adduser --gecos --ingroup ray-user --disabled-login --gecos ray-user --uid 500
|
||||
RUN adduser ray-user sudo
|
||||
RUN sed -i "s|%sudo\tALL=(ALL:ALL) ALL|%sudo\tALL=NOPASSWD: ALL|" /etc/sudoers
|
||||
USER ray-user
|
||||
WORKDIR /home/ray-user
|
||||
RUN mkdir /home/ray-user/ray-build
|
||||
RUN mkdir /home/ray-user/ray
|
||||
RUN ln -s /home/ray-user/ray-build /home/ray-user/ray/build
|
||||
ENTRYPOINT bash
|
|
@ -1,14 +1,6 @@
|
|||
# Bulding on top of deploy image, this Dockerfile adds libraries needed
|
||||
# for running examples.
|
||||
# The examples Docker image adds dependencies needed to run the examples
|
||||
|
||||
FROM ray-project/ray:deploy
|
||||
|
||||
# Tensorflow
|
||||
RUN pip install --upgrade https://storage.googleapis.com/tensorflow/linux/cpu/tensorflow-0.9.0-cp27-none-linux_x86_64.whl
|
||||
|
||||
# SciPy
|
||||
RUN pip install scipy
|
||||
|
||||
# Gym
|
||||
RUN sudo apt-get -y install zlib1g-dev libjpeg-dev xvfb libav-tools xorg-dev python-opengl libsdl2-dev swig wget
|
||||
FROM ray-project/deploy
|
||||
RUN conda install -y -c conda-forge tensorflow
|
||||
RUN apt-get install zlib1g-dev
|
||||
RUN pip install gym[atari]
|
||||
|
|
|
@ -1,20 +0,0 @@
|
|||
# Base image for tests. This differs from the deploy image in that
|
||||
# rather than downloading source code from github it instead adds
|
||||
# it from a tar file creaetd by test/travis-ci/install.sh
|
||||
|
||||
FROM ubuntu:xenial
|
||||
RUN apt-get update
|
||||
RUN apt-get -y install apt-utils
|
||||
RUN apt-get -y install sudo
|
||||
RUN apt-get install -y git cmake build-essential autoconf curl libtool python-dev python-numpy python-pip libboost-all-dev unzip graphviz
|
||||
RUN pip install ipython funcsigs subprocess32 protobuf colorama graphviz
|
||||
RUN pip install --upgrade git+git://github.com/cloudpipe/cloudpickle.git@0d225a4695f1f65ae1cbb2e0bbc145e10167cce4 # We use the latest version of cloudpickle because it can serialize named tuples.
|
||||
RUN adduser --gecos --ingroup ray-user --disabled-login --gecos ray-user
|
||||
RUN adduser ray-user sudo
|
||||
RUN sed -i "s|%sudo\tALL=(ALL:ALL) ALL|%sudo\tALL=NOPASSWD: ALL|" /etc/sudoers
|
||||
ADD ray.tar /home/ray-user/ray
|
||||
RUN chown -R ray-user.ray-user /home/ray-user/ray
|
||||
USER ray-user
|
||||
WORKDIR /home/ray-user/ray
|
||||
RUN ./setup.sh
|
||||
RUN ./build.sh
|
|
@ -1,10 +0,0 @@
|
|||
# Bulding on top of base test image, this Dockerfile adds libraries
|
||||
# needed for running additional examples.
|
||||
|
||||
FROM ray-project/ray:test-base
|
||||
|
||||
# Tensorflow
|
||||
RUN pip install --upgrade https://storage.googleapis.com/tensorflow/linux/cpu/tensorflow-0.9.0-cp27-none-linux_x86_64.whl
|
||||
|
||||
# SciPy
|
||||
RUN pip install scipy
|
Loading…
Add table
Reference in a new issue