Skip to content

glutton: add RunScript, a script tree run inside the actor as one request - #2162

Open
Max Smythe (maxsmythe) wants to merge 1 commit into
agent-substrate:mainfrom
maxsmythe:glutton-script
Open

Max Smythe (maxsmythe) wants to merge 1 commit into
agent-substrate:mainfrom
maxsmythe:glutton-script

Conversation

@maxsmythe

Copy link
Copy Markdown
Collaborator

A benchmark that wants an actor to do a whole on-sandbox activity, a build, a test run, a file churn, had to issue every resource operation as its own request through the router. That costs a round trip per operation, and it leaves the driver unable to hold the actor busy for a chosen length of time without knowing how long each operation takes on the sandbox at hand.

RunScript takes the activity as a script and runs it in-process, holding the request open until it finishes. A script is a tree. A Block runs its steps in order and may cycle them for a wall-clock budget; a Step is a nested Block or an Operation; an Operation runs its requests at the same time and waits for all of them. A budget is checked between passes: the pass under way finishes, so a loop overruns by at most one pass and no request is cut short, and a nested block stops cycling once any ancestor's budget has elapsed the same way. The only errors are the caller's context ending and a failing request, which names the request's path in the tree and keeps its status code. The request set is the service's work requests plus sleep. UseCPU and OpenFD are left out because they install a background load that outlives the script; BurnCPU is the CPU spike.

The response mirrors the tree with summed vital stats at every node: requests run, bytes written and read to disk and RAM, burn iterations, time slept, and the node's own wall clock and entry count. A node inside a looped block sums over its passes, so the response is the size of the script however long it ran, and the root carries the totals. The fake actor answers a script with the mirrored tree, so drivers can be tested against it.

Fixes #<issue_number_goes_here>

It's a good idea to open an issue first for discussion.

  • [ x ] Tests pass
  • [ x ] Appropriate changes to documentation are included in the PR

…uest

A benchmark that wants an actor to do a whole on-sandbox activity, a
build, a test run, a file churn, had to issue every resource operation as
its own request through the router. That costs a round trip per
operation, and it leaves the driver unable to hold the actor busy for a
chosen length of time without knowing how long each operation takes on
the sandbox at hand.

RunScript takes the activity as a script and runs it in-process, holding
the request open until it finishes. A script is a tree. A Block runs its
steps in order and may cycle them for a wall-clock budget; a Step is a
nested Block or an Operation; an Operation runs its requests at the same
time and waits for all of them. A budget is checked between passes: the
pass under way finishes, so a loop overruns by at most one pass and no
request is cut short, and a nested block stops cycling once any
ancestor's budget has elapsed the same way. The only errors are the
caller's context ending and a failing request, which names the request's
path in the tree and keeps its status code. The request set is the
service's work requests plus sleep. UseCPU and OpenFD are left out
because they install a background load that outlives the script; BurnCPU
is the CPU spike.

The response mirrors the tree with summed vital stats at every node:
requests run, bytes written and read to disk and RAM, burn iterations,
time slept, and the node's own wall clock and entry count. A node inside
a looped block sums over its passes, so the response is the size of the
script however long it ran, and the root carries the totals. The fake
actor answers a script with the mirrored tree, so drivers can be tested
against it.
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