Skip to content

Commit

Permalink
add 'no-cache-dir' to all pip installs (opea-project#777)
Browse files Browse the repository at this point in the history
* add 'no-cache-dir' to all pip installs

Signed-off-by: Abolfazl Shahbazi <[email protected]>

* Fix a malformed line break

Signed-off-by: Abolfazl Shahbazi <[email protected]>

---------

Signed-off-by: Abolfazl Shahbazi <[email protected]>
  • Loading branch information
ashahba authored Oct 10, 2024
1 parent f3746dc commit 4f5010c
Show file tree
Hide file tree
Showing 16 changed files with 30 additions and 33 deletions.
4 changes: 2 additions & 2 deletions comps/asr/whisper/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -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 ; \
Expand All @@ -25,4 +25,4 @@ ENV PYTHONPATH=$PYTHONPATH:/home/user

WORKDIR /home/user/comps/asr/whisper

ENTRYPOINT ["python", "asr.py"]
ENTRYPOINT ["python", "asr.py"]
3 changes: 1 addition & 2 deletions comps/asr/whisper/dependency/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -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/
Expand All @@ -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 ; \
Expand Down
4 changes: 2 additions & 2 deletions comps/dataprep/vdms/langchain/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -36,4 +36,4 @@ USER user

WORKDIR /home/user/comps/dataprep/vdms/langchain

ENTRYPOINT ["python", "prepare_doc_vdms.py"]
ENTRYPOINT ["python", "prepare_doc_vdms.py"]
5 changes: 2 additions & 3 deletions comps/dataprep/vdms/multimodal_langchain/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@

# Copyright (C) 2024 Intel Corporation
# SPDX-License-Identifier: Apache-2.0

Expand All @@ -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
Expand All @@ -37,4 +36,4 @@ USER user

WORKDIR /home/user/comps/dataprep/vdms/multimodal_langchain

ENTRYPOINT ["python", "ingest_videos.py"]
ENTRYPOINT ["python", "ingest_videos.py"]
2 changes: 1 addition & 1 deletion comps/embeddings/multimodal_clip/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions comps/image2video/dependency/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -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"]
ENTRYPOINT ["python", "svd_server.py"]
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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"]
4 changes: 2 additions & 2 deletions comps/lvms/llama-vision/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -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"]
ENTRYPOINT ["python", "lvm.py"]
4 changes: 2 additions & 2 deletions comps/lvms/llama-vision/Dockerfile_guard
Original file line number Diff line number Diff line change
Expand Up @@ -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"]
ENTRYPOINT ["python", "lvm_guard.py"]
6 changes: 3 additions & 3 deletions comps/lvms/llama-vision/Dockerfile_tp
Original file line number Diff line number Diff line change
Expand Up @@ -19,13 +19,13 @@ RUN git lfs install

COPY comps /home/user/comps

RUN pip install git+https://github.com/HabanaAI/[email protected]
RUN pip install git+https://github.com/huggingface/[email protected]
RUN pip install --no-cache-dir git+https://github.com/HabanaAI/[email protected]
RUN pip install --no-cache-dir git+https://github.com/huggingface/[email protected]

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

Expand Down
2 changes: 1 addition & 1 deletion comps/retrievers/multimodal/redis/langchain/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
11 changes: 5 additions & 6 deletions comps/retrievers/vdms/langchain/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@

# Copyright (C) 2024 Intel Corporation
# SPDX-License-Identifier: Apache-2.0

Expand All @@ -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

Expand Down
5 changes: 3 additions & 2 deletions comps/text2image/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -20,4 +21,4 @@ WORKDIR /home/comps/text2image

RUN echo python text2image.py --bf16 >> run.sh

CMD bash run.sh
CMD bash run.sh
2 changes: 1 addition & 1 deletion tests/agent/Dockerfile.hpu
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion tests/embeddings/test_embeddings_tei_langchain.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion tests/llms/test_llms_text-generation_tgi.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 4f5010c

Please sign in to comment.