mlos_bench.environments.remote.OSEnv

class mlos_bench.environments.remote.OSEnv(*, name: str, config: dict, global_config: dict | None = None, tunables: TunableGroups | None = None, service: Service | None = None)

OS Level Environment for a host.

Attributes:
parameters

Key/value pairs of all environment parameters (i.e., const_args and tunable_params).

tunable_params

Get the configuration space of the given environment.

Methods

new(*, env_name, class_name, config[, ...])

Factory method for a new environment with a given config.

pprint([indent, level])

Pretty-print the environment configuration.

run()

Execute the run script for this environment.

setup(tunables[, global_config])

Check if the host is up and running; boot it, if necessary.

status()

Check the status of the benchmark environment.

teardown()

Clean up and shut down the host without deprovisioning it.

__init__(*, name: str, config: dict, global_config: dict | None = None, tunables: TunableGroups | None = None, service: Service | None = None)

Create a new environment for remote execution.

Parameters:
name: str

Human-readable name of the environment.

configdict

Free-format dictionary that contains the benchmark environment configuration. Each config must have at least the “tunable_params” and the “const_args” sections. RemoteEnv must also have at least some of the following parameters: {setup, run, teardown, wait_boot}

global_configdict

Free-format dictionary of global parameters (e.g., security credentials) to be mixed in into the “const_args” section of the local config.

tunablesTunableGroups

A collection of tunable parameters for all environments.

service: Service

An optional service object (e.g., providing methods to deploy or reboot a VM, etc.).

setup(tunables: TunableGroups, global_config: dict | None = None) bool

Check if the host is up and running; boot it, if necessary.

Parameters:
tunablesTunableGroups

A collection of groups of tunable parameters along with the parameters’ values. HostEnv tunables are variable parameters that, together with the HostEnv configuration, are sufficient to provision and start a host.

global_configdict

Free-format dictionary of global parameters of the environment that are not used in the optimization process.

Returns:
is_successbool

True if operation is successful, false otherwise.

teardown() None

Clean up and shut down the host without deprovisioning it.