plesty.bench.cli

plesty-bench — run plesty-server commands on a remote bench.

plesty-bench -b lab-bench-03 status
plesty-bench -b lab-bench-03 field-test pm100d --address mock        # follows the job
plesty-bench -b lab-bench-03 fetch repos/plesty-pm100d/exp/reports/<slug>/field-test.json -o .
plesty-bench -b lab-bench-03 ping
plesty-bench -b lab-bench-03 control pm100d k10cr1                   # opens a window

-b (or PLESTY_BENCH) names the bench, --token (or PLESTY_BENCH_TOKEN) the shared secret. Everything else is handed to the bench’s plesty-server unchanged (put -- first when the remote arguments start with a dash). Three words are the client’s own: ping, fetch PATH [-o OUT] and control DEVICE…. When the remote command is one that starts a job (install, update, field-test) it is started --no-wait on the bench and its log is followed here until it ends.

control opens plesty-lib’s shell on this machine with one panel per named device, each driving that device through the agent. It is the one command that needs a display, and the only one whose dependencies are not in the base wheel — plesty-bench[control] brings them.

Attributes

JOB_COMMANDS

Functions

app(→ None)

Run plesty-server ARGV on the bench at -b; ping and fetch PATH [-o OUT] are local.

run_remote(→ int)

Run args on the bench; follow the job when it starts one. Returns the exit code.

_fetch(→ None)

_control(→ None)

Open a control window on one or more of the bench's running devices.

main(→ None)

Console-script entry point.

Module Contents

plesty.bench.cli.JOB_COMMANDS = ('install', 'update', 'field-test')
plesty.bench.cli.app(address: str | None, token: str | None, timeout: float, argv: tuple[str, Ellipsis]) → None

Run plesty-server ARGV on the bench at -b; ping and fetch PATH [-o OUT] are local.

Parameters:
  • address (str | None)

  • token (str | None)

  • timeout (float)

  • argv (tuple[str, Ellipsis])

Return type:

None

plesty.bench.cli.run_remote(client: plesty.bench.client.BenchClient, args: collections.abc.Sequence[str]) → int

Run args on the bench; follow the job when it starts one. Returns the exit code.

Parameters:
Return type:

int

plesty.bench.cli._fetch(client: plesty.bench.client.BenchClient, args: collections.abc.Sequence[str]) → None
Parameters:
Return type:

None

plesty.bench.cli._control(client: plesty.bench.client.BenchClient, args: collections.abc.Sequence[str]) → None

Open a control window on one or more of the bench’s running devices.

The panels are built from what each device declares, fetched over the relay, so this needs no schema of its own and works against any module.

Parameters:
Raises:

ClickException – When no device is named, or the GUI extra is absent.

Return type:

None

plesty.bench.cli.main() → None

Console-script entry point.

Return type:

None