Skip to content
Open
Show file tree
Hide file tree
Changes from all 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
6 changes: 3 additions & 3 deletions tests/configuration/benchmarks-postgres.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,12 @@ service:
access_log: true
ogx:
# Uses a remote OGX service
# The instance would have already been started with a llama-stack-run.yaml file
# The instance would have already been started with a run.yaml file
use_as_library_client: false
# Alternative for "as library use"
# use_as_library_client: true
# library_client_config_path: <path-to-llama-stack-run.yaml-file>
url: http://llama-stack:8321
# library_client_config_path: <path-to-run.yaml-file>
url: http://ogx:8321
api_key: xyzzy
user_data_collection:
feedback_enabled: true
Expand Down
6 changes: 3 additions & 3 deletions tests/configuration/benchmarks-sqlite.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,12 @@ service:
access_log: true
ogx:
# Uses a remote OGX service
# The instance would have already been started with a llama-stack-run.yaml file
# The instance would have already been started with a run.yaml file
use_as_library_client: false
# Alternative for "as library use"
# use_as_library_client: true
# library_client_config_path: <path-to-llama-stack-run.yaml-file>
url: http://llama-stack:8321
# library_client_config_path: <path-to-run.yaml-file>
url: http://ogx:8321
api_key: xyzzy
user_data_collection:
feedback_enabled: true
Expand Down
4 changes: 2 additions & 2 deletions tests/configuration/lightspeed-stack-proper-name.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,11 @@ service:
- baz_header
ogx:
# Uses a remote OGX service
# The instance would have already been started with a llama-stack-run.yaml file
# The instance would have already been started with a run.yaml file
use_as_library_client: false
# Alternative for "as library use"
# use_as_library_client: true
# library_client_config_path: <path-to-llama-stack-run.yaml-file>
# library_client_config_path: <path-to-run.yaml-file>
url: http://localhost:8321
api_key: xyzzy
user_data_collection:
Expand Down
4 changes: 2 additions & 2 deletions tests/configuration/lightspeed-stack.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,11 @@ service:
- baz_header
ogx:
# Uses a remote OGX service
# The instance would have already been started with a llama-stack-run.yaml file
# The instance would have already been started with a run.yaml file
use_as_library_client: false
# Alternative for "as library use"
# use_as_library_client: true
# library_client_config_path: <path-to-llama-stack-run.yaml-file>
# library_client_config_path: <path-to-run.yaml-file>
url: http://localhost:8321
api_key: xyzzy
user_data_collection:
Expand Down
6 changes: 3 additions & 3 deletions tests/configuration/minimal-stack.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
version: '2'
distro_name: llamastack-minimal-stack
distro_name: ogx-minimal-stack
container_image: null
external_providers_dir: /tmp

Expand All @@ -9,10 +9,10 @@ storage:
backends:
kv_default:
type: kv_sqlite
db_path: '/tmp/test_llama_stack_kv.db'
db_path: '/tmp/test_ogx_kv.db'
sql_default:
type: sql_sqlite
db_path: '/tmp/test_llama_stack_sql.db'
db_path: '/tmp/test_ogx_sql.db'
stores:
metadata:
namespace: registry
Expand Down
2 changes: 1 addition & 1 deletion tests/configuration/run.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
version: '2'
distro_name: minimal-viable-llama-stack-configuration
distro_name: minimal-viable-ogx-configuration

apis:
- responses
Expand Down
5 changes: 3 additions & 2 deletions tests/e2e/configuration/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,11 @@ This directory contains configuration files used for end-to-end testing of Light
## Library mode uses unified configs (LCORE-2342)

The library-mode configurations use the unified single-file format: instead of
the legacy `llama_stack.library_client_config_path`, they carry
the legacy `ogx.library_client_config_path` (the deprecated `llama_stack` YAML
section alias is still accepted), they carry

