Skip to content

Configuration

octomate_protocol.config

Deployment config locations shared by the server and operator CLI.

OCTOMATE_HOME_ENV module-attribute

OCTOMATE_HOME_ENV = 'OCTOMATE_HOME'

CONFIG_FILES module-attribute

CONFIG_FILES: tuple[str, ...] = (
    "octomate.yaml",
    "tentacles.yaml",
    "auth.yaml",
    "projects.yaml",
    "providers.yaml",
    "observability.yaml",
    "oauth.yaml",
)

config_home

config_home() -> Path

The directory this process reads its deployment from.

Returned whether or not it exists — a machine with no config at all still names a home, which is what octomate init writes into and what a boot error can say.

Source code in protocol/octomate_protocol/config.py
def config_home() -> Path:
    """The directory this process reads its deployment from.

    Returned whether or not it exists — a machine with no config at all still names
    a home, which is what `octomate init` writes into and what a boot error can say.
    """
    from_env = os.environ.get(OCTOMATE_HOME_ENV)
    if from_env:
        return Path(from_env).expanduser()
    candidates = (
        Path.cwd() / ".octomate" / "config",
        Path.home() / ".octomate" / "config",
    )
    for candidate in candidates:
        if any((candidate / name).is_file() for name in CONFIG_FILES):
            return candidate
    return candidates[-1]