Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use GenAIComp base image to simplify Dockerfiles & reduce image sizes #1369

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 3 additions & 25 deletions AudioQnA/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,31 +1,9 @@


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

FROM python:3.11-slim

RUN apt-get update -y && apt-get install -y --no-install-recommends --fix-missing \
libgl1-mesa-glx \
libjemalloc-dev \
git

RUN useradd -m -s /bin/bash user && \
mkdir -p /home/user && \
chown -R user /home/user/

WORKDIR /home/user/
RUN git clone https://github.com/opea-project/GenAIComps.git
WORKDIR /home/user/GenAIComps
RUN pip install --no-cache-dir --upgrade pip setuptools && \
pip install --no-cache-dir -r /home/user/GenAIComps/requirements.txt

COPY ./audioqna.py /home/user/audioqna.py

ENV PYTHONPATH=$PYTHONPATH:/home/user/GenAIComps

USER user
ARG BASE_TAG=latest
FROM opea/comps-base:$BASE_TAG

WORKDIR /home/user
COPY ./audioqna.py $HOME/audioqna.py

ENTRYPOINT ["python", "audioqna.py"]
29 changes: 3 additions & 26 deletions AudioQnA/Dockerfile.multilang
Original file line number Diff line number Diff line change
@@ -1,32 +1,9 @@


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

FROM python:3.11-slim

RUN apt-get update -y && apt-get install -y --no-install-recommends --fix-missing \
libgl1-mesa-glx \
libjemalloc-dev \
git

RUN useradd -m -s /bin/bash user && \
mkdir -p /home/user && \
chown -R user /home/user/

WORKDIR /home/user/
RUN git clone https://github.com/opea-project/GenAIComps.git

WORKDIR /home/user/GenAIComps
RUN pip install --no-cache-dir --upgrade pip setuptools && \
pip install --no-cache-dir -r /home/user/GenAIComps/requirements.txt

COPY ./audioqna_multilang.py /home/user/audioqna_multilang.py

ENV PYTHONPATH=$PYTHONPATH:/home/user/GenAIComps

USER user
ARG BASE_TAG=latest
FROM opea/comps-base:$BASE_TAG

WORKDIR /home/user
COPY ./audioqna_multilang.py $HOME/audioqna_multilang.py

ENTRYPOINT ["python", "audioqna_multilang.py"]
30 changes: 3 additions & 27 deletions AvatarChatbot/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,33 +1,9 @@


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

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 \
git

RUN useradd -m -s /bin/bash user && \
mkdir -p /home/user && \
chown -R user /home/user/

WORKDIR /home/user/
RUN git clone https://github.com/opea-project/GenAIComps.git
WORKDIR /home/user/GenAIComps

RUN pip install --no-cache-dir --upgrade pip && \
pip install --no-cache-dir -r /home/user/GenAIComps/requirements.txt

COPY ./avatarchatbot.py /home/user/avatarchatbot.py

ENV PYTHONPATH=$PYTHONPATH:/home/user/GenAIComps

USER user
ARG BASE_TAG=latest
FROM opea/comps-base:$BASE_TAG

WORKDIR /home/user
COPY ./avatarchatbot.py $HOME/avatarchatbot.py

ENTRYPOINT ["python", "avatarchatbot.py"]
32 changes: 3 additions & 29 deletions ChatQnA/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,35 +1,9 @@


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

FROM python:3.11-slim

RUN apt-get update -y && apt-get install -y --no-install-recommends --fix-missing \
libgl1-mesa-glx \
libjemalloc-dev \
git

RUN useradd -m -s /bin/bash user && \
mkdir -p /home/user && \
chown -R user /home/user/

WORKDIR /home/user/
RUN git clone https://github.com/opea-project/GenAIComps.git

WORKDIR /home/user/GenAIComps
RUN pip install --no-cache-dir --upgrade pip setuptools && \
pip install --no-cache-dir -r /home/user/GenAIComps/requirements.txt && \
pip install --no-cache-dir langchain_core

