types

package
v1.6.0 Latest Latest
Warning

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

Go to latest
Published: Dec 16, 2024 License: Apache-2.0 Imports: 19 Imported by: 0

Documentation

Index

Constants

View Source
const Auth = "auth"
View Source
const AuthAccessPolicyPath = "auth.accesspolicypath"
View Source
const AuthMethods = "auth.methods"
View Source
const AuthTokensFileName = "tokens.json"
View Source
const AuthTokensPath = "auth.tokenspath"
View Source
const ComputeDirName = "compute"
View Source
const ExecutionDirName = "executions"
View Source
const ExecutionStoreFileName = "state_boltdb.db"
View Source
const JobStoreFileName = "state_boltdb.db"
View Source
const Metrics = "metrics"
View Source
const MetricsEventTracerPath = "metrics.eventtracerpath"
View Source
const NetworkTransportDirName = "nats-store"
View Source
const Node = "node"
View Source
const NodeAllowListedLocalPaths = "node.allowlistedlocalpaths"
View Source
const NodeClientAPI = "node.clientapi"
View Source
const NodeClientAPIClientTLS = "node.clientapi.clienttls"
View Source
const NodeClientAPIClientTLSCACert = "node.clientapi.clienttls.cacert"
View Source
const NodeClientAPIClientTLSInsecure = "node.clientapi.clienttls.insecure"
View Source
const NodeClientAPIClientTLSUseTLS = "node.clientapi.clienttls.usetls"
View Source
const NodeClientAPIHost = "node.clientapi.host"
View Source
const NodeClientAPIPort = "node.clientapi.port"
View Source
const NodeClientAPITLS = "node.clientapi.tls"
View Source
const NodeClientAPITLSAutoCert = "node.clientapi.tls.autocert"
View Source
const NodeClientAPITLSAutoCertCachePath = "node.clientapi.tls.autocertcachepath"
View Source
const NodeClientAPITLSSelfSigned = "node.clientapi.tls.selfsigned"
View Source
const NodeClientAPITLSServerCertificate = "node.clientapi.tls.servercertificate"
View Source
const NodeClientAPITLSServerKey = "node.clientapi.tls.serverkey"
View Source
const NodeCompute = "node.compute"
View Source
const NodeComputeCapacity = "node.compute.capacity"
View Source
const NodeComputeCapacityDefaultJobResourceLimits = "node.compute.capacity.defaultjobresourcelimits"
View Source
const NodeComputeCapacityDefaultJobResourceLimitsCPU = "node.compute.capacity.defaultjobresourcelimits.cpu"
View Source
const NodeComputeCapacityDefaultJobResourceLimitsDisk = "node.compute.capacity.defaultjobresourcelimits.disk"
View Source
const NodeComputeCapacityDefaultJobResourceLimitsGPU = "node.compute.capacity.defaultjobresourcelimits.gpu"
View Source
const NodeComputeCapacityDefaultJobResourceLimitsMemory = "node.compute.capacity.defaultjobresourcelimits.memory"
View Source
const NodeComputeCapacityIgnorePhysicalResourceLimits = "node.compute.capacity.ignorephysicalresourcelimits"
View Source
const NodeComputeCapacityJobResourceLimits = "node.compute.capacity.jobresourcelimits"
View Source
const NodeComputeCapacityJobResourceLimitsCPU = "node.compute.capacity.jobresourcelimits.cpu"
View Source
const NodeComputeCapacityJobResourceLimitsDisk = "node.compute.capacity.jobresourcelimits.disk"
View Source
const NodeComputeCapacityJobResourceLimitsGPU = "node.compute.capacity.jobresourcelimits.gpu"
View Source
const NodeComputeCapacityJobResourceLimitsMemory = "node.compute.capacity.jobresourcelimits.memory"
View Source
const NodeComputeCapacityTotalResourceLimits = "node.compute.capacity.totalresourcelimits"
View Source
const NodeComputeCapacityTotalResourceLimitsCPU = "node.compute.capacity.totalresourcelimits.cpu"
View Source
const NodeComputeCapacityTotalResourceLimitsDisk = "node.compute.capacity.totalresourcelimits.disk"
View Source
const NodeComputeCapacityTotalResourceLimitsGPU = "node.compute.capacity.totalresourcelimits.gpu"
View Source
const NodeComputeCapacityTotalResourceLimitsMemory = "node.compute.capacity.totalresourcelimits.memory"
View Source
const NodeComputeControlPlaneSettings = "node.compute.controlplanesettings"
View Source
const NodeComputeControlPlaneSettingsHeartbeatFrequency = "node.compute.controlplanesettings.heartbeatfrequency"
View Source
const NodeComputeControlPlaneSettingsHeartbeatTopic = "node.compute.controlplanesettings.heartbeattopic"
View Source
const NodeComputeControlPlaneSettingsInfoUpdateFrequency = "node.compute.controlplanesettings.infoupdatefrequency"
View Source
const NodeComputeControlPlaneSettingsResourceUpdateFrequency = "node.compute.controlplanesettings.resourceupdatefrequency"
View Source
const NodeComputeExecutionStore = "node.compute.executionstore"
View Source
const NodeComputeExecutionStorePath = "node.compute.executionstore.path"
View Source
const NodeComputeExecutionStoreType = "node.compute.executionstore.type"
View Source
const NodeComputeJobSelection = "node.compute.jobselection"
View Source
const NodeComputeJobSelectionAcceptNetworkedJobs = "node.compute.jobselection.acceptnetworkedjobs"
View Source
const NodeComputeJobSelectionLocality = "node.compute.jobselection.locality"
View Source
const NodeComputeJobSelectionProbeExec = "node.compute.jobselection.probeexec"
View Source
const NodeComputeJobSelectionProbeHTTP = "node.compute.jobselection.probehttp"
View Source
const NodeComputeJobSelectionRejectStatelessJobs = "node.compute.jobselection.rejectstatelessjobs"
View Source
const NodeComputeJobTimeouts = "node.compute.jobtimeouts"
View Source
const NodeComputeJobTimeoutsDefaultJobExecutionTimeout = "node.compute.jobtimeouts.defaultjobexecutiontimeout"
View Source
const NodeComputeJobTimeoutsJobExecutionTimeoutClientIDBypassList = "node.compute.jobtimeouts.jobexecutiontimeoutclientidbypasslist"
View Source
const NodeComputeJobTimeoutsJobNegotiationTimeout = "node.compute.jobtimeouts.jobnegotiationtimeout"
View Source
const NodeComputeJobTimeoutsMaxJobExecutionTimeout = "node.compute.jobtimeouts.maxjobexecutiontimeout"
View Source
const NodeComputeJobTimeoutsMinJobExecutionTimeout = "node.compute.jobtimeouts.minjobexecutiontimeout"
View Source
const NodeComputeLocalPublisher = "node.compute.localpublisher"
View Source
const NodeComputeLocalPublisherAddress = "node.compute.localpublisher.address"
View Source
const NodeComputeLocalPublisherDirectory = "node.compute.localpublisher.directory"
View Source
const NodeComputeLocalPublisherPort = "node.compute.localpublisher.port"
View Source
const NodeComputeLogStreamConfig = "node.compute.logstreamconfig"
View Source
const NodeComputeLogStreamConfigChannelBufferSize = "node.compute.logstreamconfig.channelbuffersize"
View Source
const NodeComputeLogging = "node.compute.logging"
View Source
const NodeComputeLoggingLogRunningExecutionsInterval = "node.compute.logging.logrunningexecutionsinterval"
View Source
const NodeComputeManifestCache = "node.compute.manifestcache"
View Source
const NodeComputeManifestCacheDuration = "node.compute.manifestcache.duration"
View Source
const NodeComputeManifestCacheFrequency = "node.compute.manifestcache.frequency"
View Source
const NodeComputeManifestCacheSize = "node.compute.manifestcache.size"
View Source
const NodeComputeStoragePath = "node.computestoragepath"
View Source
const NodeDisabledFeatures = "node.disabledfeatures"
View Source
const NodeDisabledFeaturesEngines = "node.disabledfeatures.engines"
View Source
const NodeDisabledFeaturesPublishers = "node.disabledfeatures.publishers"
View Source
const NodeDisabledFeaturesStorages = "node.disabledfeatures.storages"
View Source
const NodeDownloadURLRequestRetries = "node.downloadurlrequestretries"
View Source
const NodeDownloadURLRequestTimeout = "node.downloadurlrequesttimeout"
View Source
const NodeExecutorPluginPath = "node.executorpluginpath"
View Source
const NodeIPFS = "node.ipfs"
View Source
const NodeIPFSConnect = "node.ipfs.connect"
View Source
const NodeLabels = "node.labels"
View Source
const NodeLoggingMode = "node.loggingmode"
View Source
const NodeName = "node.name"
View Source
const NodeNameProvider = "node.nameprovider"
View Source
const NodeNetwork = "node.network"
View Source
const NodeNetworkAdvertisedAddress = "node.network.advertisedaddress"
View Source
const NodeNetworkAuthSecret = "node.network.authsecret"
View Source
const NodeNetworkCluster = "node.network.cluster"
View Source
const NodeNetworkClusterAdvertisedAddress = "node.network.cluster.advertisedaddress"
View Source
const NodeNetworkClusterName = "node.network.cluster.name"
View Source
const NodeNetworkClusterPeers = "node.network.cluster.peers"
View Source
const NodeNetworkClusterPort = "node.network.cluster.port"
View Source
const NodeNetworkOrchestrators = "node.network.orchestrators"
View Source
const NodeNetworkPort = "node.network.port"
View Source
const NodeNetworkStoreDir = "node.network.storedir"
View Source
const NodeRequester = "node.requester"
View Source
const NodeRequesterControlPlaneSettings = "node.requester.controlplanesettings"
View Source
const NodeRequesterControlPlaneSettingsHeartbeatCheckFrequency = "node.requester.controlplanesettings.heartbeatcheckfrequency"
View Source
const NodeRequesterControlPlaneSettingsHeartbeatTopic = "node.requester.controlplanesettings.heartbeattopic"
View Source
const NodeRequesterControlPlaneSettingsNodeDisconnectedAfter = "node.requester.controlplanesettings.nodedisconnectedafter"
View Source
const NodeRequesterDefaultPublisher = "node.requester.defaultpublisher"
View Source
const NodeRequesterEvaluationBroker = "node.requester.evaluationbroker"
View Source
const NodeRequesterEvaluationBrokerEvalBrokerInitialRetryDelay = "node.requester.evaluationbroker.evalbrokerinitialretrydelay"
View Source
const NodeRequesterEvaluationBrokerEvalBrokerMaxRetryCount = "node.requester.evaluationbroker.evalbrokermaxretrycount"
View Source
const NodeRequesterEvaluationBrokerEvalBrokerSubsequentRetryDelay = "node.requester.evaluationbroker.evalbrokersubsequentretrydelay"
View Source
const NodeRequesterEvaluationBrokerEvalBrokerVisibilityTimeout = "node.requester.evaluationbroker.evalbrokervisibilitytimeout"
View Source
const NodeRequesterExternalVerifierHook = "node.requester.externalverifierhook"
View Source
const NodeRequesterFailureInjectionConfig = "node.requester.failureinjectionconfig"
View Source
const NodeRequesterFailureInjectionConfigIsBadActor = "node.requester.failureinjectionconfig.isbadactor"
View Source
const NodeRequesterHousekeepingBackgroundTaskInterval = "node.requester.housekeepingbackgroundtaskinterval"
View Source
const NodeRequesterJobDefaults = "node.requester.jobdefaults"
View Source
const NodeRequesterJobDefaultsExecutionTimeout = "node.requester.jobdefaults.executiontimeout"
View Source
const NodeRequesterJobDefaultsQueueTimeout = "node.requester.jobdefaults.queuetimeout"
View Source
const NodeRequesterJobDefaultsTotalTimeout = "node.requester.jobdefaults.totaltimeout"
View Source
const NodeRequesterJobSelectionPolicy = "node.requester.jobselectionpolicy"
View Source
const NodeRequesterJobSelectionPolicyAcceptNetworkedJobs = "node.requester.jobselectionpolicy.acceptnetworkedjobs"
View Source
const NodeRequesterJobSelectionPolicyLocality = "node.requester.jobselectionpolicy.locality"
View Source
const NodeRequesterJobSelectionPolicyProbeExec = "node.requester.jobselectionpolicy.probeexec"
View Source
const NodeRequesterJobSelectionPolicyProbeHTTP = "node.requester.jobselectionpolicy.probehttp"
View Source
const NodeRequesterJobSelectionPolicyRejectStatelessJobs = "node.requester.jobselectionpolicy.rejectstatelessjobs"
View Source
const NodeRequesterJobStore = "node.requester.jobstore"
View Source
const NodeRequesterJobStorePath = "node.requester.jobstore.path"
View Source
const NodeRequesterJobStoreType = "node.requester.jobstore.type"
View Source
const NodeRequesterManualNodeApproval = "node.requester.manualnodeapproval"
View Source
const NodeRequesterNodeInfoStoreTTL = "node.requester.nodeinfostorettl"
View Source
const NodeRequesterNodeRankRandomnessRange = "node.requester.noderankrandomnessrange"
View Source
const NodeRequesterOverAskForBidsFactor = "node.requester.overaskforbidsfactor"
View Source
const NodeRequesterScheduler = "node.requester.scheduler"
View Source
const NodeRequesterSchedulerNodeOverSubscriptionFactor = "node.requester.scheduler.nodeoversubscriptionfactor"
View Source
const NodeRequesterSchedulerQueueBackoff = "node.requester.scheduler.queuebackoff"
View Source
const NodeRequesterStorageProvider = "node.requester.storageprovider"
View Source
const NodeRequesterStorageProviderS3 = "node.requester.storageprovider.s3"
View Source
const NodeRequesterStorageProviderS3PreSignedURLDisabled = "node.requester.storageprovider.s3.presignedurldisabled"
View Source
const NodeRequesterStorageProviderS3PreSignedURLExpiration = "node.requester.storageprovider.s3.presignedurlexpiration"
View Source
const NodeRequesterTagCache = "node.requester.tagcache"
View Source
const NodeRequesterTagCacheDuration = "node.requester.tagcache.duration"
View Source
const NodeRequesterTagCacheFrequency = "node.requester.tagcache.frequency"
View Source
const NodeRequesterTagCacheSize = "node.requester.tagcache.size"
View Source
const NodeRequesterTranslationEnabled = "node.requester.translationenabled"
View Source
const NodeRequesterWorker = "node.requester.worker"
View Source
const NodeRequesterWorkerWorkerCount = "node.requester.worker.workercount"
View Source
const NodeRequesterWorkerWorkerEvalDequeueBaseBackoff = "node.requester.worker.workerevaldequeuebasebackoff"
View Source
const NodeRequesterWorkerWorkerEvalDequeueMaxBackoff = "node.requester.worker.workerevaldequeuemaxbackoff"
View Source
const NodeRequesterWorkerWorkerEvalDequeueTimeout = "node.requester.worker.workerevaldequeuetimeout"
View Source
const NodeServerAPI = "node.serverapi"
View Source
const NodeServerAPIClientTLS = "node.serverapi.clienttls"
View Source
const NodeServerAPIClientTLSCACert = "node.serverapi.clienttls.cacert"
View Source
const NodeServerAPIClientTLSInsecure = "node.serverapi.clienttls.insecure"
View Source
const NodeServerAPIClientTLSUseTLS = "node.serverapi.clienttls.usetls"
View Source
const NodeServerAPIHost = "node.serverapi.host"
View Source
const NodeServerAPIPort = "node.serverapi.port"
View Source
const NodeServerAPITLS = "node.serverapi.tls"
View Source
const NodeServerAPITLSAutoCert = "node.serverapi.tls.autocert"
View Source
const NodeServerAPITLSAutoCertCachePath = "node.serverapi.tls.autocertcachepath"
View Source
const NodeServerAPITLSSelfSigned = "node.serverapi.tls.selfsigned"
View Source
const NodeServerAPITLSServerCertificate = "node.serverapi.tls.servercertificate"
View Source
const NodeServerAPITLSServerKey = "node.serverapi.tls.serverkey"
View Source
const NodeStrictVersionMatch = "node.strictversionmatch"
View Source
const NodeType = "node.type"
View Source
const NodeVolumeSizeRequestTimeout = "node.volumesizerequesttimeout"
View Source
const NodeWebUI = "node.webui"
View Source
const NodeWebUIEnabled = "node.webui.enabled"
View Source
const NodeWebUIPort = "node.webui.port"
View Source
const OrchestratorDirName = "orchestrator"
View Source
const PluginsDirName = "plugins"
View Source
const Update = "update"
View Source
const UpdateCheckFrequency = "update.checkfrequency"
View Source
const UpdateSkipChecks = "update.skipchecks"
View Source
const User = "user"
View Source
const UserInstallationID = "user.installationid"
View Source
const UserKeyFileName = "user_id.pem"
View Source
const UserKeyPath = "user.keypath"

Variables

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

ConfigDescriptions maps configuration paths to their descriptions

View Source
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,
	},
}
View Source
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",
	},
}
View Source
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 DockerCacheConfig struct {
	Size      uint64   `yaml:"Size"`
	Duration  Duration `yaml:"Duration"`
	Frequency Duration `yaml:"Frequency"`
}

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

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 EvaluationBrokerConfig

type EvaluationBrokerConfig struct {
	EvalBrokerVisibilityTimeout    Duration `yaml:"EvalBrokerVisibilityTimeout"`
	EvalBrokerInitialRetryDelay    Duration `yaml:"EvalBrokerInitialRetryDelay"`
	EvalBrokerSubsequentRetryDelay Duration `yaml:"EvalBrokerSubsequentRetryDelay"`
	EvalBrokerMaxRetryCount        int      `yaml:"EvalBrokerMaxRetryCount"`
}

type FeatureConfig

type FeatureConfig struct {
	Engines    []string `yaml:"Engines"`
	Publishers []string `yaml:"Publishers"`
	Storages   []string `yaml:"Storages"`
}

type IpfsConfig

type IpfsConfig struct {
	// Connect is the multiaddress to connect to for IPFS.
	Connect string `yaml:"Connect"`
}

type JobDefaults

type JobDefaults struct {
	TotalTimeout     Duration `yaml:"TotalTimeout"`
	ExecutionTimeout Duration `yaml:"ExecutionTimeout"`
	QueueTimeout     Duration `yaml:"QueueTimeout"`
}

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 LocalPublisherConfig struct {
	Address   string `yaml:"Address"`
	Port      int    `yaml:"Port"`
	Directory string `yaml:"Directory"`
}

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 NetworkClusterConfig struct {
	Name              string   `yaml:"Name"`
	Port              int      `yaml:"Port"`
	AdvertisedAddress string   `yaml:"AdvertisedAddress"`
	Peers             []string `yaml:"Peers"`
}

