Documentation
¶
Overview ¶
Package kern provides CLI-backed container execution for workflow and sandbox runners.
Index ¶
- func BindSpec(source, target string, readOnly bool) string
- func BoxName(id string) string
- func LookPath(binary string) error
- func PrepareBindMount(_ context.Context, mnt *types.Mount) error
- func ResolveBinary(path string) string
- func ValidateBindMount(allowed bool, mnt types.Mount) error
- type BoxOptions
- type Client
- func (c *Client) Binary() string
- func (c *Client) BoxJob(ctx context.Context, opts BoxOptions) (stdout, stderr string, exitCode int, err error)
- func (c *Client) Doctor(ctx context.Context) error
- func (c *Client) Pull(ctx context.Context, image string) error
- func (c *Client) Stop(ctx context.Context, name string) error
- type CommandRunner
- type Config
- type Option
- type Runtime
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func PrepareBindMount ¶
PrepareBindMount ensures the bind source exists on the host.
func ResolveBinary ¶
ResolveBinary returns the configured binary or the default name.
Types ¶
type BoxOptions ¶
type BoxOptions struct {
Name string
Image string
Command []string
Entrypoint []string
Env []string
Binds []string
Memory string
CPUs string
Network string
Workdir string
SecurityProfile string
RequireLimits bool
}
BoxOptions configures a one-shot kern box job.
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client invokes the kern CLI.
func (*Client) BoxJob ¶
func (c *Client) BoxJob(ctx context.Context, opts BoxOptions) (stdout, stderr string, exitCode int, err error)
BoxJob runs a one-shot kern box job and returns captured stdout/stderr and exit code.
type CommandRunner ¶
CommandRunner runs external commands; tests may replace it.
type Config ¶
type Config struct {
// Binary is the kern executable path; empty uses "kern" on PATH.
Binary string
// SecurityProfile sets --security-profile on boxes (e.g. "untrusted").
SecurityProfile string
// RequireLimits maps to --require-limits when true.
RequireLimits bool
// BindAllowed mirrors executor.mounts.bind.allowed for user bind mounts.
BindAllowed bool
}
Config configures the kern CLI runtime.
type Option ¶
type Option func(*Runtime)
Option configures Runtime construction.
func WithClient ¶
WithClient sets a pre-built Client (tests).
type Runtime ¶
type Runtime struct {
// contains filtered or unexported fields
}
Runtime executes workflow tasks via the kern CLI.
func NewRuntime ¶
NewRuntime creates a kern workflow runtime.
func (*Runtime) HealthCheck ¶
HealthCheck verifies kern is usable on the host.