Skip to content

stress: device-orchestrator skeleton — CLI, sweep loop, runlog, abort (part 2 of #3746) #3771

@elitegreg

Description

@elitegreg

Part 2 of #3746. Depends on part 1 (sub-issue #3770) for PlanReconcile + user CRUD.

Standalone binary that runs the sweep end-to-end against a real devnet RPC but stubs the agent runner behind an interface. The issue's acceptance run (0 → 8 in batches of 2) works except pre_commit_log / applied events (those land in part 3).

Scope

New tree tools/stress/device-orchestrator/, modelled on tools/twamp/:

  • cmd/device-orchestrator/main.go — every flag from stress: implement tools/stress/device-orchestrator #3746's CLI list; dumps orchestrator-config.json on start.
  • pkg/runlog/ — append-only JSON-lines writer for orchestrator-runlog.json with the row schema {run_id, user_index, user_pubkey, tunnel_id, event, t_ns, n_after_event}.
  • pkg/sweep/ — sweep loop driven by PlanReconcile, batches of --users-per-batch, hold via --hold-seconds, deprovision phase in reverse order. Records submit | confirm | activate | deprovision_* events.
  • pkg/abort/ — poller watching --abort-file on a ticker; signals the sweep loop via context cancel between user iterations (NOT mid-instruction).
  • pkg/agent/ — Go interface AgentRunner { Start(ctx) error; Events() <-chan AgentEvent }. Ship a noopAgent impl now; SSH impl lands in part 3.
  • Makefile mirroring tools/twamp/Makefile.

Tests

  • sweep_test.go: fake ReconcileExecutor + fake clock + noopAgent; assert event order + runlog rows.
  • abort_test.go: tempdir, touch the file, assert cancellation within one batch.
  • runlog_test.go: schema round-trip.

Completion / CI

Binary builds via root make go-build; new package's tests run under make go-test. No live-RPC test in CI — manual only. PR title prefix tools/stress: orchestrator skeleton.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type
No fields configured for issues without a type.

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions