From 174284b3a200d53238c2c51fa67b07fbceb836f3 Mon Sep 17 00:00:00 2001 From: AhmedSeemalK <100253923+AhmedSeemalK@users.noreply.github.com> Date: Mon, 30 Nov 2026 15:51:59 +0530 Subject: [PATCH 1/3] feat(agentsysperf): AgentSysPerf for the agent-toolkit layer Signed-off-by: AhmedSeemalK <100253923+AhmedSeemalK@users.noreply.github.com> --- configs/repos/repos.agent-toolkit.yaml | 8 +++ docs/getting-started/agent-toolkit.md | 16 ++++++ docs/reference/adding-solutions.md | 1 + src/tests/unit/test_init_source_only.py | 67 +++++++++++++++++++++++++ toolkit_manager.sh | 21 ++++++-- 5 files changed, 109 insertions(+), 4 deletions(-) create mode 100644 src/tests/unit/test_init_source_only.py diff --git a/configs/repos/repos.agent-toolkit.yaml b/configs/repos/repos.agent-toolkit.yaml index 6772a615..91170b78 100644 --- a/configs/repos/repos.agent-toolkit.yaml +++ b/configs/repos/repos.agent-toolkit.yaml @@ -22,3 +22,11 @@ repos: deployment_subdir: "" config_dir: "" default_flavour: "" + + # AgentSysPerf, used unmodified: agent-toolkit's asp_* roles set it up from ext/agentsysperf + # when agentsysperf_enabled is true. + - layer: "agentsysperf" + url: "https://github.com/intel/agentsysperf" + dest: "agentsysperf" + rev: "main" + source_only: true diff --git a/docs/getting-started/agent-toolkit.md b/docs/getting-started/agent-toolkit.md index 217acd58..26f5b149 100644 --- a/docs/getting-started/agent-toolkit.md +++ b/docs/getting-started/agent-toolkit.md @@ -76,6 +76,22 @@ Switches without a file named live in `env//config.agent-toolkit.yaml`. Co --- +## AgentSysPerf (optional) + +[AgentSysPerf](https://github.com/intel/agentsysperf) benchmarks agents on this cluster. It records scored Terminal-Bench runs and concurrency ladders with their system cost, and shows them on its own dashboard, Grafana and Langfuse. `init agent-toolkit` clones it, unmodified, into `ext/agentsysperf`; the Agent Toolkit sets it up when you switch it on: + +1. In `env//config.agent-toolkit.yaml`, set `agentsysperf_enabled: true`. An env created before this release has no AgentSysPerf section there: add the line, and run `init agent-toolkit` once more to clone it. +2. Install as usual: `./toolkit_manager.sh install agent-toolkit`. + +The dashboard is at `https://agent-sysperf./`, behind Keycloak sign-in for the platform admin group. Run a benchmark from the checkout: + +```bash +cd ext/agentsysperf +helm install smoke deploy/chart -n agent-sandbox-system -f deploy/chart/presets/smoke.yaml +``` + +Settings, what the install adds and teardown: [AgentSysPerf in the Agent Toolkit](https://github.com/intel/agent-toolkit/blob/main/docs/agentsysperf.md). + ## Teardown ```bash diff --git a/docs/reference/adding-solutions.md b/docs/reference/adding-solutions.md index 590f174b..fff23f31 100644 --- a/docs/reference/adding-solutions.md +++ b/docs/reference/adding-solutions.md @@ -83,6 +83,7 @@ repos: | `config_dir` | no (`""`) | Relative to `deployment_subdir`; holds one subdir per flavour. Empty → seed from `config.yaml` directly. | | `default_flavour` | no (`""`) | Flavour used when `--flavour` is omitted. | | `model_catalog` | no | Path **from the repo root** (not from `deployment_subdir`) to a `models.yaml` seeded into the env. | +| `source_only` | no (`false`) | `true`: clone and pin the repo only. It has no `roles/` or `config.yaml` of its own; another layer's roles use it from `ext/`. No `config..yaml` is seeded. | **A manifest is self-contained.** List every repo the layer needs, including its dependencies, each pinned separately. That keeps versions correlated per layer: a layer is diff --git a/src/tests/unit/test_init_source_only.py b/src/tests/unit/test_init_source_only.py new file mode 100644 index 00000000..7ebc1a34 --- /dev/null +++ b/src/tests/unit/test_init_source_only.py @@ -0,0 +1,67 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- +# Copyright (C) 2026 Intel Corporation +# SPDX-License-Identifier: Apache-2.0 +# +# Unit tests for source_only manifest entries: init pins such a repo like any other but +# seeds no config..yaml, and the installer then loads no config for it. +# +# python3 -m pytest src/tests/unit + +import pathlib +import shutil +import subprocess + +import pytest +import yaml + +INSTALLER = pathlib.Path(__file__).resolve().parents[3] / "toolkit_manager.sh" + +pytestmark = pytest.mark.skipif(shutil.which("yq") is None, reason="the installer's helpers need yq v4") + + +def run(tmp_path, body): + script = (f'source "{INSTALLER}"\n' + f'EXT_DIR="{tmp_path}/ext" ENV_ROOT="{tmp_path}/env" ENV_DIR="{tmp_path}/env/t" ENV_NAME=t\n' + f'mkdir -p "$EXT_DIR" "$ENV_DIR"\n' + f'{body}\n') + env = {"PATH": f"/usr/bin:/bin:{pathlib.Path(shutil.which('yq')).parent}", "HOME": str(tmp_path)} + return subprocess.run(["bash", "-c", script], capture_output=True, text=True, env=env, timeout=60) + + +def manifest(tmp_path, **source_only): + entries = [{"layer": "lib", "url": "https://example.invalid/lib", "dest": "lib", "rev": "v1", **source_only}] + path = tmp_path / "repos.t.yaml" + path.write_text(yaml.safe_dump({"repos": entries})) + return path + + +@pytest.mark.parametrize("flag,column", [({}, "false"), ({"source_only": True}, "true")]) +def test_manifest_rows_carry_source_only(tmp_path, flag, column): + out = run(tmp_path, f'manifest_rows "{manifest(tmp_path, **flag)}"') + assert out.returncode == 0, out.stderr + assert out.stdout.strip().split("|")[-1] == column + + +def test_source_only_repo_is_recorded_and_seeds_no_config(tmp_path): + (tmp_path / "ext" / "lib").mkdir(parents=True) # cloned: no config.yaml, no roles/ + mf = manifest(tmp_path, source_only=True) + out = run(tmp_path, f'sol="$ENV_DIR/.solutions.yaml"; new="$ENV_DIR/new.yaml"; _solutions_create "$new"\n' + f'while IFS= read -r row; do _init_seed_layer "$row" t t "" false "$sol" "$new"; done ' + f'< <(manifest_rows "{mf}")\n' + f'mv "$new" "$sol"; solution_configs') + assert out.returncode == 0, out.stderr + assert not (tmp_path / "env" / "t" / "config.lib.yaml").exists() + record = yaml.safe_load((tmp_path / "env" / "t" / ".solutions.yaml").read_text()) + (entry,) = [layer for layer in record["layers"] if layer["name"] == "lib"] + assert entry["rev"] == "v1" and entry["repo"] == "lib" and not entry["config"] + assert "config.lib.yaml" not in out.stdout + + +def test_a_repo_without_config_still_needs_source_only(tmp_path): + (tmp_path / "ext" / "lib").mkdir(parents=True) + mf = manifest(tmp_path) + out = run(tmp_path, f'new="$ENV_DIR/new.yaml"; _solutions_create "$new"\n' + f'_init_seed_layer "$(manifest_rows "{mf}")" t t "" false "$ENV_DIR/.solutions.yaml" "$new"') + assert out.returncode != 0 + assert "nothing to seed config.lib.yaml" in out.stdout + out.stderr diff --git a/toolkit_manager.sh b/toolkit_manager.sh index 6df7803f..b8cd7a04 100755 --- a/toolkit_manager.sh +++ b/toolkit_manager.sh @@ -591,7 +591,8 @@ manifest_rows() { [[ -n "${1:-}" && -f "$1" ]] || return 0 # layer with no manifest → no repos yq -r '.repos[] | [(.layer // ""), (.url // ""), (.dest // ""), (.rev // "main"), (.deployment_subdir // ""), (.config_dir // ""), - (.default_flavour // ""), (.model_catalog // "")] | join("|")' \ + (.default_flavour // ""), (.model_catalog // ""), + (.source_only // false)] | join("|")' \ "$1" 2>/dev/null } @@ -817,9 +818,13 @@ ensure_repos() { local layer_name url dest rev subdir _cfgdir _flav _catalog repo roles_dir if [[ "$mode" == "--clone" ]]; then local mf; mf=$(require_layer "$target") - while IFS='|' read -r layer_name url dest rev subdir _cfgdir _flav _catalog; do + while IFS='|' read -r layer_name url dest rev subdir _cfgdir _flav _catalog source_only; do [[ -z "$url" || -z "$dest" ]] && continue repo="${EXT_DIR}/${dest}" + if [[ "$source_only" == "true" ]]; then + [[ -d "${repo}/.git" ]] || clone_repo "$url" "$repo" "$rev" "$dest" + continue + fi roles_dir="${repo}${subdir:+/$subdir}/roles" [[ -d "$roles_dir" ]] || clone_repo "$url" "$repo" "$rev" "$dest" [[ -d "$roles_dir" ]] \ @@ -1090,10 +1095,18 @@ _init_check_flavour() { # ($sol_new), so a re-init preserves fields it cannot recompute. _init_seed_layer() { local row="$1" name="$2" layer="$3" flavour="$4" upgrade="$5" sol="$6" sol_new="$7" - local layer_name url dest rev subdir config_dir default_flavour catalog - IFS='|' read -r layer_name url dest rev subdir config_dir default_flavour catalog <<< "$row" + local layer_name url dest rev subdir config_dir default_flavour catalog source_only + IFS='|' read -r layer_name url dest rev subdir config_dir default_flavour catalog source_only <<< "$row" [[ -z "$layer_name" || -z "$dest" ]] && return 0 + # Source for another layer's roles: pinned and re-pinned like any repo, nothing seeded. + if [[ "$source_only" == "true" ]]; then + SL_NAME="$layer_name" SL_CONFIG="" SL_SEEDED_FROM="" SL_REPO="$dest" SL_URL="$url" \ + SL_REV="$rev" SL_MC="" SL_BY="$layer" _solutions_upsert "$sol_new" + _init_warn_cross_env "$name" "$layer_name" "$dest" "$rev" + return 0 + fi + local repo_dir="${EXT_DIR}/${dest}${subdir:+/$subdir}" local target="${ENV_DIR}/config.${layer_name}.yaml" local seeded_from; seeded_from=$(_solutions_get "$sol" "$layer_name" seeded_from) From 594f69a5491a346ccc2f03495262f652320a2827 Mon Sep 17 00:00:00 2001 From: AhmedSeemalK <100253923+AhmedSeemalK@users.noreply.github.com> Date: Wed, 2 Dec 2026 21:12:28 +0530 Subject: [PATCH 2/3] Updated Agent Sysperf Integration files Signed-off-by: AhmedSeemalK <100253923+AhmedSeemalK@users.noreply.github.com> --- README.md | 11 +++ configs/repos/repos.agent-sysperf.yaml | 34 ++++++++ configs/repos/repos.agent-toolkit.yaml | 8 -- docs/README.md | 2 + docs/getting-started/agent-sysperf.md | 106 ++++++++++++++++++++++++ docs/getting-started/agent-toolkit.md | 16 ---- docs/reference/adding-solutions.md | 1 - src/tests/unit/test_init_source_only.py | 67 --------------- toolkit_manager.sh | 21 +---- 9 files changed, 157 insertions(+), 109 deletions(-) create mode 100644 configs/repos/repos.agent-sysperf.yaml create mode 100644 docs/getting-started/agent-sysperf.md delete mode 100644 src/tests/unit/test_init_source_only.py diff --git a/README.md b/README.md index 94ce91b2..55056674 100644 --- a/README.md +++ b/README.md @@ -181,6 +181,17 @@ Keep the admin key to yourself; give each application or agent its own virtual k More: [Getting Started with Intel® Chatbot Toolkit](docs/getting-started/chatbot-toolkit.md) (prerequisites, sign-in, pipelines). +### AgentSysPerf + +**What you get:** agent benchmarks on the agent toolkit (scored Terminal-Bench runs, concurrency ladders) with their system cost, on a dashboard at `https://agent-sysperf.inteltoolkits.ai` and in Grafana and Langfuse. + +```bash +./toolkit_manager.sh init agent-sysperf +./toolkit_manager.sh install agent-sysperf +``` + +More: [Getting Started with AgentSysPerf](docs/getting-started/agent-sysperf.md) (settings to set before the first install, running a benchmark, known limitations). + --- ## Remove or start again diff --git a/configs/repos/repos.agent-sysperf.yaml b/configs/repos/repos.agent-sysperf.yaml new file mode 100644 index 00000000..4b940847 --- /dev/null +++ b/configs/repos/repos.agent-sysperf.yaml @@ -0,0 +1,34 @@ +--- +# Copyright (C) 2026 Intel Corporation +# SPDX-License-Identifier: Apache-2.0 +# ============================================================================= +# Layer manifest — agent-sysperf (AgentSysPerf agent benchmarking) +# ============================================================================= +# inference and agent-toolkit mirror repos.agent-toolkit.yaml, so an env with both layers +# shares one checkout of each. + +repos: + - layer: "inference" + url: "https://github.com/intel/enterprise-inference" + dest: "enterprise.ai-inference" + rev: "main" + deployment_subdir: "" + config_dir: "" + default_flavour: "" + model_catalog: "model_manager/models.yaml" + + - layer: "agent-toolkit" + url: "https://github.com/intel/enterprise-agent-toolkit" + dest: "enterprise.agent-toolkit" + rev: "main" + deployment_subdir: "" + config_dir: "" + default_flavour: "" + + - layer: "agent-sysperf" + url: "https://github.com/intel/agentsysperf" + dest: "agentsysperf" + rev: "main" + deployment_subdir: "deploy/toolkit-manager" + config_dir: "" + default_flavour: "" diff --git a/configs/repos/repos.agent-toolkit.yaml b/configs/repos/repos.agent-toolkit.yaml index 91170b78..6772a615 100644 --- a/configs/repos/repos.agent-toolkit.yaml +++ b/configs/repos/repos.agent-toolkit.yaml @@ -22,11 +22,3 @@ repos: deployment_subdir: "" config_dir: "" default_flavour: "" - - # AgentSysPerf, used unmodified: agent-toolkit's asp_* roles set it up from ext/agentsysperf - # when agentsysperf_enabled is true. - - layer: "agentsysperf" - url: "https://github.com/intel/agentsysperf" - dest: "agentsysperf" - rev: "main" - source_only: true diff --git a/docs/README.md b/docs/README.md index 28f96650..6bada9ac 100644 --- a/docs/README.md +++ b/docs/README.md @@ -14,6 +14,7 @@ Start with the table. Each row is one job and one page. The sections under it ar | Deploy a model and call it | [Deploy a model](getting-started/deploy-models.md) | | Install the Intel® Agent Toolkit | [Getting Started with the Agent Toolkit](getting-started/agent-toolkit.md) | | Install the Intel® Chatbot Toolkit | [Getting Started with the Chatbot Toolkit](getting-started/chatbot-toolkit.md) | +| Benchmark agents on the Agent Toolkit | [Getting Started with AgentSysPerf](getting-started/agent-sysperf.md) | | Install step by step, with a bastion host or a chosen auth type | [Deployment Guide](deployment/install-platform.md) | | Spread the cluster over several machines, or use my own cluster | [Multi-node and BYO cluster](deployment/multi-node.md) | | Add or remove nodes on a running cluster | [Node scaling](deployment/node-scaling.md) | @@ -60,6 +61,7 @@ Do these in order: prerequisites, getting started, then a model. | [Deploy a model](getting-started/deploy-models.md) | Deploying, accessing and managing models with `model-manager` | | [Getting Started with the Agent Toolkit](getting-started/agent-toolkit.md) | Agent sandboxes, memory stores and the LiteLLM gateway on top of inference | | [Getting Started with the Chatbot Toolkit](getting-started/chatbot-toolkit.md) | Vector database, document ingestion and chat UI on top of inference | +| [Getting Started with AgentSysPerf](getting-started/agent-sysperf.md) | Agent benchmarks (Terminal-Bench, concurrency ladders) with their system cost, on top of the agent toolkit | ## Other ways to install diff --git a/docs/getting-started/agent-sysperf.md b/docs/getting-started/agent-sysperf.md new file mode 100644 index 00000000..a4d6973c --- /dev/null +++ b/docs/getting-started/agent-sysperf.md @@ -0,0 +1,106 @@ +# Getting Started with AgentSysPerf + +[AgentSysPerf](https://github.com/intel/agentsysperf) benchmarks agents on the Intel® Agent Toolkit. It records scored +Terminal-Bench runs and concurrency ladders with their system cost, and shows them on its own dashboard, in Grafana and +in Langfuse. The `agent-sysperf` layer installs it on top of the agent toolkit; its code comes from the agentsysperf +repository (`deploy/toolkit-manager/`). + +## Prerequisites + +- What the [Intel® Agent Toolkit](agent-toolkit.md) needs. The layer installs the toolkit first, with pgvector and + Agent Sandbox on. +- pgvector with at least 600 connections (a concurrency ladder holds one per slot). The layer's preflight stops below + that and names the setting. +- Internet for the task pods, which install their runtime with `pip` at start: either direct, or through the site + proxy set in `global_config.yaml`. + +## Quick Start + +```bash +./toolkit_manager.sh init agent-sysperf +``` + +Then, before the first install: + +- `env/local/config.agent-toolkit.yaml`: + ```yaml + pgvector_parameters: {max_connections: "600", shared_buffers: "1GB"} + pgvector_resources: {requests: {cpu: "1", memory: 2Gi}, limits: {cpu: "8", memory: 8Gi}} + ``` +- `env/local/config.agent-sysperf.yaml`: how task pods reach the internet. `agentsysperf_task_egress: direct` with + `agentsysperf_public_nameservers` (up to three resolvers the site lets DNS out to), or `agentsysperf_task_egress: proxy` + behind a site proxy. + +```bash +./toolkit_manager.sh install agent-sysperf +``` + +The dashboard is at `https://agent-sysperf./`, behind Keycloak sign-in for the platform admin group. + +Run a benchmark from the AgentSysPerf checkout: + +```bash +export KUBECONFIG=$PWD/env/local/kubeconfig.yaml +cd ext/agentsysperf +helm install smoke deploy/chart -n agent-sandbox-system -f deploy/chart/presets/smoke.yaml +helm install tb2 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 are yours: `helm uninstall ` +when done; results stay in the store. + +## Teardown + +```bash +./toolkit_manager.sh teardown agent-sysperf +``` + +It removes everything the layer installed: the dashboard and its Keycloak client, the images and BuildKit on every node, +the `agent-sysperf` namespace, the contract and Secrets, the driver RBAC, the Pushgateway and Grafana dashboards, the +results database `aspdb` and the LiteLLM key alias `agent-sysperf-driver`. Export results you want to keep first. + +## User Guide + +### What Gets Installed + +| Component | What it does | +|---|---| +| `asp_platform` | Preflight; the results database `aspdb` on pgvector and Secret `asp-pg-dsn`; a non-admin LiteLLM key (`asp-litellm-key`); the driver's ServiceAccount, RBAC and router token (`asp-runner`); Langfuse keys, a Pushgateway and Grafana dashboards; the cluster contract (ConfigMap `asp-cluster-env`) every run reads | +| `asp_images` | Builds the driver and dashboard images once with a pinned BuildKit, loads them on every node, labels the nodes (`agentsysperf.intel.com/images`) | +| `asp_dashboard` | The dashboard, published on the gateway with Keycloak sign-in | + +The `agent-sysperf` namespace is in the ambient mesh. Task pods are not: AgentSysPerf labels them +`istio.io/dataplane-mode: none`. + +### Settings + +In `env//config.agent-sysperf.yaml`: + +| Key | Default | Purpose | +|---|---|---| +| `agentsysperf_task_egress` | `direct` | `direct` (with `agentsysperf_public_nameservers`) or `proxy` (the site proxy, by address) | +| `agentsysperf_image_source` | `build` | `build` on the nodes, or `registry` with `agentsysperf_registry` and `agentsysperf_image_tag` | +| `agentsysperf_dashboard_enabled` | `true` | The dashboard and its route | +| `agentsysperf_dashboard_allowed_groups` | `[]` | Keycloak groups that may sign in; 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 a node | +| `agentsysperf_sandbox_nodes` | `[]` | Task-pod nodes for run-streams ladders; empty: the driver's node | + +### Known Limitations + +- **Measurement-grade CPU pinning** (DCAIDSE8-2196, DCAIDSE8-2197): runs use the toolkit's NRI policies. + AgentSysPerf's `apply.sh` stays a manual step. +- **No internet and no proxy:** task pods cannot install their runtime. Use the site proxy until AgentSysPerf ships a + prebuilt runtime or a local package index. +- **Images are built on the nodes** until AgentSysPerf publishes them; then set `agentsysperf_image_source: registry`. + Building copies the images to the other nodes one at a time, through the installer host. +- **Ladder rungs above the driver's CPU set are refused** by AgentSysPerf: the driver pod gets its CPUs from an NRI + balloon, and a rung may not run more slots than it has CPUs. +- **Failed run pods block toolkit re-installs:** the agent-toolkit install waits for every pod in + `agent-sandbox-system`. `helm uninstall` failed runs before installing again. +- **The router must admit mesh traffic** (TCP 15008, DCAIDSE8-2602); the preflight stops on an agent-toolkit release + without it. +- **Not supported:** OpenShift, `routing_mode: path` while the dashboard is on, the dashboard's "Run an experiment" + page (its launcher needs an ingress-nginx login), and AgentSysPerf's hardware-counter layers (they need its role + observers and node kernel settings). +- **Not validated:** rack-scale clusters. diff --git a/docs/getting-started/agent-toolkit.md b/docs/getting-started/agent-toolkit.md index 26f5b149..217acd58 100644 --- a/docs/getting-started/agent-toolkit.md +++ b/docs/getting-started/agent-toolkit.md @@ -76,22 +76,6 @@ Switches without a file named live in `env//config.agent-toolkit.yaml`. Co --- -## AgentSysPerf (optional) - -[AgentSysPerf](https://github.com/intel/agentsysperf) benchmarks agents on this cluster. It records scored Terminal-Bench runs and concurrency ladders with their system cost, and shows them on its own dashboard, Grafana and Langfuse. `init agent-toolkit` clones it, unmodified, into `ext/agentsysperf`; the Agent Toolkit sets it up when you switch it on: - -1. In `env//config.agent-toolkit.yaml`, set `agentsysperf_enabled: true`. An env created before this release has no AgentSysPerf section there: add the line, and run `init agent-toolkit` once more to clone it. -2. Install as usual: `./toolkit_manager.sh install agent-toolkit`. - -The dashboard is at `https://agent-sysperf./`, behind Keycloak sign-in for the platform admin group. Run a benchmark from the checkout: - -```bash -cd ext/agentsysperf -helm install smoke deploy/chart -n agent-sandbox-system -f deploy/chart/presets/smoke.yaml -``` - -Settings, what the install adds and teardown: [AgentSysPerf in the Agent Toolkit](https://github.com/intel/agent-toolkit/blob/main/docs/agentsysperf.md). - ## Teardown ```bash diff --git a/docs/reference/adding-solutions.md b/docs/reference/adding-solutions.md index fff23f31..590f174b 100644 --- a/docs/reference/adding-solutions.md +++ b/docs/reference/adding-solutions.md @@ -83,7 +83,6 @@ repos: | `config_dir` | no (`""`) | Relative to `deployment_subdir`; holds one subdir per flavour. Empty → seed from `config.yaml` directly. | | `default_flavour` | no (`""`) | Flavour used when `--flavour` is omitted. | | `model_catalog` | no | Path **from the repo root** (not from `deployment_subdir`) to a `models.yaml` seeded into the env. | -| `source_only` | no (`false`) | `true`: clone and pin the repo only. It has no `roles/` or `config.yaml` of its own; another layer's roles use it from `ext/`. No `config..yaml` is seeded. | **A manifest is self-contained.** List every repo the layer needs, including its dependencies, each pinned separately. That keeps versions correlated per layer: a layer is diff --git a/src/tests/unit/test_init_source_only.py b/src/tests/unit/test_init_source_only.py deleted file mode 100644 index 7ebc1a34..00000000 --- a/src/tests/unit/test_init_source_only.py +++ /dev/null @@ -1,67 +0,0 @@ -#!/usr/bin/env python -# -*- coding: utf-8 -*- -# Copyright (C) 2026 Intel Corporation -# SPDX-License-Identifier: Apache-2.0 -# -# Unit tests for source_only manifest entries: init pins such a repo like any other but -# seeds no config..yaml, and the installer then loads no config for it. -# -# python3 -m pytest src/tests/unit - -import pathlib -import shutil -import subprocess - -import pytest -import yaml - -INSTALLER = pathlib.Path(__file__).resolve().parents[3] / "toolkit_manager.sh" - -pytestmark = pytest.mark.skipif(shutil.which("yq") is None, reason="the installer's helpers need yq v4") - - -def run(tmp_path, body): - script = (f'source "{INSTALLER}"\n' - f'EXT_DIR="{tmp_path}/ext" ENV_ROOT="{tmp_path}/env" ENV_DIR="{tmp_path}/env/t" ENV_NAME=t\n' - f'mkdir -p "$EXT_DIR" "$ENV_DIR"\n' - f'{body}\n') - env = {"PATH": f"/usr/bin:/bin:{pathlib.Path(shutil.which('yq')).parent}", "HOME": str(tmp_path)} - return subprocess.run(["bash", "-c", script], capture_output=True, text=True, env=env, timeout=60) - - -def manifest(tmp_path, **source_only): - entries = [{"layer": "lib", "url": "https://example.invalid/lib", "dest": "lib", "rev": "v1", **source_only}] - path = tmp_path / "repos.t.yaml" - path.write_text(yaml.safe_dump({"repos": entries})) - return path - - -@pytest.mark.parametrize("flag,column", [({}, "false"), ({"source_only": True}, "true")]) -def test_manifest_rows_carry_source_only(tmp_path, flag, column): - out = run(tmp_path, f'manifest_rows "{manifest(tmp_path, **flag)}"') - assert out.returncode == 0, out.stderr - assert out.stdout.strip().split("|")[-1] == column - - -def test_source_only_repo_is_recorded_and_seeds_no_config(tmp_path): - (tmp_path / "ext" / "lib").mkdir(parents=True) # cloned: no config.yaml, no roles/ - mf = manifest(tmp_path, source_only=True) - out = run(tmp_path, f'sol="$ENV_DIR/.solutions.yaml"; new="$ENV_DIR/new.yaml"; _solutions_create "$new"\n' - f'while IFS= read -r row; do _init_seed_layer "$row" t t "" false "$sol" "$new"; done ' - f'< <(manifest_rows "{mf}")\n' - f'mv "$new" "$sol"; solution_configs') - assert out.returncode == 0, out.stderr - assert not (tmp_path / "env" / "t" / "config.lib.yaml").exists() - record = yaml.safe_load((tmp_path / "env" / "t" / ".solutions.yaml").read_text()) - (entry,) = [layer for layer in record["layers"] if layer["name"] == "lib"] - assert entry["rev"] == "v1" and entry["repo"] == "lib" and not entry["config"] - assert "config.lib.yaml" not in out.stdout - - -def test_a_repo_without_config_still_needs_source_only(tmp_path): - (tmp_path / "ext" / "lib").mkdir(parents=True) - mf = manifest(tmp_path) - out = run(tmp_path, f'new="$ENV_DIR/new.yaml"; _solutions_create "$new"\n' - f'_init_seed_layer "$(manifest_rows "{mf}")" t t "" false "$ENV_DIR/.solutions.yaml" "$new"') - assert out.returncode != 0 - assert "nothing to seed config.lib.yaml" in out.stdout + out.stderr diff --git a/toolkit_manager.sh b/toolkit_manager.sh index b8cd7a04..6df7803f 100755 --- a/toolkit_manager.sh +++ b/toolkit_manager.sh @@ -591,8 +591,7 @@ manifest_rows() { [[ -n "${1:-}" && -f "$1" ]] || return 0 # layer with no manifest → no repos yq -r '.repos[] | [(.layer // ""), (.url // ""), (.dest // ""), (.rev // "main"), (.deployment_subdir // ""), (.config_dir // ""), - (.default_flavour // ""), (.model_catalog // ""), - (.source_only // false)] | join("|")' \ + (.default_flavour // ""), (.model_catalog // "")] | join("|")' \ "$1" 2>/dev/null } @@ -818,13 +817,9 @@ ensure_repos() { local layer_name url dest rev subdir _cfgdir _flav _catalog repo roles_dir if [[ "$mode" == "--clone" ]]; then local mf; mf=$(require_layer "$target") - while IFS='|' read -r layer_name url dest rev subdir _cfgdir _flav _catalog source_only; do + while IFS='|' read -r layer_name url dest rev subdir _cfgdir _flav _catalog; do [[ -z "$url" || -z "$dest" ]] && continue repo="${EXT_DIR}/${dest}" - if [[ "$source_only" == "true" ]]; then - [[ -d "${repo}/.git" ]] || clone_repo "$url" "$repo" "$rev" "$dest" - continue - fi roles_dir="${repo}${subdir:+/$subdir}/roles" [[ -d "$roles_dir" ]] || clone_repo "$url" "$repo" "$rev" "$dest" [[ -d "$roles_dir" ]] \ @@ -1095,18 +1090,10 @@ _init_check_flavour() { # ($sol_new), so a re-init preserves fields it cannot recompute. _init_seed_layer() { local row="$1" name="$2" layer="$3" flavour="$4" upgrade="$5" sol="$6" sol_new="$7" - local layer_name url dest rev subdir config_dir default_flavour catalog source_only - IFS='|' read -r layer_name url dest rev subdir config_dir default_flavour catalog source_only <<< "$row" + local layer_name url dest rev subdir config_dir default_flavour catalog + IFS='|' read -r layer_name url dest rev subdir config_dir default_flavour catalog <<< "$row" [[ -z "$layer_name" || -z "$dest" ]] && return 0 - # Source for another layer's roles: pinned and re-pinned like any repo, nothing seeded. - if [[ "$source_only" == "true" ]]; then - SL_NAME="$layer_name" SL_CONFIG="" SL_SEEDED_FROM="" SL_REPO="$dest" SL_URL="$url" \ - SL_REV="$rev" SL_MC="" SL_BY="$layer" _solutions_upsert "$sol_new" - _init_warn_cross_env "$name" "$layer_name" "$dest" "$rev" - return 0 - fi - local repo_dir="${EXT_DIR}/${dest}${subdir:+/$subdir}" local target="${ENV_DIR}/config.${layer_name}.yaml" local seeded_from; seeded_from=$(_solutions_get "$sol" "$layer_name" seeded_from) From 65234220916a20799ab1c604d7d2b5f015db3143 Mon Sep 17 00:00:00 2001 From: AhmedSeemalK <100253923+AhmedSeemalK@users.noreply.github.com> Date: Wed, 2 Dec 2026 21:13:50 +0530 Subject: [PATCH 3/3] Update agent-sysperf.md Signed-off-by: AhmedSeemalK <100253923+AhmedSeemalK@users.noreply.github.com> --- docs/getting-started/agent-sysperf.md | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/docs/getting-started/agent-sysperf.md b/docs/getting-started/agent-sysperf.md index a4d6973c..385d797e 100644 --- a/docs/getting-started/agent-sysperf.md +++ b/docs/getting-started/agent-sysperf.md @@ -102,5 +102,4 @@ In `env//config.agent-sysperf.yaml`: without it. - **Not supported:** OpenShift, `routing_mode: path` while the dashboard is on, the dashboard's "Run an experiment" page (its launcher needs an ingress-nginx login), and AgentSysPerf's hardware-counter layers (they need its role - observers and node kernel settings). -- **Not validated:** rack-scale clusters. + observers and node kernel settings). \ No newline at end of file