httk.workflow.languages.httk_v1

Realize legacy httk v1 task packages through the ordinary runner path.

Attributes

Classes

LanguagePorts

The named input and output ports of one language document.

LanguageRequest

The data supplied when preparing one language workflow.

LanguageScaffold

The files, runner, and hooks prepared for one language workflow.

WorkflowLanguage

The operations a workflow language exposes to the common layer.

Functions

runner_reference(package, name)

Return the runner member of a job.json running one packaged runner.

validate_label(value, name)

Validate and return one protocol label.

matches(path)

Return false: bare v1 directories require an explicit format.

ports(path)

Return the port shape of a v1 task, which has no document ports.

validate_runner(options, root)

Validate v1 taskset and retry options.

prepare(request)

Prepare one v1 package realization.

collect(record)

Reject use as a default collector for v1 packages.

Package Contents

class httk.workflow.languages.httk_v1.LanguagePorts[source]

The named input and output ports of one language document.

Parameters:
  • inputs – Names of the document’s input ports.

  • outputs – Names of the document’s output ports.

inputs: tuple[str, Ellipsis]
outputs: tuple[str, Ellipsis]
class httk.workflow.languages.httk_v1.LanguageRequest[source]

The data supplied when preparing one language workflow.

Parameters:
  • workflow_id – Identify the workflow being prepared.

  • directory – Locate the workflow package, when it has one.

  • document – Locate the source workflow document, when it has one.

  • runner_options – Supply options for the language runner.

  • inputs – Describe the workflow inputs.

  • outputs – Describe the requested workflow outputs.

  • parameters – Describe the declared workflow parameters.

  • environment – Describe the declared workflow environment.

  • excluded_members – Package members the realization must not stage.

workflow_id: str
directory: pathlib.Path | None
document: pathlib.Path | None
runner_options: collections.abc.Mapping[str, object]
inputs: collections.abc.Mapping[str, collections.abc.Mapping[str, object]]
outputs: collections.abc.Mapping[str, collections.abc.Mapping[str, object]]
parameters: collections.abc.Mapping[str, collections.abc.Mapping[str, object]]
environment: collections.abc.Mapping[str, collections.abc.Mapping[str, object]]
excluded_members: tuple[str, Ellipsis] = ()
class httk.workflow.languages.httk_v1.LanguageScaffold[source]

The files, runner, and hooks prepared for one language workflow.

Parameters:
  • documents – Text or byte documents to write into the payload.

  • files – Files to stage into the payload.

  • parameters – Job parameters produced by preparation.

  • runner – Runner description for the job, when one is supplied.

  • runner_executor – Select the runner executor.

  • payload_runner – Name a runner staged in the payload.

  • workdir_path – Name the workdir below the job payload.

  • required_capabilities – Require these manager capabilities.

  • reserved_parameters – Names reserved for per-job realization output.

  • warnings – Preserve preparation warnings.

  • instantiate – Supply the per-job hook called after input staging.

  • finalize – Transform the per-job JobSpec immediately before its payload is prepared.

documents: collections.abc.Mapping[str, str | bytes]
files: collections.abc.Mapping[str, pathlib.Path]
parameters: collections.abc.Mapping[str, object]
runner: collections.abc.Mapping[str, object] | None
runner_executor: str = 'path'
payload_runner: str | None = None
workdir_path: str | None = None
required_capabilities: tuple[str, Ellipsis] = ()
reserved_parameters: tuple[str, Ellipsis] = ()
warnings: tuple[str, Ellipsis] = ()
instantiate: collections.abc.Callable[[httk.workflow.scaffold.InstantiateContext], object] | None = None
finalize: collections.abc.Callable[[httk.workflow.runtime_builders.JobSpec], httk.workflow.runtime_builders.JobSpec] | None = None
class httk.workflow.languages.httk_v1.WorkflowLanguage[source]

The operations a workflow language exposes to the common layer.

Parameters:
  • name – Name the language.

  • steps – Declare the runner’s steps.

  • initial_step – Select the runner’s initial step.

  • matches – Identify documents belonging to the language.

  • ports – Read the input and output ports of a document.

  • validate_runner – Validate runner options for a document.

  • prepare – Prepare a language request for execution.

  • collect – Convert a completed job record into language outputs.

  • document_policy – State whether package manifests require, allow, or forbid a source document.

  • open_ports – Skip manifest port validation when document ports cannot be enumerated statically.

  • has_default_collector – Provide a default collector path.

  • allows_modes – Permit manifest data and workdir mode overrides.

  • environment – Declare language-provided environment metadata.

  • required_modules – Name the importable modules a job of this language needs at run time.

name: str
steps: tuple[str, Ellipsis]
initial_step: str
matches: collections.abc.Callable[[pathlib.Path], bool]
ports: collections.abc.Callable[[pathlib.Path], LanguagePorts]
validate_runner: collections.abc.Callable[[collections.abc.Mapping[str, object], pathlib.Path], None]
prepare: collections.abc.Callable[[LanguageRequest], LanguageScaffold]
collect: collections.abc.Callable[[httk.workflow.collecting.JobRecord], collections.abc.Mapping[str, object]]
document_policy: DocumentPolicy = 'required'
open_ports: bool = False
has_default_collector: bool = True
allows_modes: bool = True
environment: collections.abc.Mapping[str, collections.abc.Mapping[str, object]]
required_modules: tuple[str, Ellipsis] = ()
httk.workflow.languages.httk_v1.runner_reference(package, name)[source]

Return the runner member of a job.json running one packaged runner.

The reserved pkg: form names the runner inside its own consumer package, and the digest is taken from the installed bytes, which is exactly what the manager verifies before it stages and executes them.

httk.workflow.languages.httk_v1.validate_label(value, name)[source]

Validate and return one protocol label.

Parameters:
  • value (object) – The label to validate.

  • name (str) – The field name used in validation errors.

Returns:

The validated label.

Raises:

httk.workflow.errors.FormatError – If the value is not valid label text.

Return type:

str

httk.workflow.languages.httk_v1.PACKAGE = 'httk.workflow.languages.httk_v1'[source]
httk.workflow.languages.httk_v1.RUNNER = 'v1_runner.py'[source]
httk.workflow.languages.httk_v1.PROGRAMS = ('ht_steps', 'ht_run')[source]
httk.workflow.languages.httk_v1.V1_PRIORITY_MAP[source]
httk.workflow.languages.httk_v1.V2_TO_V1_PRIORITY[source]
httk.workflow.languages.httk_v1.matches(path)[source]

Return false: bare v1 directories require an explicit format.

httk.workflow.languages.httk_v1.ports(path)[source]

Return the port shape of a v1 task, which has no document ports.

httk.workflow.languages.httk_v1.validate_runner(options, root)[source]

Validate v1 taskset and retry options.

httk.workflow.languages.httk_v1.prepare(request)[source]

Prepare one v1 package realization.

httk.workflow.languages.httk_v1.collect(record)[source]

Reject use as a default collector for v1 packages.

httk.workflow.languages.httk_v1.LANGUAGE[source]