From 25174c0eb5e7164b89788b8fe6684ef3f215806d Mon Sep 17 00:00:00 2001 From: Abolfazl Shahbazi Date: Tue, 27 Aug 2024 16:30:42 -0700 Subject: [PATCH 1/2] Remove 'vim' from all Dockerfiles (#557) * Remove 'vim' from all Dockerfiles Signed-off-by: Abolfazl Shahbazi --- comps/chathistory/mongo/docker/Dockerfile | 3 +-- comps/dataprep/milvus/docker/Dockerfile | 7 ++----- .../pgvector/langchain/docker/Dockerfile | 7 ++----- comps/dataprep/pinecone/docker/Dockerfile | 10 +++------- comps/dataprep/qdrant/docker/Dockerfile | 6 ++---- .../redis/langchain/docker/Dockerfile | 9 +++------ .../redis/langchain_ray/docker/Dockerfile | 5 +---- .../redis/llama_index/docker/Dockerfile | 5 +---- .../langchain-mosec/docker/Dockerfile | 5 +---- comps/embeddings/langchain/docker/Dockerfile | 5 +---- .../embeddings/llama_index/docker/Dockerfile | 3 --- .../guardrails/llama_guard/docker/Dockerfile | 3 +-- .../pii_detection/docker/Dockerfile | 3 +-- .../toxicity_detection/docker/Dockerfile | 3 +-- .../langchain/docker/Dockerfile | 3 +-- comps/llms/faq-generation/tgi/Dockerfile | 4 +--- comps/llms/summarization/tgi/Dockerfile | 4 +--- .../text-generation/native/docker/Dockerfile | 13 +++++------- comps/llms/text-generation/ollama/Dockerfile | 6 ++---- comps/llms/text-generation/tgi/Dockerfile | 4 +--- .../vllm-ray/docker/Dockerfile.microservice | 20 ++++--------------- .../vllm/docker/Dockerfile.microservice | 3 +-- comps/llms/utils/lm-eval/Dockerfile.cpu | 18 +++++++++++------ comps/prompt_registry/mongo/docker/Dockerfile | 5 ++--- comps/ragas/tgi/Dockerfile | 3 +-- comps/reranks/fastrag/docker/Dockerfile | 7 ++----- .../reranks/langchain-mosec/docker/Dockerfile | 5 +---- comps/reranks/tei/docker/Dockerfile | 5 +---- .../haystack/qdrant/docker/Dockerfile | 6 ++---- .../langchain/milvus/docker/Dockerfile | 5 +---- .../langchain/pgvector/docker/Dockerfile | 4 +--- .../langchain/pinecone/docker/Dockerfile | 6 ++---- .../langchain/redis/docker/Dockerfile | 4 +--- comps/retrievers/llamaindex/docker/Dockerfile | 4 +--- .../langchain/chroma/docker/Dockerfile | 9 ++++++--- 35 files changed, 69 insertions(+), 143 deletions(-) diff --git a/comps/chathistory/mongo/docker/Dockerfile b/comps/chathistory/mongo/docker/Dockerfile index 5209af835..81e0fde5e 100644 --- a/comps/chathistory/mongo/docker/Dockerfile +++ b/comps/chathistory/mongo/docker/Dockerfile @@ -7,9 +7,8 @@ ENV LANG=C.UTF-8 RUN apt-get update -y && apt-get install -y --no-install-recommends --fix-missing \ build-essential \ - libgl1-mesa-glx \ libjemalloc-dev \ - vim + libgl1-mesa-glx RUN useradd -m -s /bin/bash user && \ mkdir -p /home/user && \ diff --git a/comps/dataprep/milvus/docker/Dockerfile b/comps/dataprep/milvus/docker/Dockerfile index 7e2f2202b..7ce117641 100644 --- a/comps/dataprep/milvus/docker/Dockerfile +++ b/comps/dataprep/milvus/docker/Dockerfile @@ -1,4 +1,3 @@ - # Copyright (C) 2024 Intel Corporation # SPDX-License-Identifier: Apache-2.0 @@ -10,10 +9,9 @@ ARG ARCH="cpu" RUN apt-get update -y && apt-get install -y --no-install-recommends --fix-missing \ build-essential \ - libgl1-mesa-glx \ - libjemalloc-dev \ default-jre \ - vim + libgl1-mesa-glx \ + libjemalloc-dev RUN useradd -m -s /bin/bash user && \ mkdir -p /home/user && \ @@ -37,4 +35,3 @@ USER user WORKDIR /home/user/comps/dataprep/milvus ENTRYPOINT ["python", "prepare_doc_milvus.py"] - diff --git a/comps/dataprep/pgvector/langchain/docker/Dockerfile b/comps/dataprep/pgvector/langchain/docker/Dockerfile index 75e70c524..897d15564 100644 --- a/comps/dataprep/pgvector/langchain/docker/Dockerfile +++ b/comps/dataprep/pgvector/langchain/docker/Dockerfile @@ -1,4 +1,3 @@ - # Copyright (C) 2024 Intel Corporation # SPDX-License-Identifier: Apache-2.0 @@ -10,10 +9,9 @@ ARG ARCH="cpu" RUN apt-get update -y && apt-get install -y --no-install-recommends --fix-missing \ build-essential \ - libgl1-mesa-glx \ - libjemalloc-dev \ default-jre \ - vim + libgl1-mesa-glx \ + libjemalloc-dev RUN useradd -m -s /bin/bash user && \ mkdir -p /home/user && \ @@ -38,4 +36,3 @@ USER user WORKDIR /home/user/comps/dataprep/pgvector/langchain ENTRYPOINT ["python", "prepare_doc_pgvector.py"] - diff --git a/comps/dataprep/pinecone/docker/Dockerfile b/comps/dataprep/pinecone/docker/Dockerfile index d61ecf65f..4bb51956b 100644 --- a/comps/dataprep/pinecone/docker/Dockerfile +++ b/comps/dataprep/pinecone/docker/Dockerfile @@ -1,4 +1,3 @@ - # Copyright (C) 2024 Intel Corporation # SPDX-License-Identifier: Apache-2.0 @@ -10,12 +9,10 @@ ARG ARCH="cpu" RUN apt-get update -y && apt-get install -y --no-install-recommends --fix-missing \ build-essential \ - libgl1-mesa-glx \ - libjemalloc-dev \ default-jre \ - vim \ - libcairo2 - + libcairo2 \ + libgl1-mesa-glx \ + libjemalloc-dev RUN useradd -m -s /bin/bash user && \ mkdir -p /home/user && \ @@ -43,4 +40,3 @@ USER user WORKDIR /home/user/comps/dataprep/pinecone ENTRYPOINT ["python", "prepare_doc_pinecone.py"] - diff --git a/comps/dataprep/qdrant/docker/Dockerfile b/comps/dataprep/qdrant/docker/Dockerfile index ff9f6b253..f36b80bc9 100644 --- a/comps/dataprep/qdrant/docker/Dockerfile +++ b/comps/dataprep/qdrant/docker/Dockerfile @@ -1,4 +1,3 @@ - # Copyright (C) 2024 Intel Corporation # SPDX-License-Identifier: Apache-2.0 @@ -10,10 +9,9 @@ ARG ARCH="cpu" RUN apt-get update -y && apt-get install -y --no-install-recommends --fix-missing \ build-essential \ - libgl1-mesa-glx \ - libjemalloc-dev \ default-jre \ - vim + libgl1-mesa-glx \ + libjemalloc-dev RUN useradd -m -s /bin/bash user && \ mkdir -p /home/user && \ diff --git a/comps/dataprep/redis/langchain/docker/Dockerfile b/comps/dataprep/redis/langchain/docker/Dockerfile index bcd4f9917..61620b88f 100644 --- a/comps/dataprep/redis/langchain/docker/Dockerfile +++ b/comps/dataprep/redis/langchain/docker/Dockerfile @@ -1,4 +1,3 @@ - # Copyright (C) 2024 Intel Corporation # SPDX-License-Identifier: Apache-2.0 @@ -10,13 +9,12 @@ ARG ARCH="cpu" RUN apt-get update -y && apt-get install -y --no-install-recommends --fix-missing \ build-essential \ + default-jre \ libgl1-mesa-glx \ libjemalloc-dev \ - default-jre \ - vim \ + libreoffice \ poppler-utils \ - tesseract-ocr \ - libreoffice + tesseract-ocr RUN useradd -m -s /bin/bash user && \ mkdir -p /home/user && \ @@ -41,4 +39,3 @@ USER user WORKDIR /home/user/comps/dataprep/redis/langchain ENTRYPOINT ["python", "prepare_doc_redis.py"] - diff --git a/comps/dataprep/redis/langchain_ray/docker/Dockerfile b/comps/dataprep/redis/langchain_ray/docker/Dockerfile index f9f91521f..3f6b10b61 100644 --- a/comps/dataprep/redis/langchain_ray/docker/Dockerfile +++ b/comps/dataprep/redis/langchain_ray/docker/Dockerfile @@ -1,4 +1,3 @@ - # Copyright (C) 2024 Intel Corporation # SPDX-License-Identifier: Apache-2.0 @@ -10,10 +9,9 @@ ARG ARCH="cpu" RUN apt-get update -y && apt-get install -y --no-install-recommends --fix-missing \ build-essential \ + libcairo2 \ libgl1-mesa-glx \ libjemalloc-dev \ - vim \ - libcairo2 \ poppler-utils \ tesseract-ocr @@ -41,4 +39,3 @@ USER user WORKDIR /home/user/comps/dataprep/redis/langchain_ray ENTRYPOINT ["python", "prepare_doc_redis_on_ray.py"] - diff --git a/comps/dataprep/redis/llama_index/docker/Dockerfile b/comps/dataprep/redis/llama_index/docker/Dockerfile index 111bdbd0b..f34930e71 100644 --- a/comps/dataprep/redis/llama_index/docker/Dockerfile +++ b/comps/dataprep/redis/llama_index/docker/Dockerfile @@ -1,4 +1,3 @@ - # Copyright (C) 2024 Intel Corporation # SPDX-License-Identifier: Apache-2.0 @@ -10,10 +9,9 @@ ARG ARCH="cpu" RUN apt-get update -y && apt-get install -y --no-install-recommends --fix-missing \ build-essential \ + libcairo2 \ libgl1-mesa-glx \ libjemalloc-dev \ - vim \ - libcairo2 \ poppler-utils \ tesseract-ocr @@ -40,4 +38,3 @@ USER user WORKDIR /home/user/comps/dataprep/redis/llama_index ENTRYPOINT ["python", "prepare_doc_redis.py"] - diff --git a/comps/embeddings/langchain-mosec/docker/Dockerfile b/comps/embeddings/langchain-mosec/docker/Dockerfile index 2fa2e7036..4628216f1 100644 --- a/comps/embeddings/langchain-mosec/docker/Dockerfile +++ b/comps/embeddings/langchain-mosec/docker/Dockerfile @@ -1,4 +1,3 @@ - # Copyright (C) 2024 Intel Corporation # SPDX-License-Identifier: Apache-2.0 @@ -6,8 +5,7 @@ FROM langchain/langchain:latest RUN apt-get update -y && apt-get install -y --no-install-recommends --fix-missing \ libgl1-mesa-glx \ - libjemalloc-dev \ - vim + libjemalloc-dev RUN useradd -m -s /bin/bash user && \ mkdir -p /home/user && \ @@ -25,4 +23,3 @@ ENV PYTHONPATH=$PYTHONPATH:/home/user WORKDIR /home/user/comps/embeddings/langchain-mosec ENTRYPOINT ["python", "embedding_mosec.py"] - diff --git a/comps/embeddings/langchain/docker/Dockerfile b/comps/embeddings/langchain/docker/Dockerfile index 464bacf66..365c73811 100644 --- a/comps/embeddings/langchain/docker/Dockerfile +++ b/comps/embeddings/langchain/docker/Dockerfile @@ -1,4 +1,3 @@ - # Copyright (C) 2024 Intel Corporation # SPDX-License-Identifier: Apache-2.0 @@ -8,8 +7,7 @@ ARG ARCH="cpu" RUN apt-get update -y && apt-get install -y --no-install-recommends --fix-missing \ libgl1-mesa-glx \ - libjemalloc-dev \ - vim + libjemalloc-dev RUN useradd -m -s /bin/bash user && \ mkdir -p /home/user && \ @@ -28,4 +26,3 @@ ENV PYTHONPATH=$PYTHONPATH:/home/user WORKDIR /home/user/comps/embeddings/langchain ENTRYPOINT ["python", "embedding_tei.py"] - diff --git a/comps/embeddings/llama_index/docker/Dockerfile b/comps/embeddings/llama_index/docker/Dockerfile index 914293db8..8d17b0dfa 100644 --- a/comps/embeddings/llama_index/docker/Dockerfile +++ b/comps/embeddings/llama_index/docker/Dockerfile @@ -1,4 +1,3 @@ - # Copyright (C) 2024 Intel Corporation # SPDX-License-Identifier: Apache-2.0 @@ -7,7 +6,6 @@ FROM ubuntu:22.04 RUN apt-get update -y && apt-get install -y --no-install-recommends --fix-missing \ libgl1-mesa-glx \ libjemalloc-dev \ - vim \ python3 \ python3-pip @@ -27,4 +25,3 @@ ENV PYTHONPATH=$PYTHONPATH:/home/user WORKDIR /home/user/comps/embeddings/llama_index ENTRYPOINT ["python3", "embedding_tei.py"] - diff --git a/comps/guardrails/llama_guard/docker/Dockerfile b/comps/guardrails/llama_guard/docker/Dockerfile index aaec44a07..491a4171f 100644 --- a/comps/guardrails/llama_guard/docker/Dockerfile +++ b/comps/guardrails/llama_guard/docker/Dockerfile @@ -9,8 +9,7 @@ ARG ARCH="cpu" RUN apt-get update -y && apt-get install -y --no-install-recommends --fix-missing \ libgl1-mesa-glx \ - libjemalloc-dev \ - vim + libjemalloc-dev RUN useradd -m -s /bin/bash user && \ mkdir -p /home/user && \ diff --git a/comps/guardrails/pii_detection/docker/Dockerfile b/comps/guardrails/pii_detection/docker/Dockerfile index aac6d29b8..df276d299 100644 --- a/comps/guardrails/pii_detection/docker/Dockerfile +++ b/comps/guardrails/pii_detection/docker/Dockerfile @@ -10,8 +10,7 @@ ENV LANG=C.UTF-8 RUN apt-get update -y && apt-get install -y --no-install-recommends --fix-missing \ build-essential \ libgl1-mesa-glx \ - libjemalloc-dev \ - vim + libjemalloc-dev RUN useradd -m -s /bin/bash user && \ mkdir -p /home/user && \ diff --git a/comps/guardrails/toxicity_detection/docker/Dockerfile b/comps/guardrails/toxicity_detection/docker/Dockerfile index 18c372656..369b5e5af 100644 --- a/comps/guardrails/toxicity_detection/docker/Dockerfile +++ b/comps/guardrails/toxicity_detection/docker/Dockerfile @@ -9,8 +9,7 @@ ARG ARCH="cpu" RUN apt-get update -y && apt-get install -y --no-install-recommends --fix-missing \ libgl1-mesa-glx \ - libjemalloc-dev \ - vim + libjemalloc-dev RUN useradd -m -s /bin/bash user && \ mkdir -p /home/user && \ diff --git a/comps/knowledgegraphs/langchain/docker/Dockerfile b/comps/knowledgegraphs/langchain/docker/Dockerfile index dd96f0dbe..655b44d24 100755 --- a/comps/knowledgegraphs/langchain/docker/Dockerfile +++ b/comps/knowledgegraphs/langchain/docker/Dockerfile @@ -7,8 +7,7 @@ ARG ARCH="cpu" # Set this to "cpu" or "gpu" RUN apt-get update -y && apt-get install -y --no-install-recommends --fix-missing \ libgl1-mesa-glx \ - libjemalloc-dev \ - vim + libjemalloc-dev RUN useradd -m -s /bin/bash user && \ mkdir -p /home/user && \ diff --git a/comps/llms/faq-generation/tgi/Dockerfile b/comps/llms/faq-generation/tgi/Dockerfile index ff48db471..0d6bb9d61 100644 --- a/comps/llms/faq-generation/tgi/Dockerfile +++ b/comps/llms/faq-generation/tgi/Dockerfile @@ -1,4 +1,3 @@ - # Copyright (C) 2024 Intel Corporation # SPDX-License-Identifier: Apache-2.0 @@ -6,8 +5,7 @@ FROM langchain/langchain:latest RUN apt-get update -y && apt-get install -y --no-install-recommends --fix-missing \ libgl1-mesa-glx \ - libjemalloc-dev \ - vim + libjemalloc-dev RUN useradd -m -s /bin/bash user && \ mkdir -p /home/user && \ diff --git a/comps/llms/summarization/tgi/Dockerfile b/comps/llms/summarization/tgi/Dockerfile index c1e1fdcca..da449312b 100644 --- a/comps/llms/summarization/tgi/Dockerfile +++ b/comps/llms/summarization/tgi/Dockerfile @@ -1,4 +1,3 @@ - # Copyright (C) 2024 Intel Corporation # SPDX-License-Identifier: Apache-2.0 @@ -6,8 +5,7 @@ FROM langchain/langchain:latest RUN apt-get update -y && apt-get install -y --no-install-recommends --fix-missing \ libgl1-mesa-glx \ - libjemalloc-dev \ - vim + libjemalloc-dev RUN useradd -m -s /bin/bash user && \ mkdir -p /home/user && \ diff --git a/comps/llms/text-generation/native/docker/Dockerfile b/comps/llms/text-generation/native/docker/Dockerfile index 69b7a73f5..f7d32cdb9 100644 --- a/comps/llms/text-generation/native/docker/Dockerfile +++ b/comps/llms/text-generation/native/docker/Dockerfile @@ -1,5 +1,3 @@ - - # Copyright (C) 2024 Intel Corporation # SPDX-License-Identifier: Apache-2.0 @@ -11,13 +9,10 @@ ENV LANG=en_US.UTF-8 ARG REPO=https://github.com/huggingface/optimum-habana.git ARG REPO_VER=v1.12.1 -RUN apt-get update && \ - apt-get install git-lfs && \ - git-lfs install && \ - apt-get install -y --no-install-recommends --fix-missing \ +RUN apt-get update && apt-get install -y --no-install-recommends --fix-missing \ + git-lfs \ libgl1-mesa-glx \ - libjemalloc-dev \ - vim + libjemalloc-dev RUN useradd -m -s /bin/bash user && \ mkdir -p /home/user && \ @@ -25,6 +20,8 @@ RUN useradd -m -s /bin/bash user && \ USER user +RUN git lfs install + COPY comps /home/user/comps RUN pip install --upgrade-strategy eager optimum[habana] && \ diff --git a/comps/llms/text-generation/ollama/Dockerfile b/comps/llms/text-generation/ollama/Dockerfile index 876ca1eef..bf78ff394 100644 --- a/comps/llms/text-generation/ollama/Dockerfile +++ b/comps/llms/text-generation/ollama/Dockerfile @@ -1,14 +1,12 @@ - # Copyright (C) 2024 Intel Corporation # SPDX-License-Identifier: Apache-2.0 FROM langchain/langchain:latest RUN apt-get update -y && apt-get install -y --no-install-recommends --fix-missing \ + curl \ libgl1-mesa-glx \ - libjemalloc-dev \ - vim \ - curl + libjemalloc-dev RUN useradd -m -s /bin/bash user && \ mkdir -p /home/user && \ diff --git a/comps/llms/text-generation/tgi/Dockerfile b/comps/llms/text-generation/tgi/Dockerfile index 545af59df..6797f8603 100644 --- a/comps/llms/text-generation/tgi/Dockerfile +++ b/comps/llms/text-generation/tgi/Dockerfile @@ -1,4 +1,3 @@ - # Copyright (C) 2024 Intel Corporation # SPDX-License-Identifier: Apache-2.0 @@ -6,8 +5,7 @@ FROM langchain/langchain:latest RUN apt-get update -y && apt-get install -y --no-install-recommends --fix-missing \ libgl1-mesa-glx \ - libjemalloc-dev \ - vim + libjemalloc-dev RUN useradd -m -s /bin/bash user && \ mkdir -p /home/user && \ diff --git a/comps/llms/text-generation/vllm-ray/docker/Dockerfile.microservice b/comps/llms/text-generation/vllm-ray/docker/Dockerfile.microservice index 10d6500a1..516ad1a4b 100644 --- a/comps/llms/text-generation/vllm-ray/docker/Dockerfile.microservice +++ b/comps/llms/text-generation/vllm-ray/docker/Dockerfile.microservice @@ -1,23 +1,11 @@ -# Copyright (c) 2024 Intel Corporation -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. +# Copyright (C) 2024 Intel Corporation +# SPDX-License-Identifier: Apache-2.0 FROM langchain/langchain:latest RUN apt-get update -y && apt-get install -y --no-install-recommends --fix-missing \ libgl1-mesa-glx \ - libjemalloc-dev \ - vim + libjemalloc-dev RUN useradd -m -s /bin/bash user && \ mkdir -p /home/user && \ @@ -34,4 +22,4 @@ ENV PYTHONPATH=$PYTHONPATH:/home/user WORKDIR /home/user/comps/llms/text-generation/vllm-ray -ENTRYPOINT ["python", "llm.py"] \ No newline at end of file +ENTRYPOINT ["python", "llm.py"] diff --git a/comps/llms/text-generation/vllm/docker/Dockerfile.microservice b/comps/llms/text-generation/vllm/docker/Dockerfile.microservice index ccd977273..ebc1638e0 100644 --- a/comps/llms/text-generation/vllm/docker/Dockerfile.microservice +++ b/comps/llms/text-generation/vllm/docker/Dockerfile.microservice @@ -7,8 +7,7 @@ ARG ARCH="cpu" # Set this to "cpu" or "gpu" RUN apt-get update -y && apt-get install -y --no-install-recommends --fix-missing \ libgl1-mesa-glx \ - libjemalloc-dev \ - vim + libjemalloc-dev RUN useradd -m -s /bin/bash user && \ mkdir -p /home/user && \ diff --git a/comps/llms/utils/lm-eval/Dockerfile.cpu b/comps/llms/utils/lm-eval/Dockerfile.cpu index ceb98887d..5f419bfbf 100644 --- a/comps/llms/utils/lm-eval/Dockerfile.cpu +++ b/comps/llms/utils/lm-eval/Dockerfile.cpu @@ -1,24 +1,30 @@ +# Copyright (C) 2024 Intel Corporation +# SPDX-License-Identifier: Apache-2.0 + ARG UBUNTU_VER=22.04 FROM ubuntu:${UBUNTU_VER} as devel + +ENV LANG=C.UTF-8 + RUN useradd -m -s /bin/bash user && \ mkdir -p /home/user && \ chown -R user /home/user/ -ARG REPO_COMPS=https://github.com/opea-project/GenAIComps.git -ARG BRANCH=main -ENV LANG=C.UTF-8 RUN apt-get update && apt-get install -y --no-install-recommends --fix-missing \ aspell \ aspell-en \ build-essential \ + git \ python3 \ - python3-pip \ python3-dev \ python3-distutils \ - git \ - vim \ + python3-pip \ wget + USER user + +ARG REPO_COMPS=https://github.com/opea-project/GenAIComps.git +ARG BRANCH=main RUN git clone --single-branch --branch=${BRANCH} ${REPO_COMPS} /home/user/GenAIComps/ && \ cd /home/user/GenAIComps/ && python3 setup.py install && \ pip install --no-cache-dir -r /home/user/GenAIComps/comps/llms/utils/lm-eval/requirements.txt diff --git a/comps/prompt_registry/mongo/docker/Dockerfile b/comps/prompt_registry/mongo/docker/Dockerfile index db2e9c59d..a2845430c 100644 --- a/comps/prompt_registry/mongo/docker/Dockerfile +++ b/comps/prompt_registry/mongo/docker/Dockerfile @@ -8,8 +8,7 @@ ENV LANG=C.UTF-8 RUN apt-get update -y && apt-get install -y --no-install-recommends --fix-missing \ build-essential \ libgl1-mesa-glx \ - libjemalloc-dev \ - vim + libjemalloc-dev RUN useradd -m -s /bin/bash user && \ mkdir -p /home/user && \ @@ -28,4 +27,4 @@ ENV PYTHONPATH=$PYTHONPATH:/home/user WORKDIR /home/user/comps/prompt_registry/mongo -ENTRYPOINT ["python", "prompt.py"] \ No newline at end of file +ENTRYPOINT ["python", "prompt.py"] diff --git a/comps/ragas/tgi/Dockerfile b/comps/ragas/tgi/Dockerfile index 55d4229a0..f55d8de0e 100644 --- a/comps/ragas/tgi/Dockerfile +++ b/comps/ragas/tgi/Dockerfile @@ -5,8 +5,7 @@ FROM langchain/langchain:latest RUN apt-get update -y && apt-get install -y --no-install-recommends --fix-missing \ libgl1-mesa-glx \ - libjemalloc-dev \ - vim + libjemalloc-dev RUN useradd -m -s /bin/bash user && \ mkdir -p /home/user && \ diff --git a/comps/reranks/fastrag/docker/Dockerfile b/comps/reranks/fastrag/docker/Dockerfile index 8372e33b7..2bf8e02b5 100644 --- a/comps/reranks/fastrag/docker/Dockerfile +++ b/comps/reranks/fastrag/docker/Dockerfile @@ -1,4 +1,3 @@ - # Copyright (C) 2024 Intel Corporation # SPDX-License-Identifier: Apache-2.0 @@ -7,10 +6,9 @@ FROM python:3.10-slim ENV LANG=C.UTF-8 RUN apt-get update -y && apt-get install -y --no-install-recommends --fix-missing \ + git \ libgl1-mesa-glx \ - libjemalloc-dev \ - vim \ - git + libjemalloc-dev RUN useradd -m -s /bin/bash user && \ mkdir -p /home/user && \ @@ -33,4 +31,3 @@ ENV PYTHONPATH=$PYTHONPH:/home/user WORKDIR /home/user/comps/reranks/fastrag ENTRYPOINT ["python", "local_reranking.py"] - diff --git a/comps/reranks/langchain-mosec/docker/Dockerfile b/comps/reranks/langchain-mosec/docker/Dockerfile index 9a678dc4a..7f3714e60 100644 --- a/comps/reranks/langchain-mosec/docker/Dockerfile +++ b/comps/reranks/langchain-mosec/docker/Dockerfile @@ -1,4 +1,3 @@ - # Copyright (C) 2024 Intel Corporation # SPDX-License-Identifier: Apache-2.0 @@ -6,8 +5,7 @@ FROM langchain/langchain:latest RUN apt-get update -y && apt-get install -y --no-install-recommends --fix-missing \ libgl1-mesa-glx \ - libjemalloc-dev \ - vim + libjemalloc-dev RUN useradd -m -s /bin/bash user && \ mkdir -p /home/user && \ @@ -25,4 +23,3 @@ ENV PYTHONPATH=$PYTHONPATH:/home/user WORKDIR /home/user/comps/reranks/langchain-mosec ENTRYPOINT ["python", "reranking_mosec_xeon.py"] - diff --git a/comps/reranks/tei/docker/Dockerfile b/comps/reranks/tei/docker/Dockerfile index 851fbfd58..2a8e7959f 100644 --- a/comps/reranks/tei/docker/Dockerfile +++ b/comps/reranks/tei/docker/Dockerfile @@ -1,4 +1,3 @@ - # Copyright (C) 2024 Intel Corporation # SPDX-License-Identifier: Apache-2.0 @@ -10,8 +9,7 @@ ARG ARCH="cpu" RUN apt-get update -y && apt-get install -y --no-install-recommends --fix-missing \ libgl1-mesa-glx \ - libjemalloc-dev \ - vim + libjemalloc-dev RUN useradd -m -s /bin/bash user && \ mkdir -p /home/user && \ @@ -30,4 +28,3 @@ ENV PYTHONPATH=$PYTHONPATH:/home/user WORKDIR /home/user/comps/reranks/tei ENTRYPOINT ["python", "reranking_tei.py"] - diff --git a/comps/retrievers/haystack/qdrant/docker/Dockerfile b/comps/retrievers/haystack/qdrant/docker/Dockerfile index e9916c8db..eaeba479a 100644 --- a/comps/retrievers/haystack/qdrant/docker/Dockerfile +++ b/comps/retrievers/haystack/qdrant/docker/Dockerfile @@ -1,4 +1,3 @@ - # Copyright (C) 2024 Intel Corporation # SPDX-License-Identifier: Apache-2.0 @@ -6,8 +5,7 @@ FROM python:3.11-slim RUN apt-get update -y && apt-get install -y --no-install-recommends --fix-missing \ libgl1-mesa-glx \ - libjemalloc-dev \ - vim + libjemalloc-dev RUN useradd -m -s /bin/bash user && \ mkdir -p /home/user && \ @@ -24,4 +22,4 @@ ENV PYTHONPATH=$PYTHONPATH:/home/user WORKDIR /home/user/comps/retrievers/haystack/qdrant -ENTRYPOINT ["python", "retriever_qdrant.py"] \ No newline at end of file +ENTRYPOINT ["python", "retriever_qdrant.py"] diff --git a/comps/retrievers/langchain/milvus/docker/Dockerfile b/comps/retrievers/langchain/milvus/docker/Dockerfile index 99c977e6f..233a0ec13 100644 --- a/comps/retrievers/langchain/milvus/docker/Dockerfile +++ b/comps/retrievers/langchain/milvus/docker/Dockerfile @@ -1,4 +1,3 @@ - # Copyright (C) 2024 Intel Corporation # SPDX-License-Identifier: Apache-2.0 @@ -11,8 +10,7 @@ ARG ARCH="cpu" RUN apt-get update -y && apt-get install -y --no-install-recommends --fix-missing \ build-essential \ libgl1-mesa-glx \ - libjemalloc-dev \ - vim + libjemalloc-dev RUN useradd -m -s /bin/bash user && \ mkdir -p /home/user && \ @@ -31,4 +29,3 @@ ENV PYTHONPATH=$PYTHONPATH:/home/user WORKDIR /home/user/comps/retrievers/langchain/milvus ENTRYPOINT ["python", "retriever_milvus.py"] - diff --git a/comps/retrievers/langchain/pgvector/docker/Dockerfile b/comps/retrievers/langchain/pgvector/docker/Dockerfile index 0b935d7a6..84122d629 100644 --- a/comps/retrievers/langchain/pgvector/docker/Dockerfile +++ b/comps/retrievers/langchain/pgvector/docker/Dockerfile @@ -1,4 +1,3 @@ - # Copyright (C) 2024 Intel Corporation # SPDX-License-Identifier: Apache-2.0 @@ -6,8 +5,7 @@ FROM langchain/langchain:latest RUN apt-get update -y && apt-get install -y --no-install-recommends --fix-missing \ libgl1-mesa-glx \ - libjemalloc-dev \ - vim + libjemalloc-dev RUN useradd -m -s /bin/bash user && \ mkdir -p /home/user && \ diff --git a/comps/retrievers/langchain/pinecone/docker/Dockerfile b/comps/retrievers/langchain/pinecone/docker/Dockerfile index dbb6d57c2..6d36c0f55 100644 --- a/comps/retrievers/langchain/pinecone/docker/Dockerfile +++ b/comps/retrievers/langchain/pinecone/docker/Dockerfile @@ -1,4 +1,3 @@ - # Copyright (C) 2024 Intel Corporation # SPDX-License-Identifier: Apache-2.0 @@ -8,8 +7,7 @@ ARG ARCH="cpu" RUN apt-get update -y && apt-get install -y --no-install-recommends --fix-missing \ libgl1-mesa-glx \ - libjemalloc-dev \ - vim + libjemalloc-dev RUN useradd -m -s /bin/bash user && \ mkdir -p /home/user && \ @@ -28,4 +26,4 @@ ENV PYTHONPATH=$PYTHONPATH:/home/user WORKDIR /home/user/comps/retrievers/langchain/pinecone -ENTRYPOINT ["python", "retriever_pinecone.py"] \ No newline at end of file +ENTRYPOINT ["python", "retriever_pinecone.py"] diff --git a/comps/retrievers/langchain/redis/docker/Dockerfile b/comps/retrievers/langchain/redis/docker/Dockerfile index e3d519910..1993e5fd9 100644 --- a/comps/retrievers/langchain/redis/docker/Dockerfile +++ b/comps/retrievers/langchain/redis/docker/Dockerfile @@ -1,4 +1,3 @@ - # Copyright (C) 2024 Intel Corporation # SPDX-License-Identifier: Apache-2.0 @@ -8,8 +7,7 @@ ARG ARCH="cpu" RUN apt-get update -y && apt-get install -y --no-install-recommends --fix-missing \ libgl1-mesa-glx \ - libjemalloc-dev \ - vim + libjemalloc-dev RUN useradd -m -s /bin/bash user && \ mkdir -p /home/user && \ diff --git a/comps/retrievers/llamaindex/docker/Dockerfile b/comps/retrievers/llamaindex/docker/Dockerfile index 7d9cd64be..fec155b05 100644 --- a/comps/retrievers/llamaindex/docker/Dockerfile +++ b/comps/retrievers/llamaindex/docker/Dockerfile @@ -1,4 +1,3 @@ - # Copyright (C) 2024 Intel Corporation # SPDX-License-Identifier: Apache-2.0 @@ -6,8 +5,7 @@ FROM ubuntu:22.04 RUN apt-get update -y && apt-get install -y --no-install-recommends --fix-missing \ libgl1-mesa-glx \ - libjemalloc-dev \ - vim + libjemalloc-dev RUN useradd -m -s /bin/bash user && \ mkdir -p /home/user && \ diff --git a/comps/web_retrievers/langchain/chroma/docker/Dockerfile b/comps/web_retrievers/langchain/chroma/docker/Dockerfile index c391fefe2..a5a65bbd5 100644 --- a/comps/web_retrievers/langchain/chroma/docker/Dockerfile +++ b/comps/web_retrievers/langchain/chroma/docker/Dockerfile @@ -2,16 +2,19 @@ # SPDX-License-Identifier: Apache-2.0 FROM langchain/langchain:latest + +ARG ARCH="cpu" # Set this to "cpu" or "gpu" + RUN useradd -m -s /bin/bash user && \ mkdir -p /home/user && \ chown -R user /home/user/ -ARG ARCH="cpu" # Set this to "cpu" or "gpu" RUN apt-get update -y && apt-get install -y --no-install-recommends --fix-missing \ libgl1-mesa-glx \ - libjemalloc-dev \ - vim + libjemalloc-dev + USER user + COPY comps /home/user/comps RUN pip install --no-cache-dir --upgrade pip && \ From b6c0785e15ff775738cefdc797860c4b33103e94 Mon Sep 17 00:00:00 2001 From: Sihan Chen <39623753+Spycsh@users.noreply.github.com> Date: Wed, 28 Aug 2024 13:24:50 +0800 Subject: [PATCH 2/2] fix mismatched response format w/wo streaming guardrails (#568) * fix mismatched response format w/wo streaming guardrails * fix & debug * fix & rm debug * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --------- Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> --- comps/cores/mega/orchestrator.py | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/comps/cores/mega/orchestrator.py b/comps/cores/mega/orchestrator.py index 616af41c8..09444d02c 100644 --- a/comps/cores/mega/orchestrator.py +++ b/comps/cores/mega/orchestrator.py @@ -72,6 +72,18 @@ async def schedule(self, initial_inputs: Dict, llm_parameters: LLMParams = LLMPa downstreams.remove(downstream) except re.error as e: print("Pattern invalid! Operation cancelled.") + if len(downstreams) == 0 and llm_parameters.streaming: + # turn the response to a StreamingResponse + # to make the response uniform to UI + def fake_stream(text): + yield "data: b'" + text + "'\n\n" + yield "data: [DONE]\n\n" + + self.dump_outputs( + node, + StreamingResponse(fake_stream(response["text"]), media_type="text/event-stream"), + result_dict, + ) for d_node in downstreams: if all(i in result_dict for i in runtime_graph.predecessors(d_node)):