types

package
v1.6.0-rc2 Latest Latest
Warning

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

Go to latest
Published: Dec 11, 2024 License: Apache-2.0 Imports: 20 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 ComputeAuthTokenKey = "Compute.Auth.Token"
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 ComputeOrchestratorsKey = "Compute.Orchestrators"
View Source
const ComputeTLSCACertKey = "Compute.TLS.CACert"
View Source
const ComputeTLSRequireTLSKey = "Compute.TLS.RequireTLS"
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 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 JobAdmissionControlAcceptNetworkedJobsKey = "JobAdmissionControl.AcceptNetworkedJobs"
View Source
const JobAdmissionControlLocalityKey = "JobAdmissionControl.Locality"
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 JobDefaultsBatchTaskPublisherParamsKey = "JobDefaults.Batch.Task.Publisher.Params"
View Source
const JobDefaultsBatchTaskPublisherTypeKey = "JobDefaults.Batch.Task.Publisher.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 JobDefaultsOpsTaskPublisherParamsKey = "JobDefaults.Ops.Task.Publisher.Params"
View Source
const JobDefaultsOpsTaskPublisherTypeKey = "JobDefaults.Ops.Task.Publisher.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 LabelsKey = "Labels"
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 OrchestratorAuthTokenKey = "Orchestrator.Auth.Token"
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 OrchestratorSchedulerQueueBackoffKey = "Orchestrator.Scheduler.QueueBackoff"
View Source
const OrchestratorSchedulerWorkerCountKey = "Orchestrator.Scheduler.WorkerCount"
View Source
const OrchestratorSupportReverseProxyKey = "Orchestrator.SupportReverseProxy"
View Source
const OrchestratorTLSCACertKey = "Orchestrator.TLS.CACert"
View Source
const OrchestratorTLSServerCertKey = "Orchestrator.TLS.ServerCert"
View Source
const OrchestratorTLSServerKeyKey = "Orchestrator.TLS.ServerKey"
View Source
const OrchestratorTLSServerTimeoutKey = "Orchestrator.TLS.ServerTimeout"
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 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 ResultsStorageDir = "results"
View Source
const StrictVersionMatchKey = "StrictVersionMatch"
View Source
const UpdateConfigIntervalKey = "UpdateConfig.Interval"
View Source
const UserKeyFileName = "user_id.pem"
View Source
const WebUIBackendKey = "WebUI.Backend"
View Source
const WebUIEnabledKey = "WebUI.Enabled"
View Source
const WebUIListenKey = "WebUI.Listen"

Variables

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

ConfigDescriptions maps configuration paths to their descriptions

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 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" json:"Host,omitempty"`
	// Port specifies the port number on which the API server listens or the client connects.
	Port int        `yaml:"Port,omitempty" json:"Port,omitempty"`
	TLS  TLS        `yaml:"TLS,omitempty" json:"TLS,omitempty"`
	Auth AuthConfig `yaml:"Auth,omitempty" json:"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" json:"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" json:"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" json:"Type,omitempty"`
	PolicyPath string `yaml:"PolicyPath,omitempty" json:"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" json:"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" json:"NameProvider,omitempty"`
	// DataDir specifies a location on disk where the bacalhau node will maintain state.
	DataDir string `yaml:"DataDir,omitempty" json:"DataDir,omitempty"`
	// StrictVersionMatch indicates whether to enforce strict version matching.
	StrictVersionMatch bool         `yaml:"StrictVersionMatch,omitempty" json:"StrictVersionMatch,omitempty"`
	Orchestrator       Orchestrator `yaml:"Orchestrator,omitempty" json:"Orchestrator,omitempty"`
	Compute            Compute      `yaml:"Compute,omitempty" json:"Compute,omitempty"`
	// Labels are key-value pairs used to describe and categorize the nodes.
	Labels              map[string]string   `yaml:"Labels,omitempty" json:"Labels,omitempty"`
	WebUI               WebUI               `yaml:"WebUI,omitempty" json:"WebUI,omitempty"`
	InputSources        InputSourcesConfig  `yaml:"InputSources,omitempty" json:"InputSources,omitempty"`
	Publishers          PublishersConfig    `yaml:"Publishers,omitempty" json:"Publishers,omitempty"`
	Engines             EngineConfig        `yaml:"Engines,omitempty" json:"Engines,omitempty"`
	ResultDownloaders   ResultDownloaders   `yaml:"ResultDownloaders,omitempty" json:"ResultDownloaders,omitempty"`
	JobDefaults         JobDefaults         `yaml:"JobDefaults,omitempty" json:"JobDefaults,omitempty"`
	JobAdmissionControl JobAdmissionControl `yaml:"JobAdmissionControl,omitempty" json:"JobAdmissionControl,omitempty"`
	Logging             Logging             `yaml:"Logging,omitempty" json:"Logging,omitempty"`
	UpdateConfig        UpdateConfig        `yaml:"UpdateConfig,omitempty" json:"UpdateConfig,omitempty"`
	FeatureFlags        FeatureFlags        `yaml:"FeatureFlags,omitempty" json:"FeatureFlags,omitempty"`
	// DisableAnalytics, when true, disables sharing anonymous analytics data with the Bacalhau development team
	DisableAnalytics bool `yaml:"DisableAnalytics,omitempty" json:"DisableAnalytics,omitempty"`
}

