Documentation
¶
Index ¶
Constants ¶
const AppConfigPath = ".miren/app.toml"
Variables ¶
This section is empty.
Functions ¶
func SaveAppState ¶ added in v0.4.0
SaveAppState writes the cluster state for the named app. Uses a file lock to make the read-modify-write atomic across processes.
Types ¶
type AddonConfig ¶ added in v0.4.0
type AddonConfig struct {
Variant string `toml:"variant"`
}
AddonConfig represents configuration for an addon in app.toml.
type AppConfig ¶
type AppConfig struct {
Name string `toml:"name"`
PostImport string `toml:"post_import"`
EnvVars []AppEnvVar `toml:"env"`
Concurrency *int `toml:"concurrency"`
Services map[string]*ServiceConfig `toml:"services"`
Build *BuildConfig `toml:"build"`
Include []string `toml:"include"`
Addons map[string]*AddonConfig `toml:"addons"`
}
func GetDefaultsForServices ¶
GetDefaultsForServices returns an AppConfig with defaults resolved for given service names. This is useful for migration - it provides the same defaults used at build time.
func LoadAppConfig ¶
func LoadAppConfigUnder ¶
func (*AppConfig) ResolveDefaults ¶
ResolveDefaults populates Services map for all service names with fully-resolved defaults. If a service already has explicit config in app.toml, it is preserved. Otherwise, defaults are applied based on service name:
- "web": auto mode, requests_per_instance=10, scale_down_delay=15m
- others: fixed mode, num_instances=1
type AppState ¶ added in v0.4.0
type AppState struct {
Cluster string `toml:"cluster"`
}
func LoadAppState ¶ added in v0.4.0
LoadAppState reads the cluster state for the named app. Returns nil, nil if no state has been saved for this app.
type BuildConfig ¶
type DiskConfig ¶
type DiskConfig struct {
Name string `toml:"name"`
MountPath string `toml:"mount_path"`
ReadOnly bool `toml:"read_only"`
SizeGB int `toml:"size_gb"`
Filesystem string `toml:"filesystem"`
LeaseTimeout string `toml:"lease_timeout"`
}
DiskConfig represents a disk attachment for a service
type ServiceConcurrencyConfig ¶
type ServiceConcurrencyConfig struct {
Mode string `toml:"mode"` // "auto" or "fixed"
RequestsPerInstance int `toml:"requests_per_instance"`
ScaleDownDelay string `toml:"scale_down_delay"` // e.g. "2m", "15m"
NumInstances int `toml:"num_instances"`
ShutdownTimeout string `toml:"shutdown_timeout"` // e.g. "10s", "30s" - time to wait for graceful shutdown
}
ServiceConcurrencyConfig represents per-service concurrency configuration
type ServiceConfig ¶
type ServiceConfig struct {
Command string `toml:"command"`
Port int `toml:"port"`
PortName string `toml:"port_name"`
PortType string `toml:"port_type"`
Image string `toml:"image"`
EnvVars []AppEnvVar `toml:"env"`
Concurrency *ServiceConcurrencyConfig `toml:"concurrency"`
Disks []DiskConfig `toml:"disks"`
}
ServiceConfig represents configuration for a specific service