Skip to content

feat(garak): Add integration tests for Garak remote provider#2

Merged
kpunwatk merged 3 commits intokpunwatk:garak_inlinefrom
saichandrapandraju:pr-1132
Apr 1, 2026
Merged

feat(garak): Add integration tests for Garak remote provider#2
kpunwatk merged 3 commits intokpunwatk:garak_inlinefrom
saichandrapandraju:pr-1132

Conversation

@saichandrapandraju
Copy link
Copy Markdown

Implement comprehensive integration tests for the remote mode of the llama_stack_garak_provider across three tiers:

  • smoke (TestGarakRemoteQuickScan): predefined quick benchmark registration, eval job submission, status polling, and result retrieval
  • tier1 (TestGarakRemoteCustomBenchmark): custom benchmark with explicit garak_config metadata, probe selection, and result validation
  • tier2 (TestGarakRemoteShieldScan): shield registration with FMS guardrails orchestrator, benchmark with shield_ids, and shielded eval execution

Key changes:

  • Support distribution_image override in llama_stack_server_config fixture to use specific LlamaStack 0.5.x images
  • Pre-generate CR names for consistent LlamaStack service URL construction
  • Add deployment namespace to NetworkPolicy allowedFrom for KFP pod access
  • Add guardrails orchestrator service URL fixture for in-cluster communication
  • Use provider-qualified model IDs (vllm-inference/) for LlamaStack 0.5.x
  • Add eval job utilities with enhanced status logging and result validation

Made-with: Cursor

Implement comprehensive integration tests for the remote mode of the
llama_stack_garak_provider across three tiers:

- smoke (TestGarakRemoteQuickScan): predefined quick benchmark registration,
  eval job submission, status polling, and result retrieval
- tier1 (TestGarakRemoteCustomBenchmark): custom benchmark with explicit
  garak_config metadata, probe selection, and result validation
- tier2 (TestGarakRemoteShieldScan): shield registration with FMS guardrails
  orchestrator, benchmark with shield_ids, and shielded eval execution

Key changes:
- Support distribution_image override in llama_stack_server_config fixture
  to use specific LlamaStack 0.5.x images
- Pre-generate CR names for consistent LlamaStack service URL construction
- Add deployment namespace to NetworkPolicy allowedFrom for KFP pod access
- Add guardrails orchestrator service URL fixture for in-cluster communication
- Use provider-qualified model IDs (vllm-inference/<model>) for LlamaStack 0.5.x
- Add eval job utilities with enhanced status logging and result validation

Made-with: Cursor
@github-actions
Copy link
Copy Markdown

github-actions bot commented Mar 8, 2026

The following are automatically added/executed:

  • PR size label.
  • Run pre-commit
  • Run tox
  • Add PR author as the PR assignee
  • Build image based on the PR

Available user actions:

  • To mark a PR as WIP, add /wip in a comment. To remove it from the PR comment /wip cancel to the PR.
  • To block merging of a PR, add /hold in a comment. To un-block merging of PR comment /hold cancel.
  • To mark a PR as approved, add /lgtm in a comment. To remove, add /lgtm cancel.
    lgtm label removed on each new commit push.
  • To mark PR as verified comment /verified to the PR, to un-verify comment /verified cancel to the PR.
    verified label removed on each new commit push.
  • To Cherry-pick a merged PR /cherry-pick <target_branch_name> to the PR. If <target_branch_name> is valid,
    and the current PR is merged, a cherry-picked PR would be created and linked to the current PR.
  • To build and push image to quay, add /build-push-pr-image in a comment. This would create an image with tag
    pr-<pr_number> to quay repository. This image tag, however would be deleted on PR merge or close action.
Supported labels

{'/lgtm', '/wip', '/verified', '/cherry-pick', '/hold', '/build-push-pr-image'}

@saichandrapandraju saichandrapandraju changed the title Add integration tests for Garak remote provider feat(garak): Add integration tests for Garak remote provider Mar 8, 2026
The guardrails_orchestrator_ssl_cert, guardrails_orchestrator_ssl_cert_secret,
and patched_llamastack_deployment_tls_certs fixtures are no longer needed since
the shield tests now use verify_ssl=False with the HTTPS route. This resolves
the unused-code CI failure.

Made-with: Cursor
default_garak_image = "quay.io/trustyai/garak-remote-provider:latest"
# Garak uses KUBEFLOW_GARAK_BASE_IMAGE; Ragas uses KUBEFLOW_BASE_IMAGE
# quay.io/rhoai/odh-trustyai-garak-lls-provider-dsp-rhel9@sha256:75eb795e9e459c0f6951ee1fc3ee325ae593d6aab32eee203723d28880c7ca31 (3.4-ea.1 sha)
# quay.io/opendatahub/odh-trustyai-garak-lls-provider-dsp@sha256:a3b65a9fdb6996fdaac45286b17522806cdf5af133275806fef5f93265103fc9
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

images are commented

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

those are just for reference and all those images have same content. As I used the tag I pasted the links with sha just to be safe


Reads the predictor service port from the cluster instead of hardcoding
a container port. Works correctly regardless of KServe headed/headless mode.
"""
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can we modify that fixture to dynamically use port from svc instead of hardcoding?

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yeah you're right the fixture hardcodes the 8032 port, we could have modified the fixture but does make sense if to create a new one as per the test requirement

def guardrails_orchestrator_service_url(
admin_client: DynamicClient,
model_namespace: Namespace,
guardrails_orchestrator: Any,
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why we need this fixture?

Copy link
Copy Markdown
Author

@saichandrapandraju saichandrapandraju Mar 9, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We are setting up guardrails orchestrator to use for shields testing.

Copy link
Copy Markdown
Owner

@kpunwatk kpunwatk Mar 10, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@kpunwatk kpunwatk merged commit 58d6c04 into kpunwatk:garak_inline Apr 1, 2026
10 of 12 checks passed
@github-actions
Copy link
Copy Markdown

github-actions bot commented Apr 1, 2026

Status of building tag garak_inline: success.
Status of pushing tag garak_inline to image registry: failure.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants