Documentation ¶
Index ¶
- Constants
- Variables
- func Set(cfg BacalhauConfig, opts ...SetOption)
- func SetDefaults(cfg BacalhauConfig, opts ...SetOption)
- type APIConfig
- type AuthConfig
- type AuthenticatorConfig
- type BacalhauConfig
- func (c BacalhauConfig) AuthTokensPath() (string, error)
- func (c BacalhauConfig) ComputeDir() (string, error)
- func (c BacalhauConfig) ExecutionDir() (string, error)
- func (c BacalhauConfig) ExecutionStoreFilePath() (string, error)
- func (c BacalhauConfig) JobStoreFilePath() (string, error)
- func (c BacalhauConfig) NetworkTransportDir() (string, error)
- func (c BacalhauConfig) OrchestratorDir() (string, error)
- func (c BacalhauConfig) PluginsDir() (string, error)
- func (c BacalhauConfig) UserKeyPath() (string, error)
- type CapacityConfig
- type ClientTLSConfig
- type ComputeConfig
- type ComputeControlPlaneConfig
- type DockerCacheConfig
- type Duration
- type EvaluationBrokerConfig
- type FeatureConfig
- type IpfsConfig
- type JobDefaults
- type JobStoreConfig
- type JobTimeoutConfig
- type LocalPublisherConfig
- type LogStreamConfig
- type LoggingConfig
- type MetricsConfig
- type NetworkClusterConfig
- type NetworkConfig
- type NodeConfig
- type RequesterConfig
- type RequesterControlPlaneConfig
- type S3StorageProviderConfig
- type SchedulerConfig
- type SetOption
- type SetParams
- type StorageProviderConfig
- type StorageType
- type TLSConfiguration
- type UpdateConfig
- type UserConfig
- type WebUIConfig
- type WorkerConfig
Constants ¶
const Auth = "auth"
const AuthAccessPolicyPath = "auth.accesspolicypath"
const AuthMethods = "auth.methods"
const AuthTokensFileName = "tokens.json"
const AuthTokensPath = "auth.tokenspath"
const ComputeDirName = "compute"
const ExecutionDirName = "executions"
const ExecutionStoreFileName = "state_boltdb.db"
const JobStoreFileName = "state_boltdb.db"
const Metrics = "metrics"
const MetricsEventTracerPath = "metrics.eventtracerpath"
const NetworkTransportDirName = "nats-store"
const Node = "node"
const NodeAllowListedLocalPaths = "node.allowlistedlocalpaths"
const NodeClientAPI = "node.clientapi"
const NodeClientAPIClientTLS = "node.clientapi.clienttls"
const NodeClientAPIClientTLSCACert = "node.clientapi.clienttls.cacert"
const NodeClientAPIClientTLSInsecure = "node.clientapi.clienttls.insecure"
const NodeClientAPIClientTLSUseTLS = "node.clientapi.clienttls.usetls"
const NodeClientAPIHost = "node.clientapi.host"
const NodeClientAPIPort = "node.clientapi.port"
const NodeClientAPITLS = "node.clientapi.tls"
const NodeClientAPITLSAutoCert = "node.clientapi.tls.autocert"
const NodeClientAPITLSAutoCertCachePath = "node.clientapi.tls.autocertcachepath"
const NodeClientAPITLSSelfSigned = "node.clientapi.tls.selfsigned"
const NodeClientAPITLSServerCertificate = "node.clientapi.tls.servercertificate"
const NodeClientAPITLSServerKey = "node.clientapi.tls.serverkey"
const NodeCompute = "node.compute"
const NodeComputeCapacity = "node.compute.capacity"
const NodeComputeCapacityDefaultJobResourceLimits = "node.compute.capacity.defaultjobresourcelimits"
const NodeComputeCapacityDefaultJobResourceLimitsCPU = "node.compute.capacity.defaultjobresourcelimits.cpu"
const NodeComputeCapacityDefaultJobResourceLimitsDisk = "node.compute.capacity.defaultjobresourcelimits.disk"
const NodeComputeCapacityDefaultJobResourceLimitsGPU = "node.compute.capacity.defaultjobresourcelimits.gpu"
const NodeComputeCapacityDefaultJobResourceLimitsMemory = "node.compute.capacity.defaultjobresourcelimits.memory"
const NodeComputeCapacityIgnorePhysicalResourceLimits = "node.compute.capacity.ignorephysicalresourcelimits"
const NodeComputeCapacityJobResourceLimits = "node.compute.capacity.jobresourcelimits"
const NodeComputeCapacityJobResourceLimitsCPU = "node.compute.capacity.jobresourcelimits.cpu"
const NodeComputeCapacityJobResourceLimitsDisk = "node.compute.capacity.jobresourcelimits.disk"
const NodeComputeCapacityJobResourceLimitsGPU = "node.compute.capacity.jobresourcelimits.gpu"
const NodeComputeCapacityJobResourceLimitsMemory = "node.compute.capacity.jobresourcelimits.memory"
const NodeComputeCapacityTotalResourceLimits = "node.compute.capacity.totalresourcelimits"
const NodeComputeCapacityTotalResourceLimitsCPU = "node.compute.capacity.totalresourcelimits.cpu"
const NodeComputeCapacityTotalResourceLimitsDisk = "node.compute.capacity.totalresourcelimits.disk"
const NodeComputeCapacityTotalResourceLimitsGPU = "node.compute.capacity.totalresourcelimits.gpu"
const NodeComputeCapacityTotalResourceLimitsMemory = "node.compute.capacity.totalresourcelimits.memory"
const NodeComputeControlPlaneSettings = "node.compute.controlplanesettings"
const NodeComputeControlPlaneSettingsHeartbeatFrequency = "node.compute.controlplanesettings.heartbeatfrequency"
const NodeComputeControlPlaneSettingsHeartbeatTopic = "node.compute.controlplanesettings.heartbeattopic"
const NodeComputeControlPlaneSettingsInfoUpdateFrequency = "node.compute.controlplanesettings.infoupdatefrequency"
const NodeComputeControlPlaneSettingsResourceUpdateFrequency = "node.compute.controlplanesettings.resourceupdatefrequency"
const NodeComputeExecutionStore = "node.compute.executionstore"
const NodeComputeExecutionStorePath = "node.compute.executionstore.path"
const NodeComputeExecutionStoreType = "node.compute.executionstore.type"
const NodeComputeJobSelection = "node.compute.jobselection"
const NodeComputeJobSelectionAcceptNetworkedJobs = "node.compute.jobselection.acceptnetworkedjobs"
const NodeComputeJobSelectionLocality = "node.compute.jobselection.locality"
const NodeComputeJobSelectionProbeExec = "node.compute.jobselection.probeexec"
const NodeComputeJobSelectionProbeHTTP = "node.compute.jobselection.probehttp"
const NodeComputeJobSelectionRejectStatelessJobs = "node.compute.jobselection.rejectstatelessjobs"
const NodeComputeJobTimeouts = "node.compute.jobtimeouts"
const NodeComputeJobTimeoutsDefaultJobExecutionTimeout = "node.compute.jobtimeouts.defaultjobexecutiontimeout"
const NodeComputeJobTimeoutsJobExecutionTimeoutClientIDBypassList = "node.compute.jobtimeouts.jobexecutiontimeoutclientidbypasslist"
const NodeComputeJobTimeoutsJobNegotiationTimeout = "node.compute.jobtimeouts.jobnegotiationtimeout"
const NodeComputeJobTimeoutsMaxJobExecutionTimeout = "node.compute.jobtimeouts.maxjobexecutiontimeout"
const NodeComputeJobTimeoutsMinJobExecutionTimeout = "node.compute.jobtimeouts.minjobexecutiontimeout"
const NodeComputeLocalPublisher = "node.compute.localpublisher"
const NodeComputeLocalPublisherAddress = "node.compute.localpublisher.address"
const NodeComputeLocalPublisherDirectory = "node.compute.localpublisher.directory"
const NodeComputeLocalPublisherPort = "node.compute.localpublisher.port"
const NodeComputeLogStreamConfig = "node.compute.logstreamconfig"
const NodeComputeLogStreamConfigChannelBufferSize = "node.compute.logstreamconfig.channelbuffersize"
const NodeComputeLogging = "node.compute.logging"
const NodeComputeLoggingLogRunningExecutionsInterval = "node.compute.logging.logrunningexecutionsinterval"
const NodeComputeManifestCache = "node.compute.manifestcache"
const NodeComputeManifestCacheDuration = "node.compute.manifestcache.duration"
const NodeComputeManifestCacheFrequency = "node.compute.manifestcache.frequency"
const NodeComputeManifestCacheSize = "node.compute.manifestcache.size"
const NodeComputeStoragePath = "node.computestoragepath"
const NodeDisabledFeatures = "node.disabledfeatures"
const NodeDisabledFeaturesEngines = "node.disabledfeatures.engines"
const NodeDisabledFeaturesPublishers = "node.disabledfeatures.publishers"
const NodeDisabledFeaturesStorages = "node.disabledfeatures.storages"
const NodeDownloadURLRequestRetries = "node.downloadurlrequestretries"
const NodeDownloadURLRequestTimeout = "node.downloadurlrequesttimeout"
const NodeExecutorPluginPath = "node.executorpluginpath"
const NodeIPFS = "node.ipfs"
const NodeIPFSConnect = "node.ipfs.connect"
const NodeLabels = "node.labels"
const NodeLoggingMode = "node.loggingmode"
const NodeName = "node.name"
const NodeNameProvider = "node.nameprovider"
const NodeNetwork = "node.network"
const NodeNetworkAdvertisedAddress = "node.network.advertisedaddress"
const NodeNetworkAuthSecret = "node.network.authsecret"
const NodeNetworkCluster = "node.network.cluster"
const NodeNetworkClusterAdvertisedAddress = "node.network.cluster.advertisedaddress"
const NodeNetworkClusterName = "node.network.cluster.name"
const NodeNetworkClusterPeers = "node.network.cluster.peers"
const NodeNetworkClusterPort = "node.network.cluster.port"
const NodeNetworkOrchestrators = "node.network.orchestrators"
const NodeNetworkPort = "node.network.port"
const NodeNetworkStoreDir = "node.network.storedir"
const NodeRequester = "node.requester"
const NodeRequesterControlPlaneSettings = "node.requester.controlplanesettings"
const NodeRequesterControlPlaneSettingsHeartbeatCheckFrequency = "node.requester.controlplanesettings.heartbeatcheckfrequency"
const NodeRequesterControlPlaneSettingsHeartbeatTopic = "node.requester.controlplanesettings.heartbeattopic"
const NodeRequesterControlPlaneSettingsNodeDisconnectedAfter = "node.requester.controlplanesettings.nodedisconnectedafter"
const NodeRequesterDefaultPublisher = "node.requester.defaultpublisher"
const NodeRequesterEvaluationBroker = "node.requester.evaluationbroker"
const NodeRequesterEvaluationBrokerEvalBrokerInitialRetryDelay = "node.requester.evaluationbroker.evalbrokerinitialretrydelay"
const NodeRequesterEvaluationBrokerEvalBrokerMaxRetryCount = "node.requester.evaluationbroker.evalbrokermaxretrycount"
const NodeRequesterEvaluationBrokerEvalBrokerSubsequentRetryDelay = "node.requester.evaluationbroker.evalbrokersubsequentretrydelay"
const NodeRequesterEvaluationBrokerEvalBrokerVisibilityTimeout = "node.requester.evaluationbroker.evalbrokervisibilitytimeout"
const NodeRequesterExternalVerifierHook = "node.requester.externalverifierhook"
const NodeRequesterFailureInjectionConfig = "node.requester.failureinjectionconfig"
const NodeRequesterFailureInjectionConfigIsBadActor = "node.requester.failureinjectionconfig.isbadactor"
const NodeRequesterHousekeepingBackgroundTaskInterval = "node.requester.housekeepingbackgroundtaskinterval"
const NodeRequesterJobDefaults = "node.requester.jobdefaults"
const NodeRequesterJobDefaultsExecutionTimeout = "node.requester.jobdefaults.executiontimeout"
const NodeRequesterJobDefaultsQueueTimeout = "node.requester.jobdefaults.queuetimeout"
const NodeRequesterJobDefaultsTotalTimeout = "node.requester.jobdefaults.totaltimeout"
const NodeRequesterJobSelectionPolicy = "node.requester.jobselectionpolicy"
const NodeRequesterJobSelectionPolicyAcceptNetworkedJobs = "node.requester.jobselectionpolicy.acceptnetworkedjobs"
const NodeRequesterJobSelectionPolicyLocality = "node.requester.jobselectionpolicy.locality"
const NodeRequesterJobSelectionPolicyProbeExec = "node.requester.jobselectionpolicy.probeexec"
const NodeRequesterJobSelectionPolicyProbeHTTP = "node.requester.jobselectionpolicy.probehttp"
const NodeRequesterJobSelectionPolicyRejectStatelessJobs = "node.requester.jobselectionpolicy.rejectstatelessjobs"
const NodeRequesterJobStore = "node.requester.jobstore"
const NodeRequesterJobStorePath = "node.requester.jobstore.path"
const NodeRequesterJobStoreType = "node.requester.jobstore.type"
const NodeRequesterManualNodeApproval = "node.requester.manualnodeapproval"
const NodeRequesterNodeInfoStoreTTL = "node.requester.nodeinfostorettl"
const NodeRequesterNodeRankRandomnessRange = "node.requester.noderankrandomnessrange"
const NodeRequesterOverAskForBidsFactor = "node.requester.overaskforbidsfactor"
const NodeRequesterScheduler = "node.requester.scheduler"
const NodeRequesterSchedulerNodeOverSubscriptionFactor = "node.requester.scheduler.nodeoversubscriptionfactor"
const NodeRequesterSchedulerQueueBackoff = "node.requester.scheduler.queuebackoff"
const NodeRequesterStorageProvider = "node.requester.storageprovider"
const NodeRequesterStorageProviderS3 = "node.requester.storageprovider.s3"
const NodeRequesterStorageProviderS3PreSignedURLDisabled = "node.requester.storageprovider.s3.presignedurldisabled"
const NodeRequesterStorageProviderS3PreSignedURLExpiration = "node.requester.storageprovider.s3.presignedurlexpiration"
const NodeRequesterTagCache = "node.requester.tagcache"
const NodeRequesterTagCacheDuration = "node.requester.tagcache.duration"
const NodeRequesterTagCacheFrequency = "node.requester.tagcache.frequency"
const NodeRequesterTagCacheSize = "node.requester.tagcache.size"
const NodeRequesterTranslationEnabled = "node.requester.translationenabled"
const NodeRequesterWorker = "node.requester.worker"
const NodeRequesterWorkerWorkerCount = "node.requester.worker.workercount"
const NodeRequesterWorkerWorkerEvalDequeueBaseBackoff = "node.requester.worker.workerevaldequeuebasebackoff"
const NodeRequesterWorkerWorkerEvalDequeueMaxBackoff = "node.requester.worker.workerevaldequeuemaxbackoff"
const NodeRequesterWorkerWorkerEvalDequeueTimeout = "node.requester.worker.workerevaldequeuetimeout"
const NodeServerAPI = "node.serverapi"
const NodeServerAPIClientTLS = "node.serverapi.clienttls"
const NodeServerAPIClientTLSCACert = "node.serverapi.clienttls.cacert"
const NodeServerAPIClientTLSInsecure = "node.serverapi.clienttls.insecure"
const NodeServerAPIClientTLSUseTLS = "node.serverapi.clienttls.usetls"
const NodeServerAPIHost = "node.serverapi.host"
const NodeServerAPIPort = "node.serverapi.port"
const NodeServerAPITLS = "node.serverapi.tls"
const NodeServerAPITLSAutoCert = "node.serverapi.tls.autocert"
const NodeServerAPITLSAutoCertCachePath = "node.serverapi.tls.autocertcachepath"
const NodeServerAPITLSSelfSigned = "node.serverapi.tls.selfsigned"
const NodeServerAPITLSServerCertificate = "node.serverapi.tls.servercertificate"
const NodeServerAPITLSServerKey = "node.serverapi.tls.serverkey"
const NodeStrictVersionMatch = "node.strictversionmatch"
const NodeType = "node.type"
const NodeVolumeSizeRequestTimeout = "node.volumesizerequesttimeout"
const NodeWebUI = "node.webui"
const NodeWebUIEnabled = "node.webui.enabled"
const NodeWebUIPort = "node.webui.port"
const OrchestratorDirName = "orchestrator"
const PluginsDirName = "plugins"
const Update = "update"
const UpdateCheckFrequency = "update.checkfrequency"
const UpdateSkipChecks = "update.skipchecks"
const User = "user"
const UserInstallationID = "user.installationid"
const UserKeyFileName = "user_id.pem"
const UserKeyPath = "user.keypath"
Variables ¶
var ConfigDescriptions = map[string]string{}/* 129 elements not displayed */
ConfigDescriptions maps configuration paths to their descriptions
var Testing = BacalhauConfig{ Metrics: MetricsConfig{ EventTracerPath: os.DevNull, }, Update: UpdateConfig{ SkipChecks: true, }, Auth: AuthConfig{ Methods: map[string]AuthenticatorConfig{ "ClientKey": { Type: authn.MethodTypeChallenge, }, }, }, Node: NodeConfig{ NameProvider: "puuid", ClientAPI: APIConfig{ Host: "test", Port: 9999, }, ServerAPI: APIConfig{ Host: "test", Port: 9999, TLS: TLSConfiguration{}, }, Network: NetworkConfig{ Port: 4222, }, DownloadURLRequestTimeout: Duration(5 * time.Minute), VolumeSizeRequestTimeout: Duration(2 * time.Minute), DownloadURLRequestRetries: 3, LoggingMode: logger.LogModeDefault, Type: []string{"requester"}, AllowListedLocalPaths: []string{}, Labels: map[string]string{}, DisabledFeatures: FeatureConfig{ Engines: []string{}, Publishers: []string{}, Storages: []string{}, }, IPFS: IpfsConfig{ Connect: "", }, Compute: TestingComputeConfig, Requester: TestingRequesterConfig, WebUI: WebUIConfig{ Enabled: false, Port: 8483, }, StrictVersionMatch: false, }, }
var TestingComputeConfig = ComputeConfig{ Capacity: CapacityConfig{ IgnorePhysicalResourceLimits: false, TotalResourceLimits: models.ResourcesConfig{ CPU: "", Memory: "", Disk: "", GPU: "", }, JobResourceLimits: models.ResourcesConfig{ CPU: "", Memory: "", Disk: "", GPU: "", }, DefaultJobResourceLimits: models.ResourcesConfig{ CPU: "100m", Memory: "100Mi", Disk: "", GPU: "", }, }, ExecutionStore: JobStoreConfig{ Type: BoltDB, Path: "", }, JobTimeouts: JobTimeoutConfig{ JobExecutionTimeoutClientIDBypassList: []string{}, JobNegotiationTimeout: Duration(3 * time.Minute), MinJobExecutionTimeout: Duration(500 * time.Millisecond), MaxJobExecutionTimeout: Duration(models.NoTimeout), DefaultJobExecutionTimeout: Duration(10 * time.Minute), }, JobSelection: models.JobSelectionPolicy{ Locality: models.Anywhere, RejectStatelessJobs: false, AcceptNetworkedJobs: false, ProbeHTTP: "", ProbeExec: "", }, Logging: LoggingConfig{ LogRunningExecutionsInterval: Duration(10 * time.Second), }, ManifestCache: DockerCacheConfig{ Size: 1000, Duration: Duration(1 * time.Hour), Frequency: Duration(1 * time.Hour), }, LogStreamConfig: LogStreamConfig{ ChannelBufferSize: 10, }, LocalPublisher: LocalPublisherConfig{ Address: "private", Port: 6001, }, ControlPlaneSettings: ComputeControlPlaneConfig{ InfoUpdateFrequency: Duration(60 * time.Second), ResourceUpdateFrequency: Duration(30 * time.Second), HeartbeatFrequency: Duration(15 * time.Second), HeartbeatTopic: "heartbeat", }, }
var TestingRequesterConfig = RequesterConfig{ ExternalVerifierHook: "", JobSelectionPolicy: models.JobSelectionPolicy{ Locality: models.Anywhere, RejectStatelessJobs: false, AcceptNetworkedJobs: false, ProbeHTTP: "", ProbeExec: "", }, JobStore: JobStoreConfig{ Type: BoltDB, Path: "", }, HousekeepingBackgroundTaskInterval: Duration(30 * time.Second), NodeRankRandomnessRange: 5, OverAskForBidsFactor: 3, FailureInjectionConfig: models.FailureInjectionConfig{ IsBadActor: false, }, EvaluationBroker: EvaluationBrokerConfig{ EvalBrokerVisibilityTimeout: Duration(60 * time.Second), EvalBrokerInitialRetryDelay: Duration(1 * time.Second), EvalBrokerSubsequentRetryDelay: Duration(30 * time.Second), EvalBrokerMaxRetryCount: 10, }, Worker: WorkerConfig{ WorkerCount: runtime.NumCPU(), WorkerEvalDequeueTimeout: Duration(5 * time.Second), WorkerEvalDequeueBaseBackoff: Duration(1 * time.Second), WorkerEvalDequeueMaxBackoff: Duration(30 * time.Second), }, Scheduler: SchedulerConfig{ QueueBackoff: Duration(5 * time.Second), NodeOverSubscriptionFactor: 1.5, }, JobDefaults: JobDefaults{ TotalTimeout: Duration(30 * time.Second), }, StorageProvider: StorageProviderConfig{ S3: S3StorageProviderConfig{ PreSignedURLExpiration: Duration(30 * time.Minute), }, }, ControlPlaneSettings: RequesterControlPlaneConfig{ HeartbeatCheckFrequency: Duration(30 * time.Second), HeartbeatTopic: "heartbeat", NodeDisconnectedAfter: Duration(30 * time.Second), }, NodeInfoStoreTTL: Duration(10 * time.Minute), }
Functions ¶
func Set ¶
func Set(cfg BacalhauConfig, opts ...SetOption)
func SetDefaults ¶
func SetDefaults(cfg BacalhauConfig, opts ...SetOption)
Types ¶
type APIConfig ¶
type APIConfig struct { // Host is the hostname of an environment's public API servers. Host string `yaml:"Host"` // Port is the port that an environment serves the public API on. Port int `yaml:"Port"` // ClientTLS specifies tls options for the client connecting to the // API. ClientTLS ClientTLSConfig `yaml:"ClientTLS"` // TLS returns information about how TLS is configured for the public server. // This is only used in APIConfig for NodeConfig.ServerAPI TLS TLSConfiguration `yaml:"TLS"` }
type AuthConfig ¶
type AuthConfig struct { // TokensPath is the location where a state file of tokens will be stored. // By default it will be local to the Bacalhau repo, but can be any location // in the host filesystem. Tokens are sensitive and should be stored in a // location that is only readable to the current user. // Deprecated: replaced by cfg.AuthTokensPath() TokensPath string `yaml:"TokensPath"` // 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"` // 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"` }
AuthConfig is config that controls user authentication and authorization.
type AuthenticatorConfig ¶
type AuthenticatorConfig struct { Type authn.MethodType `yaml:"Type"` PolicyPath string `yaml:"PolicyPath,omitempty"` }
AuthenticationConfig 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 BacalhauConfig ¶
type BacalhauConfig struct { // NB(forrest): this field shouldn't be persisted yet. DataDir string `yaml:"-"` Node NodeConfig `yaml:"Node"` User UserConfig `yaml:"User"` Metrics MetricsConfig `yaml:"Metrics"` Update UpdateConfig `yaml:"UpdateConfig"` Auth AuthConfig `yaml:"Auth"` }
func (BacalhauConfig) AuthTokensPath ¶
func (c BacalhauConfig) AuthTokensPath() (string, error)
func (BacalhauConfig) ComputeDir ¶
func (c BacalhauConfig) ComputeDir() (string, error)
func (BacalhauConfig) ExecutionDir ¶
func (c BacalhauConfig) ExecutionDir() (string, error)
func (BacalhauConfig) ExecutionStoreFilePath ¶
func (c BacalhauConfig) ExecutionStoreFilePath() (string, error)
func (BacalhauConfig) JobStoreFilePath ¶
func (c BacalhauConfig) JobStoreFilePath() (string, error)
func (BacalhauConfig) NetworkTransportDir ¶
func (c BacalhauConfig) NetworkTransportDir() (string, error)
func (BacalhauConfig) OrchestratorDir ¶
func (c BacalhauConfig) OrchestratorDir() (string, error)
func (BacalhauConfig) PluginsDir ¶
func (c BacalhauConfig) PluginsDir() (string, error)
func (BacalhauConfig) UserKeyPath ¶
func (c BacalhauConfig) UserKeyPath() (string, error)
type CapacityConfig ¶
type CapacityConfig struct { IgnorePhysicalResourceLimits bool `yaml:"IgnorePhysicalResourceLimits"` // Total amount of resource the system can be using at one time in aggregate for all jobs. TotalResourceLimits models.ResourcesConfig `yaml:"TotalResourceLimits"` // Per job amount of resource the system can be using at one time. JobResourceLimits models.ResourcesConfig `yaml:"JobResourceLimits"` DefaultJobResourceLimits models.ResourcesConfig `yaml:"DefaultJobResourceLimits"` }
type ClientTLSConfig ¶
type ClientTLSConfig struct { // Used for NodeConfig.ClientAPI, instructs the client to connect over // TLS. Auto enabled if Insecure or CACert are specified. UseTLS bool `yaml:"UseTLS"` // Used for NodeConfig.ClientAPI, specifies the location of a ca certificate // file (primarily for self-signed server certs). Will use HTTPS for requests. CACert string `yaml:"CACert"` // Used for NodeConfig.ClientAPI, and when true instructs the client to use // HTTPS, but not to attempt to verify the certificate. Insecure bool `yaml:"Insecure"` }
type ComputeConfig ¶
type ComputeConfig struct { Capacity CapacityConfig `yaml:"Capacity"` ExecutionStore JobStoreConfig `yaml:"ExecutionStore"` JobTimeouts JobTimeoutConfig `yaml:"JobTimeouts"` JobSelection models.JobSelectionPolicy `yaml:"JobSelection"` Logging LoggingConfig `yaml:"Logging"` ManifestCache DockerCacheConfig `yaml:"ManifestCache"` LogStreamConfig LogStreamConfig `yaml:"LogStream"` LocalPublisher LocalPublisherConfig `yaml:"LocalPublisher"` ControlPlaneSettings ComputeControlPlaneConfig `yaml:"ClusterTimeouts"` }
type ComputeControlPlaneConfig ¶
type ComputeControlPlaneConfig struct { // The frequency with which the compute node will send node info (inc current labels) // to the controlling requester node. InfoUpdateFrequency Duration `yaml:"InfoUpdateFrequency"` // How often the compute node will send current resource availability to the requester node. ResourceUpdateFrequency Duration `yaml:"ResourceUpdateFrequency"` // How often the compute node will send a heartbeat to the requester node to let it know // that the compute node is still alive. This should be less than the requester's configured // heartbeat timeout to avoid flapping. HeartbeatFrequency Duration `yaml:"HeartbeatFrequency"` // This is the pubsub topic that the compute node will use to send heartbeats to the requester node. HeartbeatTopic string `yaml:"HeartbeatTopic"` }
type DockerCacheConfig ¶
type Duration ¶
Duration is a wrapper type for time.Duration for decoding and encoding from/to YAML, etc.
func (Duration) AsTimeDuration ¶
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:
- our config file is yaml, and we want to use durations for configuring things, printed in a human-readable format.
- time.Duration does not, and will not implement MarshalText/UnmarshalText - https://github.com/golang/go/issues/16039
- 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 (*Duration) UnmarshalText ¶
UnmarshalText implements interface for YAML decoding
type EvaluationBrokerConfig ¶
type EvaluationBrokerConfig struct { EvalBrokerVisibilityTimeout Duration `yaml:"EvalBrokerVisibilityTimeout"` EvalBrokerInitialRetryDelay Duration `yaml:"EvalBrokerInitialRetryDelay"` EvalBrokerSubsequentRetryDelay Duration `yaml:"EvalBrokerSubsequentRetryDelay"` EvalBrokerMaxRetryCount int `yaml:"EvalBrokerMaxRetryCount"` }
type FeatureConfig ¶
type IpfsConfig ¶
type IpfsConfig struct { // Connect is the multiaddress to connect to for IPFS. Connect string `yaml:"Connect"` }
type JobDefaults ¶
type JobStoreConfig ¶
type JobStoreConfig struct { Type StorageType `yaml:"Type"` Path string `yaml:"Path"` }
func (JobStoreConfig) Validate ¶
func (cfg JobStoreConfig) Validate() error
type JobTimeoutConfig ¶
type JobTimeoutConfig struct { // JobExecutionTimeoutClientIDBypassList is the list of clients that are allowed to bypass the job execution timeout // check. JobExecutionTimeoutClientIDBypassList []string `yaml:"JobExecutionTimeoutClientIDBypassList"` // JobNegotiationTimeout default timeout value to hold a bid for a job JobNegotiationTimeout Duration `yaml:"JobNegotiationTimeout"` // MinJobExecutionTimeout default value for the minimum execution timeout this compute node supports. Jobs with // lower timeout requirements will not be bid on. MinJobExecutionTimeout Duration `yaml:"MinJobExecutionTimeout"` // MaxJobExecutionTimeout default value for the maximum execution timeout this compute node supports. Jobs with // higher timeout requirements will not be bid on. MaxJobExecutionTimeout Duration `yaml:"MaxJobExecutionTimeout"` // DefaultJobExecutionTimeout default value for the execution timeout this compute node will assign to jobs with // no timeout requirement defined. DefaultJobExecutionTimeout Duration `yaml:"DefaultJobExecutionTimeout"` }
type LocalPublisherConfig ¶
type LogStreamConfig ¶
type LogStreamConfig struct { // How many messages to buffer in the log stream channel, per stream ChannelBufferSize int `yaml:"ChannelBufferSize"` }
type LoggingConfig ¶
type LoggingConfig struct { // logging running executions LogRunningExecutionsInterval Duration `yaml:"LogRunningExecutionsInterval"` }
type MetricsConfig ¶
type MetricsConfig struct {
EventTracerPath string `yaml:"EventTracerPath"`
}
type NetworkClusterConfig ¶
type NetworkConfig ¶
type NodeConfig ¶
type NodeConfig struct { Name string `yaml:"Name"` NameProvider string `yaml:"NameProvider"` ClientAPI APIConfig `yaml:"ClientAPI"` ServerAPI APIConfig `yaml:"ServerAPI"` IPFS IpfsConfig `yaml:"IPFS"` Compute ComputeConfig `yaml:"Compute"` Requester RequesterConfig `yaml:"Requester"` DownloadURLRequestRetries int `yaml:"DownloadURLRequestRetries"` DownloadURLRequestTimeout Duration `yaml:"DownloadURLRequestTimeout"` VolumeSizeRequestTimeout Duration `yaml:"VolumeSizeRequestTimeout"` // Deprecated: replaced by cfg.PluginsDir() ExecutorPluginPath string `yaml:"ExecutorPluginPath"` // TODO(forrest) [refactor]: rename this to ExecutorStoragePath // Deprecated: replaced by cfg.ComputeDir() ComputeStoragePath string `yaml:"ComputeStoragePath"` LoggingMode logger.LogMode `yaml:"LoggingMode"` // Type is "compute", "requester" or both Type []string `yaml:"Type"` // AllowListedLocalPaths contains local paths that are allowed to be mounted into jobs AllowListedLocalPaths []string `yaml:"AllowListedLocalPaths"` // What features should not be enabled even if installed DisabledFeatures FeatureConfig `yaml:"DisabledFeatures"` // Labels to apply to the node that can be used for node selection and filtering Labels map[string]string `yaml:"Labels"` // Configuration for the web UI WebUI WebUIConfig `yaml:"WebUI"` Network NetworkConfig `yaml:"Network"` StrictVersionMatch bool `yaml:"StrictVersionMatch"` }
type RequesterConfig ¶
type RequesterConfig struct { JobDefaults JobDefaults `yaml:"JobDefaults"` // URL where to send external verification requests to. ExternalVerifierHook string `yaml:"ExternalVerifierHook"` // How the node decides what jobs to run. JobSelectionPolicy models.JobSelectionPolicy `yaml:"JobSelectionPolicy"` JobStore JobStoreConfig `yaml:"JobStore"` HousekeepingBackgroundTaskInterval Duration `yaml:"HousekeepingBackgroundTaskInterval"` NodeRankRandomnessRange int `yaml:"NodeRankRandomnessRange"` OverAskForBidsFactor uint `yaml:"OverAskForBidsFactor"` FailureInjectionConfig models.FailureInjectionConfig `yaml:"FailureInjectionConfig"` TranslationEnabled bool `yaml:"TranslationEnabled"` EvaluationBroker EvaluationBrokerConfig `yaml:"EvaluationBroker"` Worker WorkerConfig `yaml:"Worker"` Scheduler SchedulerConfig `yaml:"Scheduler"` StorageProvider StorageProviderConfig `yaml:"StorageProvider"` TagCache DockerCacheConfig `yaml:"TagCache"` DefaultPublisher string `yaml:"DefaultPublisher"` ControlPlaneSettings RequesterControlPlaneConfig `yaml:"ControlPlaneSettings"` NodeInfoStoreTTL Duration `yaml:"NodeInfoStoreTTL"` // ManualNodeApproval is a flag that determines if nodes should be manually approved or not. // By default, nodes are auto-approved to simplify upgrades, by setting this property to // true, nodes will need to be manually approved before they are included in node selection. ManualNodeApproval bool `yaml:"ManualNodeApproval"` }
type RequesterControlPlaneConfig ¶
type RequesterControlPlaneConfig struct { // This setting is the time period after which a compute node is considered to be unresponsive. // If the compute node misses two of these frequencies, it will be marked as unknown. The compute // node should have a frequency setting less than this one to ensure that it does not keep // switching between unknown and active too frequently. HeartbeatCheckFrequency Duration `yaml:"HeartbeatFrequency"` // This is the pubsub topic that the compute node will use to send heartbeats to the requester node. HeartbeatTopic string `yaml:"HeartbeatTopic"` // This is the time period after which a compute node is considered to be disconnected. If the compute // node does not deliver a heartbeat every `NodeDisconnectedAfter` then it is considered disconnected. NodeDisconnectedAfter Duration `yaml:"NodeDisconnectedAfter"` }
type S3StorageProviderConfig ¶
type SchedulerConfig ¶
type StorageProviderConfig ¶
type StorageProviderConfig struct {
S3 S3StorageProviderConfig `yaml:"S3"`
}
type StorageType ¶
type StorageType int64
const ( UnknownStorage StorageType = 0 BoltDB StorageType = 1 )
func ParseStorageType ¶
func ParseStorageType(s string) (ret StorageType, err error)
func (StorageType) MarshalYAML ¶
func (j StorageType) MarshalYAML() (interface{}, error)
func (StorageType) String ¶
func (i StorageType) String() string
func (*StorageType) UnmarshalText ¶
func (j *StorageType) UnmarshalText(text []byte) error
func (*StorageType) UnmarshalYAML ¶
func (j *StorageType) UnmarshalYAML(value *yaml.Node) error
type TLSConfiguration ¶
type TLSConfiguration struct { // AutoCert specifies a hostname for a certificate to be obtained via ACME. // This is only used by the server, and only by the requester node when it // has a publicly resolvable domain name. AutoCert string `yaml:"AutoCert"` // AutoCertCachePath specifies the directory where the autocert process // will cache certificates to avoid rate limits. AutoCertCachePath string `yaml:"AutoCertCachePath"` // ServerCertificate specifies the location of a TLS certificate to be used // by the requester to serve TLS requests ServerCertificate string `yaml:"ServerCertificate"` // ServerKey is the TLS server key to match the certificate to allow the // requester to server TLS. ServerKey string `yaml:"ServerKey"` // SelfSignedCert will auto-generate a self-signed certificate for the // requester node if TLS certificates have not been provided. SelfSigned bool `yaml:"SelfSigned"` }