Skip to content

benchmarking: delete a template's actors before the template - #4261

Open
anishgang wants to merge 5 commits into
agent-substrate:mainfrom
anishgang:storage-actor-cleanup
Open

anishgang wants to merge 5 commits into
agent-substrate:mainfrom
anishgang:storage-actor-cleanup

Conversation

@anishgang

Copy link
Copy Markdown
Collaborator

Part of #3917. Stacked on #4229, so only the last commit is new.

Deleting an ActorTemplate leaves the actors made from it, and their external volumes. The benchmark teardown deleted only the templates, so storage tests would leak volumes.

actortemplates.delete() and apply() now delete those actors in the benchmark-workloads atespace first, and wait until ListActors no longer shows them. Actors are tracked by UID, so one recreated under a deleted name is deleted too. The golden actor is skipped, because deleting the template removes it. If actors remain after DELETE_TIMEOUT_SECS, they raise and the template stays.

apply() also takes preview, which passes --preview to kubectl-ate create actor-template. Templates with external volumes need it.

AI use: AI assisted with the implementation and an adversarial review. I reviewed the result myself.

The orchestrator called deploy.sh --deploy directly, with the same
arguments for every test type. Each test type now has a workloads(test)
hook that decides which workloads a test needs, and the orchestrator
calls it after pre_test.

Workload modules live in automation/workloads/ and are looked up by name
in WORKLOADS. install_all checks every name before it installs anything.
The deploy_sh workload runs deploy.sh --deploy with the arguments
orchestrator.deploy_workloads used to build, so every existing test
installs the same workloads as before.

The locust hook loads the test's stub from the cloned repo and installs
what the stub's workloads(test) returns. It sets LOCUST_NO_USERS=1 while
loading, and the boomer-backed stubs skip their locust imports when it is
set, so the orchestrator image doesn't need locust. Stubs that import
locust unconditionally fail with a clear error. The nighthawk-ingress hook
always uses deploy_sh. The nighthawk-egress hook does nothing, because
its pre_test installs its own workloads.

Teardown still runs deploy.sh --delete.

Signed-off-by: Parnika Mandewalkar <pmandewalkar@google.com>
A broken locust stub, or one from a branch older than the workloads hook,
failed only inside the test loop, after deploy_substrate, and again for
every test that used it.

Each test type now has a check_workloads(test) hook. The orchestrator
calls it for every test right after the checkout, before any cluster
work, and exits on the first error. For locust it loads the stub and
looks up the workload names it returns. The nighthawk types have nothing
to check.

Signed-off-by: Parnika Mandewalkar <pmandewalkar@google.com>
SWE-perf has one ActorTemplate per task, and a run needs one task, a
subset, or all of them. Installing every task for every test isn't
viable, so a sweperf test now installs only the tasks it selects.

workloads/sweperf.py selects tasks from sweperf-images.json by name or
fnmatch glob ("*", the default, selects every task) and applies the
checked-in generated templates. Golden snapshots get the test's
workerWaitTimeout. The sweperf stub reads the selection from the test's
`workloads:` block.

actortemplates.py creates and deletes benchmark ActorTemplates the way
deploy.sh does: it creates the atespace if needed, deletes and recreates
each template through kubectl-ate, and waits for every golden snapshot.
Manifests are applied as-is, and kubectl-ate failures other than NotFound
on delete and AlreadyExists on the atespace are errors.

Workloads now also implement validate and uninstall. resolve validates
every config, so check_workloads catches a bad task selector before any
cluster work. The locust hook sets up workers with workers.install()
unless the test uses deploy_sh, which creates the WorkerPool itself.

A new uninstall_workloads(test) hook runs after each test, before the
existing teardown_workloads() sweep. For sweperf it deletes the selected
templates, and so their golden snapshots, then removes the workers.

Signed-off-by: Parnika Mandewalkar <pmandewalkar@google.com>
workload_env.cluster_values() reads the OTLP endpoint from the
ate-otel-config ConfigMap, the way deploy.sh does, for workloads that
fill placeholders in their manifests. actortemplates.apply() now builds
and resolves ko:// images with ko resolve before it creates a template.

Workloads get a sweep() that removes anything they could have created,
without their config. The orchestrator's start-of-run sweep calls it for
every workload, logging failures, so a crashed run doesn't leak a
workload's state into the next. sweperf.sweep() deletes every sweperf-*
template, found with the new actortemplates.names().

The locust uninstall_workloads hook runs every workload's uninstall even
if one fails, removes the workers, then raises the first failure.

Signed-off-by: Parnika Mandewalkar <pmandewalkar@google.com>
Deleting an ActorTemplate leaves the actors made from it, and their
external volumes. actortemplates.delete() and apply() now delete those
actors in the benchmark-workloads atespace first, and wait until
ListActors no longer shows them. Actors are tracked by UID. The golden
actor is skipped, because deleting the template removes it.

apply() also takes preview, which passes --preview to kubectl-ate
create actor-template. Templates with external volumes need it.

Signed-off-by: Anish Gangu <anishgang@google.com>

This branch has not been deployed

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants