cli.administration.deploy.development package¶
Subpackages¶
- cli.administration.deploy.development.deploy package
- Submodules
- cli.administration.deploy.development.deploy.cli module
- cli.administration.deploy.development.deploy.drill module
- cli.administration.deploy.development.deploy.purge module
- cli.administration.deploy.development.deploy.rotate module
- cli.administration.deploy.development.deploy.run module
- Module contents
- cli.administration.deploy.development.inventory package
- Submodules
- cli.administration.deploy.development.inventory.builder module
- cli.administration.deploy.development.inventory.legacy_resolver module
- cli.administration.deploy.development.inventory.payload module
- cli.administration.deploy.development.inventory.planner module
- cli.administration.deploy.development.inventory.spec module
- Module contents
Submodules¶
cli.administration.deploy.development.build module¶
- cli.administration.deploy.development.build.add_parser(sub: argparse._SubParsersAction) None¶
- cli.administration.deploy.development.build.handler(args: argparse.Namespace) int¶
cli.administration.deploy.development.cli module¶
- cli.administration.deploy.development.cli.main(argv: list[str] | None = None) int¶
cli.administration.deploy.development.common module¶
Shared helpers for the development deploy CLI.
DEV_INVENTORY_VARS_FILE mirrors INFINITO_INVENTORY_VARS_FILE
from default.env; the pairing is drift-guarded.
- cli.administration.deploy.development.common.resolve_container() str¶
Return INFINITO_CONTAINER; raise SystemExit if unset.
cli.administration.deploy.development.compose module¶
- class cli.administration.deploy.development.compose.Compose(repo_root: Path, distro: str)¶
Bases:
objectWrapper around docker compose for the dev/CI stack.
- down() None¶
Tear down the stack.
- exec(cmd: list[str], *, check: bool = True, workdir: str | None = None, capture: bool = False, live: bool = False, tty: bool | None = None, extra_env: dict[str, str] | None = None) CompletedProcess¶
Execute inside the infinito container.
tty=None auto-selects (local: True, CI: False). live=True streams stdout/stderr.
- run(args: list[str], *, check: bool = True, capture: bool = False, live: bool = False, text: bool = True, extra_env: dict[str, str] | None = None) CompletedProcess¶
- up(*, run_entry_init: bool = True) None¶
- wait_for_healthy(*, timeout_s: int | None = None) None¶
Wait for the infinito container’s healthcheck.
cli.administration.deploy.development.coredns module¶
- class cli.administration.deploy.development.coredns.CoreDNSCorefileRenderer(repo_root: Path, env_filename: str = '.env', template_relpath: str = 'compose/coredns/Corefile.tmpl', output_relpath: str = 'compose/coredns/Corefile')¶
Bases:
objectRender compose/coredns/Corefile from compose/coredns/Corefile.tmpl.
- What this does:
Reads variables from env file (default: .env, generated from default.env)
Substitutes
${VAR}placeholders into the Corefile templateWrites the output atomically (tmp -> rename)
Optionally prints a preview of the first N lines
Substitution runs in-process rather than through envsubst: the act runner and the nested deploy containers do not all ship gettext, and a missing binary turned a two-variable substitution into a failed deploy.
- Hard guarantees:
Fails if template/env files are missing
Fails if output path exists and is a directory
Fails if output directory cannot be created or is not writable
Fails if rendered file is empty
- env_filename: str = '.env'¶
- output_relpath: str = 'compose/coredns/Corefile'¶
- render(*, show_preview: bool = True, preview_lines: int = 25) Path¶
- repo_root: Path¶
- template_relpath: str = 'compose/coredns/Corefile.tmpl'¶
cli.administration.deploy.development.down module¶
- cli.administration.deploy.development.down.add_parser(sub: argparse._SubParsersAction) None¶
- cli.administration.deploy.development.down.down_stack(*, repo_root: Path, distro: str) None¶
- cli.administration.deploy.development.down.handler(args: argparse.Namespace) int¶
cli.administration.deploy.development.env module¶
- cli.administration.deploy.development.env.compose_file_args() list[str]¶
Compose -f flags shared by up and down flows.
Each override is gated on the resource it needs being present, not on the instance slot: an override whose :? guard is unsatisfied would abort the stack outright, so a checkout that was never handed a shared git dir or cache network simply does not layer that file in.
- cli.administration.deploy.development.env.resolve_distro() str¶
Return INFINITO_DISTRO; raise SystemExit if missing or invalid.
cli.administration.deploy.development.exec module¶
- cli.administration.deploy.development.exec.add_parser(sub: _SubParsersAction) None¶
- cli.administration.deploy.development.exec.handler(args: Namespace) int¶
cli.administration.deploy.development.init module¶
cli.administration.deploy.development.log_utils module¶
cli.administration.deploy.development.logs module¶
- cli.administration.deploy.development.logs.add_parser(sub: argparse._SubParsersAction) None¶
- cli.administration.deploy.development.logs.handler(args: argparse.Namespace) int¶
cli.administration.deploy.development.mirrors module¶
cli.administration.deploy.development.network module¶
cli.administration.deploy.development.proc module¶
- cli.administration.deploy.development.proc.run_streaming(cmd: list[str], *, cwd, env: dict[str, str], text: bool = True) CompletedProcess¶
Run a subprocess and stream stdout/stderr live to the terminal.
cli.administration.deploy.development.profile module¶
Runtime-context helpers for the dev/CI compose stack.
- class cli.administration.deploy.development.profile.Profile¶
Bases:
objectRuntime identity and the capability decisions derived from it.
- cache_stack_enabled() bool¶
True iff the pull-through cache stack should be loaded.
- docker_root_ephemeral() bool¶
True iff the docker data root may be wiped when the stack goes down.
- image_mirror_enabled() bool¶
True iff image references should be rewritten to the GHCR mirror.
- instance() int¶
Slot index of this checkout; 0 is the primary one.
Bookkeeping only: the compose layering below keys off the concrete resources a worktree was handed, never off this number, so a stray slot cannot make compose demand a value nobody set.
- is_ci() bool¶
True when any standard CI signal is set.
- owns_cache_stack() bool¶
True iff this instance runs the cache stack rather than sharing it.
- runs_on_github() bool¶
True on a real GitHub runner; act and generic CI are not that.
Docker network of a cache stack owned elsewhere, empty when unset.
Path of the checkout’s shared .git directory, empty when it owns one.
cli.administration.deploy.development.recreate module¶
- cli.administration.deploy.development.recreate.add_parser(sub: _SubParsersAction) None¶
- cli.administration.deploy.development.recreate.foreign_endpoints(rows: str, project: str) list[str]¶
Return the running containers of other projects on the network.
- Parameters:
rows –
docker pslines of<name>\t<compose project>.project – compose project that owns the network.
- cli.administration.deploy.development.recreate.handler(args: Namespace) int¶
cli.administration.deploy.development.restart module¶
- cli.administration.deploy.development.restart.add_parser(sub: _SubParsersAction) None¶
- cli.administration.deploy.development.restart.handler(args: Namespace) int¶
cli.administration.deploy.development.runner_mirror module¶
Point the images the CI runner pulls itself at their GHCR mirror.
- cli.administration.deploy.development.runner_mirror.env_image(repo_root: Path, key: str) str¶
Return the mirror reference for an image
default.envdeclares.- Parameters:
repo_root – repository root holding
default.env.key – the
default.envkey naming the image.
- cli.administration.deploy.development.runner_mirror.mirrored_images(repo_root: Path) dict[tuple[str, str], str]¶
Return
{(source_file, service): mirror reference}for every runner image.- Parameters:
repo_root – repository root the runner images are declared under.
- cli.administration.deploy.development.runner_mirror.write_override(repo_root: Path, layered: list[str]) str¶
Write the compose override that swaps the runner’s images for mirrors.
- Parameters:
repo_root – repository root the compose files are relative to.
layered – compose files the stack is built from. Only their services are overridden, so the override never adds a service of its own.
- Returns:
The override path relative to
repo_root.
cli.administration.deploy.development.stop module¶
- cli.administration.deploy.development.stop.add_parser(sub: argparse._SubParsersAction) None¶
- cli.administration.deploy.development.stop.handler(args: argparse.Namespace) int¶
cli.administration.deploy.development.storage module¶
- cli.administration.deploy.development.storage.detect_storage_constrained(compose: Compose, app_ids: list[str], variants: dict[str, int] | None = None) bool¶
Return True if the declared storage need of app_ids and their transitive dependencies, at the given variant overlay, exceeds the free space on the filesystem holding DockerRootDir.
We intentionally measure the DockerRootDir filesystem because this is where images/volumes/build cache usually grow (especially in CI / Docker-in-Docker).
cli.administration.deploy.development.up module¶
- cli.administration.deploy.development.up.add_parser(sub: _SubParsersAction) None¶
- cli.administration.deploy.development.up.handler(args: Namespace) int¶
cli.administration.deploy.development.variant_select module¶
Module contents¶
- cli.administration.deploy.development.main(argv: list[str] | None = None) int¶