Skip to content

tdfs4ds.deploy.compute

tdfs4ds.deploy.compute

compute_deployment: optional step after an apply (never inside it): initialise the empty managers the bundle can fill, then compute the deployed processes per data domain (0.3.8.15).

logger_safe

logger_safe(level, message, *args, **kwargs)

Wrapper around the global logger that only emits logs when tdfs4ds.DISPLAY_LOGS is True. level is a string like "info", "error", etc.

load_definitions

load_definitions(path) -> Tuple[List[Dict[str, Any]], Dict[str, str], Dict[str, Any]]

(definitions in deployment order, {key: relative file}, manifest) of a bundle.

load_environment

load_environment(environment, environ=None) -> Dict[str, Any]

An environment as a dict: a path to a YAML file or a dict. ${NAME} is expanded from the process environment (environ). Keys: name, connection, variables, domain_map, options.

_describe

_describe(e) -> str

initialise_manager

initialise_manager(defn, values, state: Dict[str, Any], until=None) -> Dict[str, Any]

Fill one empty manager: bundled contents first, else (TimeManager) its calendar rule from its first date up to until (None = now; 'bundle' = the source's last date, info.last_date; a date). Never touches a manager holding rows. Returns {manager, done, how|why}.

_what_ran

_what_ran(got, ready, clocked) -> Dict[str, Any]

{recomputed, up_to_date} from what roll_out returned ({date: {process_id: status}}), pure.

A process is up to date when every date it reached was skipped (SKIPPED...: already COMPLETED, or unchanged under force_compute='changed') or it reached none; any other status means it ran. {} when the answer is not a roll-out's map (a run of a domain without a clock reports no skip): the summary then keeps the processes given to it.

compute_deployment

compute_deployment(plan_or_result, environment, *, changed: bool = False, initialise: bool = True, until=None) -> Dict[str, Any]

Initialise the empty managers the bundle can fill, then compute the deployed processes.

Per data domain of the bundle: a domain with a clock is rolled out from its first date (roll_out(data_domain=..., time_id_start=1, force_compute='changed' if changed else False, on_failure='raise', check_upstream=True)); a domain without one runs its processes (run([...], ...)). Processes whose manager is still empty are skipped and listed.

Parameters

plan_or_result : DeploymentPlan | str The applied plan (or its saved path). A :class:DeploymentResult is accepted when it carries plan_path. environment : str | dict changed : bool Only what changed (force_compute='changed'). initialise : bool Fill the empty managers first (bundled contents or calendar rule). until : None | 'bundle' | date Last date a calendar rule generates: None (default) = now; 'bundle' = the source's last date when it was exported (the same dates as the source); a date.

Returns

dict {ok, initialised: [...], computed: [...], skipped: [...], errors: [...], summary}.