Spaces:
Paused
Paused
Commit
·
718c1e6
1
Parent(s):
0f1d055
remove the docker/ dir as this confuses everyone (including me)
Browse files- docker/Dockerfile +0 -83
- docker/start.sh +0 -70
docker/Dockerfile
DELETED
@@ -1,83 +0,0 @@
|
|
1 |
-
FROM nvidia/cuda:12.8.1-devel-ubuntu22.04
|
2 |
-
|
3 |
-
LABEL authors="jaret"
|
4 |
-
|
5 |
-
# Set noninteractive to avoid timezone prompts
|
6 |
-
ENV DEBIAN_FRONTEND=noninteractive
|
7 |
-
|
8 |
-
# ref https://en.wikipedia.org/wiki/CUDA
|
9 |
-
ENV TORCH_CUDA_ARCH_LIST="8.0 8.6 8.9 9.0 10.0 12.0"
|
10 |
-
|
11 |
-
# Install dependencies
|
12 |
-
RUN apt-get update && apt-get install --no-install-recommends -y \
|
13 |
-
git \
|
14 |
-
curl \
|
15 |
-
build-essential \
|
16 |
-
cmake \
|
17 |
-
wget \
|
18 |
-
python3.10 \
|
19 |
-
python3-pip \
|
20 |
-
python3-dev \
|
21 |
-
python3-setuptools \
|
22 |
-
python3-wheel \
|
23 |
-
python3-venv \
|
24 |
-
ffmpeg \
|
25 |
-
tmux \
|
26 |
-
htop \
|
27 |
-
nvtop \
|
28 |
-
python3-opencv \
|
29 |
-
openssh-client \
|
30 |
-
openssh-server \
|
31 |
-
openssl \
|
32 |
-
rsync \
|
33 |
-
unzip \
|
34 |
-
&& apt-get clean \
|
35 |
-
&& rm -rf /var/lib/apt/lists/*
|
36 |
-
|
37 |
-
# Install nodejs
|
38 |
-
WORKDIR /tmp
|
39 |
-
RUN curl -sL https://deb.nodesource.com/setup_23.x -o nodesource_setup.sh && \
|
40 |
-
bash nodesource_setup.sh && \
|
41 |
-
apt-get update && \
|
42 |
-
apt-get install -y nodejs && \
|
43 |
-
apt-get clean && \
|
44 |
-
rm -rf /var/lib/apt/lists/*
|
45 |
-
|
46 |
-
WORKDIR /app
|
47 |
-
|
48 |
-
# Set aliases for python and pip
|
49 |
-
RUN ln -s /usr/bin/python3 /usr/bin/python
|
50 |
-
|
51 |
-
# install pytorch before cache bust to avoid redownloading pytorch
|
52 |
-
RUN pip install --pre --no-cache-dir torch torchvision torchaudio --index-url https://download.pytorch.org/whl/nightly/cu128
|
53 |
-
|
54 |
-
# Fix cache busting by moving CACHEBUST to right before git clone
|
55 |
-
ARG CACHEBUST=1234
|
56 |
-
ARG GIT_COMMIT=main
|
57 |
-
RUN echo "Cache bust: ${CACHEBUST}" && \
|
58 |
-
git clone https://github.com/ostris/ai-toolkit.git && \
|
59 |
-
cd ai-toolkit && \
|
60 |
-
git checkout ${GIT_COMMIT}
|
61 |
-
|
62 |
-
WORKDIR /app/ai-toolkit
|
63 |
-
|
64 |
-
# Install Python dependencies
|
65 |
-
RUN pip install --no-cache-dir -r requirements.txt && \
|
66 |
-
pip install --pre --no-cache-dir torch torchvision torchaudio --index-url https://download.pytorch.org/whl/nightly/cu128 --force && \
|
67 |
-
pip install setuptools==69.5.1 --no-cache-dir
|
68 |
-
|
69 |
-
# Build UI
|
70 |
-
WORKDIR /app/ai-toolkit/ui
|
71 |
-
RUN npm install && \
|
72 |
-
npm run build && \
|
73 |
-
npm run update_db
|
74 |
-
|
75 |
-
# Expose port (assuming the application runs on port 3000)
|
76 |
-
EXPOSE 8675
|
77 |
-
|
78 |
-
WORKDIR /
|
79 |
-
|
80 |
-
COPY docker/start.sh /start.sh
|
81 |
-
RUN chmod +x /start.sh
|
82 |
-
|
83 |
-
CMD ["/start.sh"]
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
docker/start.sh
DELETED
@@ -1,70 +0,0 @@
|
|
1 |
-
#!/bin/bash
|
2 |
-
set -e # Exit the script if any statement returns a non-true return value
|
3 |
-
|
4 |
-
# ref https://github.com/runpod/containers/blob/main/container-template/start.sh
|
5 |
-
|
6 |
-
# ---------------------------------------------------------------------------- #
|
7 |
-
# Function Definitions #
|
8 |
-
# ---------------------------------------------------------------------------- #
|
9 |
-
|
10 |
-
|
11 |
-
# Setup ssh
|
12 |
-
setup_ssh() {
|
13 |
-
if [[ $PUBLIC_KEY ]]; then
|
14 |
-
echo "Setting up SSH..."
|
15 |
-
mkdir -p ~/.ssh
|
16 |
-
echo "$PUBLIC_KEY" >> ~/.ssh/authorized_keys
|
17 |
-
chmod 700 -R ~/.ssh
|
18 |
-
|
19 |
-
if [ ! -f /etc/ssh/ssh_host_rsa_key ]; then
|
20 |
-
ssh-keygen -t rsa -f /etc/ssh/ssh_host_rsa_key -q -N ''
|
21 |
-
echo "RSA key fingerprint:"
|
22 |
-
ssh-keygen -lf /etc/ssh/ssh_host_rsa_key.pub
|
23 |
-
fi
|
24 |
-
|
25 |
-
if [ ! -f /etc/ssh/ssh_host_dsa_key ]; then
|
26 |
-
ssh-keygen -t dsa -f /etc/ssh/ssh_host_dsa_key -q -N ''
|
27 |
-
echo "DSA key fingerprint:"
|
28 |
-
ssh-keygen -lf /etc/ssh/ssh_host_dsa_key.pub
|
29 |
-
fi
|
30 |
-
|
31 |
-
if [ ! -f /etc/ssh/ssh_host_ecdsa_key ]; then
|
32 |
-
ssh-keygen -t ecdsa -f /etc/ssh/ssh_host_ecdsa_key -q -N ''
|
33 |
-
echo "ECDSA key fingerprint:"
|
34 |
-
ssh-keygen -lf /etc/ssh/ssh_host_ecdsa_key.pub
|
35 |
-
fi
|
36 |
-
|
37 |
-
if [ ! -f /etc/ssh/ssh_host_ed25519_key ]; then
|
38 |
-
ssh-keygen -t ed25519 -f /etc/ssh/ssh_host_ed25519_key -q -N ''
|
39 |
-
echo "ED25519 key fingerprint:"
|
40 |
-
ssh-keygen -lf /etc/ssh/ssh_host_ed25519_key.pub
|
41 |
-
fi
|
42 |
-
|
43 |
-
service ssh start
|
44 |
-
|
45 |
-
echo "SSH host keys:"
|
46 |
-
for key in /etc/ssh/*.pub; do
|
47 |
-
echo "Key: $key"
|
48 |
-
ssh-keygen -lf $key
|
49 |
-
done
|
50 |
-
fi
|
51 |
-
}
|
52 |
-
|
53 |
-
# Export env vars
|
54 |
-
export_env_vars() {
|
55 |
-
echo "Exporting environment variables..."
|
56 |
-
printenv | grep -E '^RUNPOD_|^PATH=|^_=' | awk -F = '{ print "export " $1 "=\"" $2 "\"" }' >> /etc/rp_environment
|
57 |
-
echo 'source /etc/rp_environment' >> ~/.bashrc
|
58 |
-
}
|
59 |
-
|
60 |
-
# ---------------------------------------------------------------------------- #
|
61 |
-
# Main Program #
|
62 |
-
# ---------------------------------------------------------------------------- #
|
63 |
-
|
64 |
-
|
65 |
-
echo "Pod Started"
|
66 |
-
|
67 |
-
setup_ssh
|
68 |
-
export_env_vars
|
69 |
-
echo "Starting AI Toolkit UI..."
|
70 |
-
cd /app/ai-toolkit/ui && npm run start
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|