Skip to content

mecfs_bio.analysis.runner.default_runner

Code configuring the default runner, which is used to run the main standard analysis

Some of the default runner options can bet overridden by adding a yaml file at _DEFAULT_RUNNER_CONFIG_PATH.yaml

The config is machine-local and is not checked in. Every key is independently optional, so a config may set only the ones it wants to change:

asset_root:  root of the asset store
info_store:  path of the persistent verifying-trace cache
path_remap:  rules routing selected store subtrees to other filesystems, so that one
             logical store can span disks.  See the remapping_meta_to_path module for
             the schema and for guidance on which subtrees are worth remapping.  Every
             configured root must be present when a run starts, so a detached drive
             aborts the run instead of silently rebuilding its assets elsewhere.

Functions:

Attributes:

ASSET_ROOT module-attribute

ASSET_ROOT = Path('assets') / 'base_asset_store'

CONFIG_FILE_NAME module-attribute

CONFIG_FILE_NAME = 'default_runner_config.yaml'

DEFAULT_RUNNER module-attribute

DEFAULT_RUNNER = SimpleRunner(
    tracer=_imo_hasher_128,
    info_store=_get_info_store_path(),
    asset_root=_get_asset_root_path(),
    path_remap=get_path_remap_rules(),
)

IMO_128_INFO_STORE_PATH module-attribute

IMO_128_INFO_STORE_PATH = (
    Path("build_system")
    / "verifying_trace_imo_xxh_128_info.yaml"
)

logger module-attribute

logger = structlog.get_logger(__name__)

get_path_remap_rules

get_path_remap_rules() -> tuple[PathRemapRule, ...]
Source code in mecfs_bio/analysis/runner/default_runner.py
def get_path_remap_rules() -> tuple[PathRemapRule, ...]:
    config = load_runner_config()
    if config is None or _PATH_REMAP_KEY not in config:
        return ()
    return PathRemapRule.tuple_from_config(config[_PATH_REMAP_KEY])

load_runner_config cached

load_runner_config() -> dict | None
Source code in mecfs_bio/analysis/runner/default_runner.py
@functools.cache
def load_runner_config() -> dict | None:
    if not _DEFAULT_RUNNER_CONFIG_PATH.exists():
        logger.debug(
            f"No default runner config file found at {_DEFAULT_RUNNER_CONFIG_PATH}"
        )
        return None
    with open(_DEFAULT_RUNNER_CONFIG_PATH) as infile:
        config = yaml.load(infile, Loader=yaml.FullLoader)
        logger.debug(
            f"Loading default runner config from {_DEFAULT_RUNNER_CONFIG_PATH}"
        )
        logger.debug(f"config: \n {config}")
        return config