-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
107 lines (94 loc) · 2.2 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
FROM nvidia/cuda:12.6.1-cudnn-runtime-ubuntu22.04
#start with root to install packages
#setup declaration
ENV DEBIAN_FRONTEND=noninteractive
ENV NVIDIA_VISIBLE_DEVICES all
ENV NVIDIA_DRIVER_CAPABILITIES compute,utility
ENV INSTALL_APT="apt install -y"
ENV INSTALL_PIP="python3 -m pip --no-cache-dir install --upgrade"
ENV HOME=/home/llmstudio
ENV APP_PATH=/app
ENV PATH="$PATH:$HOME/.local/bin"
#start update current packages
RUN apt-get update && apt-get install -y \
git \
ethtool \
wget \
build-essential \
zlib1g \
cmake \
ca-certificates \
lsb-release \
apache2-utils \
gnupg2 \
unzip \
vim \
man \
git-lfs \
kmod \
curl \
software-properties-common \
libgoogle-perftools-dev \
bc \
ffmpeg \
linux-headers-generic \
libopenblas-dev \
liblapack-dev \
libegl1 \
libglvnd-dev \
pkg-config \
nvidia-cuda-toolkit \
pipenv
#install python and libs
RUN add-apt-repository ppa:deadsnakes/ppa && \
$INSTALL_APT \
python3.10 \
python3-pip \
python3.10-distutils \
python3-venv \
python3-opencv \
python3-tk
RUN cp /usr/bin/python3 /usr/bin/python
#clear
RUN rm -rf /var/lib/apt/lists/*
#install all python and pip packages
RUN $INSTALL_PIP \
Wave \
pickleshare \
huggingface_hub \
awscli \
wheel \
perftool \
fastapi \
xtuner \
deepspeed \
tensorrt \
pickleshare
#based on llmstudio from h2o setup use uid not common
RUN adduser --uid 1999 llmstudio
#create working folder
WORKDIR ${APP_PATH}
COPY . ${APP_PATH}
#install jupyter
RUN $INSTALL_PIP \
jupyterlab \
jupyterhub \
notebook
#prepare folders
RUN mkdir apps/
RUN mkdir models/
RUN mkdir datasets/
RUN \
curl -sS https://bootstrap.pypa.io/get-pip.py | python3.10 && \
chmod -R a+w /home/llmstudio && chown -R llmstudio:llmstudio /home/llmstudio &&\
chmod +x ${APP_PATH}/starter.sh &&\
chmod -R a+w ${APP_PATH} && chown -R llmstudio:llmstudio ${APP_PATH}
#install nodejs
RUN curl -s https://deb.nodesource.com/setup_18.x | bash
RUN apt install -y nodejs
#switch to the llmstudio user
USER llmstudio
#for llmstudio
EXPOSE 7861
EXPOSE 7860
CMD ["/bin/bash", "-c", "./starter.sh"]