types

package
v1.5.0-alpha7 Latest Latest
Warning

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

Go to latest
Published: Sep 26, 2024 License: Apache-2.0 Imports: 18 Imported by: 0

Documentation

Index

Constants

View Source
const (
	Second = Duration(time.Second)
	Minute = Duration(time.Minute)
	Day    = Duration(time.Hour * 24)
)
View Source
const APIAuthAccessPolicyPathKey = "api.auth.accesspolicypath"
View Source
const APIAuthMethodsKey = "api.auth.methods"
View Source
const APIHostKey = "api.host"
View Source
const APIPortKey = "api.port"
View Source
const APITLSAutoCertCachePathKey = "api.tls.autocertcachepath"
View Source
const APITLSAutoCertKey = "api.tls.autocert"
View Source
const APITLSCAFileKey = "api.tls.cafile"
View Source
const APITLSCertFileKey = "api.tls.certfile"
View Source
const APITLSInsecureKey = "api.tls.insecure"
View Source
const APITLSKeyFileKey = "api.tls.keyfile"
View Source
const APITLSSelfSignedKey = "api.tls.selfsigned"
View Source
const APITLSUseTLSKey = "api.tls.usetls"
View Source
const AuthTokensFileName = "tokens.json"
View Source
const ComputeAllocatedCapacityCPUKey = "compute.allocatedcapacity.cpu"
View Source
const ComputeAllocatedCapacityDiskKey = "compute.allocatedcapacity.disk"
View Source
const ComputeAllocatedCapacityGPUKey = "compute.allocatedcapacity.gpu"
View Source
const ComputeAllocatedCapacityMemoryKey = "compute.allocatedcapacity.memory"
View Source
const ComputeAllowListedLocalPathsKey = "compute.allowlistedlocalpaths"
View Source
const ComputeDirName = "compute"
View Source
const ComputeEnabledKey = "compute.enabled"
View Source
const ComputeHeartbeatInfoUpdateIntervalKey = "compute.heartbeat.infoupdateinterval"
View Source
const ComputeHeartbeatIntervalKey = "compute.heartbeat.interval"
View Source
const ComputeHeartbeatResourceUpdateIntervalKey = "compute.heartbeat.resourceupdateinterval"
View Source
const ComputeLabelsKey = "compute.labels"
View Source
const ComputeOrchestratorsKey = "compute.orchestrators"
View Source
const ComputeTLSAutoCertCachePathKey = "compute.tls.autocertcachepath"
View Source
const ComputeTLSAutoCertKey = "compute.tls.autocert"
View Source
const ComputeTLSCAFileKey = "compute.tls.cafile"
View Source
const ComputeTLSCertFileKey = "compute.tls.certfile"
View Source
const ComputeTLSInsecureKey = "compute.tls.insecure"
View Source
const ComputeTLSKeyFileKey = "compute.tls.keyfile"
View Source
const ComputeTLSSelfSignedKey = "compute.tls.selfsigned"
View Source
const ComputeTLSUseTLSKey = "compute.tls.usetls"
View Source
const DataDirKey = "datadir"
View Source
const DisableAnalyticsKey = "disableanalytics"
View Source
const EnginesDisabledKey = "engines.disabled"
View Source
const EnginesTypesDockerManifestCacheRefreshKey = "engines.types.docker.manifestcache.refresh"
View Source
const EnginesTypesDockerManifestCacheSizeKey = "engines.types.docker.manifestcache.size"
View Source
const EnginesTypesDockerManifestCacheTTLKey = "engines.types.docker.manifestcache.ttl"
View Source
const ExecutionDirName = "executions"
View Source
const ExecutionStoreFileName = "state_boltdb.db"
View Source
const FeatureFlagsExecTranslationKey = "featureflags.exectranslation"
View Source
const InputSourcesDisabledKey = "inputsources.disabled"
View Source
const InputSourcesMaxRetryCountKey = "inputsources.maxretrycount"
View Source
const InputSourcesReadTimeoutKey = "inputsources.readtimeout"
View Source
const InputSourcesTypesIPFSEndpointKey = "inputsources.types.ipfs.endpoint"
View Source
const InputSourcesTypesS3AccessKeyKey = "inputsources.types.s3.accesskey"
View Source
const InputSourcesTypesS3EndpointKey = "inputsources.types.s3.endpoint"
View Source
const InputSourcesTypesS3SecretKeyKey = "inputsources.types.s3.secretkey"
View Source
const JobAdmissionControlAcceptNetworkedJobsKey = "jobadmissioncontrol.acceptnetworkedjobs"
View Source
const JobAdmissionControlProbeExecKey = "jobadmissioncontrol.probeexec"
View Source
const JobAdmissionControlProbeHTTPKey = "jobadmissioncontrol.probehttp"
View Source
const JobAdmissionControlRejectStatelessJobsKey = "jobadmissioncontrol.rejectstatelessjobs"
View Source
const JobDefaultsBatchPriorityKey = "jobdefaults.batch.priority"
View Source
const JobDefaultsBatchTaskPublisherConfigParamsKey = "jobdefaults.batch.task.publisher.config.params"
View Source
const JobDefaultsBatchTaskPublisherConfigTypeKey = "jobdefaults.batch.task.publisher.config.type"
View Source
const JobDefaultsBatchTaskResourcesCPUKey = "jobdefaults.batch.task.resources.cpu"
View Source
const JobDefaultsBatchTaskResourcesDiskKey = "jobdefaults.batch.task.resources.disk"
View Source
const JobDefaultsBatchTaskResourcesGPUKey = "jobdefaults.batch.task.resources.gpu"
View Source
const JobDefaultsBatchTaskResourcesMemoryKey = "jobdefaults.batch.task.resources.memory"
View Source
const JobDefaultsBatchTaskTimeoutsExecutionTimeoutKey = "jobdefaults.batch.task.timeouts.executiontimeout"
View Source
const JobDefaultsBatchTaskTimeoutsTotalTimeoutKey = "jobdefaults.batch.task.timeouts.totaltimeout"
View Source
const JobDefaultsDaemonPriorityKey = "jobdefaults.daemon.priority"
View Source
const JobDefaultsDaemonTaskResourcesCPUKey = "jobdefaults.daemon.task.resources.cpu"
View Source
const JobDefaultsDaemonTaskResourcesDiskKey = "jobdefaults.daemon.task.resources.disk"
View Source
const JobDefaultsDaemonTaskResourcesGPUKey = "jobdefaults.daemon.task.resources.gpu"
View Source
const JobDefaultsDaemonTaskResourcesMemoryKey = "jobdefaults.daemon.task.resources.memory"
View Source
const JobDefaultsOpsPriorityKey = "jobdefaults.ops.priority"
View Source
const JobDefaultsOpsTaskPublisherConfigParamsKey = "jobdefaults.ops.task.publisher.config.params"
View Source
const JobDefaultsOpsTaskPublisherConfigTypeKey = "jobdefaults.ops.task.publisher.config.type"
View Source
const JobDefaultsOpsTaskResourcesCPUKey = "jobdefaults.ops.task.resources.cpu"
View Source
const JobDefaultsOpsTaskResourcesDiskKey = "jobdefaults.ops.task.resources.disk"
View Source
const JobDefaultsOpsTaskResourcesGPUKey = "jobdefaults.ops.task.resources.gpu"
View Source
const JobDefaultsOpsTaskResourcesMemoryKey = "jobdefaults.ops.task.resources.memory"
View Source
const JobDefaultsOpsTaskTimeoutsExecutionTimeoutKey = "jobdefaults.ops.task.timeouts.executiontimeout"
View Source
const JobDefaultsOpsTaskTimeoutsTotalTimeoutKey = "jobdefaults.ops.task.timeouts.totaltimeout"
View Source
const JobDefaultsServicePriorityKey = "jobdefaults.service.priority"
View Source
const JobDefaultsServiceTaskResourcesCPUKey = "jobdefaults.service.task.resources.cpu"
View Source
const JobDefaultsServiceTaskResourcesDiskKey = "jobdefaults.service.task.resources.disk"
View Source
const JobDefaultsServiceTaskResourcesGPUKey = "jobdefaults.service.task.resources.gpu"
View Source
const JobDefaultsServiceTaskResourcesMemoryKey = "jobdefaults.service.task.resources.memory"
View Source
const JobStoreFileName = "state_boltdb.db"
View Source
const LoggingLevelKey = "logging.level"
View Source
const LoggingLogDebugInfoIntervalKey = "logging.logdebuginfointerval"
View Source
const LoggingModeKey = "logging.mode"
View Source
const NameProviderKey = "nameprovider"
View Source
const NetworkTransportDirName = "nats-store"
View Source
const OrchestratorAdvertiseKey = "orchestrator.advertise"
View Source
const OrchestratorAuthSecretKey = "orchestrator.authsecret"
View Source
const OrchestratorClusterAdvertiseKey = "orchestrator.cluster.advertise"
View Source
const OrchestratorClusterHostKey = "orchestrator.cluster.host"
View Source
const OrchestratorClusterNameKey = "orchestrator.cluster.name"
View Source
const OrchestratorClusterPeersKey = "orchestrator.cluster.peers"
View Source
const OrchestratorClusterPortKey = "orchestrator.cluster.port"
View Source
const OrchestratorDirName = "orchestrator"
View Source
const OrchestratorEnabledKey = "orchestrator.enabled"
View Source
const OrchestratorEvaluationBrokerMaxRetryCountKey = "orchestrator.evaluationbroker.maxretrycount"
View Source
const OrchestratorEvaluationBrokerVisibilityTimeoutKey = "orchestrator.evaluationbroker.visibilitytimeout"
View Source
const OrchestratorHostKey = "orchestrator.host"
View Source
const OrchestratorNodeManagerDisconnectTimeoutKey = "orchestrator.nodemanager.disconnecttimeout"
View Source
const OrchestratorNodeManagerManualApprovalKey = "orchestrator.nodemanager.manualapproval"
View Source
const OrchestratorPortKey = "orchestrator.port"
View Source
const OrchestratorSchedulerHousekeepingIntervalKey = "orchestrator.scheduler.housekeepinginterval"
View Source
const OrchestratorSchedulerHousekeepingTimeoutKey = "orchestrator.scheduler.housekeepingtimeout"
View Source
const OrchestratorSchedulerWorkerCountKey = "orchestrator.scheduler.workercount"
View Source
const OrchestratorTLSAutoCertCachePathKey = "orchestrator.tls.autocertcachepath"
View Source
const OrchestratorTLSAutoCertKey = "orchestrator.tls.autocert"
View Source
const OrchestratorTLSCAFileKey = "orchestrator.tls.cafile"
View Source
const OrchestratorTLSCertFileKey = "orchestrator.tls.certfile"
View Source
const OrchestratorTLSInsecureKey = "orchestrator.tls.insecure"
View Source
const OrchestratorTLSKeyFileKey = "orchestrator.tls.keyfile"
View Source
const OrchestratorTLSSelfSignedKey = "orchestrator.tls.selfsigned"
View Source
const OrchestratorTLSUseTLSKey = "orchestrator.tls.usetls"
View Source
const PluginsDirName = "plugins"
View Source
const PublishersDisabledKey = "publishers.disabled"
View Source
const PublishersTypesIPFSEndpointKey = "publishers.types.ipfs.endpoint"
View Source
const PublishersTypesLocalAddressKey = "publishers.types.local.address"
View Source
const PublishersTypesLocalDirectoryKey = "publishers.types.local.directory"
View Source
const PublishersTypesLocalPortKey = "publishers.types.local.port"
View Source
const PublishersTypesS3PreSignedURLDisabledKey = "publishers.types.s3.presignedurldisabled"
View Source
const PublishersTypesS3PreSignedURLExpirationKey = "publishers.types.s3.presignedurlexpiration"
View Source
const ResultDownloadersDisabledKey = "resultdownloaders.disabled"
View Source
const ResultDownloadersTimeoutKey = "resultdownloaders.timeout"
View Source
const ResultDownloadersTypesIPFSEndpointKey = "resultdownloaders.types.ipfs.endpoint"
View Source
const StrictVersionMatchKey = "strictversionmatch"
View Source
const UpdateConfigIntervalKey = "updateconfig.interval"
View Source
const UserKeyFileName = "user_id.pem"
View Source
const WebUIEnabledKey = "webui.enabled"
View Source
const WebUIListenKey = "webui.listen"

