Documentation
¶
Index ¶
- Constants
- type Runner
- func (r *Runner) Close() error
- func (r *Runner) ContainerdContainerForSandbox(ctx context.Context, id entity.Id) (containerd.Container, error)
- func (r *Runner) ContainerdNamespace() string
- func (r *Runner) Drain(ctx context.Context) error
- func (r *Runner) SetRestartMode(v bool)
- func (r *Runner) SetupControllers(ctx context.Context, eas *es.EntityAccessClient, rs *rpc.Server) (_ *controller.ControllerManager, retErr error)
- func (r *Runner) Start(ctx context.Context, eg ...*errgroup.Group) error
- type RunnerConfig
- type RunnerDeps
Constants ¶
View Source
const (
DefaulWorkers = 3
)
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Runner ¶
type Runner struct {
RunnerConfig
Log *slog.Logger
// contains filtered or unexported fields
}
func NewRunner ¶
func NewRunner(log *slog.Logger, deps RunnerDeps, cfg RunnerConfig) (*Runner, error)
func (*Runner) ContainerdContainerForSandbox ¶
func (*Runner) ContainerdNamespace ¶
func (*Runner) Drain ¶
Drain sets the runner's node status to disabled and stops all running sandboxes
func (*Runner) SetRestartMode ¶ added in v0.3.1
SetRestartMode sets whether outboard processes should be preserved when closing. When true, disk mounts are left in place so the replacement process can pick them up.
func (*Runner) SetupControllers ¶
func (r *Runner) SetupControllers( ctx context.Context, eas *es.EntityAccessClient, rs *rpc.Server, ) ( _ *controller.ControllerManager, retErr error, )
type RunnerConfig ¶
type RunnerConfig struct {
Id string `json:"id" cbor:"id" yaml:"id"`
Name string `json:"name" cbor:"name" yaml:"name"`
ListenAddress string `json:"listen_address" cbor:"listen_address" yaml:"listen_address"`
Workers int `json:"workers" cbor:"workers" yaml:"workers"`
DataPath string `json:"data_path" cbor:"data_path" yaml:"data_path"`
// Optional RPC configuration for advanced setups
// If not provided, a default insecure connection will be used
// to connect to the server address.
Config *clientconfig.Config `json:"config" cbor:"config" yaml:"config"`
// Optional cloud authentication configuration for disk replication
CloudAuth *coordinate.CloudAuthConfig `json:"cloud_auth,omitempty" cbor:"cloud_auth,omitempty" yaml:"cloud_auth,omitempty"`
// DiskMode configures disk I/O mode ("", "auto", "universal", "accelerator")
DiskMode string `json:"disk_mode,omitempty" cbor:"disk_mode,omitempty" yaml:"disk_mode,omitempty"`
}
type RunnerDeps ¶ added in v0.3.0
type RunnerDeps struct {
CC *containerd.Client
Namespace string
Bridge string
Tempdir string
Subnet *netdb.Subnet
// Network dependencies
NetServ *network.ServiceManager
// Observability dependencies
LogsMaintainer *observability.LogsMaintainer
LogWriter observability.LogWriter
StatusMon *observability.StatusMonitor
// Network config
IPv4Routable netip.Prefix
ServicePrefixes []netip.Prefix
DisableLocalNet bool
// Resolver
Resolver netresolve.Resolver
// Sandbox metrics
SandboxMetrics *sandbox.Metrics
// IsCoordinator indicates this runner is the coordinator node.
// Affects scheduling: stateful sandboxes are routed to the coordinator.
IsCoordinator bool
// Flannel network configuration (for distributed runners)
// If EtcdEndpoints is non-empty, the runner will join the Flannel network
EtcdEndpoints []string
EtcdPrefix string
NetworkBackend string
// TLS configuration for etcd mTLS (for distributed runners, file paths)
EtcdTLSCertFile string // Client certificate file path
EtcdTLSKeyFile string // Client private key file path
EtcdTLSCAFile string // CA certificate file path
}
RunnerDeps holds dependencies needed by the Runner to construct controllers.
Click to show internal directories.
Click to hide internal directories.