Skip to content

Commit d369222

Browse files
committed
Added Docker Compose
1 parent 0585a8b commit d369222

File tree

2 files changed

+18
-72
lines changed

2 files changed

+18
-72
lines changed

Dockerfile

+2-72
Original file line numberDiff line numberDiff line change
@@ -1,68 +1,4 @@
1-
FROM balenalib/genericx86-64-ext:latest-run-20231106
2-
3-
WORKDIR /usr/src
4-
5-
ENV DEBIAN_FRONTEND noninteractive
6-
7-
# Set some variables to download the proper header modules
8-
ENV VERSION="4.0.23%2Brev1"
9-
ENV BALENA_MACHINE_NAME="genericx86-64-ext"
10-
11-
# Set variables for the Yocto version of the OS
12-
ENV YOCTO_VERSION=5.15.72
13-
ENV YOCTO_KERNEL=${YOCTO_VERSION}-yocto-standard
14-
15-
# Set variables to download proper NVIDIA driver
16-
ENV NVIDIA_DRIVER_VERSION=550.67
17-
ENV NVIDIA_DRIVER=NVIDIA-Linux-x86_64-${NVIDIA_DRIVER_VERSION}
18-
19-
# Install some prereqs
20-
RUN install_packages git wget unzip build-essential libelf-dev bc libssl-dev bison flex software-properties-common pciutils libglvnd-dev
21-
22-
WORKDIR /usr/src/nvidia
23-
24-
# Download and compile NVIDIA driver
25-
RUN \
26-
curl -fsSL -O https://us.download.nvidia.com/XFree86/Linux-x86_64/$NVIDIA_DRIVER_VERSION/$NVIDIA_DRIVER.run && \
27-
chmod +x ./${NVIDIA_DRIVER}.run && \
28-
./${NVIDIA_DRIVER}.run --extract-only && \
29-
./${NVIDIA_DRIVER}/nvidia-installer \
30-
--ui=none \
31-
--no-questions \
32-
--no-drm \
33-
--no-x-check \
34-
--no-systemd \
35-
--no-kernel-module \
36-
--no-distro-scripts \
37-
--install-compat32-libs \
38-
--no-nouveau-check \
39-
--no-rpms \
40-
--no-backup \
41-
--no-abi-note \
42-
--no-check-for-alternate-installs \
43-
--no-libglx-indirect \
44-
--install-libglvnd \
45-
--x-prefix=/tmp/null \
46-
--x-module-path=/tmp/null \
47-
--x-library-path=/tmp/null \
48-
--x-sysconfig-path=/tmp/null \
49-
--skip-depmod \
50-
--expert
51-
52-
53-
# Install CUDA Toolkit for Ubuntu per https://developer.nvidia.com/cuda-downloads
54-
55-
RUN \
56-
wget https://developer.download.nvidia.com/compute/cuda/repos/ubuntu2204/x86_64/cuda-ubuntu2204.pin && \
57-
mv cuda-ubuntu2204.pin /etc/apt/preferences.d/cuda-repository-pin-600 && \
58-
wget https://developer.download.nvidia.com/compute/cuda/12.4.0/local_installers/cuda-repo-ubuntu2204-12-4-local_12.4.0-550.54.14-1_amd64.deb && \
59-
dpkg -i cuda-repo-ubuntu2204-12-4-local_12.4.0-550.54.14-1_amd64.deb && \
60-
cp /var/cuda-repo-ubuntu2204-12-4-local/cuda-*-keyring.gpg /usr/share/keyrings/ && \
61-
apt-get update && \
62-
apt-get -y install cuda-toolkit-12-4
63-
64-
ENV PATH="/usr/local/cuda-12.4/bin:$PATH"
65-
ENV LD_LIBRARY_PATH="/usr/local/cuda-12.4/lib64:$LD_LIBRARY_PATH"
1+
FROM nvidia/cuda:12.3.2-devel-ubuntu22.04 as build
662

673
ENV PYTHON_VERSION 3.11
684

@@ -93,10 +29,4 @@ RUN python -mpip install toml
9329
RUN poetry
9430
RUN ./build-bin.sh cuda linux-64 "-DLLAMA_CUBLAS=1"
9531

96-
97-
WORKDIR /usr/src/app
98-
COPY *.sh ./
99-
100-
ENTRYPOINT ["/bin/bash", "/usr/src/app/entry.sh"]
101-
102-
#CMD ["/app/dist/gputopia-worker-cuda-linux-64"]
32+
ENTRYPOINT /app/dist/gputopia-worker-cuda-linux-64 --queen_url $QUEEN_URL

docker-compose.yaml

+16
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
services:
2+
workerbee:
3+
image: mediainbox/workerbee:latest
4+
environment:
5+
QUEEN_URL: "wss://queenbee-production.up.railway.app/worker"
6+
BALENA_DEVICE_NAME: "edge-ml-1"
7+
HF_HOME: "/cache"
8+
volumes:
9+
- "/cache:/cache"
10+
deploy:
11+
resources:
12+
reservations:
13+
devices:
14+
- driver: nvidia
15+
count: 2
16+
capabilities: [gpu]

0 commit comments

Comments
 (0)