File tree Expand file tree Collapse file tree 3 files changed +49
-7
lines changed
.github/workflows/docker/compose
comps/llms/src/text-generation Expand file tree Collapse file tree 3 files changed +49
-7
lines changed Original file line number Diff line number Diff line change @@ -7,6 +7,10 @@ services:
77 build :
88 dockerfile : comps/llms/src/text-generation/Dockerfile
99 image : ${REGISTRY:-opea}/llm-textgen:${TAG:-latest}
10+ llm-textgen-openeuler :
11+ build :
12+ dockerfile : comps/llms/src/text-generation/Dockerfile.openEuler
13+ image : ${REGISTRY:-opea}/llm-textgen:${TAG:-latest}-openeuler
1014 llm-textgen-gaudi :
1115 build :
1216 dockerfile : comps/llms/src/text-generation/Dockerfile.intel_hpu
Original file line number Diff line number Diff line change 1+ # Copyright (C) 2025 Huawei Technologies Co., Ltd.
2+ # SPDX-License-Identifier: Apache-2.0
3+
4+ FROM openeuler/python:3.11.13-oe2403lts
5+
6+ RUN yum update -y && \
7+ yum install -y \
8+ shadow \
9+ jemalloc-devel && \
10+ yum clean all && \
11+ rm -rf /var/cache/yum
12+
13+ RUN useradd -m -s /bin/bash user && \
14+ mkdir -p /home/user && \
15+ chown -R user /home/user/
16+
17+ COPY comps/llms/src/text-generation/requirements.txt /home/user/comps/llms/src/text-generation/requirements.txt
18+
19+ ARG uvpip='uv pip install --system --no-cache-dir'
20+ RUN pip install --no-cache-dir --upgrade pip setuptools uv && \
21+ $uvpip -r /home/user/comps/llms/src/text-generation/requirements.txt
22+
23+ COPY comps /home/user/comps
24+ ENV PYTHONPATH=$PYTHONPATH:/home/user
25+
26+ USER user
27+
28+ WORKDIR /home/user/comps/llms/src/text-generation
29+
30+ ENTRYPOINT ["bash", "entrypoint.sh"]
Original file line number Diff line number Diff line change @@ -18,7 +18,8 @@ service_name="textgen-service-tgi"
1818
1919function build_docker_images() {
2020 cd $WORKPATH
21- docker build --no-cache -t ${REGISTRY:- opea} /llm-textgen:${TAG:- latest} --build-arg https_proxy=$https_proxy --build-arg http_proxy=$http_proxy -f comps/llms/src/text-generation/Dockerfile .
21+ dockerfile_name=" comps/llms/src/text-generation/$1 "
22+ docker build --no-cache -t ${REGISTRY:- opea} /llm-textgen:${TAG:- latest} --build-arg https_proxy=$https_proxy --build-arg http_proxy=$http_proxy -f " ${dockerfile_name} " .
2223 if [ $? -ne 0 ]; then
2324 echo " opea/llm-textgen built fail"
2425 exit 1
@@ -112,25 +113,32 @@ function validate_microservice_with_openai() {
112113 fi
113114}
114115
115- function stop_docker () {
116+ function stop_service () {
116117 cd $WORKPATH /comps/llms/deployment/docker_compose
117118 docker compose -f compose_text-generation.yaml down --remove-orphans
118119}
119120
120121function main() {
121122
122- stop_docker
123-
124- build_docker_images
123+ build_docker_images " Dockerfile "
124+ trap stop_service EXIT
125+ echo " Test normal env ... "
125126 pip install --no-cache-dir openai pydantic
126127 start_service
127128
128129 validate_microservices
129130 validate_microservice_with_openai
130131
131- stop_docker
132- echo y | docker system prune
132+ stop_service
133+
134+ echo " Test with openEuler OS ..."
135+ build_docker_images " Dockerfile.openEuler"
136+ start_service
137+ validate_microservices
138+ validate_microservice_with_openai
139+ stop_service
133140
141+ docker system prune -f
134142}
135143
136144main
You can’t perform that action at this time.
0 commit comments