package gcs

import "github.com/Microsoft/opengcs/service/gcs/core/gcs"

Package gcs defines the core functionality of the GCS. This includes all the code which manages container and their state, including interfacing with the container runtime, forwarding container stdio through transport.Connections, and configuring networking for a container.

Index

Constants

const UVMContainerID = "00000000-0000-0000-0000-000000000000"

UVMContainerID is the ContainerID that will be sent on any prot.MessageBase for V2 where the specific message is targeted at the UVM itself.

Functions

func NewGCSCore

func NewGCSCore(baseLogPath, baseStoragePath string, rtime runtime.Runtime, os oslayer.OS, vsock transport.Transport) core.Core

NewGCSCore creates a new gcsCore struct initialized with the given Runtime.

Types

type Container

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

func (*Container) ExecProcess

func (c *Container) ExecProcess(process *oci.Process, conSettings stdio.ConnectionSettings) (int, error)

func (*Container) GetProcess

func (c *Container) GetProcess(pid uint32) (*Process, error)

GetProcess returns the *Process with the matching 'pid'. If the 'pid' does not exit returns error.

func (*Container) Kill

func (c *Container) Kill(signal oslayer.Signal) error

Kill sends 'signal' to the container process.

func (*Container) Start

func (c *Container) Start(conSettings stdio.ConnectionSettings) (int, error)

func (*Container) Wait

func (c *Container) Wait() int

Wait waits for all processes exec'ed to finish as well as the init process representing the container.

type Host

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

Host is the structure tracking all UVM host state including all containers and processes.

func NewHost

func NewHost(rtime runtime.Runtime, osl oslayer.OS, vsock transport.Transport) *Host

func (*Host) CreateContainer

func (h *Host) CreateContainer(id string, settings *prot.VMHostedContainerSettingsV2) (*Container, error)

func (*Host) GetAllProcessPids

func (h *Host) GetAllProcessPids() []uint32

func (*Host) GetContainer

func (h *Host) GetContainer(id string) (*Container, error)

func (*Host) ModifyHostSettings

func (h *Host) ModifyHostSettings(settings *prot.ModifySettingRequest) error

func (*Host) Shutdown

func (h *Host) Shutdown()

Shutdown terminates this UVM. This is a destructive call and will destroy all state that has not been cleaned before calling this function.

type Process

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

Process is a struct that defines the lifetime and operations associated with an oci.Process.

func (*Process) Kill

func (p *Process) Kill(signal syscall.Signal) error

Kill sends 'signal' to the process.

func (*Process) Wait

func (p *Process) Wait() (<-chan int, chan<- bool)

Wait returns a channel that can be used to wait for the process to exit and gather the exit code. The second channel must be signaled from the caller when the caller has completed its use of this call to Wait.

Source Files

cleanup.go gcs.go networking.go storage.go uvm.go

Version
v0.3.9
Published
Aug 20, 2018
Platform
linux/amd64
Imports
24 packages
Last checked
1 hour ago

Tools for package owners.