COPY ./chatqna.py /home/user/chatqna.py

ENV PYTHONPATH=$PYTHONPATH:/home/user/GenAIComps

USER user

WORKDIR /home/user
ARG BASE_TAG=latest
FROM opea/comps-base:$BASE_TAG

RUN echo 'ulimit -S -n 999999' >> ~/.bashrc
COPY ./chatqna.py $HOME/chatqna.py

ENTRYPOINT ["python", "chatqna.py"]
32 changes: 3 additions & 29 deletions ChatQnA/Dockerfile.guardrails
Original file line number Diff line number Diff line change
@@ -1,35 +1,9 @@


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

FROM python:3.11-slim

RUN apt-get update -y && apt-get install -y --no-install-recommends --fix-missing \
libgl1-mesa-glx \
libjemalloc-dev \
git

RUN useradd -m -s /bin/bash user && \
mkdir -p /home/user && \
chown -R user /home/user/

WORKDIR /home/user/
RUN git clone https://github.com/opea-project/GenAIComps.git

WORKDIR /home/user/GenAIComps
RUN pip install --no-cache-dir --upgrade pip setuptools && \
pip install --no-cache-dir -r /home/user/GenAIComps/requirements.txt && \
pip install --no-cache-dir langchain_core

COPY ./chatqna.py /home/user/chatqna.py

ENV PYTHONPATH=$PYTHONPATH:/home/user/GenAIComps

USER user

WORKDIR /home/user
ARG BASE_TAG=latest
FROM opea/comps-base:$BASE_TAG

RUN echo 'ulimit -S -n 999999' >> ~/.bashrc
COPY ./chatqna.py $HOME/chatqna.py

ENTRYPOINT ["python", "chatqna.py", "--with-guardrails"]
32 changes: 3 additions & 29 deletions ChatQnA/Dockerfile.without_rerank
Original file line number Diff line number Diff line change
@@ -1,35 +1,9 @@


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

FROM python:3.11-slim

RUN apt-get update -y && apt-get install -y --no-install-recommends --fix-missing \
git \
libgl1-mesa-glx \
libjemalloc-dev

RUN useradd -m -s /bin/bash user && \
mkdir -p /home/user && \
chown -R user /home/user/

WORKDIR /home/user/
RUN git clone https://github.com/opea-project/GenAIComps.git

WORKDIR /home/user/GenAIComps
RUN pip install --no-cache-dir --upgrade pip setuptools && \
pip install --no-cache-dir -r /home/user/GenAIComps/requirements.txt && \
pip install --no-cache-dir langchain_core

COPY ./chatqna.py /home/user/chatqna.py

ENV PYTHONPATH=$PYTHONPATH:/home/user/GenAIComps

USER user

WORKDIR /home/user
ARG BASE_TAG=latest
FROM opea/comps-base:$BASE_TAG

RUN echo 'ulimit -S -n 999999' >> ~/.bashrc
COPY ./chatqna.py $HOME/chatqna.py

ENTRYPOINT ["python", "chatqna.py", "--without-rerank"]
29 changes: 3 additions & 26 deletions ChatQnA/Dockerfile.wrapper
Original file line number Diff line number Diff line change
@@ -1,32 +1,9 @@
# Copyright (C) 2024 Intel Corporation
# SPDX-License-Identifier: Apache-2.0

FROM python:3.11-slim
ARG BASE_TAG=latest
FROM opea/comps-base:$BASE_TAG

RUN apt-get update -y && apt-get install -y --no-install-recommends --fix-missing \
libgl1-mesa-glx \
libjemalloc-dev \
git

RUN useradd -m -s /bin/bash user && \
mkdir -p /home/user && \
chown -R user /home/user/

WORKDIR /home/user/
RUN git clone https://github.com/opea-project/GenAIComps.git