Variables

View Source
var ConfigDescriptions = map[string]string{}/* 120 elements not displayed */

ConfigDescriptions maps configuration paths to their descriptions

View Source
var Default = Bacalhau{
	DataDir: DefaultDataDir(),
	API: API{
		Host: "0.0.0.0",
		Port: 1234,
		Auth: AuthConfig{
			Methods: map[string]AuthenticatorConfig{
				"ClientKey": {
					Type: "challenge",
				},
			},
		},
	},
	NameProvider: "puuid",
	Orchestrator: Orchestrator{
		Enabled: false,
		Host:    "0.0.0.0",
		Port:    4222,
		NodeManager: NodeManager{
			DisconnectTimeout: Minute,
		},
		Scheduler: Scheduler{
			WorkerCount:          runtime.NumCPU(),
			HousekeepingInterval: 30 * Second,
			HousekeepingTimeout:  2 * Minute,
		},
		EvaluationBroker: EvaluationBroker{
			VisibilityTimeout: Minute,
			MaxRetryCount:     10,
		},
	},
	Compute: Compute{
		Enabled:       false,
		Orchestrators: []string{"nats://127.0.0.1:4222"},
		Heartbeat: Heartbeat{
			InfoUpdateInterval:     Minute,
			ResourceUpdateInterval: 30 * Second,
			Interval:               15 * Second,
		},
		AllocatedCapacity: ResourceScaler{
			CPU:    "70%",
			Memory: "70%",
			Disk:   "70%",
			GPU:    "100%",
		},
	},
	JobDefaults: JobDefaults{
		Batch: BatchJobDefaultsConfig{
			Priority: 0,
			Task: BatchTaskDefaultConfig{
				Resources: ResourcesConfig{
					CPU:    "500m",
					Memory: "1Gb",
				},
			},
		},
		Ops: BatchJobDefaultsConfig{
			Priority: 0,
			Task: BatchTaskDefaultConfig{
				Resources: ResourcesConfig{
					CPU:    "500m",
					Memory: "1Gb",
				},
			},
		},
		Daemon: LongRunningJobDefaultsConfig{
			Priority: 0,
			Task: LongRunningTaskDefaultConfig{
				Resources: ResourcesConfig{
					CPU:    "500m",
					Memory: "1Gb",
				},
			},
		},
		Service: LongRunningJobDefaultsConfig{
			Priority: 0,
			Task: LongRunningTaskDefaultConfig{
				Resources: ResourcesConfig{
					CPU:    "500m",
					Memory: "1Gb",
				},
			},
		},
	},
	InputSources: InputSourcesConfig{
		ReadTimeout:   Duration(5 * time.Minute),
		MaxRetryCount: 3,
	},
	Engines: EngineConfig{
		Types: EngineConfigTypes{
			Docker: Docker{
				ManifestCache: DockerManifestCache{
					Size:    1000,
					TTL:     Duration(1 * time.Hour),
					Refresh: Duration(1 * time.Hour),
				}},
		},
	},
	Logging: Logging{
		Level:                "info",
		Mode:                 "default",
		LogDebugInfoInterval: 0,
	},
	UpdateConfig: UpdateConfig{
		Interval: Day,
	},
	WebUI: WebUI{
		Enabled: false,
		Listen:  "0.0.0.0:8438",
	},
}

