engines

package
v3.1.0+incompatible Latest Latest
Warning

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

Go to latest
Published: Feb 22, 2019 License: BSD-3-Clause Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetName

func GetName(b []byte) string

GetName returns the engine name set in JSON []byte configuration.

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(*starter.Config) error
	// CreateContainer is called in master 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 master after successful execution of container process.
	PostStartProcess(int) error
	// MonitorContainer is called in master 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 master after the MontiorContainer returns. It is responsible
	// for ensuring that the container has been properly torn down.
	CleanupContainer(error, syscall.WaitStatus) error
}

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

Directories

Path Synopsis
oci
oci
rpc
rpc

Jump to

Keyboard shortcuts

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