From 1c4c4d6aed627bf71b54629ec359fcf2345a9eaf Mon Sep 17 00:00:00 2001 From: Nicolas Patry Date: Thu, 6 Jun 2024 13:51:40 +0200 Subject: [PATCH] Micro optimization. --- Dockerfile | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/Dockerfile b/Dockerfile index 0cffda4c..b029f0ff 100644 --- a/Dockerfile +++ b/Dockerfile @@ -225,6 +225,14 @@ RUN cd server && \ pip install -r requirements_cuda.txt && \ pip install ".[bnb, accelerate, quantize, peft, outlines]" --no-cache-dir +# Deps before the binaries +# The binaries change on every build given we burn the SHA into them +# The deps change less often. +RUN apt-get update && DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends \ + build-essential \ + g++ \ + && rm -rf /var/lib/apt/lists/* + # Install benchmarker COPY --from=builder /usr/src/target/release-opt/text-generation-benchmark /usr/local/bin/text-generation-benchmark # Install router @@ -232,10 +240,6 @@ COPY --from=builder /usr/src/target/release-opt/text-generation-router /usr/loca # Install launcher COPY --from=builder /usr/src/target/release-opt/text-generation-launcher /usr/local/bin/text-generation-launcher -RUN apt-get update && DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends \ - build-essential \ - g++ \ - && rm -rf /var/lib/apt/lists/* # AWS Sagemaker compatible image FROM base as sagemaker