Module Contents

class flambe.runnable.runnable.Runnable(**kwargs)[source]

Bases: flambe.compile.MappedRegistrable

Base class for all runnables.

A runnable contains a single run method that needs to be implemented. It must contain all the logic for the runnable.

Each runnable has also access to the secrets the user provides.

Examples of Runnables: Experiment, Cluster


The secrets that the user provides. For example, ‘config[“AWS”][“ACCESS_KEY”]’

inject_content(self, content: str)[source]

Inject the original YAML string that was used to generate this Runnable instance.

Parameters:content (str) – The YAML, as a string
inject_secrets(self, secrets: str)[source]

Inject the secrets once the Runnable was created.

Parameters:secrets (str) – The filepath to the secrets
inject_extensions(self, extensions: Dict[str, str])[source]

Inject extensions to the Runnable

Parameters:extensions (Dict[str, str]) – The extensions
run(self, **kwargs)[source]

Run the runnable.

Each implementation will implement its own logic, with the parameters it needs.


Parse the runnable to determine if it’s able to run. :raises: ParsingExperimentError – In case a parsing error is found.