-
Notifications
You must be signed in to change notification settings - Fork 72
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #205 from jhkimqd/jihwan/pool-manager
feat: integrate pool manager into kurtosis-cdk
- Loading branch information
Showing
10 changed files
with
122 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
def create_zkevm_pool_manager_service_config(args, config_artifact): | ||
zkevm_pool_manager_service_name = "zkevm-pool-manager" + args["deployment_suffix"] | ||
zkevm_pool_manager_service_config = ServiceConfig( | ||
image=args["zkevm_pool_manager_image"], | ||
ports={ | ||
"http": PortSpec( | ||
args["zkevm_pool_manager_port"], application_protocol="http" | ||
), | ||
}, | ||
files={ | ||
"/etc/pool-manager": Directory(artifact_names=[config_artifact]), | ||
}, | ||
entrypoint=["/bin/sh", "-c"], | ||
# cmd=["run", "--cfg", "/app/pool-manager-config.toml"], | ||
cmd=[ | ||
"/app/zkevm-pool-manager run --cfg /etc/pool-manager/pool-manager-config.toml", | ||
], | ||
) | ||
return {zkevm_pool_manager_service_name: zkevm_pool_manager_service_config} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
[Log] | ||
Environment = "development" # "production" or "development" | ||
Level = "debug" | ||
Outputs = ["stderr"] | ||
|
||
[Server] | ||
Host = "zkevm-pool-manager{{.deployment_suffix}}" | ||
Port = {{.zkevm_pool_manager_port}} | ||
ReadTimeout = "60s" | ||
WriteTimeout = "60s" | ||
MaxRequestsPerIPAndSecond = 500 | ||
EnableHttpLog = true | ||
BatchRequestsEnabled = false | ||
BatchRequestsLimit = 20 | ||
|
||
[DB] | ||
User = "{{.pool_manager_db.user}}" | ||
Password = "{{.pool_manager_db.password}}" | ||
Name = "{{.pool_manager_db.name}}" | ||
Host = "{{.pool_manager_db.hostname}}" | ||
Port = "{{.pool_manager_db.port}}" | ||
EnableLog = false | ||
MaxConns = 200 | ||
|
||
[Sender] | ||
SequencerURL = "http://cdk-erigon-sequencer{{.deployment_suffix}}:{{.zkevm_rpc_http_port}}" | ||
ResendTxsCheckInterval = "1s" | ||
Workers = 5 | ||
QueueSize = 25 | ||
|
||
[Monitor] | ||
L2NodeURL = "http://cdk-erigon-node{{.deployment_suffix}}:{{.zkevm_rpc_http_port}}" | ||
Workers = 5 | ||
QueueSize = 25 | ||
RetryWaitInterval = "3s" | ||
InitialWaitInterval = "1s" | ||
TxLifeTimeMax = "300s" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
zkevm_pool_manager_package = import_module("./lib/zkevm_pool_manager.star") | ||
databases = import_module("./databases.star") | ||
|
||
|
||
def run_zkevm_pool_manager(plan, args): | ||
db_configs = databases.get_db_configs(args["deployment_suffix"]) | ||
|
||
zkevm_pool_manager_config_artifact = create_zkevm_pool_manager_config_artifact( | ||
plan, args, db_configs | ||
) | ||
zkevm_pool_manager_config = ( | ||
zkevm_pool_manager_package.create_zkevm_pool_manager_service_config( | ||
args, zkevm_pool_manager_config_artifact | ||
) | ||
) | ||
|
||
# Start the pool manager service. | ||
zkevm_pool_manager_services = plan.add_services( | ||
configs=zkevm_pool_manager_config, | ||
description="Starting pool manager infra", | ||
) | ||
|
||
|
||
def create_zkevm_pool_manager_config_artifact(plan, args, db_configs): | ||
zkevm_pool_manager_config_template = read_file( | ||
src="./templates/pool-manager/pool-manager-config.toml" | ||
) | ||
return plan.render_templates( | ||
name="pool-manager-config-artifact", | ||
config={ | ||
"pool-manager-config.toml": struct( | ||
template=zkevm_pool_manager_config_template, | ||
data=args | ||
| { | ||
"deployment_suffix": args["deployment_suffix"], | ||
"zkevm_pool_manager_port": args["zkevm_pool_manager_port"], | ||
# ports | ||
"zkevm_rpc_http_port": args["zkevm_rpc_http_port"], | ||
} | ||
| db_configs, | ||
) | ||
}, | ||
) |