lakeside

package module
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Jun 25, 2025 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

View Source
const (
	LAKESIDE_ROOT     = "/tmp/lakeside"
	LIBCONTAINER_ROOT = "/tmp/libcontainer"
)

Variables

This section is empty.

Functions

func Init

func Init()

Types

type CgroupConfig

type CgroupConfig struct {
	Path       string
	CpuShares  uint64
	CpuQuota   int64
	CpusetCpus string
	CpusetMems string
	Memory     int64
	PidsLimit  int64
}

type Config

type Config struct {
	Rootfs        string
	Args          []string
	Stdin         string
	Cwd           string
	Env           []string
	UserNamespace *UserNamespaceConfig
	Cgroup        *CgroupConfig
	Rlimit        *RlimitConfig
}

type Overlayfs

type Overlayfs struct {
	LowerDir string
	UpperDir string
	WorkDir  string
}

type Report

type Report struct {
	Status   Status
	ExitCode int
	Signal   syscall.Signal
	Stdout   string
	Stderr   string
	CPUTime  uint64
	Memory   uint64
	WallTime int64
}

func MakeReport

func MakeReport(stdoutBuf, stderrBuf io.Reader, state *os.ProcessState, stats *stats.Metrics) (*Report, error)

type Rlimit

type Rlimit struct {
	Hard uint64
	Soft uint64
}

type RlimitConfig

type RlimitConfig struct {
	Core   Rlimit
	Fsize  Rlimit
	NoFile Rlimit
}

type Sandbox

type Sandbox struct {
	ID     string
	Rootfs string
	Config *Config
}

func NewSandbox

func NewSandbox(id string, cfg *Config) *Sandbox

func (*Sandbox) Run

func (s *Sandbox) Run(ctx context.Context) (*Report, error)

type Status

type Status string
const (
	STATUS_OK                    Status = "OK"
	STATUS_RUNTIME_ERROR         Status = "RUNTIME_ERROR"
	STATUS_TIME_LIMIT_EXCEEDED   Status = "TIME_LIMIT_EXCEEDED"
	STATUS_MEMORY_LIMIT_EXCEEDED Status = "MEMORY_LIMIT_EXCEEDED"
	STATUS_OUTPUT_LIMIT_EXCEEDED Status = "OUTPUT_LIMIT_EXCEEDED"
	STATUS_TERMINATED            Status = "TERMINATED"
	STATUS_UNKNOWN               Status = "UNKNOWN"
)

type UserNamespaceConfig

type UserNamespaceConfig struct {
	RootUID     uint32
	UIDMapStart uint32
	UIDMapCount uint32
	RootGID     uint32
	GIDMapStart uint32
	GIDMapCount uint32
}

Jump to

Keyboard shortcuts

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