func (Bacalhau) AuthTokensPath added in v1.5.0

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

func (Bacalhau) ComputeDir added in v1.5.0

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

func (Bacalhau) Copy added in v1.5.0

func (b Bacalhau) Copy() (Bacalhau, error)

Copy returns a deep copy of the Bacalhau configuration.

func (Bacalhau) ExecutionDir added in v1.5.0

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

func (Bacalhau) ExecutionStoreFilePath added in v1.5.0

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

func (Bacalhau) JobStoreFilePath added in v1.5.0

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

func (Bacalhau) MergeNew added in v1.5.0

func (b Bacalhau) MergeNew(other Bacalhau) (Bacalhau, error)

MergeNew combines the current Bacalhau configuration with another one, returning a new instance with the merged configuration.

func (Bacalhau) NetworkTransportDir added in v1.5.0

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

func (Bacalhau) OrchestratorDir added in v1.5.0

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

func (Bacalhau) ResultsStorageDir added in v1.5.0

func (b Bacalhau) ResultsStorageDir() (string, error)

func (Bacalhau) UserKeyPath added in v1.5.0

func (b 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" json:"Priority,omitempty"`
	Task     BatchTaskDefaultConfig `yaml:"Task,omitempty" json:"Task,omitempty"`
}

type BatchTaskDefaultConfig added in v1.5.0

type BatchTaskDefaultConfig struct {
	Resources ResourcesConfig        `yaml:"Resources,omitempty" json:"Resources,omitempty"`
	Publisher DefaultPublisherConfig `yaml:"Publisher,omitempty" json:"Publisher,omitempty"`
	Timeouts  TaskTimeoutConfig      `yaml:"Timeouts,omitempty" json:"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" json:"Name,omitempty"`
	// Host specifies the hostname or IP address for cluster communication.
	Host string `yaml:"Host,omitempty" json:"Host,omitempty"`
	// Port specifies the port number for cluster communication.
	Port int `yaml:"Port,omitempty" json:"Port,omitempty"`
	// Advertise specifies the address to advertise to other cluster members.
	Advertise string `yaml:"Advertise,omitempty" json:"Advertise,omitempty"`
	// Peers is a list of other cluster members to connect to on startup.
	Peers []string `yaml:"Peers,omitempty" json:"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" json:"Enabled,omitempty"`
	// Orchestrators specifies a list of orchestrator endpoints that this compute node connects to.
	Orchestrators []string `yaml:"Orchestrators,omitempty" json:"Orchestrators,omitempty"`
	// Auth specifies the authentication configuration for compute nodes to connect to the orchestrator.
	Auth              ComputeAuth    `yaml:"Auth,omitempty" json:"Auth,omitempty"`
	Heartbeat         Heartbeat      `yaml:"Heartbeat,omitempty" json:"Heartbeat,omitempty"`
	AllocatedCapacity ResourceScaler `yaml:"AllocatedCapacity,omitempty" json:"AllocatedCapacity,omitempty"`
	// AllowListedLocalPaths specifies a list of local file system paths that the compute node is allowed to access.
	AllowListedLocalPaths []string `yaml:"AllowListedLocalPaths" json:"AllowListedLocalPaths,omitempty"`
	// TLS specifies the TLS related configuration on the compute node when connecting with the orchestrator.
	TLS ComputeTLS `yaml:"TLS,omitempty" json:"TLS,omitempty"`
}

