Skip to content
Merged
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
39 changes: 38 additions & 1 deletion tests/fixtures/inference.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
KServeDeploymentType,
LLMdInferenceSimConfig,
RuntimeTemplates,
Timeout,
VLLMGPUConfig,
)
from utilities.inference_utils import create_isvc
Expand Down Expand Up @@ -197,7 +198,7 @@ def llm_d_inference_sim_isvc(
deployment_mode=KServeDeploymentType.RAW_DEPLOYMENT,
model_format=LLMdInferenceSimConfig.name,
runtime=llm_d_inference_sim_serving_runtime.name,
wait_for_predictor_pods=True,
wait_for_predictor_pods=False,
min_replicas=1,
max_replicas=1,
resources={
Expand All @@ -206,6 +207,12 @@ def llm_d_inference_sim_isvc(
},
teardown=teardown_resources,
) as isvc:
deployment = Deployment(
client=admin_client,
name=f"{isvc.name}-predictor",
namespace=model_namespace.name,
)
deployment.wait_for_replicas(timeout=Timeout.TIMEOUT_2MIN)
yield isvc


Expand Down Expand Up @@ -326,3 +333,33 @@ def get_vllm_chat_config(namespace: str) -> dict[str, Any]:
"port": VLLMGPUConfig.port,
}
}


@pytest.fixture(scope="class")
def patched_dsc_garak_kfp(admin_client) -> Generator[DataScienceCluster]:
"""Configure the DataScienceCluster for Garak and KFP (Kubeflow Pipelines) testing.

This fixture patches the DataScienceCluster to enable:
- KServe in Headed mode (using Service port instead of Pod port)
- AI Pipelines component in Managed state
- MLflow operator in Managed state

Waits for the DSC to be ready before yielding.
"""

dsc = get_data_science_cluster(client=admin_client)
with ResourceEditor(
patches={
dsc: {
"spec": {
"components": {
"kserve": {"rawDeploymentServiceConfig": "Headed"},
"aipipelines": {"managementState": "Managed"},
"mlflowoperator": {"managementState": "Managed"},
}
}
}
}
):
wait_for_dsc_status_ready(dsc_resource=dsc)
yield dsc
Loading
Loading