forked from amazon-archives/amazon-dsstne
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Dockerfile
113 lines (98 loc) · 3.46 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
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
# VERSION 0.1
# AUTHOR: DSSTNE Docker <[email protected]>
# DESCRIPTION: Docker image for Amazon DSSTNE
FROM ubuntu:14.04
RUN apt-get update && apt-get install -y make \
build-essential \
cmake \
g++ \
gcc \
libatlas-base-dev \
wget
ENV CUDA_MAJOR=7.0 \
CUDA_VERSION=7.0.28 \
CUDA_MAJOR_U=7_0 \
GPU_DRIVER_VERSION=346.72
# Change to the /tmp directory
RUN cd /tmp && \
# Download run file
wget http://developer.download.nvidia.com/compute/cuda/${CUDA_MAJOR_U}/Prod/local_installers/cuda_${CUDA_VERSION}_linux.run && \
# Make the run file executable and extract
chmod +x cuda_*_linux.run && ./cuda_*_linux.run -extract=`pwd`
# Install the specific driver. (7.0.28 ships with 346.46)
RUN cd /tmp && \
wget http://us.download.nvidia.com/XFree86/Linux-x86_64/$GPU_DRIVER_VERSION/NVIDIA-Linux-x86_64-$GPU_DRIVER_VERSION.run && \
chmod +x ./NVIDIA-Linux-x86_64-$GPU_DRIVER_VERSION.run && \
# Install CUDA drivers (silent, no kernel)
./NVIDIA-Linux-x86_64-$GPU_DRIVER_VERSION.run -s --no-kernel-module && \
# Install toolkit (silent)
./cuda-linux64-rel-*.run -noprompt && \
rm -rf /tmp/*
# Add to path
ENV PATH=/usr/local/cuda/bin:${PATH}
# Configure dynamic link
RUN echo "/usr/local/cuda/lib64" >> /etc/ld.so.conf && ldconfig
# Install OpenMPI
RUN cd /tmp && \
wget http://www.open-mpi.org/software/ompi/v1.8/downloads/openmpi-1.8.2.tar.gz && \
tar xvfz openmpi-1.8.2.tar.gz && \
cd openmpi-1.8.2 && \
./configure --prefix=/usr/local/openmpi && \
make && \
sudo make install && rm -rf /tmp/*
# "Installing JSONCPP"
RUN cd /tmp && \
apt-get install -y python && \
wget https://github.com/open-source-parsers/jsoncpp/archive/svn-import.tar.gz && \
tar xvfz svn-import.tar.gz &&\
cd jsoncpp-svn-import &&\
mkdir -p build/release &&\
cd build/release &&\
cmake -DCMAKE_BUILD_TYPE=release -DJSONCPP_LIB_BUILD_SHARED=OFF -G "Unix Makefiles" ../.. && \
make &&\
make install && rm -rf /tmp/*
#Installing hdf5
RUN cd /tmp && \
wget ftp://ftp.unidata.ucar.edu/pub/netcdf/netcdf-4/hdf5-1.8.9.tar.gz && \
tar xvfz hdf5-1.8.9.tar.gz && \
cd hdf5-1.8.9 && \
./configure --prefix=/usr/local &&\
make && \
make install && rm -rf /tmp/*
# Installing zlib
RUN cd /tmp && \
wget ftp://ftp.unidata.ucar.edu/pub/netcdf/netcdf-4/zlib-1.2.8.tar.gz &&\
tar xvf zlib-1.2.8.tar.gz &&\
cd zlib-1.2.8 &&\
./configure && \
make && \
make install && rm -rf /tmp/*
#"Installing netcdf"
RUN cd /tmp && \
wget ftp://ftp.unidata.ucar.edu/pub/netcdf/netcdf-4.1.3.tar.gz &&\
tar xvf netcdf-4.1.3.tar.gz &&\
cd netcdf-4.1.3 &&\
./configure --prefix=/usr/local &&\
make &&\
make install && rm -rf /tmp/*
# "Installing netcdf-cxx"
RUN cd /tmp && \
wget http://www.unidata.ucar.edu/downloads/netcdf/ftp/netcdf-cxx4-4.2.tar.gz &&\
tar xvf netcdf-cxx4-4.2.tar.gz &&\
cd netcdf-cxx4-4.2 &&\
./configure --prefix=/usr/local &&\
make && \
make install && rm -rf /tmp/*
#Installing CUBG
RUN cd /tmp && \
wget https://github.com/NVlabs/cub/archive/1.5.2.zip &&\
apt-get install -y unzip &&\
unzip 1.5.2.zip &&\
cp -rf cub-1.5.2/cub/ /usr/local/include/ &&\
rm -rf /tmp/*
ENV PATH=/usr/local/openmpi/bin/:/usr/local/cuda-7.0/bin/:${PATH} \
LD_LIBRARY_PATH=/usr/local/lib/:${LD_LIBRARY_PATH}
COPY src /opt/amazon/dsstne/src
RUN cd /opt/amazon/dsstne/src/amazon/dsstne && \
make
ENV PATH /opt/amazon/dsstne/src/amazon/dsstne/bin:${PATH}