From d60ca49d2f2a9b8673346e8199959ddb8e5a438d Mon Sep 17 00:00:00 2001 From: Aaron Pham <29749331+aarnphm@users.noreply.github.com> Date: Fri, 17 Nov 2023 01:15:56 -0500 Subject: [PATCH] perf: potentially reduce image size (#675) * perf: potentially reduce image size Signed-off-by: Aaron <29749331+aarnphm@users.noreply.github.com> * perf: use base python packages only Signed-off-by: Aaron <29749331+aarnphm@users.noreply.github.com> * fix: typo Signed-off-by: Aaron <29749331+aarnphm@users.noreply.github.com> * perf: Shave off 2GB Signed-off-by: Aaron <29749331+aarnphm@users.noreply.github.com> --------- Signed-off-by: Aaron <29749331+aarnphm@users.noreply.github.com> --- changelog.d/675.feature.md | 1 + .../src/openllm/bundle/oci/Dockerfile | 77 ++----------------- 2 files changed, 6 insertions(+), 72 deletions(-) create mode 100644 changelog.d/675.feature.md diff --git a/changelog.d/675.feature.md b/changelog.d/675.feature.md new file mode 100644 index 00000000..f9d24773 --- /dev/null +++ b/changelog.d/675.feature.md @@ -0,0 +1 @@ +OpenLLM image sizes now has been compressed and reduced to around 6.75 GB uncompressed. diff --git a/openllm-python/src/openllm/bundle/oci/Dockerfile b/openllm-python/src/openllm/bundle/oci/Dockerfile index fc2be86e..bb586d8f 100644 --- a/openllm-python/src/openllm/bundle/oci/Dockerfile +++ b/openllm-python/src/openllm/bundle/oci/Dockerfile @@ -1,13 +1,6 @@ # syntax=docker/dockerfile-upstream:master # Adapted from: https://github.com/pytorch/pytorch/blob/master/Dockerfile -FROM debian:bullseye-slim as pytorch-install - -ARG PYTORCH_VERSION=2.0.1 -ARG PYTHON_VERSION=3.9 -ARG CUDA_VERSION=11.8 -ARG MAMBA_VERSION=23.1.0-1 -ARG CUDA_CHANNEL=nvidia -ARG INSTALL_CHANNEL=pytorch +FROM python:3.9-slim-bullseye as base-container # Automatically set by buildx ARG TARGETPLATFORM @@ -21,84 +14,24 @@ RUN apt-get update && DEBIAN_FRONTEND=noninteractive apt-get install -y --no-ins ca-certificates \ ccache \ curl \ + libssl-dev ca-certificates make \ git && \ rm -rf /var/lib/apt/lists/* -# Install conda -# translating Docker's TARGETPLATFORM into mamba arches -RUN <