diff --git a/Dockerfile b/Dockerfile index d45f03da..bf8f33c1 100644 --- a/Dockerfile +++ b/Dockerfile @@ -26,4 +26,4 @@ RUN apt-get update && apt-get install -y libgl1 libglib2.0-0 WORKDIR /app COPY --from=builder ${VIRTUAL_ENV} ${VIRTUAL_ENV} COPY . . -CMD ["pai_rag", "serve"] +CMD ["ENABLE_FASTAPI=false", "ENABLE_REQUESTS=false", "ENABLE_AIOHTTPCLIENT=false", "aliyun-instrument", "python" , "src/pai_rag/main.py"] diff --git a/Dockerfile_gpu b/Dockerfile_gpu index b42c00ab..5a6fbdf8 100644 --- a/Dockerfile_gpu +++ b/Dockerfile_gpu @@ -29,4 +29,4 @@ RUN apt-get update && apt-get install -y libgl1 libglib2.0-0 WORKDIR /app COPY --from=builder ${VIRTUAL_ENV} ${VIRTUAL_ENV} COPY . . -CMD ["pai_rag", "serve"] +CMD ["ENABLE_FASTAPI=false", "ENABLE_REQUESTS=false", "ENABLE_AIOHTTPCLIENT=false", "aliyun-instrument", "python" , "src/pai_rag/main.py"] diff --git a/Dockerfile_ui b/Dockerfile_ui index 9a6037e9..f7c81fce 100644 --- a/Dockerfile_ui +++ b/Dockerfile_ui @@ -11,9 +11,6 @@ WORKDIR /app COPY . . RUN poetry install && rm -rf $POETRY_CACHE_DIR -ENV PYTHON_AGENT_PATH="https://python-agent.oss-rg-china-mainland.aliyuncs.com/1.1.0.rc/aliyun-python-agent.tar.gz" -RUN poetry run aliyun-bootstrap -a install - FROM python:3.11-slim AS prod RUN rm -rf /etc/localtime && ln -s /usr/share/zoneinfo/Asia/Harbin /etc/localtime diff --git a/src/pai_rag/main.py b/src/pai_rag/main.py index 5f0583b1..26a1d65f 100644 --- a/src/pai_rag/main.py +++ b/src/pai_rag/main.py @@ -1,9 +1,4 @@ import os -os.environ["ENABLE_FASTAPI"] = "false" -os.environ["ENABLE_REQUESTS"] = "false" -os.environ["ENABLE_AIOHTTPCLIENT"] = "false" -from aliyun.opentelemetry.instrumentation.auto_instrumentation import sitecustomize # ByPass unused import: use for arms trace initialization - import click import uvicorn from fastapi import FastAPI