```yaml
llama_stack:
ogx:
use_as_library_client: true
config:
profile: run.yaml
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ service:
workers: 1
color_log: true
access_log: true
llama_stack:
ogx:
# Library mode - embeds OGX as library
use_as_library_client: true
# Unified mode: run.yaml (materialized per provider by CI/the harness)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ service:
workers: 1
color_log: true
access_log: true
llama_stack:
ogx:
# Library mode - embeds OGX as library
use_as_library_client: true
# Unified mode: run.yaml (materialized per provider by CI/the harness)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# @cfg_shields
# LCORE-owned safety shields (not Llama Stack / OGX Safety API resources).
# LCORE-owned safety shields (not OGX Safety API resources).
# Configures one shield of each supported type so GET /v1/shields can be
# asserted against both `question_validity` and `redaction` shapes. See
# tests/e2e/features/shields.feature.
Expand All @@ -11,7 +11,7 @@ service:
workers: 1
color_log: true
access_log: true
llama_stack:
ogx:
# Library mode - embeds OGX as library
use_as_library_client: true
# Unified mode: run.yaml (materialized per provider by CI/the harness)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,11 @@ service:
access_log: true
ogx:
# Uses a remote OGX service
# The instance would have already been started with a llama-stack-run.yaml file
# The instance would have already been started with a run.yaml file
use_as_library_client: false
# Alternative for "as library use"
# use_as_library_client: true
# library_client_config_path: <path-to-llama-stack-run.yaml-file>
# library_client_config_path: <path-to-run.yaml-file>
url: http://${env.E2E_OGX_HOSTNAME}:8321
api_key: xyzzy
user_data_collection:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,11 @@ service:
access_log: true
ogx:
# Uses a remote OGX service
# The instance would have already been started with a llama-stack-run.yaml file
# The instance would have already been started with a run.yaml file
use_as_library_client: false
# Alternative for "as library use"
# use_as_library_client: true
# library_client_config_path: <path-to-llama-stack-run.yaml-file>
# library_client_config_path: <path-to-run.yaml-file>
url: http://${env.E2E_OGX_HOSTNAME}:8321
api_key: xyzzy
user_data_collection:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ service:
workers: 1
color_log: true
access_log: true
llama_stack:
ogx:
# Server mode - connects to separate OGX service
use_as_library_client: false
url: http://${env.E2E_OGX_HOSTNAME}:8321
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ service:
workers: 1
color_log: true
access_log: true
llama_stack:
ogx:
# Server mode - connects to separate OGX service
use_as_library_client: false
url: http://${env.E2E_OGX_HOSTNAME}:8321
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# @cfg_shields
# LCORE-owned safety shields (not Llama Stack / OGX Safety API resources).
# LCORE-owned safety shields (not OGX Safety API resources).
# Configures one shield of each supported type so GET /v1/shields can be
# asserted against both `question_validity` and `redaction` shapes. See
# tests/e2e/features/shields.feature.
Expand All @@ -11,7 +11,7 @@ service:
workers: 1
color_log: true
access_log: true
llama_stack:
ogx:
# Server mode - connects to separate OGX service
use_as_library_client: false
url: http://${env.E2E_OGX_HOSTNAME}:8321
Expand Down
30 changes: 3 additions & 27 deletions tests/e2e/features/environment.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@
prepare_tls_feature_entry_on_prow,
reset_tls_prow_state,
)
from tests.e2e.utils.ogx_utils import register_shield
from tests.e2e.utils.prow_utils import (
restart_pod,
restore_ogx_pod,
Expand Down Expand Up @@ -252,22 +251,14 @@ def before_scenario(context: Context, scenario: Scenario) -> None:
# Reset force-restart from a prior disrupt/MCP reset scenario.
context.force_lightspeed_restart_after_mcp_config_reset = False

# Clear shield unregister state from previous scenarios (see ``shields_are_disabled_for_scenario``).
for _attr in (
"shields_disabled_for_scenario",
"ogx_guard_provider_id",
"ogx_guard_provider_shield_id",
):
if hasattr(context, _attr):
delattr(context, _attr)


def _dump_pod_logs_on_failure(
context: Context, scenario: Scenario, namespace: str
) -> None:
"""Dump container logs when a scenario fails in Prow."""
if scenario.status != "failed":
return
# Pod names match tests/e2e-prow manifests (legacy llama-stack-service id).
pods: tuple[str, ...] = ("llama-stack-service", "lightspeed-stack-service")
feature = getattr(context, "feature", None)
feat_file = getattr(feature, "filename", "") or "" if feature else ""
Expand All @@ -287,7 +278,7 @@ def _dump_pod_logs_on_failure(
def after_scenario(context: Context, scenario: Scenario) -> None:
"""Run after each scenario is run.

Perform per-scenario teardown: failure logs (Prow) and shield re-register.
Perform per-scenario teardown: failure logs (Prow).

If ``configure_service`` applied a non-baseline YAML during the scenario
(``context.scenario_lightspeed_override_active``), clears that flag only;
Expand All @@ -304,7 +295,7 @@ def after_scenario(context: Context, scenario: Scenario) -> None:
running before the scenario.
- hostname_ogx, port_ogx (str/int, optional): host and port
used for the OGX health check.
scenario (Scenario): Behave scenario (unused; shield restore uses context flags).
scenario (Scenario): Behave scenario used for failure log dumps in Prow.
"""
if is_prow_environment():
_dump_pod_logs_on_failure(
Expand All @@ -314,21 +305,6 @@ def after_scenario(context: Context, scenario: Scenario) -> None:
if getattr(context, "scenario_lightspeed_override_active", False):
context.scenario_lightspeed_override_active = False

# Re-register shield if ``Given shields are disabled for this scenario`` unregistered it.
if getattr(context, "shields_disabled_for_scenario", False):
provider_id = getattr(context, "ogx_guard_provider_id", None)
provider_shield_id = getattr(context, "ogx_guard_provider_shield_id", None)
if provider_id is not None and provider_shield_id is not None:
try:
register_shield(
"llama-guard",
provider_id=provider_id,
provider_shield_id=provider_shield_id,
)
print("Re-registered shield llama-guard")
except (TypeError, ValueError, RuntimeError, KeyboardInterrupt) as e:
print(f"Warning: Could not re-register shield: {e}")


def _print_ogx_diagnostics() -> None:
"""Print container state, health, and recent logs to diagnose why OGX did not recover."""
Expand Down
6 changes: 3 additions & 3 deletions tests/e2e/features/proxy.feature
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@ Feature: Proxy and TLS networking tests for OGX providers
remote inference providers are configured with proxy and TLS settings
via the run.yaml NetworkConfig.

Query bodies use shield_ids: [] because Llama Guard moderation can issue
separate provider calls inside OGX that may not inherit the same
proxy/TLS CA trust as the scenario's remote inference provider.
Query bodies use shield_ids: [] so LCORE-owned shields (e.g. pii-redaction in
the default config) do not run; scenarios then exercise only the remote
inference provider's proxy/TLS path.

Background:
Given The service is started locally
Expand Down
1 change: 0 additions & 1 deletion tests/e2e/features/query.feature
Original file line number Diff line number Diff line change
Expand Up @@ -317,7 +317,6 @@ Scenario: Check if LLM responds for query request with error for missing query
#https://issues.redhat.com/browse/LCORE-1387
@skip
Scenario: Check if query without shields returns 413 when question is too long for model context
Given shields are disabled for this scenario
When I use "query" to ask question with too-long query and authorization header
Then The status code of the response is 413
And The body of the response contains Prompt is too long
Expand Down
4 changes: 0 additions & 4 deletions tests/e2e/features/steps/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -64,10 +64,6 @@ Behave steps for POST /v1/responses (LCORE Responses API) multi-turn tests.

rlsapi v1 endpoint test steps.

## [shields.py](shields.py)

Behave steps for temporarily disabling OGX shields in e2e (server mode).

## [tls.py](tls.py)

Step definitions for TLS configuration e2e tests.
Expand Down
35 changes: 0 additions & 35 deletions tests/e2e/features/steps/shields.py

This file was deleted.

3 changes: 2 additions & 1 deletion tests/e2e/features/streaming_query.feature
Original file line number Diff line number Diff line change
Expand Up @@ -282,8 +282,9 @@ Feature: streaming_query endpoint API tests
Then The status code of the response is 413
And The body of the response contains Prompt is too long

# https://issues.redhat.com/browse/LCORE-1387
@skip
Scenario: Check if streaming_query without shields returns 200 and error in stream when question is too long for model context
Given shields are disabled for this scenario
When I use "streaming_query" to ask question with too-long query and authorization header
Then The status code of the response is 200
And The streamed response contains error message Prompt is too long
4 changes: 0 additions & 4 deletions tests/e2e/utils/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,6 @@ Helpers for reading and updating OGX run.yaml across environments.

Thin Prow/OpenShift wrappers for OGX run.yaml ConfigMap operations.

## [ogx_utils.py](ogx_utils.py)

E2E test utilities for OGX shields.

## [prow_utils.py](prow_utils.py)

Prow/OpenShift-specific utility functions for E2E tests.
Expand Down
4 changes: 2 additions & 2 deletions tests/e2e/utils/ogx_config_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,14 +27,14 @@ def clear_ogx_config_backup() -> None:


def reset_ogx_run_config_to_pipeline_default() -> None:
"""Reset llama-stack-config run.yaml to Konflux/Prow pipeline seed (run-ci.yaml)."""
"""Reset OGX run.yaml ConfigMap to Konflux/Prow pipeline seed (run-ci.yaml)."""
if not is_prow_environment():
return
run_ci = Path(__file__).resolve().parents[1] / "configs" / "run-ci.yaml"
if not run_ci.is_file():
print(f"WARN: pipeline run.yaml seed not found at {run_ci}", flush=True)
return
print(f"Resetting llama-stack-config from {run_ci.name}...", flush=True)
print(f"Resetting OGX run config from {run_ci.name}...", flush=True)
update_ogx_run_configmap(str(run_ci))


Expand Down
Loading
Loading