runner

package
v1.0.5 Latest Latest
Warning

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

Go to latest
Published: May 13, 2022 License: MPL-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Args

type Args struct {
	ID          string
	ProcessArgs []string
}

Args represents the required options for services.

type Option

type Option func(*Options)

Option is the functional option func.

func WithCgroupPath added in v0.12.0

func WithCgroupPath(path string) Option

WithCgroupPath sets the cgroup path.

func WithContainerImage

func WithContainerImage(o string) Option

WithContainerImage sets the image ref.

func WithContainerOpts

func WithContainerOpts(o ...containerd.NewContainerOpts) Option

WithContainerOpts sets the containerd container options.

func WithContainerdAddress

func WithContainerdAddress(a string) Option

WithContainerdAddress sets the containerd socket path.

func WithCustomSeccompProfile added in v0.13.4

func WithCustomSeccompProfile(override func(*specs.LinuxSeccomp)) Option

WithCustomSeccompProfile sets the function to override seccomp profile.

func WithEnv

func WithEnv(o []string) Option

WithEnv sets the environment variables of a service.

func WithGracefulShutdownTimeout

func WithGracefulShutdownTimeout(timeout time.Duration) Option

WithGracefulShutdownTimeout sets the timeout for the task to terminate before sending SIGKILL.

func WithLoggingManager added in v0.6.0

func WithLoggingManager(manager runtime.LoggingManager) Option

WithLoggingManager sets the LoggingManager option.

func WithNamespace

func WithNamespace(o string) Option

WithNamespace sets the tar file to load.

func WithOCISpecOpts

func WithOCISpecOpts(o ...oci.SpecOpts) Option

WithOCISpecOpts sets the OCI spec options.

func WithOOMScoreAdj added in v0.12.0

func WithOOMScoreAdj(score int) Option

WithOOMScoreAdj sets the oom_score_adj.

func WithStdin added in v0.6.0

func WithStdin(stdin io.ReadSeeker) Option

WithStdin sets the standard input.

type Options

type Options struct {
	// LoggingManager provides service log handling.
	LoggingManager runtime.LoggingManager
	// Env describes the service's environment variables. Elements should be in
	// the format <key=<value>
	Env []string
	// ContainerdAddress is containerd socket address.
	ContainerdAddress string
	// ContainerOpts describes the container options.
	ContainerOpts []containerd.NewContainerOpts
	// OCISpecOpts describes the OCI spec options.
	OCISpecOpts []oci.SpecOpts
	// ContainerImage is the container's image.
	ContainerImage string
	// Namespace is the containerd namespace.
	Namespace string
	// GracefulShutdownTimeout is the time to wait for process to exit after SIGTERM
	// before sending SIGKILL
	GracefulShutdownTimeout time.Duration
	// Stdin is the process standard input.
	Stdin io.ReadSeeker
	// Specify an oom_score_adj for the process.
	OOMScoreAdj int
	// CgroupPath (optional) sets the cgroup path to use
	CgroupPath string
	// OverrideSeccompProfile default Linux seccomp profile.
	OverrideSeccompProfile func(*specs.LinuxSeccomp)
}

Options is the functional options struct.

func DefaultOptions

func DefaultOptions() *Options

DefaultOptions describes the default options to a runner.

type Runner

type Runner interface {
	fmt.Stringer
	Open() error
	Run(events.Recorder) error
	Stop() error
	Close() error
}

Runner describes the requirements for running a process.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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