sandbox

package
v0.0.0-...-4f2f30f Latest Latest
Warning

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

Go to latest
Published: Dec 16, 2024 License: Apache-2.0 Imports: 44 Imported by: 0

Documentation

Index

Constants

View Source
const (
	BuildIDName  = "build_id"
	RootfsName   = "rootfs.ext4"
	SnapfileName = "snapfile"
	MemfileName  = "memfile"

	BuildDirName        = "builds"
	EnvInstancesDirName = "env-instances"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type CurrentStats

type CurrentStats struct {
	CPUCount float64
	MemoryMB float64
}

type IPSlot

type IPSlot struct {
	ConsulToken string

	KVKey   string
	SlotIdx int
}

func NewSlot

func NewSlot(consulClient *consul.Client) (*IPSlot, error)

func (*IPSlot) CreateNetwork

func (ips *IPSlot) CreateNetwork() error

func (*IPSlot) HostCIDR

func (ips *IPSlot) HostCIDR() string

func (*IPSlot) HostIP

func (ips *IPSlot) HostIP() string

IP address for the sandbox from the host machine. You can use it to make requests to the sandbox.

func (*IPSlot) HostMask

func (ips *IPSlot) HostMask() int

func (*IPSlot) NamespaceID

func (ips *IPSlot) NamespaceID() string

func (*IPSlot) NamespaceIP

func (ips *IPSlot) NamespaceIP() string

func (*IPSlot) Release

func (ips *IPSlot) Release(consulClient *consul.Client) error

func (*IPSlot) RemoveNetwork

func (ipSlot *IPSlot) RemoveNetwork() error

func (*IPSlot) TapCIDR

func (ips *IPSlot) TapCIDR() string

func (*IPSlot) TapIP

func (ips *IPSlot) TapIP() string

func (*IPSlot) TapMask

func (ips *IPSlot) TapMask() int

func (*IPSlot) TapName

func (ips *IPSlot) TapName() string

func (*IPSlot) VMask

func (ips *IPSlot) VMask() int

func (*IPSlot) VethCIDR

func (ips *IPSlot) VethCIDR() string

func (*IPSlot) VethIP

func (ips *IPSlot) VethIP() string

func (*IPSlot) VethName

func (ips *IPSlot) VethName() string

func (*IPSlot) VpeerCIDR

func (ips *IPSlot) VpeerCIDR() string

func (*IPSlot) VpeerIP

func (ips *IPSlot) VpeerIP() string

func (*IPSlot) VpeerName

func (ips *IPSlot) VpeerName() string

type MmdsMetadata

type MmdsMetadata struct {
	InstanceID string `json:"instanceID"`
	EnvID      string `json:"envID"`
	Address    string `json:"address"`
	TraceID    string `json:"traceID"`
	TeamID     string `json:"teamID"`
}

type NetworkSlotPool

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

func NewNetworkSlotPool

func NewNetworkSlotPool(size, returnedSize int) *NetworkSlotPool

func (*NetworkSlotPool) Close

func (p *NetworkSlotPool) Close(consul *consul.Client) error

func (*NetworkSlotPool) Get

func (p *NetworkSlotPool) Get(ctx context.Context) (IPSlot, error)

func (*NetworkSlotPool) Return

func (p *NetworkSlotPool) Return(consul *consul.Client, slot IPSlot)

func (*NetworkSlotPool) Start

func (p *NetworkSlotPool) Start(ctx context.Context, consulClient *consul.Client) error

type PostInitJSONBody

type PostInitJSONBody struct {
	EnvVars *map[string]string `json:"envVars"`
}

type Sandbox

type Sandbox struct {
	Sandbox   *orchestrator.SandboxConfig
	StartedAt time.Time
	EndAt     time.Time
	TraceID   string

	Logger *logs.SandboxLogger
	// contains filtered or unexported fields
}

func NewSandbox

func NewSandbox(
	ctx context.Context,
	tracer trace.Tracer,
	consul *consul.Client,
	dns *dns.DNS,
	networkPool *NetworkSlotPool,
	config *orchestrator.SandboxConfig,
	traceID string,
	startedAt time.Time,
	endAt time.Time,
	logger *logs.SandboxLogger,
) (*Sandbox, error)

func (*Sandbox) CleanupAfterFCStop

func (s *Sandbox) CleanupAfterFCStop(
	ctx context.Context,
	tracer trace.Tracer,
	consul *consul.Client,
	dns *dns.DNS,
	sandboxID string,
)

func (*Sandbox) FcPid

func (s *Sandbox) FcPid() int

func (*Sandbox) Healthcheck

func (s *Sandbox) Healthcheck(ctx context.Context, alwaysReport bool)

func (*Sandbox) SlotIdx

func (s *Sandbox) SlotIdx() int

func (*Sandbox) Stop

func (s *Sandbox) Stop(ctx context.Context, tracer trace.Tracer) error

func (*Sandbox) Wait

func (s *Sandbox) Wait(ctx context.Context, tracer trace.Tracer) error

type SandboxFiles

type SandboxFiles struct {
	UFFDSocketPath *string

	EnvPath      string
	BuildDirPath string

	EnvInstancePath string
	SocketPath      string

	KernelDirPath      string
	KernelMountDirPath string

	FirecrackerBinaryPath string
}

func (*SandboxFiles) Cleanup

func (f *SandboxFiles) Cleanup(
	ctx context.Context,
	tracer trace.Tracer,
) error

func (*SandboxFiles) Ensure

func (f *SandboxFiles) Ensure(ctx context.Context) error

func (*SandboxFiles) MemfilePath

func (f *SandboxFiles) MemfilePath() string

type SandboxStats

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

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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