Default is the default configuration for a bacalhau node.

Functions

func AllKeys added in v1.5.0

func AllKeys() map[string]reflect.Type

func CastConfigValueForKey added in v1.5.0

func CastConfigValueForKey(key string, value any) (any, error)

func DefaultDataDir

func DefaultDataDir() string

DefaultDataDir determines the appropriate default directory for storing repository data. Priority order: 1. If the environment variable BACALHAU_DIR is set and non-empty, use it. 2. User's home directory with .bacalhau appended. 3. If all above fail, use .bacalhau in the current directory.

func StringSliceToMap added in v1.5.0

func StringSliceToMap(slice []string) (map[string]string, error)

Types

type API added in v1.5.0

type API struct {
	// Host specifies the hostname or IP address on which the API server listens or the client connects.
	Host string `yaml:"Host,omitempty"`
	// Port specifies the port number on which the API server listens or the client connects.
	Port int        `yaml:"Port,omitempty"`
	TLS  TLS        `yaml:"TLS,omitempty"`
	Auth AuthConfig `yaml:"Auth,omitempty"`
}

type AuthConfig added in v1.2.1

type AuthConfig struct {
	// Methods maps "method names" to authenticator implementations. A method
	// name is a human-readable string chosen by the person configuring the
	// system that is shown to users to help them pick the authentication method
	// they want to use. There can be multiple usages of the same Authenticator
	// *type* but with different configs and parameters, each identified with a
	// unique method name.
	//
	// For example, if an implementation wants to allow users to log in with
	// Github or Bitbucket, they might both use an authenticator implementation
	// of type "oidc", and each would appear once on this provider with key /
	// method name "github" and "bitbucket".
	//
	// By default, only a single authentication method that accepts
	// authentication via client keys will be enabled.
	Methods map[string]AuthenticatorConfig `yaml:"Methods,omitempty"`

	// AccessPolicyPath is the path to a file or directory that will be loaded as
	// the policy to apply to all inbound API requests. If unspecified, a policy
	// that permits access to all API endpoints to both authenticated and
	// unauthenticated users (the default as of v1.2.0) will be used.
	AccessPolicyPath string `yaml:"AccessPolicyPath,omitempty"`
}

