cmd

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Sep 4, 2026 License: MIT Imports: 32 Imported by: 0

Documentation

Index

Constants

View Source
const TokenEnvVar = "PHILHARMONIC_TOKEN"

the environment variable the client commands read the manager API bearer token from. overrides client.token/token_file from the config file if present

Variables

This section is empty.

Functions

func Execute

func Execute()

Types

type ClientConfig

type ClientConfig struct {
	Manager   *string        `yaml:"manager"`
	TLS       *TLSFileConfig `yaml:"tls"`
	Token     *string        `yaml:"token"`
	TokenFile *string        `yaml:"token_file"`
}

for cli's 'nodes', 'status', 'run', 'stop'

type Config

type Config struct {
	Manager   *ManagerConfig   `yaml:"manager"`
	Worker    *WorkerConfig    `yaml:"worker"`
	Node      *NodeConfig      `yaml:"node"`
	Scheduler *SchedulerConfig `yaml:"scheduler"`
	Task      *TaskConfig      `yaml:"task"`
	Client    *ClientConfig    `yaml:"client"`
	HTTP      *HTTPConfig      `yaml:"http"`
}

type HTTPConfig

type HTTPConfig struct {
	ClientTimeout *string `yaml:"client_timeout"` // duration

	// bounds long-running worker operations such as image pulls,
	// which routinely outlast client_timeout
	LongOpTimeout *string `yaml:"long_op_timeout"` // duration
}

type ManagerAuthConfig

type ManagerAuthConfig struct {
	// TokenFile is a YAML file of bearer token records (user, role,
	// token_hash). Empty/nil disables authentication.
	TokenFile *string `yaml:"token_file"`
}

configures user authentication on the manager API

type ManagerConfig

type ManagerConfig struct {
	Host      *string            `yaml:"host"`
	Port      *int               `yaml:"port"`
	Workers   []string           `yaml:"workers"`
	Scheduler *string            `yaml:"scheduler"`
	DBType    *string            `yaml:"dbtype"`
	TLS       *TLSFileConfig     `yaml:"tls"`
	Auth      *ManagerAuthConfig `yaml:"auth"`

	DbFile             *string `yaml:"db_file"`
	DbTaskBucket       *string `yaml:"db_task_bucket"`
	DbEventBucket      *string `yaml:"db_event_bucket"`
	MaxRestarts        *int    `yaml:"max_restarts"`
	RestartBackoffBase *string `yaml:"restart_backoff_base"` // duration
	RestartBackoffMax  *string `yaml:"restart_backoff_max"`  // duration
	LoopInterval       *string `yaml:"loop_interval"`        // duration
	ApiShutdownTimeout *string `yaml:"api_shutdown_timeout"` // duration
}

type NodeConfig

type NodeConfig struct {
	StatsQueryMaxRetries  *int    `yaml:"stats_query_max_retries"`
	StatsQuerySleepPeriod *string `yaml:"stats_query_sleep_period"` // duration
	PortsQueryTimeout     *string `yaml:"ports_query_timeout"`      // duration
}

type SchedulerConfig

type SchedulerConfig struct {
	EpvmMaxJobs        *int     `yaml:"epvm_max_jobs"`
	EpvmMaxSafeCPUUtil *float64 `yaml:"epvm_max_safe_cpu_util"`
}

type TLSFileConfig

type TLSFileConfig struct {
	CertFile     *string `yaml:"cert_file"`
	KeyFile      *string `yaml:"key_file"`
	CAFile       *string `yaml:"ca_file"`
	ClientCAFile *string `yaml:"client_ca_file"`
}

the shared shape of the per-role "tls" config sections which fields are meaningful depends on the role:

manager: cert/key = manager API server identity (also presented to
         workers when talking to them); ca_file = trust root for worker
         certificates; client_ca_file = require client certs (mTLS) on
         the manager API
worker:  cert/key = worker API server identity; client_ca_file =
         require client certs (mTLS), i.e. only certificate holders
         (normally the manager) may reach the worker API
client:  ca_file = trust root for the manager's (and workers')
         certificates; cert/key = client certificate presented
         to mTLS-protected servers

type TaskConfig

type TaskConfig struct {
	HealthCheckDefaultInterval    *int `yaml:"health_check_default_interval"`
	HealthCheckDefaultTimeout     *int `yaml:"health_check_default_timeout"`
	HealthCheckDefaultRetries     *int `yaml:"health_check_default_retries"`
	HealthCheckDefaultStartPeriod *int `yaml:"health_check_default_start_period"`
}

type WorkerConfig

type WorkerConfig struct {
	Host   *string        `yaml:"host"`
	Port   *int           `yaml:"port"`
	Name   *string        `yaml:"name"`
	DBType *string        `yaml:"dbtype"`
	TLS    *TLSFileConfig `yaml:"tls"`

	DbFilename         *string `yaml:"db_filename"`
	DbBucketName       *string `yaml:"db_bucket_name"`
	DbLogBucketName    *string `yaml:"db_log_bucket_name"`
	LogCaptureMaxLines *int    `yaml:"log_capture_max_lines"`
	LoopInterval       *string `yaml:"loop_interval"`        // duration
	ApiShutdownTimeout *string `yaml:"api_shutdown_timeout"` // duration
}

Jump to

Keyboard shortcuts

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