config

package
v0.0.0-...-a75a1c7 Latest Latest
Warning

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

Go to latest
Published: Jul 9, 2026 License: AGPL-3.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var DefaultConfig = Default()
View Source
var ErrConfigValidation = errors.New("a configuration option was invalid")
View Source
var ErrEncryptionNotEnabled = errors.New("transport encryption config cannot be provided when encryption is disabled")
View Source
var ErrInvalidRole = errors.New("unsupported role found")
View Source
var ErrLoadMethodUnsupported = errors.New("this executor does not support load factor calculation")
View Source
var ErrTimeouts = errors.New("timeouts.request must be higher than timeouts.session and timeouts.connection")
View Source
var ISMRoles = []ISMRole{
	CoordinatorRole,
	APIRole,
	BrokerRole,
	AgentRole,
}

Functions

This section is empty.

Types

type APIConfig

type APIConfig struct {
	Bind       string     `yaml:"bind"`           // bind address:port for api to listen
	Broker     BrokerConn `yaml:"broker"`         // config to reach server
	Prometheus bool       `yaml:"export_metrics"` // enable /metrics endpoint
	Pprof      bool       `yaml:"pprof"`          // Wether to expose pprof endpoints
}

configuration for API

func (*APIConfig) String

func (ac *APIConfig) String() string

type BrokerConfig

type BrokerConfig struct {
	ServiceConfig  `yaml:"service"`
	Expiry         time.Duration      `yaml:"expiry"`            // max unused time for envs
	SharedPath     string             `yaml:"shared_path"`       // path where tmp directories are created, default `$TMPDIR` or `/tmp`
	Backup         ReplicaConfig      `yaml:"backup"`            // replica configuration
	ProcMountpoint string             `yaml:"procfs_mountpoint"` // (deprecated value) procfs mountpoint
	ID             string             `yaml:"id"`                // broker ID
	Load           LoadFactorConfig   `yaml:"load"`              // type of load factor calculation method
	Limits         BrokerLimitsConfig `yaml:"limits"`            // limits config
}

func (*BrokerConfig) String

func (bc *BrokerConfig) String() string

type BrokerConn

type BrokerConn struct {
	Server     string                `yaml:"address"` // url for broker server
	Encryption BrokerTransportConfig `yaml:"mtls"`    // transport encryption for api <> broker
}

broker configuration for API

func (*BrokerConn) String

func (ma *BrokerConn) String() string

type BrokerLimitsConfig

type BrokerLimitsConfig struct {
	Expiry             time.Duration `yaml:"expiry"`           // max unused time for envs
	MaxConcurrentTasks uint          `yaml:"concurrent_tasks"` // max number of concurrent async tasks
}

broker bound/rate limit configuration

func (*BrokerLimitsConfig) String

func (blc *BrokerLimitsConfig) String() string

type BrokerTransportConfig

type BrokerTransportConfig struct {
	TransportConfig
	ServerName string `yaml:"server_name"` // server name for certificate validation
}

broker transport configuration with specific server name for certificate validation

func (*BrokerTransportConfig) Config

func (tc *BrokerTransportConfig) Config(logger log.Logger) (*tls.Config, error)

func (*BrokerTransportConfig) String

func (tc *BrokerTransportConfig) String() string

type Config

type Config struct {
	Roles       []ISMRole         `yaml:"roles"`       // roles that should be run by this instance
	Monitoring  MonitoringConfig  `yaml:"monitoring"`  // config for the prometheus endpoint of the broker, formerly known as agent
	Coordinator CoordinatorConfig `yaml:"coordinator"` // config for coordinator
	Isabelle    IsabelleConfig    `yaml:"isabelle"`    // config for the isabelle servers run by the executors
	Executor    ExecutorConfig    `yaml:"executor"`    // config for the executors
	API         APIConfig         `yaml:"api"`         // config for the experimental api
	Otel        OtelConfig        `yaml:"otel"`        // configuration for otel
	Broker      BrokerConfig      `yaml:"broker"`      // configuration for broker
	Logging     LoggingConfig     `yaml:"logging"`     // configuration for logging output/level
}

