ofa_site¶
Site-configuration loader for ofa.
Historically ofa hard-coded a handful of Kestrel-specific strings across
bin/ofa, ofa_main.py and ofa_server.py (partition names, GRES
strings, protected filesystem roots, the ssh -L login host in the BYOK
hint, the banner subtitle, and so on). This module extracts those into a
single optional $OFA_ROOT/site.toml file so ofa can be installed on a
non-Kestrel HPC by editing one place.
Design goals:
Zero behavior change when ``site.toml`` is absent. The
DEFAULTSdict below mirrors the Kestrel values that used to be inline, so an unmodified Kestrel checkout keeps operating identically whether or not asite.tomlexists.Additive override. Values in
site.tomlare deep-merged overDEFAULTS; missing keys keep their default. Users at Kestrel do not need to write asite.toml.Bash-consumable. The shell launcher can
evalthe output ofpython3 -m ofa_site --shell-exportto pick up the scheduler / module settings without parsing TOML in bash.No dependency on the rest of ofa. Import order sanity: this module is imported from
ofa_mainandofa_serverat their top, so it must not import from either.
Functions
Return the effective site config as a nested dict. |
- ofa_site.load_site()[source]¶
Return the effective site config as a nested dict.
- Search order:
$OFA_SITE_TOMLif set and points to a readable file.$OFA_ROOT/site.tomlif that file exists.Defaults only.
Any TOML parse error is swallowed and the defaults are returned; a broken
site.tomlmust never disable ofa’s safety guards.