-
Notifications
You must be signed in to change notification settings - Fork 85
/
local.go
194 lines (189 loc) · 5.64 KB
/
local.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
//nolint:gomnd
package configenv
import (
"os"
"runtime"
"time"
"github.com/bacalhau-project/bacalhau/pkg/authn"
"github.com/bacalhau-project/bacalhau/pkg/config/types"
"github.com/bacalhau-project/bacalhau/pkg/logger"
"github.com/bacalhau-project/bacalhau/pkg/model"
"github.com/bacalhau-project/bacalhau/pkg/models"
)
var Local = types.BacalhauConfig{
Metrics: types.MetricsConfig{
Libp2pTracerPath: os.DevNull,
EventTracerPath: os.DevNull,
},
Update: types.UpdateConfig{
SkipChecks: true,
},
Auth: types.AuthConfig{
Methods: map[string]types.AuthenticatorConfig{
"ClientKey": {
Type: authn.MethodTypeChallenge,
},
},
},
Node: types.NodeConfig{
NameProvider: "puuid",
ClientAPI: types.APIConfig{
Host: "0.0.0.0",
Port: 1234,
},
ServerAPI: types.APIConfig{
Host: "0.0.0.0",
Port: 1234,
TLS: types.TLSConfiguration{},
},
Network: types.NetworkConfig{
Type: models.NetworkTypeNATS,
Port: 4222,
},
BootstrapAddresses: []string{},
DownloadURLRequestTimeout: types.Duration(300 * time.Second),
VolumeSizeRequestTimeout: types.Duration(2 * time.Minute),
NodeInfoStoreTTL: types.Duration(10 * time.Minute),
DownloadURLRequestRetries: 3,
LoggingMode: logger.LogModeDefault,
Type: []string{"requester"},
AllowListedLocalPaths: []string{},
Labels: map[string]string{},
DisabledFeatures: types.FeatureConfig{
Engines: []string{},
Publishers: []string{},
Storages: []string{},
},
Libp2p: types.Libp2pConfig{
SwarmPort: 1235,
PeerConnect: "none",
},
IPFS: types.IpfsConfig{
Connect: "",
PrivateInternal: true,
SwarmAddresses: []string{},
Profile: "flatfs",
SwarmListenAddresses: []string{"/ip4/0.0.0.0/tcp/0"},
GatewayListenAddresses: []string{"/ip4/0.0.0.0/tcp/0"},
APIListenAddresses: []string{"/ip4/0.0.0.0/tcp/0"},
},
Compute: LocalComputeConfig,
Requester: LocalRequesterConfig,
WebUI: types.WebUIConfig{
Enabled: false,
Port: 8483,
},
StrictVersionMatch: false,
},
}
var LocalComputeConfig = types.ComputeConfig{
Capacity: types.CapacityConfig{
IgnorePhysicalResourceLimits: false,
TotalResourceLimits: models.ResourcesConfig{
CPU: "",
Memory: "",
Disk: "",
GPU: "",
},
JobResourceLimits: models.ResourcesConfig{
CPU: "",
Memory: "",
Disk: "",
GPU: "",
},
DefaultJobResourceLimits: models.ResourcesConfig{
CPU: "500m",
Memory: "1Gb",
Disk: "",
GPU: "",
},
},
ExecutionStore: types.JobStoreConfig{
Type: types.BoltDB,
Path: "",
},
JobTimeouts: types.JobTimeoutConfig{
JobExecutionTimeoutClientIDBypassList: []string{},
JobNegotiationTimeout: types.Duration(3 * time.Minute),
MinJobExecutionTimeout: types.Duration(500 * time.Millisecond),
MaxJobExecutionTimeout: types.Duration(model.NoJobTimeout),
DefaultJobExecutionTimeout: types.Duration(10 * time.Minute),
},
JobSelection: model.JobSelectionPolicy{
Locality: model.Anywhere,
RejectStatelessJobs: false,
AcceptNetworkedJobs: false,
ProbeHTTP: "",
ProbeExec: "",
},
Logging: types.LoggingConfig{
LogRunningExecutionsInterval: types.Duration(10 * time.Second),
},
ManifestCache: types.DockerCacheConfig{
Size: 1000,
Duration: types.Duration(1 * time.Hour),
Frequency: types.Duration(1 * time.Hour),
},
LogStreamConfig: types.LogStreamConfig{
ChannelBufferSize: 10,
},
LocalPublisher: types.LocalPublisherConfig{
Address: "127.0.0.1",
Port: 6001,
},
ControlPlaneSettings: types.ComputeControlPlaneConfig{
InfoUpdateFrequency: types.Duration(60 * time.Second),
ResourceUpdateFrequency: types.Duration(30 * time.Second),
HeartbeatFrequency: types.Duration(15 * time.Second),
HeartbeatTopic: "heartbeat",
},
}
var LocalRequesterConfig = types.RequesterConfig{
ExternalVerifierHook: "",
JobSelectionPolicy: model.JobSelectionPolicy{
Locality: model.Anywhere,
RejectStatelessJobs: false,
AcceptNetworkedJobs: false,
ProbeHTTP: "",
ProbeExec: "",
},
JobStore: types.JobStoreConfig{
Type: types.BoltDB,
Path: "",
},
HousekeepingBackgroundTaskInterval: types.Duration(30 * time.Second),
NodeRankRandomnessRange: 5,
OverAskForBidsFactor: 3,
FailureInjectionConfig: model.FailureInjectionRequesterConfig{
IsBadActor: false,
},
EvaluationBroker: types.EvaluationBrokerConfig{
EvalBrokerVisibilityTimeout: types.Duration(60 * time.Second),
EvalBrokerInitialRetryDelay: types.Duration(1 * time.Second),
EvalBrokerSubsequentRetryDelay: types.Duration(30 * time.Second),
EvalBrokerMaxRetryCount: 10,
},
Worker: types.WorkerConfig{
WorkerCount: runtime.NumCPU(),
WorkerEvalDequeueTimeout: types.Duration(5 * time.Second),
WorkerEvalDequeueBaseBackoff: types.Duration(1 * time.Second),
WorkerEvalDequeueMaxBackoff: types.Duration(30 * time.Second),
},
Scheduler: types.SchedulerConfig{
QueueBackoff: types.Duration(30 * time.Second),
NodeOverSubscriptionFactor: 1.5,
},
JobDefaults: types.JobDefaults{
ExecutionTimeout: types.Duration(30 * time.Minute),
},
StorageProvider: types.StorageProviderConfig{
S3: types.S3StorageProviderConfig{
PreSignedURLExpiration: types.Duration(30 * time.Minute),
},
},
ControlPlaneSettings: types.RequesterControlPlaneConfig{
HeartbeatCheckFrequency: types.Duration(30 * time.Second),
HeartbeatTopic: "heartbeat",
NodeDisconnectedAfter: types.Duration(30 * time.Second),
},
}