Thanks for helping improve NetOpsBench. This project is an early-stage DCN troubleshooting benchmark, so focused changes with clear behavior, tests, and documentation are especially valuable.
git clone https://github.com/NetX-lab/NetOpsBench.git
cd NetOpsBench
python -m venv .venv
source .venv/bin/activate
pip install -e ".[dev,agent]"Real lab runs also require Docker, Containerlab, GNU Parallel, and non-interactive access to the required Docker and Containerlab commands. For the runtime path, start from docs/content/docs/debug-operate/observability.mdx.
The documentation website is now maintained from docs. To preview it locally:
cd docs
npm install
npm run build
npm run startnpm run start serves the static export from docs/out and automatically retries on the next free port if the requested port is busy. You can still request a preferred port with npm run start -- --port 3010.
Runtime secrets are loaded from environment variables or a repo-root .env file. Do not commit .env.
Common variables:
MINIMAX_API_KEY,OPENAI_API_KEY,ZHIPU_API_KEY,DEEPSEEK_API_KEY,KIMI_API_KEY— provider keys for example agentsNETOPSBENCH_INFLUXDB_URL,NETOPSBENCH_INFLUXDB_TOKEN,NETOPSBENCH_INFLUXDB_ORG,NETOPSBENCH_INFLUXDB_BUCKETNETOPSBENCH_LOG_LEVEL— logging verbosity, for exampleDEBUGNETOPSBENCH_NO_SUDO=1— suppress sudo in CI or tests
See .env.example for the fuller reference.
Prefer public APIs in new user-facing code:
netopsbench.sdk.*netopsbench.agents.baseexamples/*scripts/*
Treat netopsbench.platform.* as internal unless you are intentionally changing runtime, scenario execution, observability, or fault-injection internals. The main reference pages are:
- docs/content/docs/quickstart.mdx
- docs/content/docs/architecture/system-overview.mdx
- docs/content/docs/run-benchmarks/methodology.mdx
Run the main non-real regression suite before submitting changes:
pytest -q tests/test_fault_registry.py \
tests/test_scenario_schema.py \
tests/test_scenario_commands.py \
tests/test_commands_cli.py \
tests/test_route_parser_and_static_route.py \
tests/test_runtime_config_consistency.py \
tests/test_topology_fail_fast.py \
tests/test_platform_toolkit_fastmcp.py \
tests/test_example_agents.py \
tests/test_agent_base_contract.pyTests marked real require a deployed lab and external services:
pytest -m realIf you modify the docs site, also validate it with:
cd docs
npm run build- Custom agents: docs/content/docs/build-your-agent/custom-agents.mdx
- Python API guide: docs/content/docs/build-your-agent/python-api-guide.mdx
- Custom faults (external/project-local): docs/content/docs/extend-netopsbench/custom-faults.mdx
- Benchmark methodology: docs/content/docs/run-benchmarks/methodology.mdx
- Scenario format: scenarios/README.md
When adding a fault to the core distribution rather than an external pack:
- Add inject/recover handlers under
netopsbench/platform/faults/handlers/<category>.py. - Register a
FaultSpecin the matchingnetopsbench/platform/faults/builtin/<category>_specs.py(setrequires_interface/requires_prefix/required_parametersas needed). - Update the scenario parser in
netopsbench/platform/scenario/parser.pyif the fault introduces new fields. - Add a scenario example under
scenarios/and tests undertests/. - Update the relevant extension docs under docs/content/docs/extend-netopsbench.
Good PRs are small, explain the behavior change, include relevant tests, and update docs when public interfaces or benchmark behavior change.
If you change package ownership, script entrypoints, public import paths, runtime defaults, or documentation structure, update the related entry points in the same PR:
If a change affects benchmark behavior, runtime defaults, or import boundaries, call that out explicitly in the PR description.