mlos_bench.services.types.remote_exec_type module

Protocol interface for Service types that provide helper functions to run scripts on a remote host OS.

class mlos_bench.services.types.remote_exec_type.SupportsRemoteExec(*args, **kwargs)

Bases: Protocol

Protocol interface for Service types that provide helper functions to run scripts on a remote host OS.

Methods

get_remote_exec_results(config)

Get the results of the asynchronously running command.

remote_exec(script, config, env_params)

Run a command on remote host OS.

get_remote_exec_results(config: dict) Tuple[Status, dict]

Get the results of the asynchronously running command.

Parameters:
configdict

Flat dictionary of (key, value) pairs of tunable parameters. Must have the “asyncResultsUrl” key to get the results. If the key is not present, return Status.PENDING.

Returns:
result(Status, dict)

A pair of Status and result. Status is one of {PENDING, SUCCEEDED, FAILED, TIMED_OUT}

remote_exec(script: Iterable[str], config: dict, env_params: dict) Tuple[Status, dict]

Run a command on remote host OS.

Parameters:
scriptIterable[str]

A list of lines to execute as a script on a remote VM.

configdict

Flat dictionary of (key, value) pairs of parameters. They usually come from const_args and tunable_params properties of the Environment.

env_paramsdict

Parameters to pass as shell environment variables into the script. This is usually a subset of config with some possible conversions.

Returns:
result(Status, dict)

A pair of Status and result. Status is one of {PENDING, SUCCEEDED, FAILED}