Skip to content

benchmarking/automation: add nighthawk-egress capacity suites - #3630

Closed
Yuan Gao (ygao-g) wants to merge 13 commits into
agent-substrate:mainfrom
ygao-g:nighthawk-egress-3-automation
Closed

Yuan Gao (ygao-g) wants to merge 13 commits into
agent-substrate:mainfrom
ygao-g:nighthawk-egress-3-automation

Conversation

@ygao-g

@ygao-g Yuan Gao (ygao-g) commented Nov 4, 2026 •

Copy link
Copy Markdown
Collaborator

Part of #3624 (Stage 1, item 4): run the egress capacity benchmark from benchmarking/automation.

Stacks on #3628, #3627 and #3629, in that order; review the last three commits.

What changes

  • testtypes/nighthawk_egress.py: the test type. Validates the numeric and duration knobs up front, shapes atenet-egress CPU, deploys nighthawk-server and nighthawk/tester in pre_test, tears them down after.
  • orchestrator.py: deploy_substrate takes extra ingress SPIFFE ids, so traffic-driver-invoker is allowed only for egress suites; teardown asks each test type for its workloads instead of always running the shared deploy.sh --delete.
  • tests.yaml: four suites, egress_gatewaycap_{http,mitm,passthrough}_1cpu and egress_gatewaycap_http_2cpu.
  • Automation Dockerfile copies the egress runner Job template; README documents the CI flow.

Review guide

  1. Test type and the testtypes registry.
  2. Automation README.
  3. Orchestrator changes, tests.yaml, Dockerfile, and the orchestrator unit tests.

Testing

hack/verify/benchmarking-python.sh green (automation 69, egress 24, ingress 13).

AI use: AI-assisted (Claude Code) for the diff, the commit split and the test runs; I reviewed the diff.

  • Tests pass
  • Docs updated

@ygao-g

Yuan Gao (ygao-g) commented Nov 4, 2026 •

Copy link
Copy Markdown
Collaborator Author

Reviewer notes (Stage 1 stack guide)

Stack position: Stacks on #3629 (991cdf5db), after #3628 and #3627. Review the last three commits (662d775f9..9160d73b2).

Commit-by-commit checks (9160d73b2):

  1. 662d775f9 (testtypes/nighthawk_egress.py, testtypes/__init__.py): Check validate (rejects bool, negative, and unknown knobs), EXTRA_INGRESS_SPIFFE_IDS, and pre_test ordering (cluster_setup.py shape, setup-e2e-egress-tls-kind.sh with KUBECTL_CONTEXT, deploy.sh, deploy-traffic-driver.sh).
  2. 1de518d3e: benchmarking/automation/README.md and benchmarking/nighthawk-egress/README.md.
  3. 9160d73b2 (orchestrator.py, tests.yaml, Dockerfile, test_orchestrator.py): Check deploy_substrate extra SPIFFE ID wiring, the four suites in tests.yaml (egress_gatewaycap_{http,mitm,passthrough}_1cpu and egress_gatewaycap_http_2cpu), and teardown_test_workloads. Cross-cutting behavior change: teardown now dispatches through USES_SHARED_WORKLOADS and per-type teardown_workloads for locust, nighthawk-ingress, and nighthawk-egress.

Local check:

hack/verify/benchmarking-python.sh

@ygao-g
Yuan Gao (ygao-g) force-pushed the nighthawk-egress-3-automation branch 2 times, most recently from 7227f00 to ac6b856 Compare November 5, 2026 22:14
…f nighthawk-ingress

Move nighthawk-ingress/output.py to nighthawk_common unchanged so
nighthawk-egress can reuse it. The ingress Dockerfile copies the package
into the image and the ingress tests put benchmarking/ on sys.path.

Signed-off-by: Yuan Gao <ypgao@google.com>
… out of nighthawk-ingress

Move nighthawk-ingress/spec.py to nighthawk_common unchanged and point its importers at the new path. actors.py imported it without using it.

Signed-off-by: Yuan Gao <ypgao@google.com>
…ut of nighthawk_common

build_session_spec in nighthawk_common now takes a finished traffic template. The router SNI, the certificate paths and build_spec_dict, which assembles that template, move back to nighthawk-ingress/spec.py.

Signed-off-by: Yuan Gao <ypgao@google.com>
benchmarking/workloads/deploy.sh built kubectl-ate inline, and the
nighthawk-egress deploy script was about to carry a copy. Move the
function into benchmarking/lib/kubectl-ate.sh for both to source.

