-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathpresets.go
140 lines (132 loc) · 3.77 KB
/
presets.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
package presets
import (
"github.com/goplugin/plugin-env/environment"
"github.com/goplugin/plugin-env/pkg/cdk8s/blockscout"
"github.com/goplugin/plugin-env/pkg/helm/plugin"
"github.com/goplugin/plugin-env/pkg/helm/ethereum"
"github.com/goplugin/plugin-env/pkg/helm/mockserver"
mockservercfg "github.com/goplugin/plugin-env/pkg/helm/mockserver-cfg"
"github.com/goplugin/plugin-env/pkg/helm/reorg"
)
// EVMOneNode local development Plugin deployment
func EVMOneNode(config *environment.Config) *environment.Environment {
return environment.New(config).
AddHelm(mockservercfg.New(nil)).
AddHelm(mockserver.New(nil)).
AddHelm(ethereum.New(nil)).
AddHelm(plugin.New(0, nil))
}
// EVMMinimalLocalBS local development Plugin deployment,
// 1 bootstrap + 4 oracles (minimal requirements for OCR) + Blockscout
func EVMMinimalLocalBS(config *environment.Config) *environment.Environment {
return environment.New(config).
AddChart(blockscout.New(&blockscout.Props{})).
AddHelm(mockservercfg.New(nil)).
AddHelm(mockserver.New(nil)).
AddHelm(ethereum.New(nil)).
AddHelm(plugin.New(0, map[string]interface{}{
"replicas": 5,
}))
}
// EVMMinimalLocal local development Plugin deployment,
// 1 bootstrap + 4 oracles (minimal requirements for OCR)
func EVMMinimalLocal(config *environment.Config) *environment.Environment {
return environment.New(config).
AddHelm(mockservercfg.New(nil)).
AddHelm(mockserver.New(nil)).
AddHelm(ethereum.New(nil)).
AddHelm(plugin.New(0, map[string]interface{}{
"replicas": 5,
}))
}
// EVMReorg deployment for two Ethereum networks re-org test
func EVMReorg(config *environment.Config) *environment.Environment {
var clToml = `[[EVM]]
ChainID = '1337'
FinalityDepth = 200
[[EVM.Nodes]]
Name = 'geth'
WSURL = 'ws://geth-ethereum-geth:8546'
HTTPURL = 'http://geth-ethereum-geth:8544'
[EVM.HeadTracker]
HistoryDepth = 400`
return environment.New(config).
AddHelm(mockservercfg.New(nil)).
AddHelm(mockserver.New(nil)).
AddHelm(reorg.New(&reorg.Props{
NetworkName: "geth",
NetworkType: "geth-reorg",
Values: map[string]interface{}{
"geth": map[string]interface{}{
"genesis": map[string]interface{}{
"networkId": "1337",
},
},
},
})).
AddHelm(reorg.New(&reorg.Props{
NetworkName: "geth-2",
NetworkType: "geth-reorg",
Values: map[string]interface{}{
"geth": map[string]interface{}{
"genesis": map[string]interface{}{
"networkId": "2337",
},
},
},
})).
AddHelm(plugin.New(0, map[string]interface{}{
"replicas": 5,
"toml": clToml,
}))
}
// EVMSoak deployment for a long running soak tests
func EVMSoak(config *environment.Config) *environment.Environment {
return environment.New(config).
AddHelm(mockservercfg.New(nil)).
AddHelm(mockserver.New(nil)).
AddHelm(ethereum.New(ðereum.Props{
Simulated: true,
Values: map[string]interface{}{
"resources": map[string]interface{}{
"requests": map[string]interface{}{
"cpu": "1000m",
"memory": "2048Mi",
},
"limits": map[string]interface{}{
"cpu": "1000m",
"memory": "2048Mi",
},
},
},
})).
AddHelm(plugin.New(0, map[string]interface{}{
"replicas": 5,
"db": map[string]interface{}{
"stateful": true,
"capacity": "1Gi",
"resources": map[string]interface{}{
"requests": map[string]interface{}{
"cpu": "250m",
"memory": "256Mi",
},
"limits": map[string]interface{}{
"cpu": "250m",
"memory": "256Mi",
},
},
},
"plugin": map[string]interface{}{
"resources": map[string]interface{}{
"requests": map[string]interface{}{
"cpu": "1000m",
"memory": "2048Mi",
},
"limits": map[string]interface{}{
"cpu": "1000m",
"memory": "2048Mi",
},
},
},
}))
}