Skip to content

Commit

Permalink
Merge branch 'main' into jesteban/bump_aggsender
Browse files Browse the repository at this point in the history
  • Loading branch information
praetoriansentry authored Nov 14, 2024
2 parents 954061c + a01f8b9 commit feaeb97
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 18 deletions.
38 changes: 23 additions & 15 deletions input_parser.star
Original file line number Diff line number Diff line change
Expand Up @@ -265,6 +265,10 @@ DEFAULT_ARGS = (
# Suffix appended to service names.
# Note: It should be a string.
"deployment_suffix": "-001",
# Verbosity of the `kurtosis run` output.
# Valid values are "error", "warn", "info", "debug", and "trace".
# By default, the verbosity is set to "info". It won't log the value of the args.
"verbosity": "info",
# The global log level that all components of the stack should log at.
# Valid values are "error", "warn", "info", "debug", and "trace".
"global_log_level": "info",
Expand Down Expand Up @@ -312,8 +316,11 @@ def parse_args(plan, args):
args = DEFAULT_ARGS | args.get("args", {})

# Validation step.
verbosity = args.get("verbosity", "")
validate_log_level("verbosity", verbosity)

global_log_level = args.get("global_log_level", "")
validate_global_log_level(global_log_level)
validate_log_level("global log level", global_log_level)

# Determine fork id from the zkevm contracts image tag.
zkevm_contracts_image = args.get("zkevm_contracts_image", "")
Expand Down Expand Up @@ -363,22 +370,23 @@ def parse_args(plan, args):
return (sorted_deployment_stages, sorted_args)


def validate_global_log_level(global_log_level):
if global_log_level not in (
constants.GLOBAL_LOG_LEVEL.error,
constants.GLOBAL_LOG_LEVEL.warn,
constants.GLOBAL_LOG_LEVEL.info,
constants.GLOBAL_LOG_LEVEL.debug,
constants.GLOBAL_LOG_LEVEL.trace,
def validate_log_level(name, log_level):
if log_level not in (
constants.LOG_LEVEL.error,
constants.LOG_LEVEL.warn,
constants.LOG_LEVEL.info,
constants.LOG_LEVEL.debug,
constants.LOG_LEVEL.trace,
):
fail(
"Unsupported global log level: '{}', please use '{}', '{}', '{}', '{}' or '{}'".format(
global_log_level,
constants.GLOBAL_LOG_LEVEL.error,
constants.GLOBAL_LOG_LEVEL.warn,
constants.GLOBAL_LOG_LEVEL.info,
constants.GLOBAL_LOG_LEVEL.debug,
constants.GLOBAL_LOG_LEVEL.trace,
"Unsupported {}: '{}', please use '{}', '{}', '{}', '{}' or '{}'".format(
name,
log_level,
constants.LOG_LEVEL.error,
constants.LOG_LEVEL.warn,
constants.LOG_LEVEL.info,
constants.LOG_LEVEL.debug,
constants.LOG_LEVEL.trace,
)
)

Expand Down
6 changes: 4 additions & 2 deletions main.star
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,9 @@ def run(plan, args={}):
# Parse args.
(deployment_stages, args) = input_parser.parse_args(plan, args)
plan.print("Deploying the following components: " + str(deployment_stages))
plan.print("Deploying CDK stack with the following configuration: " + str(args))
verbosity = args.get("verbosity", "")
if verbosity == constants.LOG_LEVEL.debug or verbosity == constants.LOG_LEVEL.trace:
plan.print("Deploying CDK stack with the following configuration: " + str(args))

# Deploy a local L1.
if deployment_stages.get("deploy_l1", False):
Expand Down Expand Up @@ -67,7 +69,7 @@ def run(plan, args={}):
# Get the genesis file.
genesis_artifact = ""
if deployment_stages.get("deploy_cdk_central_environment", False):
plan.print("Getting genesis file...")
plan.print("Getting genesis file")
genesis_artifact = plan.store_service_files(
name="genesis",
service_name="contracts" + args["deployment_suffix"],
Expand Down
2 changes: 1 addition & 1 deletion src/package_io/constants.star
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
GLOBAL_LOG_LEVEL = struct(
LOG_LEVEL = struct(
error="error",
warn="warn",
info="info",
Expand Down

0 comments on commit feaeb97

Please sign in to comment.