-
Notifications
You must be signed in to change notification settings - Fork 216
Expand file tree
/
Copy pathDockerfile.graph
More file actions
46 lines (34 loc) · 1.3 KB
/
Dockerfile.graph
File metadata and controls
46 lines (34 loc) · 1.3 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
# Copyright (C) 2024 Intel Corporation
# SPDX-License-Identifier: Apache-2.0
FROM ubuntu:22.04
WORKDIR /home/graph_extract
FROM python:3.11-slim
ENV LANG=C.UTF-8
ARG ARCH=cpu
RUN apt-get update -y && apt-get install vim -y && apt-get install -y --no-install-recommends --fix-missing \
build-essential
RUN useradd -m -s /bin/bash user && \
mkdir -p /home/user && \
chown -R user /home/user/
COPY comps /home/user/comps
ARG uvpip='uv pip install --system --no-cache-dir'
RUN pip install --no-cache-dir --upgrade pip setuptools uv && \
if [ ${ARCH} = "cpu" ]; then \
$uvpip torch --index-url https://download.pytorch.org/whl/cpu; \
$uvpip -r /home/user/comps/text2query/src/requirements-cpu.txt; \
else \
$uvpip -r /home/user/comps/text2query/src/requirements-gpu.txt; \
fi
ENV LLM_ID=${LLM_ID:-"Babelscape/rebel-large"}
ENV SPAN_LENGTH=${SPAN_LENGTH:-"1024"}
ENV OVERLAP=${OVERLAP:-"100"}
ENV MAX_LENGTH=${MAX_NEW_TOKENS:-"256"}
ENV HUGGINGFACEHUB_API_TOKEN=${HF_TOKEN}
ENV HF_TOKEN=${HF_TOKEN}
ENV LLM_MODEL_ID=${LLM_ID}
ENV TGI_PORT=8008
ENV PYTHONPATH="/home/user/":$PYTHONPATH
USER user
WORKDIR /home/user/comps/text2query/src/
RUN bash -c 'source /home/user/comps/text2query/src/integrations/graph/setup_service_env.sh'
ENTRYPOINT ["python", "opea_text2query_microservice.py"]