primary config for ISM

func Default

func Default() Config

return a new instance of the "default" config options

func (*Config) String

func (c *Config) String() string

func (*Config) ValidateRoles

func (c *Config) ValidateRoles(logger log.Logger) error

type ConsoleExporterConfig

type ConsoleExporterConfig struct {
	Pretty      bool   `yaml:"pretty"`      // whether to pretty print the output
	Destination string `yaml:"destination"` // either "stdin", "stderr" or file path
}

configuration of OTEL console exporter writes output as JSON to Destination

func (*ConsoleExporterConfig) String

func (cec *ConsoleExporterConfig) String() string

type ContainerConfig

type ContainerConfig struct {
	Image    string `yaml:"image"`               // image alias
	ID       string `yaml:"id,omitempty"`        // isabelle version id in image
	Version  string `yaml:"version,omitempty"`   // isabelle version in image
	Default  bool   `yaml:"default,omitempty"`   // wether this is the default container
	SkipPull bool   `yaml:"skip_pull,omitempty"` // wether to skip the container pull, useful if already in local registry or offline
}

configuration for an container variant

func (*ContainerConfig) String

func (cc *ContainerConfig) String() string

type CoordinatorConfig

type CoordinatorConfig struct {
	ServiceConfig              `yaml:"service"`            // config for gRPC server
	keepalive.ClientParameters `yaml:"upstream_keepalive"` // config for client keepalive
	Upstreams                  map[string]*BrokerConn      `yaml:"upstreams"`                 // List of upstreams
	Timeouts                   TimeoutConfig               `yaml:"timeout"`                   // timeout configuration, also defined retries etc.
	TickerInterval             int64                       `yaml:"ticker_interval,omitempty"` // Ticker Interval in ms, default 5s
	Encryption                 TransportConfig             `yaml:"mtls"`                      // transport encryption for broker gRPC
}

config for coordinator

func (*CoordinatorConfig) String

func (cc *CoordinatorConfig) String() string

type DockerConfig

type DockerConfig struct {
	Enable           bool                       `yaml:"enable,omitempty"`            // Wether to enable the executor
	Name             string                     `yaml:"name"`                        // Name of host container
	Containers       map[string]ContainerConfig `yaml:"containers"`                  // list of container variants
	Prefix           string                     `yaml:"prefix,omitempty"`            // prefix for containers and networks
	NetworkIsolation bool                       `yaml:"network_isolation,omitempty"` // wether to manage networks
	Mode             DockerExecutorMode         `yaml:"operation_mode,omitempty"`
	SpareNetworks    int                        `yaml:"spare_networks,omitempty"` // number of spare networks

}

config for the docker executor

func (*DockerConfig) String

func (dc *DockerConfig) String() string

type DockerExecutorMode

type DockerExecutorMode = string
var (
	DCContainer DockerExecutorMode = "container" // running inside a container
	DCHost      DockerExecutorMode = "host"      // running on the host
)

type EndpointConfig

type EndpointConfig struct {
	AddrPort string `yaml:"host"`     // host:port of endpoint
	Insecure bool   `yaml:"insecure"` // whether to use http
	Path     string `yaml:"path"`     // path of endpoint
}

endpoint configuration to override otlp handling by lib If not defined, the default is to look for env variables as defined in https://pkg.go.dev/go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc#WithEndpointURL ISM always defers to the defaults of the underlying libraries

func (*EndpointConfig) String

func (ec *EndpointConfig) String() string

type ExecutorConfig

type ExecutorConfig struct {
	Local  *LocalConfig  `yaml:"local,omitempty"`  // config for local executor
	Docker *DockerConfig `yaml:"docker,omitempty"` // config for the docker executor
}

config for executors

func (*ExecutorConfig) String

func (ec *ExecutorConfig) String() string

type HTTPExporterConfig

