-
Notifications
You must be signed in to change notification settings - Fork 1
/
Dockerfile
47 lines (33 loc) · 1.25 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
FROM ubuntu:focal-20220415 as build
RUN apt update && \
apt install -y python3-dev \
python3-pip \
wget
RUN pip install wheel
RUN wget https://download.pytorch.org/models/vgg19-dcbb9e9d.pth
WORKDIR /build
COPY setup.py .
COPY torchsr torchsr
COPY README.md .
RUN python3 setup.py bdist_wheel
FROM nvcr.io/nvidia/cuda:11.3.0-base-ubuntu20.04
ENV MASTER_PORT 29500
WORKDIR /torchsr
RUN apt update && \
apt install -y python3-pip
COPY --from=build vgg19-dcbb9e9d.pth /root/.cache/torch/hub/checkpoints/vgg19-dcbb9e9d.pth
COPY --from=build /build/dist .
COPY requirements.txt .
COPY media/waterfalls-low-res.png media/waterfalls-low-res.png
# Set the MASTER_ADDR variable for Slurm-based jobs if possible. This will only
# be set if found to be running in a Slurm job. If not, it will be left empty
# and functionality will not change from the expected behavior.
RUN echo "export MASTER_ADDR=\$(hostlist -l 1 \"\${SLURM_NODELIST}\")" >> /etc/profile.d/50-slurm-addr.sh
RUN pip3 install --no-cache-dir \
--extra-index-url https://download.pytorch.org/whl/cu113 \
-r requirements.txt \
python-hostlist \
torchsr-0.1.0-py3-none-any.whl && \
rm torchsr-0.1.0-py3-none-any.whl
RUN mkdir -p output && \
rm requirements.txt