Skip to main content

ComputeActionOutputPath

Constructs the full output directory for a task action, including a deterministic shard prefix for storage hot-spot avoidance and an attempt segment to isolate retries.

def ComputeActionOutputPath(
ctx: context.Context,
namespace: string,
name: string,
runOutputBase: string,
actionName: string,
attempt: uint32
) - > storage.DataReference

Constructs the full output directory for a task action, including a sharded path for hot-spot avoidance and an attempt segment to isolate retries. This function is used to generate a unique and optimized storage path for each action's output.

Parameters

NameTypeDescription
ctxcontext.ContextThe context for the operation, used for cancellation and deadlines.
namespacestringThe namespace of the TaskAction, used to deterministically derive the shard prefix.
namestringThe name of the TaskAction, used in conjunction with the namespace to derive the shard prefix.
runOutputBasestringThe base output path for the run, which will be augmented with the shard, action name, and attempt number.
actionNamestringThe name of the specific action within the task, used as a segment in the output path.
attemptuint32The attempt number for the action, used to create a unique path for each retry.

Returns

TypeDescription
storage.DataReferenceThe full output path as a storage.DataReference, or an error if parsing fails.