type ComputeAuth added in v1.5.0

type ComputeAuth struct {
	// Token specifies the key for compute nodes to be able to access the orchestrator.
	Token string `yaml:"Token,omitempty" json:"Token,omitempty"`
}

type ComputeTLS added in v1.5.2

type ComputeTLS struct {
	// CACert specifies the CA file path that the compute node trusts when connecting to orchestrator.
	CACert string `yaml:"CACert,omitempty" json:"CACert,omitempty"`

	// RequireTLS specifies if the compute node enforces encrypted communication with orchestrator.
	RequireTLS bool `yaml:"RequireTLS,omitempty" json:"RequireTLS,omitempty"`
}

type DefaultPublisherConfig added in v1.5.0

type DefaultPublisherConfig struct {
	// Type specifies the publisher type. e.g. "s3", "local", "ipfs", etc.
	Type string `json:"Type,omitempty" yaml:"Type,omitempty"`

	// Params specifies the publisher configuration data.
	Params map[string]string `json:"Params,omitempty" yaml:"Params,omitempty"`
}

func (DefaultPublisherConfig) ToSpecConfig added in v1.5.0

func (d DefaultPublisherConfig) ToSpecConfig() models.SpecConfig

type Docker added in v1.5.0

type Docker struct {
	// ManifestCache specifies the settings for the Docker manifest cache.
	ManifestCache DockerManifestCache `yaml:"ManifestCache,omitempty" json:"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" json:"Size,omitempty"`
	// TTL specifies the time-to-live duration for cache entries.
	TTL Duration `yaml:"TTL,omitempty" json:"TTL,omitempty"`
	// Refresh specifies the refresh interval for cache entries.
	Refresh Duration `yaml:"Refresh,omitempty" json:"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" json:"Disabled,omitempty"`
	Types    EngineConfigTypes `yaml:"Types,omitempty" json:"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" json:"Docker,omitempty"`
	WASM   WASM   `yaml:"WASM,omitempty" json:"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" json:"VisibilityTimeout,omitempty"`
	// MaxRetryCount specifies the maximum number of times an evaluation can be retried before being marked as failed.
	MaxRetryCount int `yaml:"MaxRetryCount,omitempty" json:"MaxRetryCount,omitempty"`
}

type FeatureFlags added in v1.5.0

type FeatureFlags struct {
}

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" json:"InfoUpdateInterval,omitempty"`
	// Deprecated: use Interval instead
	ResourceUpdateInterval Duration `yaml:"ResourceUpdateInterval,omitempty" json:"ResourceUpdateInterval,omitempty"`
	// Interval specifies the time between heartbeat signals sent to the orchestrator.
	Interval Duration `yaml:"Interval,omitempty" json:"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" json:"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" json:"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" json:"Disabled,omitempty"`
	// ReadTimeout specifies the maximum time allowed for reading from a storage.
	ReadTimeout Duration `yaml:"ReadTimeout,omitempty" json:"ReadTimeout,omitempty"`
	// ReadTimeout specifies the maximum number of attempts for reading from a storage.
	MaxRetryCount int               `yaml:"MaxRetryCount,omitempty" json:"MaxRetryCount,omitempty"`
	Types         InputSourcesTypes `yaml:"Types,omitempty" json:"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" json:"IPFS,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" json:"Endpoint,omitempty"`
}