AuthConfig is config that controls user authentication and authorization.

type AuthenticatorConfig added in v1.2.1

type AuthenticatorConfig struct {
	Type       string `yaml:"Type,omitempty"`
	PolicyPath string `yaml:"PolicyPath,omitempty"`
}

AuthenticatorConfig is config for a specific named authentication method, specifying the type of authentication and the path to a policy file that controls the method. Some implementation types may require policies that meet a certain interface beyond the default – see the documentation on that type for more info.

type Bacalhau added in v1.5.0

type Bacalhau struct {
	API API `yaml:"API,omitempty"`
	// NameProvider specifies the method used to generate names for the node. One of: hostname, aws, gcp, uuid, puuid.
	NameProvider string `yaml:"NameProvider,omitempty"`
	// DataDir specifies a location on disk where the bacalhau node will maintain state.
	DataDir string `yaml:"DataDir,omitempty"`
	// StrictVersionMatch indicates whether to enforce strict version matching.
	StrictVersionMatch  bool                `yaml:"StrictVersionMatch,omitempty"`
	Orchestrator        Orchestrator        `yaml:"Orchestrator,omitempty"`
	Compute             Compute             `yaml:"Compute,omitempty"`
	WebUI               WebUI               `yaml:"WebUI,omitempty"`
	InputSources        InputSourcesConfig  `yaml:"InputSources,omitempty"`
	Publishers          PublishersConfig    `yaml:"Publishers,omitempty"`
	Engines             EngineConfig        `yaml:"Engines,omitempty"`
	ResultDownloaders   ResultDownloaders   `yaml:"ResultDownloaders,omitempty"`
	JobDefaults         JobDefaults         `yaml:"JobDefaults,omitempty"`
	JobAdmissionControl JobAdmissionControl `yaml:"JobAdmissionControl,omitempty"`
	Logging             Logging             `yaml:"Logging,omitempty"`
	UpdateConfig        UpdateConfig        `yaml:"UpdateConfig,omitempty"`
	FeatureFlags        FeatureFlags        `yaml:"FeatureFlags,omitempty"`
	DisableAnalytics    bool                `yaml:"DisableAnalytics,omitempty"`
}

func (Bacalhau) AuthTokensPath added in v1.5.0

func (c Bacalhau) AuthTokensPath() (string, error)

func (Bacalhau) ComputeDir added in v1.5.0

func (c Bacalhau) ComputeDir() (string, error)

func (Bacalhau) ExecutionDir added in v1.5.0

func (c Bacalhau) ExecutionDir() (string, error)

func (Bacalhau) ExecutionStoreFilePath added in v1.5.0

func (c Bacalhau) ExecutionStoreFilePath() (string, error)

