-
Notifications
You must be signed in to change notification settings - Fork 8
/
Copy pathDockerfile
64 lines (53 loc) · 2.19 KB
/
Dockerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
# This Dockerfile creates a base dev environment for running grl package code.
# use nvidia/cuda image
FROM nvidia/cuda:11.1.1-devel-ubuntu20.04
# set bash as current shell
RUN chsh -s /bin/bash
SHELL ["/bin/bash", "-c"]
# apt install conda dependencies, openspiel dependencies, and general utils
RUN apt-get update \
&& DEBIAN_FRONTEND=noninteractive apt-get install -y \
wget bzip2 ca-certificates libglib2.0-0 libxext6 libsm6 libxrender1 \
git virtualenv clang cmake curl python3 python3-dev python3-pip python3-setuptools python3-wheel python3-tk \
tmux nano htop
# install conda
RUN wget --quiet https://repo.anaconda.com/archive/Anaconda3-2020.02-Linux-x86_64.sh -O ~/anaconda.sh && \
/bin/bash ~/anaconda.sh -b -p /opt/conda && \
rm ~/anaconda.sh && \
ln -s /opt/conda/etc/profile.d/conda.sh /etc/profile.d/conda.sh && \
echo ". /opt/conda/etc/profile.d/conda.sh" >> ~/.bashrc && \
find /opt/conda/ -follow -type f -name '*.a' -delete && \
find /opt/conda/ -follow -type f -name '*.js.map' -delete && \
/opt/conda/bin/conda clean -afy
# set path to conda
ENV PATH /opt/conda/bin:$PATH
# create conda env and set it as default
COPY environment.yml /grl/
RUN conda update conda && \
conda env create -f /grl/environment.yml && \
echo "conda activate grl" >> ~/.bashrc
ENV PATH=/opt/conda/envs/grl/bin:$PATH \
CONDA_DEFAULT_ENV=$grl
# copy remaining files required for docker setup
COPY .git /grl/.git/
COPY dependencies /grl/dependencies/
COPY .gitmodules setup.py /grl/
# install openspiel dependency
RUN cd /grl && \
git submodule update --init --recursive && \
cd dependencies/open_spiel && \
./install.sh && \
pip install -e .
# add optional tmux config not required for running code
# https://github.com/gpakosz/.tmux
RUN cd /root && \
git clone https://github.com/gpakosz/.tmux.git && \
ln -s -f .tmux/.tmux.conf && \
cp .tmux/.tmux.conf.local . && \
echo "tmux_conf_theme_root_attr='bold'" >> /root/.tmux.conf.local && \
echo "set -g mouse on" >> /root/.tmux.conf.local
# copy all repo files (except those listed in .dockerignore)
COPY . /grl
WORKDIR /grl
# install grl python package
RUN pip install -e .