type JobAdmissionControl added in v1.5.0

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

type JobDefaults added in v1.1.0

type JobDefaults struct {
	Batch   BatchJobDefaultsConfig       `yaml:"Batch,omitempty" json:"Batch,omitempty"`
	Ops     BatchJobDefaultsConfig       `yaml:"Ops,omitempty" json:"Ops,omitempty"`
	Daemon  LongRunningJobDefaultsConfig `yaml:"Daemon,omitempty" json:"Daemon,omitempty"`
	Service LongRunningJobDefaultsConfig `yaml:"Service,omitempty" json:"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" json:"Address,omitempty"`
	// Port specifies the port the publisher serves on.
	Port int `yaml:"Port,omitempty" json:"Port,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" json:"Level,omitempty"`
	// Mode specifies the logging mode. One of: default, json.
	Mode string `yaml:"Mode,omitempty" json:"Mode,omitempty"`
	// LogDebugInfoInterval specifies the interval for logging debug information.
	LogDebugInfoInterval Duration `yaml:"LogDebugInfoInterval,omitempty" json:"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" json:"Priority,omitempty"`
	Task     LongRunningTaskDefaultConfig `yaml:"Task,omitempty" json:"Task,omitempty"`
}

type LongRunningTaskDefaultConfig added in v1.5.0

type LongRunningTaskDefaultConfig struct {
	Resources ResourcesConfig `yaml:"Resources,omitempty" json:"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" json:"DisconnectTimeout,omitempty"`
	// ManualApproval, if true, requires manual approval for new compute nodes joining the cluster.
	ManualApproval bool `yaml:"ManualApproval,omitempty" json:"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" json:"Enabled,omitempty"`
	// Host specifies the hostname or IP address on which the Orchestrator server listens for compute node connections.
	Host string `yaml:"Host,omitempty" json:"Host,omitempty"`
	// Host specifies the port number on which the Orchestrator server listens for compute node connections.
	Port int `yaml:"Port,omitempty" json:"Port,omitempty"`
	// Advertise specifies URL to advertise to other servers.
	Advertise string `yaml:"Advertise,omitempty" json:"Advertise,omitempty"`
	// Auth specifies the authentication configuration for compute nodes to connect to the orchestrator.
	Auth OrchestratorAuth `yaml:"Auth,omitempty" json:"Auth,omitempty"`
	// TLS specifies the TLS related configuration on the orchestrator for when compute nodes need to connect.
	TLS              OrchestratorTLS  `yaml:"TLS,omitempty" json:"TLS,omitempty"`
	Cluster          Cluster          `yaml:"Cluster,omitempty" json:"Cluster,omitempty"`
	NodeManager      NodeManager      `yaml:"NodeManager,omitempty" json:"NodeManager,omitempty"`
	Scheduler        Scheduler        `yaml:"Scheduler,omitempty" json:"Scheduler,omitempty"`
	EvaluationBroker EvaluationBroker `yaml:"EvaluationBroker,omitempty" json:"EvaluationBroker,omitempty"`
	// SupportReverseProxy configures the orchestrator node to run behind a reverse proxy
	SupportReverseProxy bool `yaml:"SupportReverseProxy,omitempty" json:"SupportReverseProxy,omitempty"`
}

type OrchestratorAuth added in v1.5.0

type OrchestratorAuth struct {
	// Token specifies the key for compute nodes to be able to access the orchestrator
	Token string `yaml:"Token,omitempty" json:"Token,omitempty"`
}

type OrchestratorTLS added in v1.5.2

