Skip to content

Commit ace035d

Browse files
committed
Return Mega/Micro Service Version number at runtime
Signed-off-by: Tsai, Louie <[email protected]>
1 parent dca337d commit ace035d

File tree

3 files changed

+19
-3
lines changed

3 files changed

+19
-3
lines changed

README.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -139,6 +139,18 @@ from comps import ChatQnAGateway
139139
self.gateway = ChatQnAGateway(megaservice=self.megaservice, host="0.0.0.0", port=self.port)
140140
```
141141

142+
## Check Mega/Micro Service health status and version number
143+
Use below command to check Mega/Micro Service status.
144+
```bash
145+
curl http://${your_ip}:${service_port}/v1/health_check\
146+
-X GET \
147+
-H 'Content-Type: application/json'
148+
```
149+
Users should get output like below example if Mega/Micro Service works correctly.
150+
```bash
151+
{"Service Title":"ChatQnAGateway/MicroService","Version":"1.0","Service Description":"OPEA Microservice Infrastructure"}
152+
```
153+
142154
## Contributing to OPEA
143155

144156
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.

comps/cores/mega/http_service.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,8 @@ def _create_app(self):
6969
)
7070
async def _health_check():
7171
"""Get the health status of this GenAI microservice."""
72-
return {"Service Title": self.title, "Service Description": self.description}
72+
from comps.version import __version__
73+
return {"Service Title": self.title,"Version": __version__ ,"Service Description": self.description}
7374

7475
@app.get(
7576
path="/v1/statistics",

comps/llms/text-generation/README.md

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -257,14 +257,17 @@ docker compose -f docker_compose_llm.yaml up -d
257257

258258
## 🚀3. Consume LLM Service
259259

260-
### 3.1 Check Service Status
260+
### 3.1 Check Service Status and its Version
261261

262262
```bash
263263
curl http://${your_ip}:9000/v1/health_check\
264264
-X GET \
265265
-H 'Content-Type: application/json'
266266
```
267-
267+
Users should get output like below example if MicroService works correctly.
268+
```bash
269+
{"Service Title":"ChatQnAGateway/MicroService","Version":"1.0","Service Description":"OPEA Microservice Infrastructure"}
270+
```
268271
### 3.2 Verify the LLM Service
269272

270273
#### 3.2.1 Verify the TGI Service

0 commit comments

Comments
 (0)