config

package
v0.2400.0 Latest Latest
Warning

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

Go to latest
Published: May 13, 2024 License: Apache-2.0 Imports: 5 Imported by: 3

Documentation

Overview

Package config implements global configuration options.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ComponentConfig added in v0.2400.0

type ComponentConfig struct {
	// ID is the component identifier.
	ID component.ID `yaml:"id"`

	// Disabled specifies whether the component is disabled. If a component is specified and not
	// disabled, it is enabled.
	Disabled bool `yaml:"disabled,omitempty"`
}

ComponentConfig is the component configuration.

func (*ComponentConfig) UnmarshalYAML added in v0.2400.0

func (c *ComponentConfig) UnmarshalYAML(value *yaml.Node) error

UnmarshalYAML implements yaml.Unmarshaler.

type Config

type Config struct {
	// Runtime provisioner to use (mock, unconfined, sandboxed).
	Provisioner RuntimeProvisioner `yaml:"provisioner"`
	// Paths to runtime bundles.
	Paths []string `yaml:"paths"`
	// Path to the sandbox binary (bubblewrap).
	SandboxBinary string `yaml:"sandbox_binary"`
	// Path to SGXS runtime loader binary (for SGX runtimes).
	SGXLoader string `yaml:"sgx_loader"`
	// The runtime environment (sgx, elf, auto).
	Environment RuntimeEnvironment `yaml:"environment"`

	// History pruner configuration.
	Prune PruneConfig `yaml:"prune,omitempty"`

	// Runtime ID -> local config.
	RuntimeConfig map[string]interface{} `yaml:"config,omitempty"`

	// Address(es) of sentry node(s) to connect to of the form [PubKey@]ip:port
	// (where the PubKey@ part represents base64 encoded node TLS public key).
	SentryAddresses []string `yaml:"sentry_addresses,omitempty"`

	// Transaction pool configuration.
	TxPool tpConfig.Config `yaml:"tx_pool,omitempty"`

	// Number of epochs before runtime activation epoch when to start the runtime to warm it up and
	// prepare any required attestations. Zero disables pre-warming.
	PreWarmEpochs uint64 `yaml:"pre_warm_epochs,omitempty"`

	// AttestInterval is the interval for periodic runtime re-attestation. If not specified
	// a default will be used.
	AttestInterval time.Duration `yaml:"attest_interval,omitempty"`

	// LoadBalancer is the load balancer configuration.
	LoadBalancer LoadBalancerConfig `yaml:"load_balancer,omitempty"`

	// Components is the list of components to configure.
	Components []ComponentConfig `yaml:"components,omitempty"`
}

Config is the runtime registry configuration structure.

func DefaultConfig

func DefaultConfig() Config

DefaultConfig returns the default configuration settings.

func (*Config) GetComponent added in v0.2400.0

func (c *Config) GetComponent(id component.ID) (ComponentConfig, bool)

GetComponent returns configuration for the given component if it exists.

func (*Config) Validate

func (c *Config) Validate() error

Validate validates the configuration settings.

type LoadBalancerConfig added in v0.2400.0

type LoadBalancerConfig struct {
	// NumInstances is the number of runtime instances to provision for load-balancing. Setting it
	// to zero (default) or one disables load balancing.
	NumInstances uint64 `yaml:"num_instances,omitempty"`
}

LoadBalancerConfig is the load balancer configuration.

type PruneConfig

type PruneConfig struct {
	// History pruner strategy.
	Strategy string `yaml:"strategy"`
	// History pruning interval.
	Interval time.Duration `yaml:"interval"`
	// Number of last rounds to keep.
	NumKept uint64 `yaml:"num_kept"`
}

PruneConfig is the history pruner configuration structure.

type RuntimeEnvironment

type RuntimeEnvironment string

RuntimeEnvironment is the runtime environment.

const (
	// RuntimeEnvironmentSGX specifies to run the runtime in SGX.
	RuntimeEnvironmentSGX RuntimeEnvironment = "sgx"

	// RuntimeEnvironmentSGXMock specifies to run the runtime in mocked SGX.
	//
	// Use of this runtime environment is only allowed if DebugDontBlameOasis flag is set.
	RuntimeEnvironmentSGXMock RuntimeEnvironment = "sgx-mock"

	// RuntimeEnvironmentELF specifies to run the runtime in the OS address space.
	//
	// Use of this runtime environment is only allowed if DebugDontBlameOasis flag is set.
	RuntimeEnvironmentELF RuntimeEnvironment = "elf"

	// RuntimeEnvironmentAuto specifies to run the runtime in the most appropriate location.
	RuntimeEnvironmentAuto RuntimeEnvironment = "auto"
)

type RuntimeProvisioner

type RuntimeProvisioner string

RuntimeProvisioner is the runtime provisioner.

const (
	// RuntimeProvisionerMock is the name of the mock runtime provisioner.
	//
	// Use of this provisioner is only allowed if DebugDontBlameOasis flag is set.
	RuntimeProvisionerMock RuntimeProvisioner = "mock"

	// RuntimeProvisionerUnconfined is the name of the unconfined runtime
	// provisioner that executes runtimes as regular processes without any
	// sandboxing.
	//
	// Use of this provisioner is only allowed if DebugDontBlameOasis flag is set.
	RuntimeProvisionerUnconfined RuntimeProvisioner = "unconfined"

	// RuntimeProvisionerSandboxed is the name of the sandboxed runtime
	// provisioner that executes runtimes as regular processes in a Linux
	// namespaces/cgroups/SECCOMP sandbox.
	RuntimeProvisionerSandboxed RuntimeProvisioner = "sandboxed"
)

func (*RuntimeProvisioner) UnmarshalText

func (m *RuntimeProvisioner) UnmarshalText(text []byte) error

UnmarshalText decodes a text marshaled runtime provisioner.

Jump to

Keyboard shortcuts

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