-
Notifications
You must be signed in to change notification settings - Fork 4
/
Dockerfile
102 lines (84 loc) · 3.27 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
# Created by: George Corrêa de Araújo ([email protected])
# FROM pytorch/pytorch:1.11.0-cuda11.3-cudnn8-devel
FROM pytorch/pytorch:2.0.1-cuda11.7-cudnn8-devel
# used to make generated files belong to actual user
ARG GROUPID=901
ARG GROUPNAME=deeplearning
ARG USERID=901
ARG USERNAME=dl
# Environment variables
RUN APT_INSTALL="apt-get install -y --no-install-recommends" && \
PIP_INSTALL="pip --no-cache-dir install --upgrade" && \
DOWNLOAD_FILE="curl -LO" && \
# ==================================================================
# Create a system group with name deeplearning and id 901 to avoid
# conflict with existing uids on the host system
# Create a system user with id 901 that belongs to group deeplearning
# When building the image, these values will be replaced by actual
# user info
# ------------------------------------------------------------------
groupadd -r $GROUPNAME -g $GROUPID && \
useradd -u $USERID -m -g $GROUPNAME $USERNAME && \
# ==================================================================
# install libraries via apt-get
# ------------------------------------------------------------------
rm -rf /var/lib/apt/lists/* && \
# temporary solution for bug
# see https://forums.developer.nvidia.com/t/gpg-error-http-developer-download-nvidia-com-compute-cuda-repos-ubuntu1804-x86-64/212904/3
apt-key adv --fetch-keys https://developer.download.nvidia.com/compute/machine-learning/repos/ubuntu1804/x86_64/3bf863cc.pub && \
apt-key adv --fetch-keys https://developer.download.nvidia.com/compute/cuda/repos/ubuntu1804/x86_64/3bf863cc.pub && \
apt-get update && \
DEBIAN_FRONTEND=noninteractive $APT_INSTALL \
bc \
curl \
git \
libffi-dev \
rsync \
wget && \
# ==================================================================
# install python libraries via pip
# ------------------------------------------------------------------
$PIP_INSTALL \
pip \
setuptools \
wheel && \
$PIP_INSTALL \
comet-ml \
datasets \
ipdb \
ipython \
kornia \
lightning \
"lightning[extra]" \
matplotlib \
numpy \
omegaconf \
pillow \
piq \
prettytable \
rich \
tensorboard \
torch_optimizer \
tqdm && \
# ==================================================================
# install python libraries via git
# ------------------------------------------------------------------
$PIP_INSTALL git+https://github.com/jonbarron/robust_loss_pytorch && \
# ==================================================================
# send telegram message
# ------------------------------------------------------------------
$PIP_INSTALL \
# https://github.com/rahiel/telegram-send/issues/115#issuecomment-1368728425
python-telegram-bot==13.5 \
telegram-send && \
# ==================================================================
# config & cleanup
# ------------------------------------------------------------------
ldconfig && \
apt-get clean && \
apt-get autoremove && \
/opt/conda/bin/conda clean -ya && \
rm -rf /var/lib/apt/lists/* /tmp/* ~/*
USER $USERNAME
# Expose TensorBoard ports
EXPOSE 6006 7000