type OrchestratorTLS struct {
	// ServerKey specifies the private key file path given to NATS server to serve TLS connections.
	ServerKey string `yaml:"ServerKey,omitempty" json:"ServerKey,omitempty"`
	// ServerCert specifies the certificate file path given to NATS server to serve TLS connections.
	ServerCert string `yaml:"ServerCert,omitempty" json:"ServerCert,omitempty"`
	// ServerTimeout specifies the TLS timeout, in seconds, set on the NATS server.
	ServerTimeout int `yaml:"ServerTimeout,omitempty" json:"ServerTimeout,omitempty"`

	// CACert specifies the CA file path that the orchestrator node trusts when connecting to NATS server.
	CACert string `yaml:"CACert,omitempty" json:"CACert,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" json:"IPFS,omitempty"`
	S3    S3Publisher    `yaml:"S3,omitempty" json:"S3,omitempty"`
	Local LocalPublisher `yaml:"Local,omitempty" json:"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" json:"Disabled,omitempty"`
	Types    PublisherTypes `yaml:"Types,omitempty" json:"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" json:"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" json:"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" json:"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" json:"GPU,omitempty"`
}

func ResourceScalerFromModelsResourceConfig added in v1.5.0

func ResourceScalerFromModelsResourceConfig(r models.ResourcesConfig) ResourceScaler

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)

ToResource TODO: This is a very complex function that should be simplified and split

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" json:"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" json:"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" json:"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" json:"GPU,omitempty"`
}

func FromModelsResourceConfig added in v1.5.0

func FromModelsResourceConfig(r models.ResourcesConfig) ResourcesConfig

FromModelsResourceConfig converts a models.ResourcesConfig to a ResourcesConfig.

type ResultDownloaders added in v1.5.0

type ResultDownloaders struct {
	// Disabled is a list of downloaders that are disabled.
	Disabled []string `yaml:"Disabled,omitempty" json:"Disabled,omitempty"`
	// Timeout specifies the maximum time allowed for a download operation.
	Timeout Duration               `yaml:"Timeout,omitempty" json:"Timeout,omitempty"`
	Types   ResultDownloadersTypes `yaml:"Types,omitempty" json:"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" json:"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" json:"PreSignedURLDisabled,omitempty"`
	// PreSignedURLExpiration specifies the duration before a pre-signed URL expires.
	PreSignedURLExpiration Duration `yaml:"PreSignedURLExpiration,omitempty" json:"PreSignedURLExpiration,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" json:"WorkerCount,omitempty"`
	// QueueBackoff specifies the time to wait before retrying a failed job.
	QueueBackoff Duration `yaml:"QueueBackoff,omitempty" json:"QueueBackoff,omitempty"`
	// HousekeepingInterval specifies how often to run housekeeping tasks.
	HousekeepingInterval Duration `yaml:"HousekeepingInterval,omitempty" json:"HousekeepingInterval,omitempty"`
	// HousekeepingTimeout specifies the maximum time allowed for a single housekeeping run.
	HousekeepingTimeout Duration `yaml:"HousekeepingTimeout,omitempty" json:"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" json:"CertFile,omitempty"`
	// KeyFile specifies the path to the TLS private key file.
	KeyFile string `yaml:"KeyFile,omitempty" json:"KeyFile,omitempty"`
	// CAFile specifies the path to the Certificate Authority file.
	CAFile string `yaml:"CAFile,omitempty" json:"CAFile,omitempty"`

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

	// SelfSigned indicates whether to use a self-signed certificate.
	SelfSigned bool `yaml:"SelfSigned,omitempty" json:"SelfSigned,omitempty"`
	// AutoCert specifies the domain for automatic certificate generation.
	AutoCert string `yaml:"AutoCert,omitempty" json:"AutoCert,omitempty"`
	// AutoCertCachePath specifies the directory to cache auto-generated certificates.
	AutoCertCachePath string `yaml:"AutoCertCachePath,omitempty" json:"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" json:"TotalTimeout,omitempty"`
	// ExecutionTimeout is the maximum time allowed for task execution
	ExecutionTimeout Duration `yaml:"ExecutionTimeout,omitempty" json:"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" json:"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" json:"Enabled,omitempty"`
	// Listen specifies the address and port on which the Web UI listens.
	Listen string `yaml:"Listen,omitempty" json:"Listen,omitempty"`
	// Backend specifies the address and port of the backend API server.
	// If empty, the Web UI will use the same address and port as the API server.
	Backend string `yaml:"Backend,omitempty" json:"Backend,omitempty"`
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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