Skip to content

Commit 9fc8195

Browse files
authored
Merge pull request #927 from rewenila/mcpo
Add test for mcpo container
2 parents e803458 + 3b10cae commit 9fc8195

File tree

4 files changed

+46
-0
lines changed

4 files changed

+46
-0
lines changed

bci_tester/data.py

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1049,6 +1049,24 @@ def create_BCI(
10491049
forwarded_ports=[PortForwarding(container_port=8080)],
10501050
)
10511051

1052+
MCPO_CONTAINER = create_BCI(
1053+
build_tag=f"{SAC_CONTAINER_PREFIX}/mcpo:0",
1054+
bci_type=ImageType.SAC_APPLICATION,
1055+
available_versions=["15.6-ai"],
1056+
custom_entry_point="mcpo",
1057+
extra_entrypoint_args=[
1058+
"--host",
1059+
"0.0.0.0",
1060+
"--port",
1061+
"8000",
1062+
"--",
1063+
"uvx",
1064+
"mcp-server-time",
1065+
"--local-timezone=America/New_York",
1066+
],
1067+
forwarded_ports=[PortForwarding(container_port=8000)],
1068+
)
1069+
10521070
MILVUS_CONTAINER = create_BCI(
10531071
build_tag=f"{SAC_CONTAINER_PREFIX}/milvus:2.4",
10541072
bci_type=ImageType.SAC_APPLICATION,
@@ -1369,6 +1387,7 @@ def create_BCI(
13691387
*KIOSK_XORG_CONTAINERS,
13701388
*KIOSK_XORG_CLIENT_CONTAINERS,
13711389
*KIOSK_PULSEAUDIO_CONTAINERS,
1390+
MCPO_CONTAINER,
13721391
MICRO_CONTAINER,
13731392
MICRO_FIPS_CONTAINER,
13741393
MINIMAL_CONTAINER,

pyproject.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -109,6 +109,7 @@ markers = [
109109
'git_latest',
110110
'helm_3',
111111
'helm_latest',
112+
'mcpo_0',
112113
'milvus_2.4',
113114
'nginx_1.21',
114115
'nginx_latest',

tests/test_ai.py

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88

99
from bci_tester.data import LMCACHE_LMSTACK_ROUTER_CONTAINER
1010
from bci_tester.data import LMCACHE_VLLM_OPENAI_CONTAINER
11+
from bci_tester.data import MCPO_CONTAINER
1112
from bci_tester.data import MILVUS_CONTAINER
1213
from bci_tester.data import OLLAMA_CONTAINER
1314
from bci_tester.data import OPENWEBUI_CONTAINER
@@ -21,6 +22,7 @@
2122
OLLAMA_CONTAINER,
2223
OPENWEBUI_CONTAINER,
2324
MILVUS_CONTAINER,
25+
MCPO_CONTAINER,
2426
PYTORCH_CONTAINER,
2527
SUSE_AI_OBSERVABILITY_EXTENSION_RUNTIME,
2628
SUSE_AI_OBSERVABILITY_EXTENSION_SETUP,
@@ -172,3 +174,25 @@ def test_lmstack_router_health(container):
172174
container.connection.check_output(
173175
"python3.11 -c 'import vllm_router._version; print(vllm_router._version.__version__)'"
174176
)
177+
178+
179+
@pytest.mark.parametrize(
180+
"container_per_test",
181+
[MCPO_CONTAINER],
182+
indirect=["container_per_test"],
183+
)
184+
def test_mcpo_health(container_per_test):
185+
"""Test that we can reach the port 8000 successfully."""
186+
host_port = container_per_test.forwarded_ports[0].host_port
187+
188+
# Retry 5 times with exponential backoff delay
189+
@retry(
190+
wait=wait_exponential(multiplier=1, min=4, max=10),
191+
stop=stop_after_attempt(5),
192+
)
193+
def check_mcpo_response():
194+
resp = requests.get(f"http://localhost:{host_port}/docs", timeout=30)
195+
resp.raise_for_status()
196+
assert "mcp-time" in resp.text
197+
198+
check_mcpo_response()

tests/test_metadata.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,7 @@
6868
from bci_tester.data import LTSS_BASE_FIPS_CONTAINERS
6969
from bci_tester.data import MARIADB_CLIENT_CONTAINERS
7070
from bci_tester.data import MARIADB_CONTAINERS
71+
from bci_tester.data import MCPO_CONTAINER
7172
from bci_tester.data import MICRO_CONTAINER
7273
from bci_tester.data import MICRO_FIPS_CONTAINER
7374
from bci_tester.data import MILVUS_CONTAINER
@@ -338,6 +339,7 @@ def _get_container_ref(
338339
"lmcache-lmstack-router",
339340
ImageType.SAC_APPLICATION,
340341
),
342+
(MCPO_CONTAINER, "mcpo", ImageType.SAC_APPLICATION),
341343
]
342344
+ [(STUNNEL_CONTAINER, "stunnel", ImageType.APPLICATION)]
343345
+ [

0 commit comments

Comments
 (0)