Skip to content

benchmarking(Declarative Workload Install): add a sweperf workload module - #4229

Open
Parnika Mandewalkar (pmandewalkar) wants to merge 3 commits into
agent-substrate:mainfrom
pmandewalkar:sweperf-module
Open

Parnika Mandewalkar (pmandewalkar) wants to merge 3 commits into
agent-substrate:mainfrom
pmandewalkar:sweperf-module

Conversation

@pmandewalkar

Copy link
Copy Markdown
Contributor

Part of #3917. Stacked on #3994: only the last commit (d4d1e9f) is new. I'll rebase onto main once #3994 merges.

SWE-perf has one ActorTemplate per task, and a run needs one task, a subset, or all of them. With this change a sweperf test installs only the tasks it selects:

  • workloads/sweperf.py selects tasks from sweperf-images.json by name or glob ("*", the default, selects every task) and applies the checked-in generated templates.
  • actortemplates.py creates and deletes benchmark ActorTemplates the way deploy.sh does, and waits for the golden snapshots. It applies manifests as-is, so callers fill in any placeholders first.
  • Workloads now implement validate, install and uninstall. check_workloads validates configs too, so a bad task selector fails 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 their golden snapshots, then removes the workers.

Existing tests don't change: they still use deploy_sh, and deploy.sh --delete still runs after them.

Not done yet: removing the sweperf branches from deploy.sh, and a cluster smoke test (one task, a subset, "*"). The boomer client still runs one template (--sweperf-template), so that template's task must be among the selected tasks until boomer takes a task list.

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

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>
A failed uninstall was only logged, so a test that passed was still
reported complete while the uninstall could have leaked state, such as a
volume. uninstall_test_workloads now returns the failure, and the
orchestrator reports a passing test as failed with it. The run still
goes on to the next test.

Signed-off-by: Parnika Mandewalkar <pmandewalkar@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.

1 participant