-
Notifications
You must be signed in to change notification settings - Fork 7
/
Dockerfile-min-version
51 lines (51 loc) · 1.8 KB
/
Dockerfile-min-version
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
FROM ubuntu:16.04
ENV LC_ALL=C.UTF-8
WORKDIR /app/
# Install CUDA 9.0.
RUN apt-get update -y && \
DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends \
wget \
ca-certificates \
libfile-tail-perl \
&& \
rm -rf /var/lib/apt/lists/* && \
cd /tmp && \
wget --quiet https://developer.nvidia.com/compute/cuda/9.0/Prod/local_installers/cuda_9.0.176_384.81_linux-run && \
sh cuda_9.0.176_384.81_linux-run --silent && \
rm *
# Install an old version of Python.
ARG MIN_PYTHON_VERSION
RUN apt-get update -y && \
DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends \
build-essential \
wget \
zlib1g \
zlib1g-dev \
libssl-dev \
&& \
rm -rf /var/lib/apt/lists/* && \
cd /tmp && \
wget --quiet https://www.python.org/ftp/python/${MIN_PYTHON_VERSION}/Python-${MIN_PYTHON_VERSION}.tar.xz && \
tar xf Python-${MIN_PYTHON_VERSION}.tar.xz --xz && \
rm Python-${MIN_PYTHON_VERSION}.tar.xz && \
cd Python-${MIN_PYTHON_VERSION} && \
./configure && \
make && \
make install && \
cd .. && \
rm -r Python-${MIN_PYTHON_VERSION}
# Install old versions of Python packages.
ARG MIN_PYNVML_VERSION
ARG MIN_PYTORCH_VERSION
ARG MIN_TYPING_EXTENSIONS_VERSION
RUN python_major_version=`echo ${MIN_PYTHON_VERSION} | sed 's/\.[0-9]\+$//'` && \
ln -sf "`which python"$python_major_version"`" /usr/local/bin/python && \
python"$python_major_version" -m ensurepip --upgrade && \
pip3 install --trusted-host pypi.python.org \
pynvml==${MIN_PYNVML_VERSION} \
torch==${MIN_PYTORCH_VERSION} \
typing-extensions==${MIN_TYPING_EXTENSIONS_VERSION} \
numpy
COPY torch_semiring_einsum/ ./torch_semiring_einsum
COPY tests/ ./tests
COPY scripts/ ./scripts