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

Optional container build instructions #457

Merged
merged 2 commits into from
Aug 12, 2024
Merged
Changes from 1 commit
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
Next Next commit
update installation
Signed-off-by: chensuyue <[email protected]>
chensuyue committed Aug 12, 2024
commit 47ebe28391b2021efbc7be2a0ad9fb0425983017
8 changes: 6 additions & 2 deletions comps/agent/langchain/docker/Dockerfile
Original file line number Diff line number Diff line change
@@ -4,6 +4,7 @@
FROM python:3.11-slim

ENV LANG=C.UTF-8
ARG ARCH=cpu

RUN apt-get update -y && apt-get install -y --no-install-recommends --fix-missing \
build-essential \
@@ -19,8 +20,11 @@ USER user
COPY comps /home/user/comps

RUN pip install --no-cache-dir --upgrade pip setuptools && \
if [ ${ARCH} = "cpu" ]; then pip install torch --index-url https://download.pytorch.org/whl/cpu; fi && \
pip install --no-cache-dir -r /home/user/comps/agent/langchain/requirements.txt
if [ ${ARCH} = "cpu" ]; then \
pip install --no-cache-dir --extra-index-url https://download.pytorch.org/whl/cpu -r /home/user/comps/agent/langchain/requirements.txt; \
else \
pip install --no-cache-dir -r /home/user/comps/agent/langchain/requirements.txt; \
fi

ENV PYTHONPATH=$PYTHONPATH:/home/user

7 changes: 6 additions & 1 deletion comps/asr/Dockerfile
Original file line number Diff line number Diff line change
@@ -9,11 +9,16 @@ RUN useradd -m -s /bin/bash user && \
USER user

ENV LANG=C.UTF-8
ARG ARCH=cpu

COPY comps /home/user/comps

RUN pip install --no-cache-dir --upgrade pip && \
pip install --no-cache-dir -r /home/user/comps/asr/requirements.txt
if [ "${ARCH}" = "cpu" ]; then \
pip install --no-cache-dir --extra-index-url https://download.pytorch.org/whl/cpu -r /home/user/comps/asr/requirements.txt ; \
else \
pip install --no-cache-dir -r /home/user/comps/asr/requirements.txt ; \
fi

ENV PYTHONPATH=$PYTHONPATH:/home/user

6 changes: 6 additions & 0 deletions comps/asr/whisper/Dockerfile
Original file line number Diff line number Diff line change
@@ -10,6 +10,7 @@ RUN useradd -m -s /bin/bash user && \

# Set environment variables
ENV LANG=en_US.UTF-8
ARG ARCH=cpu

# Install system dependencies
RUN apt-get update \
@@ -21,6 +22,11 @@ USER user

RUN pip install --no-cache-dir --upgrade pip && \
pip install --no-cache-dir -r /home/user/comps/asr/requirements.txt && \
if [ "${ARCH}" = "cpu" ]; then \
pip install --no-cache-dir --extra-index-url https://download.pytorch.org/whl/cpu -r /home/user/comps/asr/requirements.txt ; \
else \
pip install --no-cache-dir -r /home/user/comps/asr/requirements.txt ; \
fi
pip list

ENV PYTHONPATH=$PYTHONPATH:/home/user
11 changes: 8 additions & 3 deletions comps/asr/whisper/Dockerfile_hpu
Original file line number Diff line number Diff line change
@@ -9,8 +9,9 @@ RUN useradd -m -s /bin/bash user && \
chown -R user /home/user/

# Set environment variables
ENV LANG=en_US.UTF-8
ENV PYTHONPATH=/home/user:/usr/lib/habanalabs/:/optimum-habana
ENV LANG=en_US.UTF-8 \
PYTHONPATH=/home/user:/usr/lib/habanalabs/:/optimum-habana
ARG ARCH=cpu

# Install system dependencies
RUN apt-get update \
@@ -22,7 +23,11 @@ USER user

# Install requirements and optimum habana
RUN pip install --no-cache-dir --upgrade pip && \
pip install --no-cache-dir -r /home/user/comps/asr/requirements.txt && \
if [ "${ARCH}" = "cpu" ]; then \
pip install --no-cache-dir --extra-index-url https://download.pytorch.org/whl/cpu -r /home/user/comps/asr/requirements.txt ; \
else \
pip install --no-cache-dir -r /home/user/comps/asr/requirements.txt ; \
fi && \
pip install optimum[habana]

ENV PYTHONPATH=$PYTHONPATH:/home/user
7 changes: 6 additions & 1 deletion comps/tts/Dockerfile
Original file line number Diff line number Diff line change
@@ -7,11 +7,16 @@ RUN useradd -m -s /bin/bash user && \
chown -R user /home/user/
USER user
ENV LANG=C.UTF-8
ARG ARCH=cpu

COPY comps /home/user/comps

RUN pip install --no-cache-dir --upgrade pip && \
pip install --no-cache-dir -r /home/user/comps/tts/requirements.txt
if [ "${ARCH}" = "cpu" ]; then \
pip install --no-cache-dir --extra-index-url https://download.pytorch.org/whl/cpu -r /home/user/comps/tts/requirements.txt ; \
else \
pip install --no-cache-dir -r /home/user/comps/tts/requirements.txt ; \
fi

ENV PYTHONPATH=$PYTHONPATH:/home/user

7 changes: 6 additions & 1 deletion comps/tts/speecht5/Dockerfile
Original file line number Diff line number Diff line change
@@ -9,6 +9,7 @@ RUN useradd -m -s /bin/bash user && \
# Set environment variables
ENV LANG=en_US.UTF-8
ENV PYTHONPATH=/home/user
ARG ARCH=cpu

# Install system dependencies
RUN apt-get update \
@@ -20,7 +21,11 @@ COPY --chown=user:user comps /home/user/comps
USER user

RUN pip install --no-cache-dir --upgrade pip && \
pip install --no-cache-dir -r /home/user/comps/tts/requirements.txt
if [ "${ARCH}" = "cpu" ]; then \
pip install --no-cache-dir --extra-index-url https://download.pytorch.org/whl/cpu -r /home/user/comps/tts/requirements.txt ; \
else \
pip install --no-cache-dir -r /home/user/comps/tts/requirements.txt ; \
fi

ENV PYTHONPATH=$PYTHONPATH:/home/user

7 changes: 6 additions & 1 deletion comps/tts/speecht5/Dockerfile_hpu
Original file line number Diff line number Diff line change
@@ -11,6 +11,7 @@ RUN rm -rf /etc/ssh/ssh_host*
# Set environment variables
ENV LANG=en_US.UTF-8
ENV PYTHONPATH=/home/user:/usr/lib/habanalabs/:/optimum-habana
ARG ARCH=cpu

# Install system dependencies
RUN apt-get update \
@@ -23,7 +24,11 @@ USER user

# Install requirements and optimum habana
RUN pip install --no-cache-dir --upgrade pip && \
pip install --no-cache-dir -r /home/user/comps/tts/requirements.txt && \
if [ "${ARCH}" = "cpu" ]; then \
pip install --no-cache-dir --extra-index-url https://download.pytorch.org/whl/cpu -r /home/user/comps/tts/requirements.txt ; \
else \
pip install --no-cache-dir -r /home/user/comps/tts/requirements.txt ; \
fi && \
pip install optimum[habana]

ENV PYTHONPATH=$PYTHONPATH:/home/user