Skip to contents

Create isolated workspace policies and run supervised external commands with explicit input staging, ordered lifecycle events, deterministic retention, and workspace-content fingerprints.

Usage

new_external_process_workspace_policy(
  root = tempdir(),
  cleanup_on_success = TRUE,
  retain_on_failure = TRUE,
  label = "default-process-workspace"
)

# S3 method for class 'PopgenVCFExternalProcessWorkspacePolicy'
print(x, ...)

run_supervised_external_command_in_workspace(
  command,
  inputs = character(),
  execution_label = command$label,
  workspace_policy = new_external_process_workspace_policy(),
  requirements = new_module_resource_requirements(),
  supervision_policy = new_external_process_supervision_policy(),
  cancellation_token = NULL
)

Arguments

root

Existing directory beneath which workspaces are created.

cleanup_on_success

Whether successful workspaces are removed.

retain_on_failure

Whether unsuccessful workspaces are retained.

label

Stable workspace-policy label.

x

A workspace policy.

...

Unused.

command

A validated PopgenVCFExternalCommand.

inputs

Regular files copied into the workspace before launch.

execution_label

Stable label included in workspace identity.

workspace_policy

Workspace policy.

requirements

Declared process resource requirements.

supervision_policy

External-process supervision policy.

cancellation_token

Optional execution cancellation token.

Value

new_external_process_workspace_policy() returns a validated PopgenVCFExternalProcessWorkspacePolicy. The runner returns a PopgenVCFExternalProcessResult augmented with workspace identity, retention state, input manifest, content fingerprint, and ordered lifecycle events.

Details

Workspace identity is derived from the original command fingerprint, workspace policy label, execution label, and sorted staged-input fingerprints. Existing workspace collisions fail before launch. Input files must be regular files with unique basenames. Only explicitly declared inputs are staged.

Successful workspaces are cleaned by default. Failed workspaces are retained by default for diagnosis and their contents are fingerprinted. Retention never changes the scientific interpretation of the underlying supervised process status.