func (Bacalhau) JobStoreFilePath added in v1.5.0

func (c Bacalhau) JobStoreFilePath() (string, error)

func (Bacalhau) NetworkTransportDir added in v1.5.0

func (c Bacalhau) NetworkTransportDir() (string, error)

func (Bacalhau) OrchestratorDir added in v1.5.0

func (c Bacalhau) OrchestratorDir() (string, error)

func (Bacalhau) PluginsDir added in v1.5.0

func (c Bacalhau) PluginsDir() (string, error)

func (Bacalhau) UserKeyPath added in v1.5.0

func (c Bacalhau) UserKeyPath() (string, error)

type BatchJobDefaultsConfig added in v1.5.0

type BatchJobDefaultsConfig struct {
	// Priority specifies the default priority allocated to a batch or ops job.
	// This value is used when the job hasn't explicitly set its priority requirement.
	Priority int                    `yaml:"Priority,omitempty"`
	Task     BatchTaskDefaultConfig `yaml:"Task,omitempty"`
}

type BatchTaskDefaultConfig added in v1.5.0

type BatchTaskDefaultConfig struct {
	Resources ResourcesConfig        `yaml:"Resources,omitempty"`
	Publisher DefaultPublisherConfig `yaml:"Publisher,omitempty"`
	Timeouts  TaskTimeoutConfig      `yaml:"Timeouts,omitempty"`
}

type Cluster added in v1.5.0

type Cluster struct {
	// Name specifies the unique identifier for this orchestrator cluster.
	Name string `yaml:"Name,omitempty"`
	// Host specifies the hostname or IP address for cluster communication.
	Host string `yaml:"Host,omitempty"`
	// Port specifies the port number for cluster communication.
	Port int `yaml:"Port,omitempty"`
	// Advertise specifies the address to advertise to other cluster members.
	Advertise string `yaml:"Advertise,omitempty"`
	// Peers is a list of other cluster members to connect to on startup.
	Peers []string `yaml:"Peers,omitempty"`
}

type Compute added in v1.5.0

type Compute struct {
	// Enabled indicates whether the compute node is active and available for job execution.
	Enabled bool `yaml:"Enabled,omitempty"`
	// Orchestrators specifies a list of orchestrator endpoints that this compute node connects to.
	Orchestrators []string  `yaml:"Orchestrators,omitempty"`
	TLS           TLS       `yaml:"TLS,omitempty"`
	Heartbeat     Heartbeat `yaml:"Heartbeat,omitempty"`
	// Labels are key-value pairs used to describe and categorize the compute node.
	Labels            map[string]string `yaml:"Labels,omitempty"`
	AllocatedCapacity ResourceScaler    `yaml:"AllocatedCapacity,omitempty"`
	// AllowListedLocalPaths specifies a list of local file system paths that the compute node is allowed to access.
	AllowListedLocalPaths []string `yaml:"AllowListedLocalPaths"`
}

type DefaultPublisherConfig added in v1.5.0

type DefaultPublisherConfig struct {
	Config models.SpecConfig `yaml:"Config,omitempty"`
}

type Docker added in v1.5.0

type Docker struct {
	// ManifestCache specifies the settings for the Docker manifest cache.
	ManifestCache DockerManifestCache `yaml:"ManifestCache,omitempty"`
}

Docker represents the configuration settings for the Docker runtime provider.

type DockerManifestCache added in v1.5.0

type DockerManifestCache struct {
	// Size specifies the size of the Docker manifest cache.
	Size uint64 `yaml:"Size,omitempty"`
	// TTL specifies the time-to-live duration for cache entries.
	TTL Duration `yaml:"TTL,omitempty"`
	// Refresh specifies the refresh interval for cache entries.
	Refresh Duration `yaml:"Refresh,omitempty"`
}

DockerManifestCache represents the configuration settings for the Docker manifest cache.

type Duration

type Duration time.Duration

Duration is a wrapper type for time.Duration for decoding and encoding from/to YAML, etc.

func (Duration) AsTimeDuration added in v1.2.0

func (dur Duration) AsTimeDuration() time.Duration

AsTimeDuration returns Duration as a time.Duration type. It is only called in the code gen to set viper defaults. This method exists for the following reasons:

  1. our config file is yaml, and we want to use durations for configuring things, printed in a human-readable format.
  2. time.Duration does not, and will not implement MarshalText/UnmarshalText - https://github.com/golang/go/issues/16039
  3. viper.GetDuration doesn't return an error, and instead returns `0` if it fails to cast - https://github.com/spf13/viper/blob/master/viper.go#L1048 - https://github.com/spf13/cast/blob/master/caste.go#L61 viper.GetDuration is unable to cast a types.Duration to a time.Duration (see second link), so it returns 0.

To meet the 3 constraints above we write durations into viper as a time.Duration, but cast them to a types.Duration when they are added to our config structure. This allows us to: 1. Have human-readable times in out config file. 2. Have type safety on out cli, i.e. config set <duration_key> 10s 3. Return durations instead of `0` from viper.GetDuration.

func (Duration) MarshalText

func (dur Duration) MarshalText() ([]byte, error)

func (Duration) String

func (dur Duration) String() string

