Skip to content
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/post-merge-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -876,7 +876,7 @@ jobs:
uses: ./.github/workflows/shared-deploy-test.yml
with:
framework: sglang
profiles: '["agg", "agg_router"]'
profiles: '["agg", "agg_logging", "agg_router"]'
Comment thread
knarangN marked this conversation as resolved.
Resolved
image_suffix: sglang-runtime
namespace: ${{ needs.deploy-operator.outputs.namespace }}
vcluster_name: ${{ needs.deploy-operator.outputs.vcluster_name }}
Expand Down
38 changes: 38 additions & 0 deletions tests/deploy/test_deploy.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
to chat completion requests correctly.
"""

import json
import logging
import os
import subprocess
Expand Down Expand Up @@ -48,6 +49,24 @@
# This matches the validation threshold from the original shell-based deployment tests.
MIN_RESPONSE_CONTENT_LENGTH = 100
GAIE_MODEL_NAME = "Qwen/Qwen3-0.6B"
JSON_LOG_REQUIRED_FIELDS = frozenset({"time", "level", "target", "message"})


def find_structured_json_log(log_lines: Any) -> Dict[str, Any] | None:
"""Return the first Dynamo JSONL record with the documented core fields."""
if isinstance(log_lines, str):
log_lines = log_lines.splitlines()

for line in log_lines:
try:
record = json.loads(line)
except (json.JSONDecodeError, TypeError):
continue

if isinstance(record, dict) and JSON_LOG_REQUIRED_FIELDS.issubset(record):
return record

return None


def validate_chat_response(
Expand Down Expand Up @@ -168,6 +187,12 @@ async def test_deployment(
f"{framework}/{profile}"
)

if profile == "agg_logging":
Comment thread
knarangN marked this conversation as resolved.
Resolved
logging_config = deployment_spec.get_logging_config()
assert logging_config[
"jsonl_enabled"
], "The agg_logging deployment profile must enable DYN_LOGGING_JSONL"

Comment thread
knarangN marked this conversation as resolved.
Resolved
logger.info(
f"Starting deployment test for {deployment_target.test_id} "
f"(source: {deployment_target.source}, model: {model}, namespace: {namespace})"
Expand Down Expand Up @@ -236,6 +261,19 @@ async def test_deployment(
min_content_length=MIN_RESPONSE_CONTENT_LENGTH,
)

if profile == "agg_logging":
frontend_logs = frontend_pod.logs(container="main")
json_log_record = find_structured_json_log(frontend_logs)
assert json_log_record is not None, (
"The agg_logging deployment served inference but the frontend "
"did not emit a structured Dynamo JSONL record"
)
logger.info(
"Validated structured JSON logging: target=%s message=%s",
json_log_record["target"],
json_log_record["message"],
)

Comment thread
knarangN marked this conversation as resolved.
Resolved
logger.info(
f"Deployment test PASSED for {deployment_target.test_id} "
f"(source: {deployment_target.source}, model: {model}, namespace: {namespace})"
Expand Down
Loading