-
Notifications
You must be signed in to change notification settings - Fork 97
LCORE-1801: Wrap lightspeed-stack startup with opentelemetry-instrument #2221
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -62,8 +62,12 @@ def run_e2e_ops( | |
| ) | ||
|
|
||
|
|
||
| def wait_for_pod_health(pod_name: str, max_attempts: int = 12) -> None: | ||
| """Wait for pod to be ready in OpenShift/Prow environment.""" | ||
| def wait_for_pod_health(pod_name: str, max_attempts: int = 20) -> None: | ||
| """Wait for pod to be ready in OpenShift/Prow environment. | ||
|
|
||
| Generous number of attempts to account for OpenTelemetry instrumentation | ||
| initialization overhead during service startup. | ||
| """ | ||
|
Comment on lines
+65
to
+70
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 📐 Maintainability & Code Quality | 🟠 Major | ⚡ Quick win Complete the updated function docstring. Document 🤖 Prompt for AI AgentsSources: Coding guidelines, Learnings |
||
| actual_pod_name = get_pod_name(pod_name) | ||
| try: | ||
| result = run_e2e_ops("wait-for-pod", [actual_pod_name, str(max_attempts)]) | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -181,7 +181,7 @@ def validate_json(message: Any, schema: Any) -> None: | |
| assert False, "The provided schema is faulty:" + str(e) | ||
|
|
||
|
|
||
| def wait_for_container_health(container_name: str, max_attempts: int = 6) -> None: | ||
| def wait_for_container_health(container_name: str, max_attempts: int = 20) -> None: | ||
| """Wait for container to be healthy. | ||
|
|
||
| Polls a Docker container until its health status becomes `healthy` or the | ||
|
|
@@ -192,14 +192,17 @@ def wait_for_container_health(container_name: str, max_attempts: int = 6) -> Non | |
| inspect errors or timeouts are ignored and retried; the function returns | ||
| after the container is observed healthy or after all attempts complete. | ||
|
|
||
| OpenTelemetry instrumentation adds initialization overhead, so the default | ||
| has been set to 20 attempts (40 seconds) to prevent timeouts. | ||
|
Comment on lines
+195
to
+196
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🩺 Stability & Availability | 🟡 Minor | ⚡ Quick win Correct the documented timeout budget. With 20 attempts, 5-second 🤖 Prompt for AI Agents |
||
|
|
||
| Returns: | ||
| ------- | ||
| None | ||
|
|
||
| Parameters: | ||
| ---------- | ||
| container_name (str): Docker container name or ID to check. | ||
| max_attempts (int): Maximum number of health check attempts (default 6). | ||
| max_attempts (int): Maximum number of health check attempts (default 20). | ||
| """ | ||
| if is_prow_environment(): | ||
| wait_for_pod_health(container_name, max_attempts) | ||
|
|
@@ -468,9 +471,10 @@ def restart_container(container_name: str) -> None: | |
|
|
||
| # Wait for container to be healthy. | ||
| # Library mode embeds llama-stack, so the container takes longer to start | ||
| # (~45-60s vs ~10s in server mode). Use a generous attempt count so | ||
| # MCP-auth scenarios that restart the container don't time out. | ||
| wait_for_container_health(container_name, max_attempts=12) | ||
| # (~45-60s vs ~10s in server mode). OpenTelemetry instrumentation adds | ||
| # initialization overhead. Use a generous attempt count so MCP-auth scenarios | ||
| # that restart the container don't time out. | ||
| wait_for_container_health(container_name, max_attempts=20) | ||
|
|
||
| if container_name == "llama-stack": | ||
| from tests.e2e.features.steps.health import ( | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.