Documentation
¶
Overview ¶
Package runtime defines interfaces for job runtime providers. It enables the CLI to support multiple runtimes (Apple container, Podman) through a common abstraction.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type JobOptions ¶
type JobOptions struct {
JobID string
Image string
CPUs int // Required. Number of CPUs to allocate.
Memory int // Required. Memory in whole gigabytes.
Entrypoint string
Args []string
Stdin io.Reader
Stdout io.Writer
Stderr io.Writer
LogPath string
}
JobOptions specifies the configuration for running a job.
type Provider ¶
type Provider interface {
// Name returns the configuration name (e.g., "apple", "podman") of the provider.
Name() string
// IsInstalled reports whether the runtime is available on the system.
IsInstalled() bool
// Validate checks that the runtime is properly configured and functional.
Validate(ctx context.Context) error
// PullImage pulls the specified container image.
PullImage(ctx context.Context, image string) error
// RunJob runs a job with the specified options.
RunJob(ctx context.Context, opts JobOptions) error
// KillJob terminates the job with the given ID.
KillJob(ctx context.Context, jobID string) error
// GetRunningContainerIDs returns IDs of all running containers managed by this runtime.
GetRunningContainerIDs(ctx context.Context) ([]string, error)
// GetCompletedJobIDs returns IDs of all completed jobs with log files.
GetCompletedJobIDs() ([]string, error)
// ValidateJobID checks if the given job ID is valid for this runtime.
ValidateJobID(jobID string) error
// DeleteJobLog removes the log file for the specified job.
DeleteJobLog(jobID string) error
}
Provider defines the interface for job runtime implementations. Each supported runtime (Apple container, Podman) must implement this interface.
Click to show internal directories.
Click to hide internal directories.