type HTTPExporterConfig struct {
	Compression string                     `yaml:"compression"` // compression type, enum of ("", "gzip")
	Endpoint    EndpointConfig             `yaml:"endpoint"`    // otlp endpoint
	Retry       *otlptracehttp.RetryConfig `yaml:"retry"`       // retry config
}

configuration for HTTP otel exporter, used for pushing to otel-collector

func (*HTTPExporterConfig) String

func (cfg *HTTPExporterConfig) String() string

type ISMRole

type ISMRole = string
const (
	CoordinatorRole ISMRole = "coordinator"
	APIRole         ISMRole = "api"
	BrokerRole      ISMRole = "broker"
	AgentRole       ISMRole = "agent"
)

type IsabelleConfig

type IsabelleConfig struct {
	ToolOptions                 string        `yaml:"java_options"`                          // ISABELLE_TOOL_JAVA_OPTIONS
	MaxConnections              int32         `yaml:"max_connections"`                       // Allowed clients per instance
	Mounts                      []string      `yaml:"shared_directories"`                    // directories made available to all clients
	Timeouts                    TimeoutConfig `yaml:"timeouts"`                              // timeouts for various actions
	MaxOperations               uint32        `yaml:"max_operations"`                        // maximum amount of operations to perform on a server before recycling it
	MaxTime                     int64         `yaml:"max_lifetime"`                          // maximum amount of time in seconds a server may be alive
	OperationFailureRate        float32       `yaml:"operation_failure_rate"`                // failure rate of operations in window until a server is declared unhealthy
	OperationFailureRateWindow  int64         `yaml:"operation_failure_rate_window_seconds"` // window for `OperationFailureRate` in seconds
	OperationFailureRateMinimum uint          `yaml:"operation_failure_rate_window_minimum"` // minimum amount of operations in window to check the failure rate
	MaxRAM                      int64         `yaml:"max_memory_reservation"`                // soft limit on memory consumption per server instance
}

configuration for the isabelle instances

func (*IsabelleConfig) String

func (ic *IsabelleConfig) String() string

type LoadFactorConfig

type LoadFactorConfig struct {
	Method         LoadMethod `yaml:"method"`            // selected load factor source
	StaticValue    uint32     `yaml:"value"`             // static value, only relevant if method == `static`
	ProcMountpoint string     `yaml:"procfs_mountpoint"` // procfs mountpoint
}

func (*LoadFactorConfig) String

func (lfc *LoadFactorConfig) String() string

type LoadMethod

type LoadMethod = string
const (
	LoadMethodProc     LoadMethod = "proc"
	LoadMethodExecutor LoadMethod = "executor"
	LoadMethodStatic   LoadMethod = "static"
)

type LocalConfig

type LocalConfig struct {
	Enable     bool       `yaml:"enable,omitempty"`     // Wether to enable the executor
	Executable string     `yaml:"executable,omitempty"` // Path to patched isabelle binary
	Ports      []uint16   `yaml:"ports"`                // range of ports used by server
	Pipe       PipeConfig `yaml:"pipe,omitempty"`       // wether to pipe stdout/stderr into debug logs after startup
}

config for the local executor

func (*LocalConfig) String

func (lc *LocalConfig) String() string

type LoggingConfig

type LoggingConfig struct {
	Output string `yaml:"destination"`
	Level  string `yaml:"level"`
}

configuration for logging output level and location

func (*LoggingConfig) Options

func (lc *LoggingConfig) Options() (io.Writer, level.Value, error)

parse logging options and provide relevant writer and decoded log level

type MonitoringConfig

type MonitoringConfig struct {
	Enable          bool          `yaml:"enable,omitempty"`          // enable listener for prometheus server
	Bind            string        `yaml:"bind,omitempty"`            // bind address:port for monitoring endpoint
	Pprof           bool          `yaml:"pprof"`                     // Wether to expose pprof endpoints
	TickerInterval  int64         `yaml:"ticker_interval,omitempty"` // Ticker Interval in ms, default 5s
	ShutdownTimeout time.Duration `yaml:"shutdown_timeout"`          // Timeout for shutdown of HTTP server
}

