From 4f5010cfbbe10b1ec53e468a1dbe5ee311a9d3ce Mon Sep 17 00:00:00 2001 From: Abolfazl Shahbazi Date: Wed, 9 Oct 2024 20:09:47 -0700 Subject: [PATCH] add 'no-cache-dir' to all pip installs (#777) * add 'no-cache-dir' to all pip installs Signed-off-by: Abolfazl Shahbazi * Fix a malformed line break Signed-off-by: Abolfazl Shahbazi --------- Signed-off-by: Abolfazl Shahbazi --- comps/asr/whisper/Dockerfile | 4 ++-- comps/asr/whisper/dependency/Dockerfile | 3 +-- comps/dataprep/vdms/langchain/Dockerfile | 4 ++-- comps/dataprep/vdms/multimodal_langchain/Dockerfile | 5 ++--- comps/embeddings/multimodal_clip/Dockerfile | 2 +- comps/image2video/dependency/Dockerfile | 4 ++-- .../vllm/langchain/dependency/Dockerfile.intel_hpu | 3 +-- comps/lvms/llama-vision/Dockerfile | 4 ++-- comps/lvms/llama-vision/Dockerfile_guard | 4 ++-- comps/lvms/llama-vision/Dockerfile_tp | 6 +++--- .../retrievers/multimodal/redis/langchain/Dockerfile | 2 +- comps/retrievers/vdms/langchain/Dockerfile | 11 +++++------ comps/text2image/Dockerfile | 5 +++-- tests/agent/Dockerfile.hpu | 2 +- tests/embeddings/test_embeddings_tei_langchain.sh | 2 +- tests/llms/test_llms_text-generation_tgi.sh | 2 +- 16 files changed, 30 insertions(+), 33 deletions(-) diff --git a/comps/asr/whisper/Dockerfile b/comps/asr/whisper/Dockerfile index 6a1e4d4ec..05c02c880 100644 --- a/comps/asr/whisper/Dockerfile +++ b/comps/asr/whisper/Dockerfile @@ -15,7 +15,7 @@ COPY comps /home/user/comps RUN pip install --no-cache-dir --upgrade pip && \ if [ "${ARCH}" = "cpu" ]; then \ - pip install torch torchvision --index-url https://download.pytorch.org/whl/cpu ; \ + pip install --no-cache-dir torch torchvision --index-url https://download.pytorch.org/whl/cpu ; \ pip install --no-cache-dir --extra-index-url https://download.pytorch.org/whl/cpu -r /home/user/comps/asr/whisper/requirements.txt ; \ else \ pip install --no-cache-dir -r /home/user/comps/asr/whisper/requirements.txt ; \ @@ -25,4 +25,4 @@ ENV PYTHONPATH=$PYTHONPATH:/home/user WORKDIR /home/user/comps/asr/whisper -ENTRYPOINT ["python", "asr.py"] \ No newline at end of file +ENTRYPOINT ["python", "asr.py"] diff --git a/comps/asr/whisper/dependency/Dockerfile b/comps/asr/whisper/dependency/Dockerfile index 18285def0..e94713757 100644 --- a/comps/asr/whisper/dependency/Dockerfile +++ b/comps/asr/whisper/dependency/Dockerfile @@ -3,7 +3,6 @@ FROM python:3.11-slim - RUN useradd -m -s /bin/bash user && \ mkdir -p /home/user && \ chown -R user /home/user/ @@ -23,7 +22,7 @@ USER user RUN pip install --no-cache-dir --upgrade pip && \ pip install --no-cache-dir -r /home/user/comps/asr/whisper/requirements.txt && \ if [ "${ARCH}" = "cpu" ]; then \ - pip install torch torchvision --index-url https://download.pytorch.org/whl/cpu ; \ + pip install --no-cache-dir torch torchvision --index-url https://download.pytorch.org/whl/cpu ; \ pip install --no-cache-dir --extra-index-url https://download.pytorch.org/whl/cpu -r /home/user/comps/asr/whisper/requirements.txt ; \ else \ pip install --no-cache-dir -r /home/user/comps/asr/whisper/requirements.txt ; \ diff --git a/comps/dataprep/vdms/langchain/Dockerfile b/comps/dataprep/vdms/langchain/Dockerfile index df5b75544..67e5abde4 100644 --- a/comps/dataprep/vdms/langchain/Dockerfile +++ b/comps/dataprep/vdms/langchain/Dockerfile @@ -23,7 +23,7 @@ USER user COPY comps /home/user/comps RUN pip install --no-cache-dir --upgrade pip setuptools && \ - if [ ${ARCH} = "cpu" ]; then pip install torch torchvision --index-url https://download.pytorch.org/whl/cpu; fi && \ + if [ ${ARCH} = "cpu" ]; then pip install --no-cache-dir torch torchvision --index-url https://download.pytorch.org/whl/cpu; fi && \ pip install --no-cache-dir -r /home/user/comps/dataprep/vdms/langchain/requirements.txt ENV PYTHONPATH=/home/user @@ -36,4 +36,4 @@ USER user WORKDIR /home/user/comps/dataprep/vdms/langchain -ENTRYPOINT ["python", "prepare_doc_vdms.py"] \ No newline at end of file +ENTRYPOINT ["python", "prepare_doc_vdms.py"] diff --git a/comps/dataprep/vdms/multimodal_langchain/Dockerfile b/comps/dataprep/vdms/multimodal_langchain/Dockerfile index a0de62cba..f12d47c45 100644 --- a/comps/dataprep/vdms/multimodal_langchain/Dockerfile +++ b/comps/dataprep/vdms/multimodal_langchain/Dockerfile @@ -1,4 +1,3 @@ - # Copyright (C) 2024 Intel Corporation # SPDX-License-Identifier: Apache-2.0 @@ -24,7 +23,7 @@ USER user COPY comps /home/user/comps RUN pip install --no-cache-dir --upgrade pip setuptools && \ - if [ ${ARCH} = "cpu" ]; then pip install torch torchvision --index-url https://download.pytorch.org/whl/cpu; fi && \ + if [ ${ARCH} = "cpu" ]; then pip install --no-cache-dir torch torchvision --index-url https://download.pytorch.org/whl/cpu; fi && \ pip install --no-cache-dir -r /home/user/comps/dataprep/vdms/multimodal_langchain/requirements.txt ENV PYTHONPATH=/home/user @@ -37,4 +36,4 @@ USER user WORKDIR /home/user/comps/dataprep/vdms/multimodal_langchain -ENTRYPOINT ["python", "ingest_videos.py"] \ No newline at end of file +ENTRYPOINT ["python", "ingest_videos.py"] diff --git a/comps/embeddings/multimodal_clip/Dockerfile b/comps/embeddings/multimodal_clip/Dockerfile index 6f45a81b2..4824620e0 100644 --- a/comps/embeddings/multimodal_clip/Dockerfile +++ b/comps/embeddings/multimodal_clip/Dockerfile @@ -19,7 +19,7 @@ USER user COPY comps /home/user/comps RUN pip install --no-cache-dir --upgrade pip && \ - if [ ${ARCH} = "cpu" ]; then pip install torch torchvision --index-url https://download.pytorch.org/whl/cpu; fi && \ + if [ ${ARCH} = "cpu" ]; then pip install --no-cache-dir torch torchvision --index-url https://download.pytorch.org/whl/cpu; fi && \ pip install --no-cache-dir -r /home/user/comps/embeddings/multimodal_clip/requirements.txt ENV PYTHONPATH=$PYTHONPATH:/home/user diff --git a/comps/image2video/dependency/Dockerfile b/comps/image2video/dependency/Dockerfile index 1ae4dfb75..2d10cae4e 100644 --- a/comps/image2video/dependency/Dockerfile +++ b/comps/image2video/dependency/Dockerfile @@ -12,11 +12,11 @@ COPY comps /home/comps RUN apt-get update && apt-get install python3-opencv -y && \ pip install --no-cache-dir --upgrade pip && \ - if [ ${ARCH} = "cpu" ]; then pip install torch torchvision --index-url https://download.pytorch.org/whl/cpu; fi && \ + if [ ${ARCH} = "cpu" ]; then pip install --no-cache-dir torch torchvision --index-url https://download.pytorch.org/whl/cpu; fi && \ pip install --no-cache-dir -r /home/comps/image2video/dependency/requirements.txt ENV PYTHONPATH=$PYTHONPATH:/home WORKDIR /home/comps/image2video/dependency -ENTRYPOINT ["python", "svd_server.py"] \ No newline at end of file +ENTRYPOINT ["python", "svd_server.py"] diff --git a/comps/llms/text-generation/vllm/langchain/dependency/Dockerfile.intel_hpu b/comps/llms/text-generation/vllm/langchain/dependency/Dockerfile.intel_hpu index f82f7aa5a..b31a45667 100644 --- a/comps/llms/text-generation/vllm/langchain/dependency/Dockerfile.intel_hpu +++ b/comps/llms/text-generation/vllm/langchain/dependency/Dockerfile.intel_hpu @@ -10,7 +10,7 @@ RUN git clone https://github.com/HabanaAI/vllm-fork.git /workspace/vllm WORKDIR /workspace/vllm -RUN pip install -v -r requirements-hpu.txt +RUN pip install --no-cache-dir -v -r requirements-hpu.txt ENV no_proxy=localhost,127.0.0.1 ENV PT_HPU_ENABLE_LAZY_COLLECTIVES=true @@ -21,5 +21,4 @@ WORKDIR /workspace/ RUN ln -s /workspace/vllm/tests && ln -s /workspace/vllm/examples && ln -s /workspace/vllm/benchmarks -#ENTRYPOINT ["python3", "-m", "vllm.entrypoints.openai.api_server"] CMD ["/bin/bash"] diff --git a/comps/lvms/llama-vision/Dockerfile b/comps/lvms/llama-vision/Dockerfile index 90d7c357f..a43b0f9e9 100644 --- a/comps/lvms/llama-vision/Dockerfile +++ b/comps/lvms/llama-vision/Dockerfile @@ -23,10 +23,10 @@ COPY comps /home/user/comps RUN cd /home/user/comps/lvms/llama-vision/ && \ pip install --no-cache-dir -r requirements.txt && \ - pip install --upgrade Pillow + pip install --no-cache-dir --upgrade Pillow ENV PYTHONPATH=/root:/home/user WORKDIR /home/user/comps/lvms/llama-vision/ -ENTRYPOINT ["python", "lvm.py"] \ No newline at end of file +ENTRYPOINT ["python", "lvm.py"] diff --git a/comps/lvms/llama-vision/Dockerfile_guard b/comps/lvms/llama-vision/Dockerfile_guard index 107c74ff6..cfc087e1e 100644 --- a/comps/lvms/llama-vision/Dockerfile_guard +++ b/comps/lvms/llama-vision/Dockerfile_guard @@ -23,10 +23,10 @@ COPY comps /home/user/comps RUN cd /home/user/comps/lvms/llama-vision/ && \ pip install --no-cache-dir -r requirements.txt && \ - pip install --upgrade Pillow + pip install --no-cache-dir --upgrade Pillow ENV PYTHONPATH=/root:/home/user WORKDIR /home/user/comps/lvms/llama-vision/ -ENTRYPOINT ["python", "lvm_guard.py"] \ No newline at end of file +ENTRYPOINT ["python", "lvm_guard.py"] diff --git a/comps/lvms/llama-vision/Dockerfile_tp b/comps/lvms/llama-vision/Dockerfile_tp index 5605fae19..4987bc63b 100644 --- a/comps/lvms/llama-vision/Dockerfile_tp +++ b/comps/lvms/llama-vision/Dockerfile_tp @@ -19,13 +19,13 @@ RUN git lfs install COPY comps /home/user/comps -RUN pip install git+https://github.com/HabanaAI/DeepSpeed.git@1.17.1 -RUN pip install git+https://github.com/huggingface/optimum-habana@v1.13.2 +RUN pip install --no-cache-dir git+https://github.com/HabanaAI/DeepSpeed.git@1.17.1 +RUN pip install --no-cache-dir git+https://github.com/huggingface/optimum-habana@v1.13.2 RUN cd /home/user/comps/lvms/llama-vision/ \ pip install --no-cache-dir --upgrade pip && \ bash update && \ - pip install -r /home/user/comps/lvms/llama-vision/requirements_tp.txt + pip install --no-cache-dir -r /home/user/comps/lvms/llama-vision/requirements_tp.txt ENV PYTHONPATH=/root:/home/user diff --git a/comps/retrievers/multimodal/redis/langchain/Dockerfile b/comps/retrievers/multimodal/redis/langchain/Dockerfile index fa25b2efe..04b4fd3a7 100644 --- a/comps/retrievers/multimodal/redis/langchain/Dockerfile +++ b/comps/retrievers/multimodal/redis/langchain/Dockerfile @@ -19,7 +19,7 @@ COPY comps /home/user/comps USER user RUN pip install --no-cache-dir --upgrade pip && \ - if [ ${ARCH} = "cpu" ]; then pip install torch torchvision --index-url https://download.pytorch.org/whl/cpu; fi && \ + if [ ${ARCH} = "cpu" ]; then pip install --no-cache-dir torch torchvision --index-url https://download.pytorch.org/whl/cpu; fi && \ pip install --no-cache-dir -r /home/user/comps/retrievers/multimodal/redis/langchain/requirements.txt ENV PYTHONPATH=$PYTHONPATH:/home/user diff --git a/comps/retrievers/vdms/langchain/Dockerfile b/comps/retrievers/vdms/langchain/Dockerfile index baf1ea731..f84b520b2 100644 --- a/comps/retrievers/vdms/langchain/Dockerfile +++ b/comps/retrievers/vdms/langchain/Dockerfile @@ -1,4 +1,3 @@ - # Copyright (C) 2024 Intel Corporation # SPDX-License-Identifier: Apache-2.0 @@ -20,13 +19,13 @@ COPY comps /home/user/comps USER user RUN pip install --no-cache-dir --upgrade pip && \ - if [ ${ARCH} = "cpu" ]; then pip install torch torchvision --index-url https://download.pytorch.org/whl/cpu; fi && \ + if [ ${ARCH} = "cpu" ]; then pip install --no-cache-dir torch torchvision --index-url https://download.pytorch.org/whl/cpu; fi && \ pip install --no-cache-dir -r /home/user/comps/retrievers/vdms/langchain/requirements.txt -RUN pip install -U langchain -RUN pip install -U langchain-community - -RUN pip install --upgrade huggingface-hub +RUN pip install --no-cache-dir -U \ + huggingface-hub \ + langchain \ + langchain-community ENV PYTHONPATH=$PYTHONPATH:/home/user diff --git a/comps/text2image/Dockerfile b/comps/text2image/Dockerfile index 50dc6e3b7..156fac4d8 100644 --- a/comps/text2image/Dockerfile +++ b/comps/text2image/Dockerfile @@ -11,7 +11,8 @@ ARG ARCH="cpu" COPY comps /home/comps RUN pip install --no-cache-dir --upgrade pip && \ - if [ ${ARCH} = "cpu" ]; then pip install torch torchvision --index-url https://download.pytorch.org/whl/cpu; fi && \ + if [ ${ARCH} = "cpu" ]; then \ + pip install --no-cache-dir torch torchvision --index-url https://download.pytorch.org/whl/cpu; fi && \ pip install --no-cache-dir -r /home/comps/text2image/requirements.txt ENV PYTHONPATH=$PYTHONPATH:/home @@ -20,4 +21,4 @@ WORKDIR /home/comps/text2image RUN echo python text2image.py --bf16 >> run.sh -CMD bash run.sh \ No newline at end of file +CMD bash run.sh diff --git a/tests/agent/Dockerfile.hpu b/tests/agent/Dockerfile.hpu index e92208771..13e93afaf 100644 --- a/tests/agent/Dockerfile.hpu +++ b/tests/agent/Dockerfile.hpu @@ -4,7 +4,7 @@ COPY ./ /workspace/vllm WORKDIR /workspace/vllm -RUN pip install -v cmake>=3.26 ninja packaging setuptools-scm>=8 wheel jinja2 -r requirements-hpu.txt +RUN pip install --no-cache-dir -v cmake>=3.26 ninja packaging setuptools-scm>=8 wheel jinja2 -r requirements-hpu.txt ENV no_proxy=localhost,127.0.0.1 ENV PT_HPU_ENABLE_LAZY_COLLECTIVES=true diff --git a/tests/embeddings/test_embeddings_tei_langchain.sh b/tests/embeddings/test_embeddings_tei_langchain.sh index a7b9e1927..8c369a116 100644 --- a/tests/embeddings/test_embeddings_tei_langchain.sh +++ b/tests/embeddings/test_embeddings_tei_langchain.sh @@ -69,7 +69,7 @@ function main() { start_service validate_microservice - pip install openai + pip install -no-cache-dir openai validate_microservice_with_openai stop_docker diff --git a/tests/llms/test_llms_text-generation_tgi.sh b/tests/llms/test_llms_text-generation_tgi.sh index 383535efc..f2daea77f 100644 --- a/tests/llms/test_llms_text-generation_tgi.sh +++ b/tests/llms/test_llms_text-generation_tgi.sh @@ -80,7 +80,7 @@ function main() { stop_docker build_docker_images - pip install openai + pip install --no-cache-dir openai llm_models=( Intel/neural-chat-7b-v3-3