container

package
v0.1.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 31, 2026 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

View Source
const (
	SandboxedCommandProviderName        = "sandboxed-command"
	SandboxedCommandOperationRun        = "run-sandboxed-command"
	SandboxedContainerBuildProviderName = "sandboxed-container-build"
	SandboxedContainerBuildOperation    = "build-sandboxed-container"

	SandboxNetworkNone   = "none"
	SandboxNetworkBridge = "bridge"

	SandboxedContainerBuildStateDir     = "/wfcompute-build"
	SandboxedContainerBuildDigestPath   = SandboxedContainerBuildStateDir + "/wfcompute-container-build-digest"
	SandboxedContainerBuildDigestMarker = "WORKFLOW_COMPUTE_BUILD_DIGEST="
)

Variables

This section is empty.

Functions

func CleanContainerPath

func CleanContainerPath(value string) string

func CommandRuntimeEnv

func CommandRuntimeEnv(workload core.CommandWorkload, resolved map[string]string) (map[string]string, error)

func ContainerBuildEnv

func ContainerBuildEnv(workload core.ContainerBuildWorkload, resolved map[string]string) (map[string]string, error)

func DirectorySize

func DirectorySize(root string) int64

func ParseSandboxedContainerBuildDigestMarker

func ParseSandboxedContainerBuildDigestMarker(output []byte) string

func ReadSandboxedContainerBuildDigest

func ReadSandboxedContainerBuildDigest(path string) (string, error)

func ResolveContainerBuildPaths

func ResolveContainerBuildPaths(workspace string, workload core.ContainerBuildWorkload) (string, string, error)

func SandboxedCommandContract

func SandboxedCommandContract(descriptor core.RuntimeDescriptor) core.RuntimeAdapterContract

func SandboxedContainerBuildContract

func SandboxedContainerBuildContract(descriptor core.RuntimeDescriptor) core.RuntimeAdapterContract

func ValidSHA256Digest

func ValidSHA256Digest(value string) bool

Types

type ContainerRuntimeScope

type ContainerRuntimeScope struct {
	Args []string
}

type RuntimeAdapterCatalogDocument

type RuntimeAdapterCatalogDocument struct {
	Version                   string                       `json:"version"`
	ProtocolVersion           string                       `json:"protocol_version"`
	Adapters                  []RuntimeAdapterCatalogEntry `json:"adapters"`
	HostOwnedResponsibilities []string                     `json:"host_owned_responsibilities"`
}

func (RuntimeAdapterCatalogDocument) Validate

func (d RuntimeAdapterCatalogDocument) Validate() error

type RuntimeAdapterCatalogEntry

type RuntimeAdapterCatalogEntry struct {
	AdapterID           string                      `json:"adapter_id"`
	Operation           string                      `json:"operation"`
	Kinds               []core.RuntimeAdapterKind   `json:"kinds"`
	WorkloadKinds       []core.WorkloadKind         `json:"workload_kinds"`
	RuntimeProfiles     []core.RuntimeProfile       `json:"runtime_profiles"`
	WorkspacePolicy     core.RuntimeWorkspacePolicy `json:"workspace_policy"`
	ConformanceProfiles []string                    `json:"conformance_profiles"`
}

func (RuntimeAdapterCatalogEntry) Contract

func (RuntimeAdapterCatalogEntry) Validate

func (e RuntimeAdapterCatalogEntry) Validate() error

type SandboxMount

type SandboxMount struct {
	HostPath       string
	ContainerPath  string
	ReadOnly       bool
	RequiredPrefix string
}

type SandboxRunRequest

type SandboxRunRequest struct {
	Image           string
	Command         []string
	RuntimeScope    ContainerRuntimeScope
	Stdin           []byte
	Workspace       string
	WorkingDir      string
	Env             map[string]string
	Network         string
	RuntimeName     string
	RunAsRoot       bool
	WritableRootFS  bool
	AddCapabilities []string
	ExtraTmpfs      []string
	DataMounts      []SandboxMount
	Timeout         time.Duration
	Limits          core.ResourceLimits
}

type SandboxRunResult

type SandboxRunResult struct {
	ExitCode      int
	Stdout        []byte
	Stderr        []byte
	ArtifactHash  string
	ResourceUsage core.ResourceUsage
}

type SandboxRuntime

type SandboxRuntime interface {
	Available(context.Context) error
	Run(context.Context, SandboxRunRequest) (SandboxRunResult, error)
}

type SandboxRuntimeCommandAdapter

type SandboxRuntimeCommandAdapter struct {
	Runtime SandboxRuntime
}

func (SandboxRuntimeCommandAdapter) RunSandboxedCommand

type SandboxRuntimeContainerBuildAdapter

type SandboxRuntimeContainerBuildAdapter struct {
	Runtime SandboxRuntime
}

func (SandboxRuntimeContainerBuildAdapter) BuildSandboxedContainer

type SandboxedCommandInvocationOptions

type SandboxedCommandInvocationOptions struct {
	TaskID          string
	LeaseID         string
	Image           string
	Workspace       string
	Network         string
	Timeout         time.Duration
	TimeoutLimitHit string
	Workload        core.CommandWorkload
	ResolvedEnv     map[string]string
	Limits          core.ResourceLimits
}

type SandboxedCommandRuntime

type SandboxedCommandRuntime interface {
	RunSandboxedCommand(context.Context, SandboxedCommandRuntimeInvocation) (core.RuntimeExecutionResult, error)
}

type SandboxedCommandRuntimeInvocation

type SandboxedCommandRuntimeInvocation struct {
	Request         core.RuntimeExecutionRequest
	Image           string
	Workspace       string
	Network         string
	Timeout         time.Duration
	TimeoutLimitHit string
}

type SandboxedContainerBuildInvocationOptions

type SandboxedContainerBuildInvocationOptions struct {
	TaskID          string
	LeaseID         string
	Image           string
	Workspace       string
	Network         string
	Timeout         time.Duration
	TimeoutLimitHit string
	Workload        core.ContainerBuildWorkload
	ResolvedEnv     map[string]string
	Limits          core.ResourceLimits
}

type SandboxedContainerBuildRuntime

type SandboxedContainerBuildRuntime interface {
	BuildSandboxedContainer(context.Context, SandboxedContainerBuildRuntimeInvocation) (core.RuntimeExecutionResult, error)
}

type SandboxedContainerBuildRuntimeInvocation

type SandboxedContainerBuildRuntimeInvocation struct {
	Request         core.RuntimeExecutionRequest
	Image           string
	Workspace       string
	Network         string
	Timeout         time.Duration
	TimeoutLimitHit string
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL