rundmc

package
v0.0.0-...-499d384 Latest Latest
Warning

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

Go to latest
Published: Oct 8, 2015 License: MIT, Apache-2.0 Imports: 18 Imported by: 0

README

RunDMC - Diminuatively Managed RunC Containers

RunDMC is a small wrapper around runC.

High Level Architecture

Each container is stored as a subdirectory of a directory called 'the depot'. The depot is the source of truth for RunDMC, when a container is created, this amounts to creating an Open Container Spec compliant container as a subdirectory of the depot directory. The subdirectory is named after the container's handle. Looking up a container amounts to checking for the presence of a subdirectory with the right name.

To execute processes in a container, we launch the runc binary inside the container directory and pass it a custom process spec. Since we want to control the container lifecycle via the API without the restriction that the container dies when its first process dies, the containers are always created with a no-op initial process that never exits. User processes are all executed using runc exec.

The process_tracker allows reattaching to running containers when RunDMC is restarted. It holds on to process input/output streams and allows reconnecting to them later.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BundleRunner

type BundleRunner interface {
	Start(bundlePath, id string, io garden.ProcessIO) (garden.Process, error)
	Exec(id string, spec garden.ProcessSpec, io garden.ProcessIO) (garden.Process, error)
	Kill(bundlePath string) error
}

type BundleTemplate

type BundleTemplate struct {
	*goci.Bndl
}

func (BundleTemplate) Bundle

type Bundler

type Bundler interface {
	Bundle(spec gardener.DesiredContainerSpec) *goci.Bndl
}

type CgroupStarter

type CgroupStarter struct {
	CgroupPath    string
	CommandRunner command_runner.CommandRunner

	ProcCgroups io.ReadCloser
}

func (*CgroupStarter) Start

func (s *CgroupStarter) Start() error

type Checker

type Checker interface {
	Check(output io.Reader) error
}

type Containerizer

type Containerizer struct {
	// contains filtered or unexported fields
}

Containerizer knows how to manage a depot of container bundles

func New

func New(depot Depot, bundler Bundler, runner BundleRunner, startChecker Checker) *Containerizer

func (*Containerizer) Create

Create creates a bundle in the depot and starts its init process

func (*Containerizer) Destroy

func (c *Containerizer) Destroy(handle string) error

Destroy kills any container processes and deletes the bundle directory

func (*Containerizer) Run

Run runs a process inside a running container

type Depot

type Depot interface {
	Create(handle string, bundle depot.BundleSaver) error
	Lookup(handle string) (path string, err error)
	Destroy(handle string) error
}

type MaybeLoggingRunner

type MaybeLoggingRunner struct{ BundleRunner }

type SimplePidGenerator

type SimplePidGenerator struct {
	// contains filtered or unexported fields
}

func (*SimplePidGenerator) Generate

func (s *SimplePidGenerator) Generate() uint32

type StartChecker

type StartChecker struct {
	Expect  string
	Timeout time.Duration
}

func (StartChecker) Check

func (s StartChecker) Check(output io.Reader) error

type Starter

type Starter struct {
	*CgroupStarter
}

func NewStarter

func NewStarter(procCgroupReader io.ReadCloser, cgroupMountpoint string, runner command_runner.CommandRunner) *Starter

Directories

Path Synopsis
fakes
This file was generated by counterfeiter This file was generated by counterfeiter
This file was generated by counterfeiter This file was generated by counterfeiter
This file was generated by counterfeiter This file was generated by counterfeiter This file was generated by counterfeiter This file was generated by counterfeiter
This file was generated by counterfeiter This file was generated by counterfeiter This file was generated by counterfeiter This file was generated by counterfeiter
fake_msg_sender
This file was generated by counterfeiter
This file was generated by counterfeiter
fake_process_tracker
This file was generated by counterfeiter
This file was generated by counterfeiter
fake_signaller
This file was generated by counterfeiter
This file was generated by counterfeiter
fakes
This file was generated by counterfeiter This file was generated by counterfeiter This file was generated by counterfeiter
This file was generated by counterfeiter This file was generated by counterfeiter This file was generated by counterfeiter

Jump to

Keyboard shortcuts

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