Skip to content

Commit

Permalink
Return Mega/Micro Service Version number at runtime
Browse files Browse the repository at this point in the history
Signed-off-by: Tsai, Louie <[email protected]>

fix

Signed-off-by: Tsai, Louie <[email protected]>
  • Loading branch information
louie-tsai committed Nov 27, 2024
1 parent c5b8cdd commit e19a9ab
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 2 deletions.
16 changes: 16 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,22 @@ from comps import ChatQnAGateway
self.gateway = ChatQnAGateway(megaservice=self.megaservice, host="0.0.0.0", port=self.port)
```

## Check Mega/Micro Service health status and version number

Use below command to check Mega/Micro Service status.

```bash
curl http://${your_ip}:${service_port}/v1/health_check\
-X GET \
-H 'Content-Type: application/json'
```

Users should get output like below example if Mega/Micro Service works correctly.

```bash
{"Service Title":"ChatQnAGateway/MicroService","Version":"1.0","Service Description":"OPEA Microservice Infrastructure"}
```

## Contributing to OPEA

Welcome to the OPEA open-source community! We are thrilled to have you here and excited about the potential contributions you can bring to the OPEA platform. Whether you are fixing bugs, adding new GenAI components, improving documentation, or sharing your unique use cases, your contributions are invaluable.
Expand Down
4 changes: 3 additions & 1 deletion comps/cores/mega/http_service.py
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,9 @@ def _create_app(self):
)
async def _health_check():
"""Get the health status of this GenAI microservice."""
return {"Service Title": self.title, "Service Description": self.description}
from comps.version import __version__

Check warning on line 72 in comps/cores/mega/http_service.py

View check run for this annotation

Codecov / codecov/patch

comps/cores/mega/http_service.py#L72

Added line #L72 was not covered by tests

return {"Service Title": self.title, "Version": __version__, "Service Description": self.description}

Check warning on line 74 in comps/cores/mega/http_service.py

View check run for this annotation

Codecov / codecov/patch

comps/cores/mega/http_service.py#L74

Added line #L74 was not covered by tests

@app.get(
path="/v1/statistics",
Expand Down
8 changes: 7 additions & 1 deletion comps/llms/text-generation/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -257,14 +257,20 @@ docker compose -f docker_compose_llm.yaml up -d

## 🚀3. Consume LLM Service

### 3.1 Check Service Status
### 3.1 Check Service Status and its Version

```bash
curl http://${your_ip}:9000/v1/health_check\
-X GET \
-H 'Content-Type: application/json'
```

Users should get output like below example if MicroService works correctly.

```bash
{"Service Title":"ChatQnAGateway/MicroService","Version":"1.0","Service Description":"OPEA Microservice Infrastructure"}
```

### 3.2 Verify the LLM Service

#### 3.2.1 Verify the TGI Service
Expand Down

0 comments on commit e19a9ab

Please sign in to comment.