From 0a1d889e27d6aaa3293dd2c692b849a9bcf4b474 Mon Sep 17 00:00:00 2001 From: Ed Lepedus Date: Thu, 4 Apr 2024 17:31:22 +0100 Subject: [PATCH] server: add cURL support to server Dockerfiles (#6474) * server: add cURL support to `full.Dockerfile` * server: add cURL support to `full-cuda.Dockerfile` and `server-cuda.Dockerfile` * server: add cURL support to `full-rocm.Dockerfile` and `server-rocm.Dockerfile` * server: add cURL support to `server-intel.Dockerfile` * server: add cURL support to `server-vulkan.Dockerfile` * fix typo in `server-vulkan.Dockerfile` Co-authored-by: Georgi Gerganov --------- Co-authored-by: Georgi Gerganov --- .devops/full-cuda.Dockerfile | 4 +++- .devops/full-rocm.Dockerfile | 5 +++++ .devops/full.Dockerfile | 5 ++++- .devops/server-cuda.Dockerfile | 7 ++++++- .devops/server-intel.Dockerfile | 7 +++++-- .devops/server-rocm.Dockerfile | 5 +++++ .devops/server-vulkan.Dockerfile | 6 +++++- 7 files changed, 33 insertions(+), 6 deletions(-) diff --git a/.devops/full-cuda.Dockerfile b/.devops/full-cuda.Dockerfile index 8cc1480d3..059fd2695 100644 --- a/.devops/full-cuda.Dockerfile +++ b/.devops/full-cuda.Dockerfile @@ -12,7 +12,7 @@ FROM ${BASE_CUDA_DEV_CONTAINER} as build ARG CUDA_DOCKER_ARCH=all RUN apt-get update && \ - apt-get install -y build-essential python3 python3-pip git + apt-get install -y build-essential python3 python3-pip git libcurl4-openssl-dev COPY requirements.txt requirements.txt COPY requirements requirements @@ -28,6 +28,8 @@ COPY . . ENV CUDA_DOCKER_ARCH=${CUDA_DOCKER_ARCH} # Enable CUDA ENV LLAMA_CUDA=1 +# Enable cURL +ENV LLAMA_CURL=1 RUN make diff --git a/.devops/full-rocm.Dockerfile b/.devops/full-rocm.Dockerfile index 8b9633dc4..6ecf3bcc7 100644 --- a/.devops/full-rocm.Dockerfile +++ b/.devops/full-rocm.Dockerfile @@ -40,6 +40,11 @@ ENV LLAMA_HIPBLAS=1 ENV CC=/opt/rocm/llvm/bin/clang ENV CXX=/opt/rocm/llvm/bin/clang++ +# Enable cURL +ENV LLAMA_CURL=1 +RUN apt-get update && \ + apt-get install -y libcurl4-openssl-dev + RUN make ENTRYPOINT ["/app/.devops/tools.sh"] diff --git a/.devops/full.Dockerfile b/.devops/full.Dockerfile index cef1297d3..432fb5dad 100644 --- a/.devops/full.Dockerfile +++ b/.devops/full.Dockerfile @@ -3,7 +3,7 @@ ARG UBUNTU_VERSION=22.04 FROM ubuntu:$UBUNTU_VERSION as build RUN apt-get update && \ - apt-get install -y build-essential python3 python3-pip git + apt-get install -y build-essential python3 python3-pip git libcurl4-openssl-dev COPY requirements.txt requirements.txt COPY requirements requirements @@ -15,6 +15,9 @@ WORKDIR /app COPY . . +ENV LLAMA_CURL=1 + + RUN make ENV LC_ALL=C.utf8 diff --git a/.devops/server-cuda.Dockerfile b/.devops/server-cuda.Dockerfile index 5683a3646..59a52ba21 100644 --- a/.devops/server-cuda.Dockerfile +++ b/.devops/server-cuda.Dockerfile @@ -12,7 +12,7 @@ FROM ${BASE_CUDA_DEV_CONTAINER} as build ARG CUDA_DOCKER_ARCH=all RUN apt-get update && \ - apt-get install -y build-essential git + apt-get install -y build-essential git libcurl4-openssl-dev WORKDIR /app @@ -22,11 +22,16 @@ COPY . . ENV CUDA_DOCKER_ARCH=${CUDA_DOCKER_ARCH} # Enable CUDA ENV LLAMA_CUDA=1 +# Enable cURL +ENV LLAMA_CURL=1 RUN make FROM ${BASE_CUDA_RUN_CONTAINER} as runtime +RUN apt-get update && \ + apt-get install -y libcurl4-openssl-dev + COPY --from=build /app/server /server ENTRYPOINT [ "/server" ] diff --git a/.devops/server-intel.Dockerfile b/.devops/server-intel.Dockerfile index 312f2df80..304487335 100644 --- a/.devops/server-intel.Dockerfile +++ b/.devops/server-intel.Dockerfile @@ -4,7 +4,7 @@ FROM intel/oneapi-basekit:$ONEAPI_VERSION as build ARG LLAMA_SYCL_F16=OFF RUN apt-get update && \ - apt-get install -y git + apt-get install -y git libcurl4-openssl-dev WORKDIR /app @@ -16,11 +16,14 @@ RUN mkdir build && \ echo "LLAMA_SYCL_F16 is set" && \ export OPT_SYCL_F16="-DLLAMA_SYCL_F16=ON"; \ fi && \ - cmake .. -DLLAMA_SYCL=ON -DCMAKE_C_COMPILER=icx -DCMAKE_CXX_COMPILER=icpx ${OPT_SYCL_F16} && \ + cmake .. -DLLAMA_SYCL=ON -DCMAKE_C_COMPILER=icx -DCMAKE_CXX_COMPILER=icpx -DLLAMA_CURL=ON ${OPT_SYCL_F16} && \ cmake --build . --config Release --target server FROM intel/oneapi-basekit:$ONEAPI_VERSION as runtime +RUN apt-get update && \ + apt-get install -y libcurl4-openssl-dev + COPY --from=build /app/build/bin/server /server ENV LC_ALL=C.utf8 diff --git a/.devops/server-rocm.Dockerfile b/.devops/server-rocm.Dockerfile index e9a31647c..c02a31dd8 100644 --- a/.devops/server-rocm.Dockerfile +++ b/.devops/server-rocm.Dockerfile @@ -40,6 +40,11 @@ ENV LLAMA_HIPBLAS=1 ENV CC=/opt/rocm/llvm/bin/clang ENV CXX=/opt/rocm/llvm/bin/clang++ +# Enable cURL +ENV LLAMA_CURL=1 +RUN apt-get update && \ + apt-get install -y libcurl4-openssl-dev + RUN make ENTRYPOINT [ "/app/server" ] diff --git a/.devops/server-vulkan.Dockerfile b/.devops/server-vulkan.Dockerfile index e0add6fc3..7e5a5283b 100644 --- a/.devops/server-vulkan.Dockerfile +++ b/.devops/server-vulkan.Dockerfile @@ -11,12 +11,16 @@ RUN wget -qO - https://packages.lunarg.com/lunarg-signing-key-pub.asc | apt-key apt update -y && \ apt-get install -y vulkan-sdk +# Install cURL +RUN apt-get update && \ + apt-get install -y libcurl4-openssl-dev + # Build it WORKDIR /app COPY . . RUN mkdir build && \ cd build && \ - cmake .. -DLLAMA_VULKAN=1 && \ + cmake .. -DLLAMA_VULKAN=1 -DLLAMA_CURL=1 && \ cmake --build . --config Release --target server # Clean up