engines

package
v3.0.2-rc2+incompatible Latest Latest
Warning

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

Go to latest
Published: Dec 22, 2018 License: BSD-3-Clause Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Init

func Init()

Init initializes registered runtime engines

func ServeRuntimeEngineRequests

func ServeRuntimeEngineRequests(name string, conn net.Conn)

ServeRuntimeEngineRequests serves runtime engine requests with corresponding registered engine methods.

Types

type Engine

type Engine struct {
	EngineOperations
	*config.Common
}

Engine is the combination of an EngineOperations and a config.Common. The singularity startup routines (src/runtime/startup/*) can spawn a container process from this type

func NewEngine

func NewEngine(b []byte) (*Engine, error)

NewEngine returns the engine described by the JSON []byte configuration.

type EngineOperations

type EngineOperations interface {
	// Config returns the current EngineConfig, used to populate the Common struct
	Config() config.EngineConfig
	// InitConfig is responsible for storing the parse config.Common inside
	// the EngineOperations implementation.
	InitConfig(*config.Common)
	// PrepareConfig is called in stage1 to validate and prepare container configuration.
	PrepareConfig(net.Conn, *starter.Config) error
	// CreateContainer is called in smaster and does mount operations, etc... to
	// set up the container environment for the payload proc.
	CreateContainer(int, net.Conn) error
	// StartProcess is called in stage2 after waiting on RPC server exit. It is
	// responsible for exec'ing the payload proc in the container.
	StartProcess(net.Conn) error
	// PostStartProcess is called in smaster after successful execution of container process.
	PostStartProcess(int) error
	// MonitorContainer is called in smaster once the container proc has been spawned. It
	// will typically block until the container proc exists.
	MonitorContainer(int, chan os.Signal) (syscall.WaitStatus, error)
	// CleanupContainer is called in smaster after the MontiorContainer returns. It is responsible
	// for ensuring that the container has been properly torn down.
	CleanupContainer() error
}

EngineOperations is an interface describing necessary operations to launch a container process.

Directories

Path Synopsis
oci
rpc

Jump to

Keyboard shortcuts

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