type NetworkConfig

type NetworkConfig struct {
	Port              int                  `yaml:"Port"`
	AdvertisedAddress string               `yaml:"AdvertisedAddress"`
	AuthSecret        string               `yaml:"AuthSecret"`
	Orchestrators     []string             `yaml:"Orchestrators"`
	StoreDir          string               `yaml:"StoreDir"`
	Cluster           NetworkClusterConfig `yaml:"Cluster"`
}

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 S3StorageProviderConfig struct {
	PreSignedURLDisabled   bool     `yaml:"PreSignedURLDisabled"`
	PreSignedURLExpiration Duration `yaml:"PreSignedURLExpiration"`
}

type SchedulerConfig

type SchedulerConfig struct {
	QueueBackoff               Duration `yaml:"QueueBackoff"`
	NodeOverSubscriptionFactor float64  `yaml:"NodeOverSubscriptionFactor"`
}

type SetOption

type SetOption func(p *SetParams)

func WithViper

func WithViper(v *viper.Viper) SetOption

type SetParams

type SetParams struct {
	Viper *viper.Viper
}

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"`
}

type UpdateConfig

type UpdateConfig struct {
	SkipChecks     bool     `yaml:"SkipChecks"`
	CheckFrequency Duration `yaml:"CheckFrequency"`
}

type UserConfig

type UserConfig struct {
	// KeyPath is deprecated
	// Deprecated: replaced by cfg.UserKeyPath()
	KeyPath        string `yaml:"KeyPath"`
	InstallationID string `yaml:"InstallationID"`
}

type WebUIConfig

type WebUIConfig struct {
	Enabled bool `yaml:"Enabled"`
	Port    int  `yaml:"Port"`
}

type WorkerConfig

type WorkerConfig struct {
	WorkerCount                  int      `yaml:"WorkerCount"`
	WorkerEvalDequeueTimeout     Duration `yaml:"WorkerEvalDequeueTimeout"`
	WorkerEvalDequeueBaseBackoff Duration `yaml:"WorkerEvalDequeueBaseBackoff"`
	WorkerEvalDequeueMaxBackoff  Duration `yaml:"WorkerEvalDequeueMaxBackoff"`
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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