func (*Duration) UnmarshalText

func (dur *Duration) UnmarshalText(text []byte) error

UnmarshalText implements interface for YAML decoding

type EngineConfig added in v1.5.0

type EngineConfig struct {
	// Disabled specifies a list of engines that are disabled.
	Disabled []string          `yaml:"Disabled,omitempty"`
	Types    EngineConfigTypes `yaml:"Types,omitempty"`
}

func (EngineConfig) IsNotDisabled added in v1.5.0

func (e EngineConfig) IsNotDisabled(kind string) bool

type EngineConfigTypes added in v1.5.0

type EngineConfigTypes struct {
	Docker Docker `yaml:"Docker,omitempty"`
	WASM   WASM   `yaml:"WASM,omitempty"`
}

type EvaluationBroker added in v1.5.0

type EvaluationBroker struct {
	// VisibilityTimeout specifies how long an evaluation can be claimed before it's returned to the queue.
	VisibilityTimeout Duration `yaml:"VisibilityTimeout,omitempty"`
	// MaxRetryCount specifies the maximum number of times an evaluation can be retried before being marked as failed.
	MaxRetryCount int `yaml:"MaxRetryCount,omitempty"`
}

type FeatureFlags added in v1.5.0

type FeatureFlags struct {
	// ExecTranslation enables the execution translation feature.
	ExecTranslation bool `yaml:"ExecTranslation,omitempty"`
}

type Heartbeat added in v1.5.0

type Heartbeat struct {
	// InfoUpdateInterval specifies the time between updates of non-resource information to the orchestrator.
	InfoUpdateInterval Duration `yaml:"InfoUpdateInterval,omitempty"`
	// ResourceUpdateInterval specifies the time between updates of resource information to the orchestrator.
	ResourceUpdateInterval Duration `yaml:"ResourceUpdateInterval,omitempty"`
	// Interval specifies the time between heartbeat signals sent to the orchestrator.
	Interval Duration `yaml:"Interval,omitempty"`
}

type IPFSPublisher added in v1.5.0

type IPFSPublisher struct {
	// Endpoint specifies the multi-address to connect to for IPFS. e.g /ip4/127.0.0.1/tcp/5001
	Endpoint string `yaml:"Endpoint,omitempty"`
}

type IPFSStorage added in v1.5.0

type IPFSStorage struct {
	// Endpoint specifies the multi-address to connect to for IPFS. e.g /ip4/127.0.0.1/tcp/5001
	Endpoint string `yaml:"Endpoint,omitempty"`
}

type InputSourcesConfig added in v1.5.0

type InputSourcesConfig struct {
	// Disabled specifies a list of storages that are disabled.
	Disabled []string `yaml:"Disabled,omitempty"`
	// ReadTimeout specifies the maximum time allowed for reading from a storage.
	ReadTimeout Duration `yaml:"ReadTimeout,omitempty"`
	// ReadTimeout specifies the maximum number of attempts for reading from a storage.
	MaxRetryCount int               `yaml:"MaxRetryCount,omitempty"`
	Types         InputSourcesTypes `yaml:"Types,omitempty"`
}

func (InputSourcesConfig) IsNotDisabled added in v1.5.0

func (i InputSourcesConfig) IsNotDisabled(kind string) bool

type InputSourcesTypes added in v1.5.0

type InputSourcesTypes struct {
	IPFS IPFSStorage `yaml:"IPFS,omitempty"`
	S3   S3Storage   `yaml:"S3,omitempty"`
}

type IpfsDownloader added in v1.5.0

type IpfsDownloader struct {
	// Endpoint specifies the multi-address to connect to for IPFS. e.g /ip4/127.0.0.1/tcp/5001
	Endpoint string `yaml:"Endpoint,omitempty"`
}

type JobAdmissionControl added in v1.5.0

type JobAdmissionControl struct {
	// RejectStatelessJobs indicates whether to reject stateless jobs, i.e. jobs without inputs.
	RejectStatelessJobs bool `yaml:"RejectStatelessJobs,omitempty"`
	// AcceptNetworkedJobs indicates whether to accept jobs that require network access.
	AcceptNetworkedJobs bool `yaml:"AcceptNetworkedJobs,omitempty"`
	// ProbeHTTP specifies the HTTP endpoint for probing job submission.
	ProbeHTTP string `yaml:"ProbeHTTP,omitempty"`
	// ProbeExec specifies the command to execute for probing job submission.
	ProbeExec string `yaml:"ProbeExec,omitempty"`
}

type JobDefaults added in v1.1.0

type JobDefaults struct {
	Batch   BatchJobDefaultsConfig       `yaml:"Batch,omitempty"`
	Ops     BatchJobDefaultsConfig       `yaml:"Ops,omitempty"`
	Daemon  LongRunningJobDefaultsConfig `yaml:"Daemon,omitempty"`
	Service LongRunningJobDefaultsConfig `yaml:"Service,omitempty"`
}

type LocalPublisher added in v1.5.0

type LocalPublisher struct {
	// Address specifies the endpoint the publisher serves on.
	Address string `yaml:"Address,omitempty"`
	// Port specifies the port the publisher serves on.
	Port int `yaml:"Port,omitempty"`
	// Directory specifies a path to location on disk where content is served from.
	Directory string `yaml:"Directory,omitempty"`
}

