Skip to content

Commit

Permalink
Refactor chathistory based on E-RAG code structure.
Browse files Browse the repository at this point in the history
Previously, the code for implementing microservice and functionalities was placed in one folder. Now the microservice and functionalities code have been separated.
Fix [Issue](#989)

Signed-off-by: Yao, Qing <[email protected]>
  • Loading branch information
yao531441 committed Jan 16, 2025
1 parent 5098e82 commit c7917e1
Show file tree
Hide file tree
Showing 13 changed files with 9 additions and 9 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/docker/compose/chathistory-compose.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,5 @@
services:
chathistory-mongo-server:
build:
dockerfile: comps/chathistory/mongo/Dockerfile
dockerfile: comps/chathistory/src/Dockerfile
image: ${REGISTRY:-opea}/chathistory-mongo-server:${TAG:-latest}
2 changes: 1 addition & 1 deletion comps/chathistory/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,4 +23,4 @@ The Chat History microservice able to support various database backends for stor

### Chat History with MongoDB

For more detail, please refer to this [README](./mongo/README.md)
For more detail, please refer to this [README](src/README.md)
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,11 @@ COPY comps /home/user/comps
COPY requirements.txt /home/user/

RUN pip install --no-cache-dir --upgrade pip setuptools && \
pip install --no-cache-dir -r /home/user/comps/chathistory/mongo/requirements.txt && \
pip install --no-cache-dir -r /home/user/comps/chathistory/src/requirements.txt && \
pip install --no-cache-dir -r /home/user/requirements.txt

ENV PYTHONPATH=$PYTHONPATH:/home/user

WORKDIR /home/user/comps/chathistory/mongo
WORKDIR /home/user/comps/chathistory/src

ENTRYPOINT ["python", "chathistory_mongo.py"]
ENTRYPOINT ["python", "opea_chathistory_microservice.py"]
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ export COLLECTION_NAME=${COLLECTION_NAME}

```bash
cd ../../../../
docker build -t opea/chathistory-mongo-server:latest --build-arg https_proxy=$https_proxy --build-arg http_proxy=$http_proxy -f comps/chathistory/mongo/Dockerfile .
docker build -t opea/chathistory-mongo-server:latest --build-arg https_proxy=$https_proxy --build-arg http_proxy=$http_proxy -f comps/chathistory/src/Dockerfile .
```

### Run Docker with CLI
Expand Down
Empty file.
Empty file.
Empty file.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
# Copyright (C) 2024 Intel Corporation
# Copyright (C) 2024 Intel Corporation
# SPDX-License-Identifier: Apache-2.0
import os
from typing import Optional

from fastapi import HTTPException
from mongo_store import DocumentStore
from pydantic import BaseModel

from comps import CustomLogger
from comps.chathistory.src.integrations.mongo.mongo_store import DocumentStore
from comps.cores.mega.micro_service import opea_microservices, register_microservice
from comps.cores.proto.api_protocol import ChatCompletionRequest

Expand Down
File renamed without changes.
2 changes: 1 addition & 1 deletion tests/chathistory/test_chathistory_mongo.sh
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ function build_docker_images() {
echo $(pwd)
docker run -d -p 27017:27017 --name=test-comps-mongo mongo:latest

docker build --no-cache -t opea/chathistory-mongo-server:comps --build-arg https_proxy=$https_proxy --build-arg http_proxy=$http_proxy -f comps/chathistory/mongo/Dockerfile .
docker build --no-cache -t opea/chathistory-mongo-server:comps --build-arg https_proxy=$https_proxy --build-arg http_proxy=$http_proxy -f comps/chathistory/src/Dockerfile .
if [ $? -ne 0 ]; then
echo "opea/chathistory-mongo-server built fail"
exit 1
Expand Down

0 comments on commit c7917e1

Please sign in to comment.