Skip to content
Closed
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
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,8 @@ Enables agents to safely execute code and run arbitrary actions in isolated envi

**Optional provider:** [NVIDIA OpenShell](docs/openshell.md) — policy-enforced sandboxes on top of Agent Sandbox (egress default-deny, L7 rules, Landlock, credential isolation with GenAI Gateway keys). Enable with `openshell_enabled: true` in `config.agent-toolkit.yaml`.

**Optional benchmarking:** [AgentSysPerf](docs/agentsysperf.md) — scored agent benchmarks and concurrency ladders with their system cost, on its own dashboard, Grafana and Langfuse. Enable with `agentsysperf_enabled: true` in `config.agent-toolkit.yaml`.

---

### Memory, State & Context
Expand Down
5 changes: 3 additions & 2 deletions charts/pgvector/templates/statefulset.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -61,9 +61,10 @@ spec:
- name: init-scripts
mountPath: /docker-entrypoint-initdb.d
# initdb on slow storage (NFS) can outlast the liveness window; a restart mid-init leaves a broken cluster
# Over TCP: the image's temporary init server listens on the socket only, and stops after the init scripts.
startupProbe:
exec:
command: [pg_isready, -U, postgres]
command: [pg_isready, -h, 127.0.0.1, -U, postgres]
periodSeconds: 10
failureThreshold: 90
livenessProbe:
Expand All @@ -74,7 +75,7 @@ spec:
failureThreshold: 3
readinessProbe:
exec:
command: [pg_isready, -U, postgres]
command: [pg_isready, -h, 127.0.0.1, -U, postgres]
initialDelaySeconds: 10
periodSeconds: 10
failureThreshold: 3
Expand Down
24 changes: 24 additions & 0 deletions components.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -47,3 +47,27 @@ components:
layer: agent-toolkit
enabled: "{{ kuberay_enabled | default(false) | bool }}"
depends_on: []

# AgentSysPerf (agentsysperf_enabled): benchmarks agents on this layer from the unmodified
# ext/agentsysperf checkout. Teardown always plans them, so switching off strands nothing.
- name: asp_platform
layer: agent-toolkit
teardown: both
enabled: "{{ (agentsysperf_enabled | default(false) | bool) or (component_action | default('install')) == 'teardown' }}"
depends_on: [pgvector, agent_sandbox]

- name: asp_images
layer: agent-toolkit
teardown: both
enabled: >-
{{ ((agentsysperf_enabled | default(false) | bool) and (agentsysperf_image_source | default('build')) == 'build')
or (component_action | default('install')) == 'teardown' }}
depends_on: [asp_platform]

- name: asp_dashboard
layer: agent-toolkit
teardown: both
enabled: >-
{{ ((agentsysperf_enabled | default(false) | bool) and (agentsysperf_dashboard_enabled | default(true) | bool))
or (component_action | default('install')) == 'teardown' }}
depends_on: [asp_platform, asp_images]
12 changes: 12 additions & 0 deletions config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,18 @@ kuberay_enabled: false
kuberay_namespace: "ray-system"
kuberay_operator_version: "1.3.0"

# --- AgentSysPerf (optional) ---
# Agent benchmarking on this cluster: result store on pgvector, a LiteLLM key, the driver's
# RBAC and the dashboard. Runs: helm install <name> ext/agentsysperf/deploy/chart -f <preset>.
agentsysperf_enabled: false # needs ext/agentsysperf (init agent-toolkit clones it)
agentsysperf_image_source: "build" # build: on the nodes from ext/agentsysperf | registry
agentsysperf_dashboard_enabled: true # https://agent-sysperf.<base_domain_name>/, Keycloak sign-in
agentsysperf_dashboard_allowed_groups: [] # Keycloak groups; empty: the platform admin group
# agentsysperf_llm_model: "qwen2-5-coder-14b" # unset: the first model in llm_services_autodeploy_models
agentsysperf_driver_node: "" # pin the driver to this node; empty: any node with the images
agentsysperf_sandbox_nodes: [] # task-pod nodes for run-streams ladders; empty: the driver's node
agentsysperf_teardown_delete_results: false # true: teardown also drops the results database

