forked from aws/amazon-sagemaker-examples
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
66 lines (56 loc) · 1.68 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
65
66
#
# This is the custom docker image used in the sagemaker container
#
ARG CPU_OR_GPU
ARG AWS_REGION
FROM 520713654638.dkr.ecr.$AWS_REGION.amazonaws.com/sagemaker-tensorflow-scriptmode:1.12.0-$CPU_OR_GPU-py3
RUN apt-get update && apt-get install -y --no-install-recommends \
build-essential \
jq \
libav-tools \
libjpeg-dev \
libxrender1 \
python3.6-dev \
python3-opengl \
wget \
xvfb && \
apt-get clean && \
rm -rf /var/lib/apt/lists/*
# Install Redis.
RUN \
cd /tmp && \
wget http://download.redis.io/redis-stable.tar.gz && \
tar xvzf redis-stable.tar.gz && \
cd redis-stable && \
make && \
make install
# Bootstrap the PIP installs to make it faster to re-build the container image on code changes.
RUN pip install \
annoy==1.8.3 \
Pillow==4.3.0 \
matplotlib==2.0.2 \
numpy==1.17.0 \
pandas==0.22.0 \
pygame==1.9.3 \
PyOpenGL==3.1.0 \
scipy==1.3.0 \
scikit-image==0.15.0 \
gym==0.10.5 \
retrying \
eventlet \
boto3 \
minio==4.0.5 \
futures==3.1.1 \
redis==3.3.8
#Install rl coach
RUN pip install rl-coach-slim==0.11.1
RUN pip install --no-cache-dir --upgrade sagemaker-containers
# Patch intel coach so that discrete distributions can not produce nan's
COPY src/lib/ppo_head.py /usr/local/lib/python3.6/dist-packages/rl_coach/architectures/tensorflow_components/heads/ppo_head.py
# Copy in all the code and make it available on the path
COPY src/lib/redis.conf /etc/redis/redis.conf
ENV PYTHONPATH /opt/amazon/:$PYTHONPATH
ENV PATH /opt/ml/code/:$PATH
WORKDIR /opt/ml/code
ENV NODE_TYPE SAGEMAKER_TRAINING_WORKER
ENV PYTHONUNBUFFERED 1