imbajin commented on code in PR #262: URL: https://github.com/apache/incubator-hugegraph-ai/pull/262#discussion_r2123665274
########## docker/Dockerfile.llm: ########## @@ -32,17 +28,18 @@ RUN useradd -m -s /bin/bash work && \ WORKDIR /home/work/ -# Copy only the built packages and virtual environment from the builder stage -COPY --from=builder --chown=work:work /build/hugegraph-llm/.venv /home/work/hugegraph-llm/.venv -COPY --from=builder --chown=work:work /build/hugegraph-llm/src /home/work/hugegraph-llm/src +# Copy virtual environment and source code +COPY --from=builder --chown=work:work /home/work/hugegraph-llm/.venv /home/work/hugegraph-llm/.venv +COPY --from=builder --chown=work:work /home/work/hugegraph-llm/src /home/work/hugegraph-llm/src USER work ENV PATH="/home/work/hugegraph-llm/.venv/bin:$PATH" +ENV PYTHONPATH="/home/work/hugegraph-llm/src" -WORKDIR /home/work/hugegraph-llm/src +WORKDIR /home/work/hugegraph-llm VOLUME ["/home/work/hugegraph-llm/src/hugegraph_llm/resources"] EXPOSE 8001 HEALTHCHECK --interval=60s --timeout=10s --start-period=5s --retries=3 CMD curl -f http://localhost:8001/ || exit 1 -CMD ["python", "-m", "hugegraph_llm.demo.rag_demo.app", "--host", "0.0.0.0", "--port", "8001"] +CMD ["python", "-m", "hugegraph_llm.demo.rag_demo.app", "--host", "0.0.0.0", "--port", "8001"] Review Comment: ```suggestion CMD ["python", "-m", "hugegraph_llm.demo.rag_demo.app", "--host", "0.0.0.0", "--port", "8001"] ``` ########## hugegraph-llm/README.md: ########## Review Comment: maybe put `docker way` in a separate section? like <img width="762" alt="image" src="https://github.com/user-attachments/assets/1718d545-4836-4232-a772-8dc2d72ba247" /> ########## hugegraph-llm/src/hugegraph_llm/config/models/base_prompt_config.py: ########## @@ -38,6 +40,16 @@ class BasePromptConfig: doc_input_text: str = '' def ensure_yaml_file_exists(self): + if os.getcwd() == str(get_project_root()): + log.info("Current working directory is the project root, proceeding to run the app.") + else: + error_msg = ( + f"Current working directory is not the project root. " + f"Please run this script from the project root directory: {get_project_root()}\n" + f"Current directory: {os.getcwd()}" + ) + log.error(error_msg) + sys.exit(1) Review Comment: for container env? -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected] --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