type Logging added in v1.5.0

type Logging struct {
	// Level sets the logging level. One of: trace, debug, info, warn, error, fatal, panic.
	Level string `yaml:"Level,omitempty"`
	// Mode specifies the logging mode. One of: default, json.
	Mode string `yaml:"Mode,omitempty"`
	// LogDebugInfoInterval specifies the interval for logging debug information.
	LogDebugInfoInterval Duration `yaml:"LogDebugInfoInterval,omitempty"`
}

type LongRunningJobDefaultsConfig added in v1.5.0

type LongRunningJobDefaultsConfig struct {
	// Priority specifies the default priority allocated to a service or daemon job.
	// This value is used when the job hasn't explicitly set its priority requirement.
	Priority int                          `yaml:"Priority,omitempty"`
	Task     LongRunningTaskDefaultConfig `yaml:"Task,omitempty"`
}

type LongRunningTaskDefaultConfig added in v1.5.0

type LongRunningTaskDefaultConfig struct {
	Resources ResourcesConfig `yaml:"Resources,omitempty"`
}

type NodeManager added in v1.5.0

type NodeManager struct {
	// DisconnectTimeout specifies how long to wait before considering a node disconnected.
	DisconnectTimeout Duration `yaml:"DisconnectTimeout,omitempty"`
	// ManualApproval, if true, requires manual approval for new compute nodes joining the cluster.
	ManualApproval bool `yaml:"ManualApproval,omitempty"`
}

type Orchestrator added in v1.5.0

type Orchestrator struct {
	// Enabled indicates whether the orchestrator node is active and available for job submission.
	Enabled bool `yaml:"Enabled,omitempty"`
	// Host specifies the hostname or IP address on which the Orchestrator server listens for compute node connections.
	Host string `yaml:"Host,omitempty"`
	// Host specifies the port number on which the Orchestrator server listens for compute node connections.
	Port int `yaml:"Port,omitempty"`
	// Advertise specifies URL to advertise to other servers.
	Advertise string `yaml:"Advertise,omitempty"`
	// AuthSecret key specifies the key used by compute nodes to connect to an orchestrator.
	AuthSecret       string           `yaml:"AuthSecret,omitempty"`
	TLS              TLS              `yaml:"TLS,omitempty"`
	Cluster          Cluster          `yaml:"Cluster,omitempty"`
	NodeManager      NodeManager      `yaml:"NodeManager,omitempty"`
	Scheduler        Scheduler        `yaml:"Scheduler,omitempty"`
	EvaluationBroker EvaluationBroker `yaml:"EvaluationBroker,omitempty"`
}

type Provider added in v1.5.0

type Provider interface {
	IsNotDisabled(kind string) bool
}

type PublisherTypes added in v1.5.0

type PublisherTypes struct {
	IPFS  IPFSPublisher  `yaml:"IPFS,omitempty"`
	S3    S3Publisher    `yaml:"S3,omitempty"`
	Local LocalPublisher `yaml:"Local,omitempty"`
}

type PublishersConfig added in v1.5.0

type PublishersConfig struct {
	// Disabled specifies a list of publishers that are disabled.
	Disabled []string       `yaml:"Disabled,omitempty"`
	Types    PublisherTypes `yaml:"Types,omitempty"`
}

func (PublishersConfig) IsNotDisabled added in v1.5.0

func (p PublishersConfig) IsNotDisabled(kind string) bool

type ResourceScaler added in v1.5.0

type ResourceScaler struct {
	// CPU specifies the amount of CPU a compute node allocates for running jobs.
	// It can be expressed as a percentage (e.g., "85%") or a Kubernetes resource string (e.g., "100m").
	CPU ResourceType `yaml:"CPU,omitempty"`

	// Memory specifies the amount of Memory a compute node allocates for running jobs.
	// It can be expressed as a percentage (e.g., "85%") or a Kubernetes resource string (e.g., "1Gi").
	Memory ResourceType `yaml:"Memory,omitempty"`

	// Disk specifies the amount of Disk space a compute node allocates for running jobs.
	// It can be expressed as a percentage (e.g., "85%") or a Kubernetes resource string (e.g., "10Gi").
	Disk ResourceType `yaml:"Disk,omitempty"`

	// GPU specifies the amount of GPU a compute node allocates for running jobs.
	// It can be expressed as a percentage (e.g., "85%") or a Kubernetes resource string (e.g., "1").
	// Note: When using percentages, the result is always rounded up to the nearest whole GPU.
	GPU ResourceType `yaml:"GPU,omitempty"`
}

func (ResourceScaler) IsZero added in v1.5.0

func (s ResourceScaler) IsZero() bool

func (ResourceScaler) ToResource added in v1.5.0

func (s ResourceScaler) ToResource(in models.Resources) (*models.Resources, error)

type ResourceType added in v1.5.0

type ResourceType string

func (ResourceType) IsScaler added in v1.5.0

func (t ResourceType) IsScaler() bool

type ResourcesConfig added in v1.5.0