WORKDIR /home/user/GenAIComps
RUN pip install --no-cache-dir --upgrade pip && \
pip install --no-cache-dir -r /home/user/GenAIComps/requirements.txt

COPY ./chatqna_wrapper.py /home/user/chatqna.py

ENV PYTHONPATH=$PYTHONPATH:/home/user/GenAIComps

USER user

WORKDIR /home/user

RUN echo 'ulimit -S -n 999999' >> ~/.bashrc
COPY ./chatqna_wrapper.py $HOME/chatqna.py

ENTRYPOINT ["python", "chatqna.py"]
31 changes: 3 additions & 28 deletions CodeGen/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,34 +1,9 @@


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

FROM python:3.11-slim

ENV LANG=C.UTF-8

RUN apt-get update -y && apt-get install -y --no-install-recommends --fix-missing \
libgl1-mesa-glx \
libjemalloc-dev \
git

RUN useradd -m -s /bin/bash user && \
mkdir -p /home/user && \
chown -R user /home/user/

WORKDIR /home/user/
RUN git clone https://github.com/opea-project/GenAIComps.git

WORKDIR /home/user/GenAIComps
RUN pip install --no-cache-dir --upgrade pip setuptools && \
pip install --no-cache-dir -r /home/user/GenAIComps/requirements.txt

COPY ./codegen.py /home/user/codegen.py

ENV PYTHONPATH=$PYTHONPATH:/home/user/GenAIComps

USER user
ARG BASE_TAG=latest
FROM opea/comps-base:$BASE_TAG

WORKDIR /home/user
COPY ./codegen.py $HOME/codegen.py

ENTRYPOINT ["python", "codegen.py"]
29 changes: 3 additions & 26 deletions CodeTrans/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,32 +1,9 @@


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

FROM python:3.11-slim

RUN apt-get update -y && apt-get install -y --no-install-recommends --fix-missing \
libgl1-mesa-glx \
libjemalloc-dev \
git

RUN useradd -m -s /bin/bash user && \
mkdir -p /home/user && \
chown -R user /home/user/

WORKDIR /home/user/
RUN git clone https://github.com/opea-project/GenAIComps.git

WORKDIR /home/user/GenAIComps
RUN pip install --no-cache-dir --upgrade pip setuptools && \
pip install --no-cache-dir -r /home/user/GenAIComps/requirements.txt

COPY ./code_translation.py /home/user/code_translation.py

ENV PYTHONPATH=$PYTHONPATH:/home/user/GenAIComps

USER user
ARG BASE_TAG=latest
FROM opea/comps-base:$BASE_TAG

WORKDIR /home/user
COPY ./code_translation.py $HOME/code_translation.py

ENTRYPOINT ["python", "code_translation.py"]
27 changes: 3 additions & 24 deletions DocIndexRetriever/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,30 +1,9 @@
# Copyright (C) 2024 Intel Corporation
# SPDX-License-Identifier: Apache-2.0

FROM python:3.11-slim
ARG BASE_TAG=latest
FROM opea/comps-base:$BASE_TAG

RUN apt-get update -y && apt-get install -y --no-install-recommends --fix-missing \
libgl1-mesa-glx \
libjemalloc-dev \
git

RUN useradd -m -s /bin/bash user && \
mkdir -p /home/user && \
chown -R user /home/user/

WORKDIR /home/user/
RUN git clone https://github.com/opea-project/GenAIComps.git

WORKDIR /home/user/GenAIComps
RUN pip install --no-cache-dir --upgrade pip setuptools && \
pip install --no-cache-dir -r /home/user/GenAIComps/requirements.txt

COPY ./retrieval_tool.py /home/user/retrieval_tool.py

ENV PYTHONPATH=$PYTHONPATH:/home/user/GenAIComps

USER user

WORKDIR /home/user
COPY ./retrieval_tool.py $HOME/retrieval_tool.py

ENTRYPOINT ["python", "retrieval_tool.py"]
Loading
Loading