httk.workflow.adapters

Versioned JSON remote-adapter bundles.

Attributes

Classes

RemoteTarget

Resolved remote bundle and queue.

Functions

seed_application_settings(→ dict[str, object])

Return the application settings a remote queue seeds a workspace with.

metadata_path(→ pathlib.Path)

Return the metadata file of one adapter bundle.

read_metadata(→ dict[str, Any])

Read the metadata of one adapter bundle.

validate_adapter_bundle(→ dict[str, Any])

Validate static adapter metadata and the single dispatcher executable.

split_remote(→ tuple[str, str | None])

resolve_remote(→ RemoteTarget)

Resolve project-local before global remote definitions.

project_remote_roots(→ tuple[pathlib.Path, Ellipsis])

Return where one project keeps its remotes.

list_remotes(→ list[dict[str, object]])

List definitions with project entries shadowing global entries.

add_remote(→ pathlib.Path)

Copy one maintained adapter template into user/project data.

split_settings(→ tuple[dict[str, str], dict[str, str]])

Partition --set values into persistable settings and credentials.

read_credentials(→ dict[str, Any])

Read queue-scoped credentials that never enter a project manifest.

store_credentials(→ pathlib.Path)

Merge settings into the queue-scoped, manifest-excluded credentials.

queue_settings(→ dict[str, Any])

Return persisted queue settings with credentials merged back in.

import_v1_remote(→ pathlib.Path)

Map a recognizable legacy executable bundle to the versioned contract.

run_adapter(→ dict[str, Any])

Execute one JSON adapter operation without invoking a shell.

Module Contents

httk.workflow.adapters.ADAPTER_OPERATIONS = ('configure', 'install', 'invoke', 'push', 'pull', 'start-manager', 'status')[source]
httk.workflow.adapters.ADAPTER_EXECUTABLE = 'adapter'[source]
httk.workflow.adapters.CREDENTIALS_FILE = 'credentials.json'[source]
httk.workflow.adapters.METADATA_FILE = 'remote.json'[source]
httk.workflow.adapters.ADAPTER_FORMAT = 'httk-computer-adapter'[source]
httk.workflow.adapters.REQUEST_FORMAT = 'httk-computer-request'[source]
httk.workflow.adapters.RESULT_FORMAT = 'httk-computer-result'[source]
httk.workflow.adapters.PERSISTABLE_QUEUE_SETTINGS[source]
httk.workflow.adapters.SEED_SETTING_MAP: collections.abc.Mapping[str, str][source]
httk.workflow.adapters.seed_application_settings(bundle: str | os.PathLike[str], queue: str) dict[str, object][source]

Return the application settings a remote queue seeds a workspace with.

class httk.workflow.adapters.RemoteTarget[source]

Resolved remote bundle and queue.

name: str[source]
queue: str[source]
bundle: pathlib.Path[source]
project_local: bool[source]
httk.workflow.adapters.metadata_path(bundle: str | os.PathLike[str]) pathlib.Path[source]

Return the metadata file of one adapter bundle.

httk.workflow.adapters.read_metadata(bundle: str | os.PathLike[str]) dict[str, Any][source]

Read the metadata of one adapter bundle.

httk.workflow.adapters.validate_adapter_bundle(bundle: str | os.PathLike[str]) dict[str, Any][source]

Validate static adapter metadata and the single dispatcher executable.

httk.workflow.adapters.split_remote(value: str) tuple[str, str | None][source]
httk.workflow.adapters.resolve_remote(value: str, *, project: str | os.PathLike[str] | None = None) RemoteTarget[source]

Resolve project-local before global remote definitions.

httk.workflow.adapters.project_remote_roots(project_root: pathlib.Path) tuple[pathlib.Path, Ellipsis][source]

Return where one project keeps its remotes.

httk.workflow.adapters.list_remotes(project: str | os.PathLike[str] | None = None) list[dict[str, object]][source]

List definitions with project entries shadowing global entries.

httk.workflow.adapters.add_remote(name: str, *, template: str, global_scope: bool = False, project: str | os.PathLike[str] | None = None) pathlib.Path[source]

Copy one maintained adapter template into user/project data.

httk.workflow.adapters.split_settings(settings: collections.abc.Mapping[str, str]) tuple[dict[str, str], dict[str, str]][source]

Partition --set values into persistable settings and credentials.

httk.workflow.adapters.read_credentials(bundle: str | os.PathLike[str], queue: str) dict[str, Any][source]

Read queue-scoped credentials that never enter a project manifest.

httk.workflow.adapters.store_credentials(bundle: str | os.PathLike[str], queue: str, settings: collections.abc.Mapping[str, str]) pathlib.Path[source]

Merge settings into the queue-scoped, manifest-excluded credentials.

httk.workflow.adapters.queue_settings(bundle: str | os.PathLike[str], queue: str) dict[str, Any][source]

Return persisted queue settings with credentials merged back in.

httk.workflow.adapters.import_v1_remote(source: str | os.PathLike[str], *, name: str | None = None, global_scope: bool = False, project: str | os.PathLike[str] | None = None) pathlib.Path[source]

Map a recognizable legacy executable bundle to the versioned contract.

Legacy shell programs are never copied or executed. Only their simple assignment-only config files are read, and the result uses a maintained v2 adapter implementation. What is read is an httk v1 computer definition, so the legacy names below are the names that tree really uses.

httk.workflow.adapters.run_adapter(bundle: str | os.PathLike[str], operation: str, request: collections.abc.Mapping[str, object], *, timeout: float | None = None) dict[str, Any][source]

Execute one JSON adapter operation without invoking a shell.