configuration for broker monitoring

func (*MonitoringConfig) String

func (mc *MonitoringConfig) String() string

type OtelConfig

type OtelConfig struct {
	Exporter string                `yaml:"exporter"`  // exporter enum for traces (console, otlp)
	ID       string                `yaml:"id"`        // user id (instance id) for traces
	Sampling OtelSamplingConfig    `yaml:"sampling"`  // local sampling rules for traces
	Console  ConsoleExporterConfig `yaml:"console"`   // config for console trace exporter, only relevant if exporter == "console"
	HTTP     HTTPExporterConfig    `yaml:"otlp-http"` // config for otlp HTTP exporter, only relevant if exporter == "otlp-http"
}

func (*OtelConfig) String

func (oc *OtelConfig) String() string

type OtelDropSamplingConfig

type OtelDropSamplingConfig struct {
	Enable bool     `yaml:"enable"` // enable dropping spans by exact name
	Names  []string `yaml:"names"`  // span names or gRPC full method names to drop
}

type OtelExporter

type OtelExporter = string
var (
	ConsoleExporter OtelExporter = "console"
	HTTPExporter    OtelExporter = "otlp"
)

type OtelSamplingConfig

type OtelSamplingConfig struct {
	Drop OtelDropSamplingConfig `yaml:"drop"` // spans to drop before export
}

type PipeConfig

type PipeConfig struct {
	Enable   bool   `yaml:"enable,omitempty"`  // wether to enable server output pipes
	Capture  string `yaml:"capture,omitempty"` // wether to capture "stdout", "stderr" or "both"
	LogLevel string `yaml:"level,omitempty"`   // output log level
}

config for output handling of local executor

func (*PipeConfig) String

func (pc *PipeConfig) String() string

type ReplicaConfig

type ReplicaConfig struct {
	Enable      bool   `yaml:"enable"`      // whether to maintain a replica server
	Consistency string `yaml:"consistency"` // consistency mode to use, either `strict` or `eventual`
}

func (*ReplicaConfig) String

func (rc *ReplicaConfig) String() string

type ServiceConfig

type ServiceConfig struct {
	keepalive.ServerParameters  `yaml:"keepalive"`
	keepalive.EnforcementPolicy `yaml:"keepalive_limits"`
	MaxMessageSize              int             `yaml:"message_size"` // max message size in bytes allowed for a single gRPC message
	Bind                        string          `yaml:"bind"`         // Address to bind to
	Reflection                  bool            `yaml:"reflection"`   // enable grpc reflection
	Channelz                    bool            `yaml:"channelz"`     // enable channelz
	Encryption                  TransportConfig `yaml:"mtls"`         // transport encryption
}

shared config for services exposing a gRPC endpoint

type TimeoutConfig

type TimeoutConfig struct {
	Connection time.Duration `yaml:"connection"` // timeout for initial connection
	Session    time.Duration `yaml:"session"`    // timeout for creation of new sessions
	Request    time.Duration `yaml:"request"`    // total request timeout
	Shutdown   time.Duration `yaml:"shutdown"`   // graceful shutdown timeout
	Retries    uint          `yaml:"retries"`    // retries for connection
}

func (*TimeoutConfig) String

func (tc *TimeoutConfig) String() string

func (*TimeoutConfig) Validate

func (tc *TimeoutConfig) Validate(logger log.Logger) error

type TransportConfig

type TransportConfig struct {
	Enable      bool   `yaml:"enable,omitempty"` // enable [mTLS](https://www.cloudflare.com/learning/access-management/what-is-mutual-tls/)
	Certificate string `yaml:"certificate"`      // service certificate
	Key         string `yaml:"key"`              // service key
	CA          string `yaml:"ca"`               // ca certificate
}

configuration for mTLS on gRPC services

func (*TransportConfig) Config

func (tc *TransportConfig) Config(logger log.Logger) (*tls.Config, error)

func (*TransportConfig) String

func (tc *TransportConfig) String() string

Source Files

  • lib.go

Jump to

Keyboard shortcuts

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