Repository: bentoml/BentoML
Pull request: chore: http client healthcheck
## What does this PR address?

Fixes #3315 

## Before submitting:

<!--- Go over all the following points, and put an `x` in all the boxes that apply. -->
<!--- If you're unsure about any of these, don't hesitate to ask. We're here to help! -->
<!--- If you plan to update documentation or tests in follow-up, please note -->

- [ ] Does the Pull Request follow [Conventional Commits specification](https://www.conventionalcommits.org/en/v1.0.0/#summary) naming? Here are [GitHub's
      guide](https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/proposing-changes-to-your-work-with-pull-requests/creating-a-pull-request) on how to create a pull request.
- [ ] Does the code follow BentoML's code style, both `make format` and `make lint` script have passed ([instructions](https://github.com/bentoml/BentoML/blob/main/DEVELOPMENT.md#style-check-auto-formatting-type-checking))?
- [ ] Did you read through [contribution guidelines](https://github.com/bentoml/BentoML/blob/main/CONTRIBUTING.md#ways-to-contribute) and follow [development guidelines](https://github.com/bentoml/BentoML/blob/main/DEVELOPMENT.md#start-developing)?
- [ ] Did your changes require updates to the documentation? Have you updated
      those accordingly? Here are [documentation guidelines](https://github.com/bentoml/BentoML/tree/main/docs) and [tips on writting docs](https://github.com/bentoml/BentoML/tree/main/docs#writing-documentation).
- [ ] Did you write tests to cover your changes?


Problem statement:
feature: `client.health`
### Feature request

client to have a health function:
```python
client.health()
await client.async_health()
```

### Motivation

For HTTP, would probably just need to invoke `/readyz`, and for gRPC is to invoke the `Health` rpc from `grpc.health.v1.HealthServicer`.

### Other

_No response_

Hints from issue discussion:
@aarnphm Hi! I'm a newbie to BentoML. May I work on this issue?
Hi there, feel free to pick up this issue after https://github.com/bentoml/BentoML/pull/3280 is merged.
Has anyone started this one? It's being here for a while
feel free to pick it up. The client.health is already implemented for gRPC client. You can go a head and implement for HTTP client.

Commit message: (fix) move simple_service back, remove retries for tests

Patch to review:
diff --git a/src/bentoml/_internal/client/http.py b/src/bentoml/_internal/client/http.py
index c5abd7a22f9..90275cf9868 100644
--- a/src/bentoml/_internal/client/http.py
+++ b/src/bentoml/_internal/client/http.py
@@ -4,6 +4,7 @@
 import time
 import socket
 import typing as t
+import asyncio
 import logging
 import urllib.error
 import urllib.request
@@ -77,6 +78,14 @@ def wait_until_server_ready(
             logger.error(err)
             raise
 
+    async def async_health(self) -> t.Any:
+        async with aiohttp.ClientSession(self.server_url) as sess:
+            async with sess.get("/readyz") as resp:
+                return resp
+
+    def health(self) -> t.Any:
+        return asyncio.run(self.async_health())
+
     @classmethod
     def from_url(cls, server_url: str, **kwargs: t.Any) -> HTTPClient:
         server_url = server_url if "://" in server_url else "http://" + server_url
diff --git a/tests/e2e/bento_server_http/tests/test_client.py b/tests/e2e/bento_server_http/tests/test_client.py
new file mode 100644
index 00000000000..20c565239ba
--- /dev/null
+++ b/tests/e2e/bento_server_http/tests/test_client.py
@@ -0,0 +1,25 @@
+import pytest
+
+import bentoml
+from bentoml.client import HTTPClient
+
+pytestmark = pytest.mark.asyncio
+
+
+@pytest.fixture(scope="session")
+def http_client(host: str) -> HTTPClient:
+    service = bentoml.load(bento_identifier="service:svc")
+
+    return HTTPClient(service, f"http://{host}")
+
+
+async def test_async_health(http_client: HTTPClient) -> None:
+    resp = await http_client.async_health()
+
+    assert resp.status == 200
+
+
+def test_health(http_client: HTTPClient) -> None:
+    resp = http_client.health()
+
+    assert resp.status == 200


Code review comments:
diff_hunk: @@ -0,0 +1,25 @@
+import pytest
+
+import bentoml
+from bentoml.client import HTTPClient
+
+pytestmark = pytest.mark.asyncio
path: tests/e2e/bento_server_http/tests/test_client.py
text: @user1:
Lets not do this
```suggestion
```

@author:
Of curiosity, what's the reason?