Signed-off-by: Yuan Gao <ypgao@google.com>
…ration

With a 2 vCPU actor sandbox and no requests on the worker pod or
nighthawk-server, nothing kept the load generator and the origin server
from saturating before atenet-egress, so a run could measure them
instead of the gateway. Give the sandbox 16 vCPUs, request 12 vCPUs for
the worker pod and 6 for nighthawk-server, run the server with
--concurrency 8, and move the example nighthawk_client run from one
worker to sixteen.

Signed-off-by: Yuan Gao <ypgao@google.com>
deploy-traffic-driver.sh required kubectl-ate on PATH, so a fresh
environment needed a manual go install step first. Source
build_kubectl_ate from benchmarking/lib/kubectl-ate.sh instead, and say
so in the README prerequisites in place of the install step.

Signed-off-by: Yuan Gao <ypgao@google.com>
… per stage

Add the queue_to_connect and sequencer.blocking statistics and the latency pstdev to each stage row, make actors optional in capacity_summary, accept Path for descriptor paths, and export the helpers nighthawk-egress uses. Compute achieved-rps and send-rate from the exact stage duration, because Nighthawk truncates execution_duration to whole seconds.

Signed-off-by: Yuan Gao <ypgao@google.com>
…nter parser

Define the egress-specific failure predicates and Nighthawk template
for the adaptive load search, targeting the atenet-egress gateways.
Add the prometheus output parser for the egress metrics.

Signed-off-by: Yuan Gao <ypgao@google.com>
@ygao-g
Yuan Gao (ygao-g) force-pushed the nighthawk-egress-3-automation branch from ac6b856 to 44d6b61 Compare November 5, 2026 22:54
…and run-dev.sh

Add runner.py, spec.py and output.py glue, cluster_setup.py, the runner image and run-dev.sh, which drives one adaptive capacity run end to end and scrapes atenet-egress counters before and after it through the atenet-egress-metrics Service. Name nighthawk-server exactly in egress-policy.yaml, with and without the cluster.local suffix, because the actor resolv.conf sets ndots:5 and atunnel sees the suffixed name.

Signed-off-by: Yuan Gao <ypgao@google.com>
…ters, and results

Signed-off-by: Yuan Gao <ypgao@google.com>
Add testtypes/nighthawk_egress.py for nighthawk-egress benchmarks,
implementing the TestType protocol hooks to configure atenet-egress CPU
limits, deploy the in-cluster test rig, and render runner Job manifests.

Signed-off-by: Yuan Gao <ypgao@google.com>
…dule dependencies

Signed-off-by: Yuan Gao <ypgao@google.com>
…rator unit tests

Signed-off-by: Yuan Gao <ypgao@google.com>
@ygao-g

Copy link
Copy Markdown
Collaborator Author

Superseded by #3708, which carries the test type, suites and orchestrator changes from this branch together with the runner.

shankgan pushed a commit to shankgan/substrate that referenced this pull request Nov 13, 2026
…to nighthawk_common (agent-substrate#3628)

Part of agent-substrate#3624 (Stage 1, item 2): share the adaptive load session spec
and output helpers between `nighthawk-ingress` and the coming
`nighthawk-egress` runner.

### What changes
Pure relocation, no behavior change. `nighthawk-ingress/output.py` and
`spec.py` move to `benchmarking/nighthawk_common/`. The router-specific
parts of the spec builder (router SNI, certificate paths,
`build_spec_dict`) stay in `nighthawk-ingress/spec.py`, which now calls
the generic `build_session_spec`. Callers and tests import
`nighthawk_common` directly; the ingress Dockerfile copies the package
into the image.

### Review guide
1. `output.py` rename (GitHub shows 100%), two import lines, the
Dockerfile `COPY`, two `sys.path` lines in the ingress tests.
2. `spec.py` rename at 100%, importers repointed, an unused import
dropped from `actors.py`.
3. The split: read `nighthawk_common/spec.py` as deletions and
`nighthawk-ingress/spec.py` as the same lines moving back.

### Testing
`hack/verify/benchmarking-python.sh`: the ingress suite passes at each
commit, and fails without the new `sys.path` lines, so the import path
is exercised.

Independent of agent-substrate#3627. agent-substrate#3629 and agent-substrate#3630 stack on both.

AI use: AI-assisted for the diff, the commit split and the test runs; I
reviewed the diff.

- [x] Tests pass
- [ ] Docs updated (none needed)

---------

Signed-off-by: Yuan Gao <ypgao@google.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant