Skip to main content
Version: v0.3.0

Quick Reference

All sflow.yaml config fields at a glance. The Required column indicates mandatory fields.

For detailed explanations and examples, see Configuration.

Root-Level​

FieldRequiredTypeDefaultDescription
versionYesstring—Schema version. Must be "0.1".
variablesdict / list—Global variables available to expressions and task env.
artifactsdict / list—Named resources referenced by URI.
backendsdict / list—Compute backends (local, slurm, docker, kubernetes).
operatorsdict / list—Task execution operators (bash, srun, docker_run, ssh, python, k8s, k8s_mpi).
workflowYesobject—Workflow definition containing name and tasks.

Variables​

YAML path: variables.<name>

FieldRequiredTypeDefaultDescription
valueYesany—Variable value (int, float, bool, string, or list).
descriptionstringnullHuman-readable description.
domainlistnullAllowed values; enables replica variable sweeps. value must be in domain if set.
typestring"string"Type hint (string, integer, etc.).

Artifacts​

YAML path: artifacts.<name>

FieldRequiredTypeDefaultDescription
uriYesstring—Resource URI with scheme (fs://, file://, http://, s3://).
descriptionstringnullHuman-readable description.
contentstringnullInline file content. Only valid with file:// URI.

Backends — Common Fields​

YAML path: backends.<name>

FieldRequiredTypeDefaultDescription
typeYesstring—local, slurm, docker, or kubernetes.
defaultboolfalseMark as the default backend (only one allowed).
gpus_per_nodeint / exprnullGPUs per node for sflow planning / packing. Does not add Slurm GPU allocation flags.

Backends — Local​

Additional fields when type: local

FieldRequiredTypeDefaultDescription
nodesint / expr1Number of synthetic local nodes.

Backends — Slurm​

Additional fields when type: slurm

FieldRequiredTypeDefaultDescription
accountYesstring / expr—Slurm account.
partitionYesstring / expr—Slurm partition.
timeYesstring / expr—Time limit (e.g. 00:30:00).
nodesYesint / expr—Number of nodes.
gpus_per_nodeYesint / expr—GPUs per node for planning. Set to 0 for CPU-only partitions; tasks that request resources.gpus against a zero-capacity backend will be rejected.
extra_argslist[string]nullExtra salloc arguments (e.g. --exclusive, --gpus-per-node=8).
job_namestringnullJob name; defaults to workflow name.

Operators — Common Fields​

YAML path: operators.<name>

FieldRequiredTypeDefaultDescription
typeYesstring—Operator type: bash, srun, docker_run, ssh, python, k8s, or k8s_mpi.

Operators — srun​

Additional fields when type: srun

FieldRequiredTypeDefaultDescription
job_idstringnullExisting Slurm job ID.
nodesint / stringnullNode count.
nodelistlist[string][]Node list.
partitionstringnullSlurm partition.
accountstringnullSlurm account.
qosstringnullQOS.
reservationstringnullReservation.
timestringnullTime limit.
constraintstringnullSlurm constraint.
exclusiveboolfalseExclusive node allocation.
chdirstringnullWorking directory.
cpus_per_taskint / stringnullCPUs per task.
gpusstringnullGPU spec (e.g. all, 1, device=0).
gpus_per_taskstringnullGPUs per task.
gresstringnullGeneric resource spec.
memstringnullMemory.
mem_per_cpustringnullMemory per CPU.
ntasksint / stringnullNumber of tasks.
ntasks_per_nodeint / stringnullTasks per node.
exportstring"ALL"Environment export setting.
labelbooltruePrefix output with task label.
unbufferedbooltrueUnbuffered output.
kill_on_bad_exitboolfalseKill job on non-zero task exit.
overlapbooltrueAllow step overlap.
waitint / stringnullWait time.
container_imagestringnullContainer image (Pyxis). Mutually exclusive with container_name.
container_namestringnullExisting container name (Pyxis). Mutually exclusive with container_image.
container_mount_homeboolfalseMount home directory in container.
container_writablebooltrueWritable container filesystem.
container_mountslist[string][]Bind mounts (e.g. "/host:/ctr:rw").
container_workdirstringnullContainer working directory.
container_remap_rootboolfalseRemap root inside container.
mpistringnullMPI type (e.g. pmix, ucx).
extra_argslist[string][]Extra CLI arguments.

Operators — Docker Run​

Additional fields when type: docker_run

FieldRequiredTypeDefaultDescription
imageYesstring—Docker image.
workdirstringnullWorking directory inside container.
mountslist[string][]Bind mounts (e.g. "/host:/ctr:rw").
gpusstringnullGPU spec (e.g. all, device=0).
extra_argslist[string][]Extra docker run arguments.
pass_envsbooltrueForward host environment variables.

Operators — SSH​

Additional fields when type: ssh

FieldRequiredTypeDefaultDescription
hostYesstring—SSH host.
userstringnullSSH user.
portintnullSSH port.
identity_filestringnullPath to identity file.
extra_argslist[string][]Extra SSH arguments.

Operators — Python​

Additional fields when type: python

FieldRequiredTypeDefaultDescription
python_execstring"python"Python executable.
extra_argslist[string][]Extra Python arguments.

Operators — Kubernetes (k8s)​

Additional fields when type: k8s. The workload image lives on the operator (the kubernetes backend has none). See Backends for the complete pod/container passthrough list.

FieldRequiredTypeDefaultDescription
imageYesstring—Container image for the pod.
image_pull_policystringnullAlways / IfNotPresent / Never (else cluster default).
restartstring"Never"Pod restartPolicy.
host_networkboolinherit backendPod IP == node IP (needed by some RDMA paths).
node_selectormapinherit backendConstrain the pod to nodes with these labels.
run_as_rootboolfalseForce runAsUser/Group=0 (root-owned PVCs, MPI/sshd bootstrap).
pass_envsbooltrueCreate + mount the env Secret.
shm_sizestringnullCap for RAM-backed /dev/shm (e.g. 64Gi); unset = node-RAM-bounded tmpfs.
ttyboolfalseAllocate a pseudo-TTY so \r progress bars stream live.
cpu / memoryint/stringnullContainer resource requests.
cpu_limit / memory_limitint/stringnullOptional hard caps (unset = requests-only).
envlist[dict]nullRaw k8s EnvVar entries (only way to use valueFrom).
security_contextmapnullContainer securityContext (deep-merged; caps union-merged).
device_class / device_selectorsstring/listinherit backendDRA overrides (ignored under device_plugin).
container_overrides / pod_overridesmapnullRaw escape hatches, deep-merged last (they win).

Operators — Kubernetes MPI (k8s_mpi)​

Additional fields when type: k8s_mpi — any MPI (mpirun) job, single- or multi-node. Inherits every k8s field above and adds an mpi: block. Write an explicit mpirun -np N ... <workload> and sflow builds the MPI world either way, injecting the SSH keypair, hostfile, and launcher wiring. Use plain k8s for non-MPI, single-pod workloads.

mpi. fieldTypeDefaultDescription
routeauto|operator|podsautoMPIJob CR (Kubeflow MPI Operator) vs plain-pods bootstrap; auto detects the CRD.
slots_per_workerint/stringper-node GPU countSlots advertised per worker.
run_launcher_as_workerbooltrueLauncher pod also runs a rank.
launcher_creation_policyAtStartup|WaitForWorkersReadyWaitForWorkersReadyWhen the launcher starts.
ssh_portint2222Port for the injected sshd.
mpi_implementationOpenMPI|Intel|MPICHOpenMPISelects hostfile/env conventions.
ensure_sshdbooltrueInstall openssh-server if the image lacks sshd.
forward_env_prefixeslist[string][]Extra env-namespace prefixes forwarded to remote ranks.
omp_num_threadsint8Injected OMP_NUM_THREADS per rank; null/0 keeps the image default.

Workflow​

YAML path: workflow

FieldRequiredTypeDefaultDescription
nameYesstring—Workflow name.
tasksYeslist—List of task definitions (must be non-empty).
timeoutstring / intnullWorkflow-level timeout (e.g. 1h, 115m).
variablesdict / listnullWorkflow-scoped variables (same format as root variables).

Tasks​

YAML path: workflow.tasks[]

FieldRequiredTypeDefaultDescription
nameYesstring—Task name (must be unique).
scriptYeslist[string]—Script lines to execute (non-empty).
operatorstring / objectnullOperator name, or inline operator override object.
backendstring / dictnullBackend name, or inline backend override.
depends_onlist[string]nullNames of tasks this task depends on.
timeoutint / stringnullTask-level timeout.
variablesdict / listnullTask-scoped variables.
resourcesobjectnullNode / GPU resource requirements.
replicasobjectnullReplication configuration.
retriesobjectnullRetry configuration.
probesobjectnullReadiness and failure probes.
outputslistnullOutput parsing configuration (legacy MVP).
resultmap / objectnullConsolidated result parsing (regex map, patterns, or file). Writes result.json + workflow results.json.

Task Resources​

YAML path: workflow.tasks[].resources

FieldRequiredTypeDefaultDescription
nodes.indiceslist[int / expr]nullSpecific node indices (e.g. [0]).
nodes.countint / exprnullNumber of nodes.
nodes.excludeint / list[int] / exprnullNode indices to remove from the placement pool before indices, count, or GPU packing.
nodes.release_afterstringinferredWhen node reservations can be reused: workflow_completion, task_ready, or task_completion.
gpus.countIf gpus is setint / expr—Number of GPUs (sets CUDA_VISIBLE_DEVICES).
gpus.release_afterstringinferredWhen GPU reservations can be reused: workflow_completion, task_ready, or task_completion.

For nodes, release_after only creates an exclusive node reservation when explicitly set; omitted nodes.indices and nodes.count are placement constraints and may overlap with other planned tasks. For GPUs, omitted release_after is inferred: tasks without readiness probes release GPUs after task completion for downstream dependents, while tasks with readiness probes keep GPUs until workflow completion unless explicitly set to task_ready. task_ready releases after readiness succeeds. task_completion releases after any terminal task status (COMPLETED, FAILED, TIMEOUT, or CANCELLED). Dry-run rehearses these resource lifetimes across the DAG.

Task Replicas​

YAML path: workflow.tasks[].replicas

FieldRequiredTypeDefaultDescription
countint / exprnullNumber of replicas.
policystring / expr"parallel""parallel" or "sequential".
variableslist[string]nullVariable names for sweeps (Cartesian product of domains).

Task Retries​

YAML path: workflow.tasks[].retries

FieldRequiredTypeDefaultDescription
countYesint / expr—Number of retries.
intervalYesint / expr—Delay between retries (seconds).
backoffint / expr1Backoff multiplier.

Task Probes (Readiness / Failure)​

YAML path: workflow.tasks[].probes.readiness or workflow.tasks[].probes.failure

FieldRequiredTypeDefaultDescription
delayint / expr0Initial delay before probing (seconds).
timeoutint / expr1200Max readiness wait time (seconds). Failure probes do not use this as an overall deadline.
each_check_timeoutint / expr30Timeout for a single probe check attempt.
intervalint / expr5Check interval (seconds).
success_thresholdint / expr1Consecutive successes required.
failure_thresholdint / expr3Consecutive failures before failing.

Exactly one probe type must be set per probe:

Probe TypeRequired FieldsOptional FieldsDescription
tcp_portporthost, on_node ("first" / "each")TCP connection check.
http_geturlheadersHTTP GET health check.
http_posturlheaders, bodyHTTP POST health check.
log_watchregex_pattern or match_patternlogger, match_countMatch pattern in task logs. Literal by default; prefix with re: or regex: for regular expressions.

Task Outputs​

YAML path: workflow.tasks[].outputs[]

FieldRequiredTypeDefaultDescription
patternYesstring—Parse pattern (e.g. "TTFT: {ttft:f} ms").
sourcestring"stdout"Log source: stdout or stderr.
metrics.<key>.descriptionstringnullMetric description.
metrics.<key>.typestringnullMetric type.
metrics.<key>.aggregatestringnullAggregation hint.

Task Result​

YAML path: workflow.tasks[].result. Accepts a simple name: regex map, an object with patterns:, or an object with file:. See Results.

patterns and file are mutually exclusive.

FieldRequiredTypeDefaultDescription
patternslistnullAdvanced regex patterns (see below). Mutually exclusive with file.
filestringnullRelative path to a JSON source file ending in .json (e.g. result.json). Normalized into result.json.
sourcestring"log"Source selector. Only log is implemented.

result.patterns[]:

FieldRequiredTypeDefaultDescription
nameYesstring—Result key under values.
regexYesstring—Python regex; prefer one capture group or a named value group.
typestring"auto"auto, string, int, float, bool, or json.
unitstringnullOptional metadata unit (e.g. ms).
aggregatestring"last"first, last, list, count, min, max, avg, or sum.
requiredboolfalseIf true, a missing match marks the result ok: false.
sourcestringinheritedPer-pattern source override; only log is implemented.
groupstring / intvalue then 1Capture group name or index to extract.

A simple name: regex map is shorthand for patterns with type: auto, aggregate: last, required: false, source: log.

To publish a metric literally named file, use patterns:; a top-level file: key is reserved for JSON file-source results.

Expression Syntax​

Fields marked int / expr or string / expr support ${{ ... }} expressions:

ExpressionExample
Variable${{ variables.MY_VAR }}
Variable domain${{ variables.MY_VAR.domain }}
Backend node IP${{ backends.slurm_cluster.nodes[0].ip_address }}
Artifact path${{ artifacts.model_dir.path }}
Task node IP${{ task.server.nodes[0].ip_address }}

Reserved Environment Variables​

Injected by sflow into task environments​

These are automatically set by sflow and available in every task script.

VariableDescription
SFLOW_WORKSPACE_DIRAbsolute path to the project workspace root.
SFLOW_OUTPUT_DIRGlobal output root directory (default ./sflow_output).
SFLOW_WORKFLOW_OUTPUT_DIROutput directory for the current workflow run (e.g. sflow_output/<run-id>).
SFLOW_TASK_OUTPUT_DIROutput directory for the current task replica (e.g. sflow_output/<run-id>/my_task_0).
SFLOW_TASK_RESULT_FILECanonical per-task result file path (${SFLOW_TASK_OUTPUT_DIR}/result.json). Write JSON here to publish results directly.
SFLOW_WORKFLOW_RESULT_FILEWorkflow-level results index path (${SFLOW_WORKFLOW_OUTPUT_DIR}/results.json).
SFLOW_REPLICA_INDEXZero-based replica index (0, 1, 2, ...).
SFLOW_TASK_ASSIGNED_NODE_NAMESComma-separated hostnames of nodes assigned to this task.
SFLOW_TASK_ASSIGNED_NODE_IPSComma-separated IP addresses of nodes assigned to this task.
SFLOW_BACKEND_JOB_IDBackend allocation/job id when available. For Slurm this mirrors SLURM_JOB_ID / SLURM_JOBID.
SFLOW_BACKEND_NODELISTBackend allocation nodelist when available. For Slurm this mirrors SLURM_JOB_NODELIST / SLURM_NODELIST.
SFLOW_BACKEND_NUM_NODESNumber of nodes in the backend allocation when available. For Slurm this mirrors SLURM_NNODES.
CUDA_VISIBLE_DEVICESComma-separated GPU indices allocated to this task (set when resources.gpus.count is used).

In addition, all resolved variables and artifacts paths are injected as environment variables accessible via ${VAR_NAME} in scripts.

Avoid naming a variable after a reserved SFLOW_* / CUDA_VISIBLE_DEVICES env var above — sflow injects and owns these at launch, so a same-named variable collides and causes undefined behavior. sflow run --dry-run prints a Reserved env collisions section listing any such variables so you can rename them before a real run.

Read by sflow from the host environment​

sflow reads these to detect an existing Slurm allocation and skip salloc. When a Slurm controller provides SLURM_* / SLURMD_* variables, sflow preserves those controller values in task environments even if workflow variables use the same names.

VariableDescription
SLURM_JOB_ID / SLURM_JOBIDCurrent Slurm job ID. Used to detect an existing allocation.
SLURM_JOB_NODELIST / SLURM_NODELISTNode list for the current Slurm allocation.

Provided by Slurm at runtime​

These are set by Slurm (not by sflow) and commonly used in task scripts. The srun operator also maps common Slurm step/rank variables into backend-agnostic aliases.

Slurm variableSFLOW aliasDescription
SLURM_STEP_IDSFLOW_BACKEND_STEP_IDSlurm step id for the current srun step.
SLURMD_NODENAMESFLOW_TASK_NODE_NAMEHostname of the node running the task process.
SLURM_NODEIDSFLOW_TASK_NODE_INDEXNode index within the allocation (useful for NODE_RANK).
SLURM_PROCIDSFLOW_TASK_PROCESS_IDGlobal process/rank id within the step.
SLURM_LOCALIDSFLOW_TASK_LOCAL_PROCESS_IDLocal process/rank id on the node.
SLURM_NTASKSSFLOW_TASK_NUM_PROCESSESNumber of tasks/processes in the step.
SLURM_SUBMIT_DIR—Directory from which the job was submitted.