httk.workflow.compat.v1

Compatibility support for instantiated httk v1 task templates.

Attributes

Classes

V1RunnerBackend

Runner backend which adapts v1 filesystem decisions to v2 outcomes.

V1TaskManager

A task manager restricted to jobs using the httk v1 runner backend.

Functions

bundled_v1_root(→ pathlib.Path)

Return the packaged compatibility HTTK_DIR root.

legacy_priority(→ int)

Map a legacy priority from 1 through 5 onto the v2 range.

prepare_v1_payload(→ httk.workflow.protocol.JobDefinition)

Copy an instantiated v1 template and add its immutable v2 job definition.

submit_v1_task(→ httk.workflow.protocol.Marker)

Prepare and atomically submit one legacy task through a v2 workspace.

parse_v1_task_name(→ dict[str, str] | None)

Parse a legacy task basename, returning None when it is unrelated.

Package Contents

httk.workflow.compat.v1.V1_BACKEND = 'httk-v1'[source]
httk.workflow.compat.v1.V1_CAPABILITY = 'httk-v1'[source]
httk.workflow.compat.v1.V1_WORKFLOW = 'httk.v1.ht_steps'[source]
httk.workflow.compat.v1.V1_PRIORITY_MAP[source]
httk.workflow.compat.v1.V2_TO_V1_PRIORITY[source]
httk.workflow.compat.v1.bundled_v1_root() pathlib.Path[source]

Return the packaged compatibility HTTK_DIR root.

httk.workflow.compat.v1.legacy_priority(value: int) int[source]

Map a legacy priority from 1 through 5 onto the v2 range.

httk.workflow.compat.v1.prepare_v1_payload(source: str | os.PathLike[str], destination: str | os.PathLike[str], *, materializer: V1Materializer | None = None, instantiate_globals: collections.abc.Mapping[str, object] | None = None, job_id: str | None = None, tag: str = 'v1-task', name: str = 'httk v1 task', initial_step: str = 'start', pool: str = 'default', priority: int = 3, attempts: int = 10, parent: collections.abc.Mapping[str, object] | None = None, root_placement: str | None = None, legacy_link: collections.abc.Mapping[str, object] | None = None) httk.workflow.protocol.JobDefinition[source]

Copy an instantiated v1 template and add its immutable v2 job definition.

materializer and instantiate_globals are mutually exclusive. The latter executes trusted template code in the current interpreter and does not restore removed v1 Python imports.

httk.workflow.compat.v1.submit_v1_task(workspace: httk.workflow.Workspace, source: str | os.PathLike[str], placement: str | pathlib.PurePosixPath, *, materializer: V1Materializer | None = None, instantiate_globals: collections.abc.Mapping[str, object] | None = None, job_id: str | None = None, tag: str = 'v1-task', name: str = 'httk v1 task', initial_step: str = 'start', pool: str = 'default', priority: int = 3, attempts: int = 10) httk.workflow.protocol.Marker[source]

Prepare and atomically submit one legacy task through a v2 workspace.

httk.workflow.compat.v1.parse_v1_task_name(value: str) dict[str, str] | None[source]

Parse a legacy task basename, returning None when it is unrelated.

class httk.workflow.compat.v1.V1RunnerBackend(*, runtime_root: str | os.PathLike[str] | None = None, timeout: float = 21600.0, wrapper: str | None = None, log_compression: str = 'bzip2', attempts: int = 10)[source]

Runner backend which adapts v1 filesystem decisions to v2 outcomes.

name = 'httk-v1'[source]
runtime_root[source]
timeout = 21600.0[source]
wrapper = None[source]
log_compression = 'bzip2'[source]
attempts = 10[source]
validate(job: httk.workflow.protocol.JobDefinition, payload: pathlib.Path) None[source]
command(launch: httk.workflow.backends.AttemptLaunch) collections.abc.Sequence[str][source]
commit_outcome(commit: httk.workflow.backends.OutcomeCommit) None[source]
reconcile(workspace: httk.workflow.Workspace) None[source]
marker_changed(workspace: httk.workflow.Workspace, marker: httk.workflow.protocol.Marker) None[source]
class httk.workflow.compat.v1.V1TaskManager(workspace: httk.workflow.Workspace, *, taskset: str = 'any', maximum_workers: int = 1, lease_seconds: float | None = None, heartbeat_interval: float = 30.0, unsafe_persistent_takeover: bool = False, runtime_root: str | os.PathLike[str] | None = None, timeout: float = 21600.0, wrapper: str | None = None, log_compression: str = 'bzip2', attempts: int = 10)[source]

Bases: httk.workflow.TaskManager

A task manager restricted to jobs using the httk v1 runner backend.