# --- Istio mesh ---
# Namespaces LiteLLM admits; add your own ambient-labelled agent namespace here.
litellm_allowed_namespaces:
Expand Down
67 changes: 67 additions & 0 deletions docs/agentsysperf.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
# AgentSysPerf (Agent Benchmarking)

[AgentSysPerf](https://github.com/intel/agentsysperf) benchmarks agents on this cluster. It records
scored Terminal-Bench runs and concurrency ladders together with their system cost, and shows them
on its own dashboard, in Grafana and in Langfuse.

The toolkit installs and wires it; AgentSysPerf itself is used unmodified. Toolkit Manager's
`init agent-toolkit` clones it into `ext/agentsysperf` at the release pinned in
`configs/repos/repos.agent-toolkit.yaml`, and three components of this layer (`asp_platform`,
`asp_images`, `asp_dashboard`) set it up from that checkout.

## Turn it on

1. In `env/<env>/config.agent-toolkit.yaml`, set `agentsysperf_enabled: true`. An env created before
this release has no AgentSysPerf section: add the line.
2. Install as usual: `./toolkit_manager.sh install agent-toolkit --env <env>`. An env inited before
this release must run `init agent-toolkit` once more, so that `ext/agentsysperf` is cloned.

It needs `pgvector_enabled` and `agent_sandbox_enabled` (both on by default). LiteLLM
(`auth_type: litellm_vkey`), Langfuse and observability are used when present. The install stops
on OpenShift, and on `routing_mode: path` while the dashboard is on.

## Settings

All in the AgentSysPerf section of `env/<env>/config.agent-toolkit.yaml`:

| Key | Default | Purpose |
|---|---|---|
| `agentsysperf_enabled` | `false` | The switch |
| `agentsysperf_image_source` | `build` | `build`: on the nodes from `ext/agentsysperf`; `registry`: published images |
| `agentsysperf_dashboard_enabled` | `true` | Dashboard at `https://agent-sysperf.<base_domain_name>/`, Keycloak sign-in |
| `agentsysperf_dashboard_allowed_groups` | `[]` | Keycloak groups that may open it; empty: the platform admin group |
| `agentsysperf_llm_model` | first of `llm_services_autodeploy_models` | Model the driver calls through LiteLLM |
| `agentsysperf_driver_node` | `""` | Pin the driver to this node; empty: any node with the images |
| `agentsysperf_sandbox_nodes` | `[]` | Task-pod nodes for run-streams ladders; empty: the driver's node |
| `agentsysperf_teardown_delete_results` | `false` | `true`: teardown also drops the results database |

While it is on, pgvector gets 600 connections and 8 GiB (run-streams ladders hold one connection
per slot).

## What the install adds

- a results database `aspdb` on the toolkit's pgvector
- a non-admin LiteLLM key (alias `agent-sysperf-driver`)
- the driver's ServiceAccount, RBAC and router token in `agent-sandbox-system`
- the cluster contract, ConfigMap `asp-cluster-env` (in `agent-sysperf` and `agent-sandbox-system`), which every run reads
- a Pushgateway and Grafana dashboards
- the images, built once and loaded on every node (`agentsysperf.intel.com/images` node label)
- the dashboard behind the gateway's Keycloak sign-in

## Run a benchmark

From the AgentSysPerf checkout:

```bash
cd ext/agentsysperf
helm install smoke deploy/chart -n agent-sandbox-system -f deploy/chart/presets/smoke.yaml
helm install tb1 deploy/chart -n agent-sandbox-system -f deploy/chart/presets/tb2-gateway.yaml
```

The presets are described in `ext/agentsysperf/docs/TOOLKIT_ONBOARDING.md`. Runs started with
`helm install` are yours: teardown leaves their releases and Job pods.

## Teardown

`teardown agent-toolkit` (or `teardown asp_platform`) removes everything the install added and
revokes the LiteLLM key. It keeps the results database unless `agentsysperf_teardown_delete_results: true`.
38 changes: 35 additions & 3 deletions roles/agent_sandbox/tasks/install.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,31 @@
vars:
_authz_args: "- --cache-enabled=true\n - --authz-mode=tokenreview\n - --authz-tokenreview-require-token=true"

# Ambient mesh callers reach the router as HBONE on 15008, which the upstream policy does not admit.
- name: "agent_sandbox | Admit mesh callers to the sandbox-router (HBONE)"
kubernetes.core.k8s:
state: present
definition:
apiVersion: networking.k8s.io/v1
kind: NetworkPolicy
metadata:
name: eat-sandbox-router-mesh
namespace: "{{ agent_sandbox_namespace }}"
labels:
app.kubernetes.io/managed-by: agentic-ai-stack
spec:
podSelector:
matchLabels:
app.kubernetes.io/name: sandbox-router
app.kubernetes.io/component: sandbox-router
policyTypes: [Ingress]
ingress:
- from:
- namespaceSelector: {}
ports:
- {protocol: TCP, port: 15008}
Comment on lines +85 to +106
when: istio_enabled | default(false) | bool

- name: "agent_sandbox | Wait for sandbox-router to be ready"
kubernetes.core.k8s_info:
kind: Deployment
Expand Down Expand Up @@ -237,15 +262,22 @@
- "WarmPool : {{ kata_warm_pool_name }} (size={{ kata_warm_pool_size }})"
- "Verify : kubectl get sandbox,pod -n {{ agent_sandbox_namespace }} -l sandbox=kata"

# The toolkit's own pods only (controller, router, warm pools): other workloads share the namespace.
- name: "agent_sandbox | Wait for Agent Sandbox pods to be ready"
kubernetes.core.k8s_info:
kind: Pod
namespace: "{{ agent_sandbox_namespace }}"
register: _asb_pods
vars:
_asb_own: >-
{{ (_asb_pods.resources | default([]) | selectattr('metadata.labels.app', 'defined')
| selectattr('metadata.labels.app', 'in', ['agent-sandbox-controller', 'sandbox-router']) | list)
+ (_asb_pods.resources | default([]) | selectattr('metadata.labels', 'defined')
| selectattr('metadata.labels', 'contains', 'agents.x-k8s.io/warm-pool-sandbox') | list) }}
until: >-
_asb_pods.resources | default([]) | length > 0 and
(_asb_pods.resources | rejectattr('status.phase', 'in', ['Running', 'Succeeded']) | list | length == 0) and
(_asb_pods.resources | selectattr('status.phase', 'eq', 'Running')
_asb_own | length > 0 and
(_asb_own | rejectattr('status.phase', 'in', ['Running', 'Succeeded']) | list | length == 0) and
(_asb_own | selectattr('status.phase', 'eq', 'Running')
| map(attribute='status.containerStatuses') | flatten | rejectattr('ready') | list | length == 0)
retries: 60
delay: 10
Expand Down
45 changes: 45 additions & 0 deletions roles/asp_common/defaults/main.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
# Copyright (C) 2026 Intel Corporation
# SPDX-License-Identifier: Apache-2.0
---
# Shared by the asp_* components. Operators set the switch and settings in config.agent-toolkit.yaml.
agentsysperf_enabled: false
# The AgentSysPerf checkout that Toolkit Manager's init clones (repos.agent-toolkit.yaml); used unmodified.
agentsysperf_repo_dir: "{{ playbook_dir }}/../ext/agentsysperf"

agentsysperf_namespace: "agent-sysperf"
agentsysperf_sandbox_namespace: "{{ agent_sandbox_namespace | default('agent-sandbox-system') }}"

# build: on the nodes from ext/agentsysperf | registry: <agentsysperf_registry>/agentsysperf-{driver,dashboard}:<tag>
agentsysperf_image_source: "build"
agentsysperf_registry: ""
agentsysperf_image_tag: "" # empty: the checkout's git describe
agentsysperf_images_rebuild: false
agentsysperf_build_node: "" # empty: the first control-plane node
agentsysperf_buildkit_version: "v0.35.1"
agentsysperf_buildkit_sha256: "b248c2b91698aafef11818fe8b681dc5e341581f7d5676709ff45ca1f29b0408"
agentsysperf_buildkit_url: "https://github.com/moby/buildkit/releases/download/{{ agentsysperf_buildkit_version }}/buildkit-{{ agentsysperf_buildkit_version }}.linux-amd64.tar.gz"
agentsysperf_host_dir: "/var/lib/agentsysperf"

agentsysperf_llm_key_enabled: true
agentsysperf_llm_key_alias: "agent-sysperf-driver"
agentsysperf_rotate_llm_key: false
agentsysperf_llm_model: "{{ llm_services_autodeploy_models | default([], true) | first | default('', true) }}"

agentsysperf_driver_sa: "agentsysperf-driver"
agentsysperf_driver_node: ""
agentsysperf_sandbox_nodes: []
agentsysperf_sandbox_pool: ""
# Task-pod DNS without a proxy: public (agentsysperf_public_nameservers) | none
agentsysperf_sandbox_dns: "public"
agentsysperf_public_nameservers: []

agentsysperf_store_database: "aspdb"
agentsysperf_teardown_delete_results: false

agentsysperf_observability_enabled: "{{ observability_enabled | default(true) }}"

agentsysperf_dashboard_enabled: true
agentsysperf_dashboard_release: "agent-sysperf"
agentsysperf_dashboard_hostname: "agent-sysperf.{{ base_domain_name | default('inteltoolkits.ai') }}"
agentsysperf_dashboard_allowed_groups: []
agentsysperf_dashboard_oidc_client_id: "agentsysperf-dashboard"
125 changes: 125 additions & 0 deletions roles/asp_common/tasks/facts.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,125 @@
# Copyright (C) 2026 Intel Corporation
# SPDX-License-Identifier: Apache-2.0
---
# Library tasks (include_role tasks_from, public): what every asp_* component derives.
- name: "agentsysperf | facts | The AgentSysPerf checkout"
ansible.builtin.stat:
path: "{{ agentsysperf_repo_dir }}/deploy/chart/Chart.yaml"
register: _asp_checkout

# Teardown deletes by name and runs without it, so switching off never strands anything.
- name: "agentsysperf | facts | Install and validate need the checkout"
ansible.builtin.assert:
that: _asp_checkout.stat.exists or (component_action | default('install')) == 'teardown'
fail_msg: >-
agentsysperf_enabled is true, but {{ agentsysperf_repo_dir }} holds no AgentSysPerf checkout.
Clone it with: ./toolkit_manager.sh init agent-toolkit --env {{ env_name | default('local') }}
quiet: true

- name: "agentsysperf | facts | Source ref of the checkout"
ansible.builtin.command:
argv: [git, -C, "{{ agentsysperf_repo_dir | realpath }}", describe, --always, --dirty, --match, "v[0-9]*"]
register: _asp_describe
changed_when: false
failed_when: false
check_mode: false

- name: "agentsysperf | facts | Names"
ansible.builtin.set_fact:
_asp_repo: "{{ agentsysperf_repo_dir | realpath }}"
_asp_source_ref: "{{ _asp_describe.stdout | default('', true) | trim or 'unknown' }}"
# Also a label value: at most 63 of [A-Za-z0-9_.-], alphanumeric at both ends.
_asp_image_tag: >-
{{ (agentsysperf_image_tag or (_asp_describe.stdout | default('', true) | trim) or 'dev')
| regex_replace('[^A-Za-z0-9_.-]', '-') | truncate(63, true, '')
| regex_replace('^[^A-Za-z0-9]+|[^A-Za-z0-9]+$', '') }}
_asp_nodes: "{{ (groups['kube_control_plane'] | default([])) | union(groups['kube_node'] | default([])) }}"
_asp_istio: "{{ istio_enabled | default(true) | bool }}"
_asp_litellm_ns: "{{ litellm_namespace | default('litellm') }}"
_asp_pgvector_ns: "{{ pgvector_namespace | default('pgvector') }}"
_asp_nri_owner: >-
{{ 'toolkit' if (kubernetes_cpu_policy | default('nri-balloons')) == 'nri-balloons'
and (kubernetes_accelerator | default('cpu')) == 'cpu' else '' }}
_asp_proxy_url: "{{ https_proxy | default('', true) or http_proxy | default('', true) }}"

- name: "agentsysperf | facts | Images"
ansible.builtin.set_fact:
_asp_driver_image: >-
{{ (agentsysperf_registry ~ '/agentsysperf-driver:' ~ agentsysperf_image_tag)
if agentsysperf_image_source == 'registry' else ('agentsysperf-driver:' ~ _asp_image_tag) }}
_asp_dashboard_repository: >-
{{ (agentsysperf_registry ~ '/agentsysperf-dashboard') if agentsysperf_image_source == 'registry'
else 'agentsysperf-dashboard' }}
_asp_dashboard_tag: "{{ agentsysperf_image_tag if agentsysperf_image_source == 'registry' else _asp_image_tag }}"
# Built images exist only on the nodes asp_images loaded them into.
_asp_node_selector: >-
{{ {} if agentsysperf_image_source == 'registry' else {'agentsysperf.intel.com/images': _asp_image_tag} }}

- name: "agentsysperf | facts | Sandbox router"
kubernetes.core.k8s_info:
kind: Deployment
namespace: "{{ agentsysperf_sandbox_namespace }}"
name: "{{ item }}"
loop: [sandbox-router, sandbox-router-deployment]
register: _asp_routers

- name: "agentsysperf | facts | LiteLLM"
kubernetes.core.k8s_info:
kind: Pod
namespace: "{{ _asp_litellm_ns }}"
label_selectors: [app.kubernetes.io/name=litellm]
field_selectors: [status.phase=Running]
register: _asp_litellm_pods

- name: "agentsysperf | facts | Langfuse keys"
kubernetes.core.k8s_info:
kind: Secret
namespace: "{{ _asp_litellm_ns }}"
name: langfuse-api-keys
register: _asp_langfuse
no_log: true

- name: "agentsysperf | facts | The kubernetes Service"
kubernetes.core.k8s_info:
kind: Service
namespace: default
name: kubernetes
register: _asp_k8s_svc

# Task pods get the proxy by address: they have no resolver of their own.
- name: "agentsysperf | facts | Resolve the proxy"
ansible.builtin.command:
argv: [getent, ahostsv4, "{{ _asp_proxy_url | urlsplit('hostname') }}"]
register: _asp_proxy_lookup
changed_when: false
failed_when: false
check_mode: false
when:
- _asp_proxy_url | length > 0
- not ((_asp_proxy_url | urlsplit('hostname')) is match('^[0-9.]+$'))

- name: "agentsysperf | facts | Cluster facts"
vars:
_host: "{{ _asp_proxy_url | urlsplit('hostname') if _asp_proxy_url else '' }}"
_no_proxy_base: "{{ no_proxy | default('', true) }}"
ansible.builtin.set_fact:
_asp_router_v1: "{{ _asp_routers.results[0].resources | default([]) | length > 0 }}"
_asp_router_v0: "{{ _asp_routers.results[1].resources | default([]) | length > 0 }}"
_asp_has_litellm: "{{ _asp_litellm_pods.resources | default([]) | length > 0 }}"
_asp_has_langfuse: "{{ _asp_langfuse.resources | default([]) | length > 0 }}"
_asp_proxy_ips: >-
{{ [] if not _host
else ([_host] if _host is match('^[0-9.]+$')
else (_asp_proxy_lookup.stdout_lines | default([]) | map('split') | map('first') | unique | list)) }}
_asp_proxy_port: >-
{{ ((_asp_proxy_url | urlsplit('port')) or (443 if (_asp_proxy_url | urlsplit('scheme')) == 'https' else 80))
if _asp_proxy_url else 0 }}
_asp_no_proxy: >-
{{ ([_no_proxy_base, '.svc', '.svc.cluster.local', '.cluster.local']
+ (_asp_k8s_svc.resources | default([]) | map(attribute='spec.clusterIP') | list)) | select | join(',') }}
_asp_dashboard_url: "https://{{ agentsysperf_dashboard_hostname }}/"
_asp_grafana_url: >-
{{ ('https://' ~ base_domain_name ~ (observability_grafana_path | default('/grafana')))
if (routing_mode | default('subdomain')) == 'path'
else ('https://' ~ (observability_grafana_hostname | default('grafana.' ~ base_domain_name))) }}
_asp_langfuse_ui_url: "https://{{ langfuse_hostname | default('langfuse.' ~ base_domain_name) }}"
6 changes: 6 additions & 0 deletions roles/asp_dashboard/defaults/main.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# Copyright (C) 2026 Intel Corporation
# SPDX-License-Identifier: Apache-2.0
---
# Shared settings: asp_common/defaults/main.yaml.
asp_dashboard_port: 7870
asp_dashboard_helm_timeout: "600s"
Loading
Loading