type ResourcesConfig struct {
	// CPU specifies the default amount of CPU allocated to a task.
	// It uses Kubernetes resource string format (e.g., "100m" for 0.1 CPU cores).
	// This value is used when the task hasn't explicitly set its CPU requirement.
	CPU string `yaml:"CPU,omitempty"`

	// Memory specifies the default amount of memory allocated to a task.
	// It uses Kubernetes resource string format (e.g., "256Mi" for 256 mebibytes).
	// This value is used when the task hasn't explicitly set its memory requirement.
	Memory string `yaml:"Memory,omitempty"`

	// Disk specifies the default amount of disk space allocated to a task.
	// It uses Kubernetes resource string format (e.g., "1Gi" for 1 gibibyte).
	// This value is used when the task hasn't explicitly set its disk space requirement.
	Disk string `yaml:"Disk,omitempty"`

	// GPU specifies the default number of GPUs allocated to a task.
	// It uses Kubernetes resource string format (e.g., "1" for 1 GPU).
	// This value is used when the task hasn't explicitly set its GPU requirement.
	GPU string `yaml:"GPU,omitempty"`
}

type ResultDownloaders added in v1.5.0

type ResultDownloaders struct {
	// Disabled is a list of downloaders that are disabled.
	Disabled []string `yaml:"Disabled,omitempty"`
	// Timeout specifies the maximum time allowed for a download operation.
	Timeout Duration               `yaml:"Timeout,omitempty"`
	Types   ResultDownloadersTypes `yaml:"Types,omitempty"`
}

func (ResultDownloaders) IsNotDisabled added in v1.5.0

func (r ResultDownloaders) IsNotDisabled(kind string) bool

type ResultDownloadersTypes added in v1.5.0

type ResultDownloadersTypes struct {
	IPFS IpfsDownloader `yaml:"IPFS,omitempty"`
}

type S3Publisher added in v1.5.0

type S3Publisher struct {
	// PreSignedURLDisabled specifies whether pre-signed URLs are enabled for the S3 provider.
	PreSignedURLDisabled bool `yaml:"PreSignedURLDisabled,omitempty"`
	// PreSignedURLExpiration specifies the duration before a pre-signed URL expires.
	PreSignedURLExpiration Duration `yaml:"PreSignedURLExpiration,omitempty"`
}

type S3Storage

type S3Storage struct {
	// Endpoint specifies the endpoint URL for the S3 input source.
	Endpoint string `yaml:"Endpoint,omitempty"`
	// AccessKey specifies the access key for the S3 input source.
	AccessKey string `yaml:"AccessKey,omitempty"`
	// SecretKey specifies the secret key for the S3 input source.
	SecretKey string `yaml:"SecretKey,omitempty"`
}

type Scheduler added in v1.5.0

type Scheduler struct {
	// WorkerCount specifies the number of concurrent workers for job scheduling.
	WorkerCount int `yaml:"WorkerCount,omitempty"`
	// HousekeepingInterval specifies how often to run housekeeping tasks.
	HousekeepingInterval Duration `yaml:"HousekeepingInterval,omitempty"`
	// HousekeepingTimeout specifies the maximum time allowed for a single housekeeping run.
	HousekeepingTimeout Duration `yaml:"HousekeepingTimeout,omitempty"`
}

type TLS added in v1.5.0

type TLS struct {
	// CertFile specifies the path to the TLS certificate file.
	CertFile string `yaml:"CertFile,omitempty"`
	// KeyFile specifies the path to the TLS private key file.
	KeyFile string `yaml:"KeyFile,omitempty"`
	// CAFile specifies the path to the Certificate Authority file.
	CAFile string `yaml:"CAFile,omitempty"`

	// UseTLS indicates whether to use TLS for client connections.
	UseTLS bool `yaml:"UseTLS,omitempty"`
	// Insecure allows insecure TLS connections (e.g., self-signed certificates).
	Insecure bool `yaml:"Insecure"`

	// SelfSigned indicates whether to use a self-signed certificate.
	SelfSigned bool `yaml:"SelfSigned,omitempty"`
	// AutoCert specifies the domain for automatic certificate generation.
	AutoCert string `yaml:"AutoCert,omitempty"`
	// AutoCertCachePath specifies the directory to cache auto-generated certificates.
	AutoCertCachePath string `yaml:"AutoCertCachePath,omitempty"`
}

type TaskTimeoutConfig added in v1.5.0

type TaskTimeoutConfig struct {
	// TotalTimeout is the maximum total time allowed for a task
	TotalTimeout Duration `yaml:"TotalTimeout,omitempty"`
	// ExecutionTimeout is the maximum time allowed for task execution
	ExecutionTimeout Duration `yaml:"ExecutionTimeout,omitempty"`
}

type UpdateConfig added in v1.1.2

type UpdateConfig struct {
	// Interval specifies the time between update checks, when set to 0 update checks are not performed.
	Interval Duration `yaml:"Interval,omitempty"`
}

type WASM added in v1.5.0

type WASM struct {
}

type WebUI added in v1.5.0

type WebUI struct {
	// Enabled indicates whether the Web UI is enabled.
	Enabled bool `yaml:"Enabled,omitempty"`
	// Listen specifies the address and port on which the Web UI listens.
	Listen string `yaml:"Listen,omitempty"`
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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