-
Notifications
You must be signed in to change notification settings - Fork 1
/
Dockerfile
135 lines (105 loc) · 3.95 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
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
ARG SOURCE_IMAGE='nvcr.io/nvidia/cuda:12.2.0-devel-ubuntu22.04'
FROM $SOURCE_IMAGE
ENV DEBIAN_FRONTEND="noninteractive"
ENV HF_HOME="/tmp"
RUN apt-get update \
&& apt-get install -y --no-install-recommends \
ca-certificates \
curl \
gnupg \
&& rm -rf /var/lib/apt/lists/*
RUN install -m 0755 -d /etc/apt/keyrings && \
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | gpg --dearmor -o /etc/apt/keyrings/docker.gpg && \
chmod a+r /etc/apt/keyrings/docker.gpg && \
echo "deb [arch="$(dpkg --print-architecture)" signed-by=/etc/apt/keyrings/docker.gpg] https://download.docker.com/linux/ubuntu" \
$(. /etc/os-release && echo "$VERSION_CODENAME")" stable" | \
tee /etc/apt/sources.list.d/docker.list > /dev/null
ARG NODE_VERSION
RUN curl -fsSL https://deb.nodesource.com/setup_$NODE_VERSION.x | bash -
RUN apt-get update -y \
&& apt-get install -y --no-install-recommends \
gcc \
clang \
containerd.io \
docker-ce \
docker-ce-cli \
docker-buildx-plugin \
docker-compose-plugin \
git \
libaio-dev \
libclang-dev \
libopencv-dev \
ninja-build \
nodejs \
openssh-client \
python3-dev \
python3-pip \
python3-packaging \
python3-venv \
sqlite3 \
unzip \
vim \
&& rm -rf /var/lib/apt/lists/*
WORKDIR /tmp
ARG DOTNET_VERSION
RUN curl -fSL --output dotnet.tar.gz https://dotnetcli.azureedge.net/dotnet/Runtime/$DOTNET_VERSION/dotnet-runtime-$DOTNET_VERSION-linux-x64.tar.gz \
&& dotnet_sha512='f15b6bf0ef0ce48901880bd89a5fa4b3ae6f6614ab416b23451567844448f2510cf5beeeef6c2ac33400ea013cda7b6d2a4477e7aa0f36461b94741161424c3e' \
&& echo "$dotnet_sha512 dotnet.tar.gz" | sha512sum -c - \
&& mkdir -p /usr/share/dotnet \
&& tar -zxf dotnet.tar.gz -C /usr/share/dotnet \
&& rm dotnet.tar.gz \
&& ln -s /usr/share/dotnet/dotnet /usr/bin/dotnet
LABEL sponsor="United Nations of Earth"
ARG DCE_VERSION
RUN curl --location --remote-header-name --remote-name https://github.com/Tyrrrz/DiscordChatExporter/releases/download/$DCE_VERSION/DiscordChatExporter.Cli.zip && \
mkdir -p /usr/share/dce && \
unzip DiscordChatExporter.Cli.zip -d /usr/share/dce && \
chmod -R 755 /usr/share/dce && \
rm DiscordChatExporter.Cli.zip
ARG ARCH
ARG HUGO_VERSION
RUN curl --location --remote-header-name --remote-name https://github.com/gohugoio/hugo/releases/download/v${HUGO_VERSION}/hugo_extended_${HUGO_VERSION}_linux-$ARCH.tar.gz && \
mkdir -p /usr/share/hugo && \
tar -zxf hugo_extended_${HUGO_VERSION}_linux-$ARCH.tar.gz -C /usr/share/hugo && \
chmod -R 755 /usr/share/hugo && \
rm hugo_extended_${HUGO_VERSION}_linux-$ARCH.tar.gz && \
ln -s /usr/share/hugo/hugo /usr/bin/hugo && \
hugo version
WORKDIR /src
COPY requirements.txt prepare.py ./
RUN pip install -r requirements.txt && \
pip cache purge
RUN python3 prepare.py
# RUN pip install flash-attn --no-build-isolation && \
# pip cache purge
ARG NODEMON_VERSION
RUN npm i -g nodemon@$NODEMON_VERSION
COPY lab/petals/ /lab/petals
COPY lab/lightning-hivemind/ /lab/lightning-hivemind
COPY lab/ModuleFormer/ /lab/ModuleFormer
RUN python3 -m venv /venv/x \
&& chmod +x /venv/x/bin/activate \
&& . /venv/x/bin/activate
COPY requirements.x.txt ./
RUN pip install -r requirements.x.txt && \
pip cache purge
RUN python3 -m venv /venv/y \
&& chmod +x /venv/y/bin/activate \
&& . /venv/y/bin/activate
COPY lab/ /lab
COPY requirements.y.txt ./
COPY src/aigen /src/aigen
RUN pip install -r requirements.y.txt && \
pip cache purge
COPY src/ /src
COPY book/ /book
COPY data/embeddings/ /embeddings
COPY data/adapters/ /adapters
RUN mkdir /env && \
mkdir -p /lab/discord/private
ENV TZ="America/Chicago"
ENV PYTHONPYCACHEPREFIX='/tmp/__pycache__'
ENV CUDA_DEVICE_ORDER=PCI_BUS_ID
ENV FOCUS='toe'
LABEL maintainer="R"
CMD ["nodemon", "--watch", "/src", "--watch", "/env", "--ext", "*.py,*.yml", "--ignore", "models/*", "--ignore", "*.json", "--exec", "python3", "main.py"]