sizing

package
v0.8.6 Latest Latest
Warning

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

Go to latest
Published: Oct 5, 2026 License: Apache-2.0 Imports: 1 Imported by: 0

Documentation

Overview

Package sizing owns the deployment's default sandbox size and nothing else.

It is a leaf (standard library only) so that internal/composer can read the effective default without importing internal/runner, which imports the whole egress proxy. internal/runner re-exports every name here, so a caller that already speaks runner.EffectiveLimits keeps doing so.

Index

Constants

View Source
const (
	DefaultCPUMillis int64 = 2000 // 2 vCPU
	DefaultMemoryMiB int64 = 4096 // 4 GiB hard memory cap
	DefaultPidsLimit int64 = 512  // max processes/threads (fork-bomb guard)
)

Conservative platform resource defaults, applied when a Resources field is zero, so EVERY agent sandbox is capped even when policy sets nothing: without them one runaway or prompt-injected agent can OOM-kill the host, fork-bomb the host PID space, or fill host storage and take sibling runs down with it (see types.ResourceLimits). A policy value always overrides.

Variables

This section is empty.

Functions

func SetDefaultLimits

func SetDefaultLimits(cpuMillis, memoryMiB int64)

SetDefaultLimits records the deployment's default sandbox size; a value <= 0 leaves that field at its compiled-in default.

Types

type Limits

type Limits struct {
	CPUMillis int64
	MemoryMiB int64
	PidsLimit int64
}

Limits is the effective default size of one sandbox.

func EffectiveLimits

func EffectiveLimits() Limits

EffectiveLimits is the default sandbox size every fallback site uses when a Resources field is zero: the deployment's configured value, else DefaultCPUMillis/DefaultMemoryMiB. PidsLimit is always the compiled-in default.

Jump to

Keyboard shortcuts

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