Update Dockerfile
Browse files- Dockerfile +30 -3
Dockerfile
CHANGED
|
@@ -1,4 +1,33 @@
|
|
| 1 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 2 |
|
| 3 |
# Install build and runtime dependencies
|
| 4 |
RUN apt-get update && \
|
|
@@ -9,8 +38,6 @@ RUN apt-get update && \
|
|
| 9 |
pkg-config \
|
| 10 |
curl
|
| 11 |
|
| 12 |
-
RUN make LLAMA_CUBLAS=1
|
| 13 |
-
|
| 14 |
RUN pip install -U pip setuptools wheel && \
|
| 15 |
pip install --verbose llama-cpp-python[server]
|
| 16 |
|
|
|
|
| 1 |
+
ARG UBUNTU_VERSION=22.04
|
| 2 |
+
# This needs to generally match the container host's environment.
|
| 3 |
+
ARG CUDA_VERSION=11.7.1
|
| 4 |
+
# Target the CUDA build image
|
| 5 |
+
ARG BASE_CUDA_DEV_CONTAINER=nvidia/cuda:${CUDA_VERSION}-devel-ubuntu${UBUNTU_VERSION}
|
| 6 |
+
# Target the CUDA runtime image
|
| 7 |
+
ARG BASE_CUDA_RUN_CONTAINER=nvidia/cuda:${CUDA_VERSION}-runtime-ubuntu${UBUNTU_VERSION}
|
| 8 |
+
|
| 9 |
+
FROM ${BASE_CUDA_DEV_CONTAINER} as build
|
| 10 |
+
|
| 11 |
+
# Unless otherwise specified, we make a fat build.
|
| 12 |
+
ARG CUDA_DOCKER_ARCH=all
|
| 13 |
+
|
| 14 |
+
RUN apt-get update && \
|
| 15 |
+
apt-get install -y build-essential git
|
| 16 |
+
|
| 17 |
+
WORKDIR /app
|
| 18 |
+
|
| 19 |
+
COPY . .
|
| 20 |
+
|
| 21 |
+
# Set nvcc architecture
|
| 22 |
+
ENV CUDA_DOCKER_ARCH=${CUDA_DOCKER_ARCH}
|
| 23 |
+
# Enable cuBLAS
|
| 24 |
+
ENV LLAMA_CUBLAS=1
|
| 25 |
+
|
| 26 |
+
RUN make
|
| 27 |
+
|
| 28 |
+
FROM ${BASE_CUDA_RUN_CONTAINER} as runtime
|
| 29 |
+
|
| 30 |
+
COPY --from=build /app/main /main
|
| 31 |
|
| 32 |
# Install build and runtime dependencies
|
| 33 |
RUN apt-get update && \
|
|
|
|
| 38 |
pkg-config \
|
| 39 |
curl
|
| 40 |
|
|
|
|
|
|
|
| 41 |
RUN pip install -U pip setuptools wheel && \
|
| 42 |
pip install --verbose llama-cpp-python[server]
|
| 43 |
|