From 174e3f2a59af4b2c67b31c6740c089b0831ba218 Mon Sep 17 00:00:00 2001 From: alon-dotan-starkware Date: Wed, 4 Dec 2024 10:49:44 +0200 Subject: [PATCH] chore(deployment): support unified deployment config (#2378) --- deployments/sequencer/app/service.py | 149 +++++++++--------- deployments/sequencer/config/sequencer.py | 14 +- deployments/sequencer/main.py | 16 +- .../ConfigMap.sequencer-node-config.k8s.yaml | 2 +- ...loyment.sequencer-node-deployment.k8s.yaml | 7 +- deployments/sequencer/services/helpers.py | 3 - deployments/sequencer/services/objects.py | 11 +- deployments/sequencer/services/topology.py | 2 +- .../sequencer/services/topology_helpers.py | 29 ++-- 9 files changed, 126 insertions(+), 107 deletions(-) diff --git a/deployments/sequencer/app/service.py b/deployments/sequencer/app/service.py index f436fabcbf..5cd5c95fa1 100644 --- a/deployments/sequencer/app/service.py +++ b/deployments/sequencer/app/service.py @@ -11,13 +11,19 @@ class ServiceApp(Construct): def __init__( - self, scope: Construct, id: str, *, namespace: str, topology: topology.ServiceTopology + self, + scope: Construct, + id: str, + *, + namespace: str, + topology: topology.ServiceTopology, ): super().__init__(scope, id) self.namespace = namespace self.label = {"app": Names.to_label_value(self, include_hash=False)} self.topology = topology + self.node_config = topology.config.get_config() self.set_k8s_namespace() @@ -44,7 +50,7 @@ def set_k8s_configmap(self): self, "configmap", metadata=k8s.ObjectMeta(name=f"{self.node.id}-config"), - data=dict(config=json.dumps(self.topology.config.get())), + data=dict(config=json.dumps(self.topology.config.get_config())), ) def set_k8s_service(self): @@ -65,7 +71,14 @@ def set_k8s_service(self): ), ) + def _get_container_ports(self): + ports = [] + for c in ["http_server_config.port", "monitoring_endpoint_config.port"]: + ports.append(self.node_config[c].get("value")) + return ports + def set_k8s_deployment(self): + node_http_port = self.node_config["http_server_config.port"].get("value") return k8s.KubeDeployment( self, "deployment", @@ -83,60 +96,50 @@ def set_k8s_deployment(self): # command=["sleep", "infinity"], args=container.args, ports=[ - k8s.ContainerPort(container_port=port.container_port) - for port in container.ports + k8s.ContainerPort( + container_port=port, + ) + for port in self._get_container_ports() ], - startup_probe=k8s.Probe( - http_get=k8s.HttpGetAction( - path=container.startup_probe.path, - port=k8s.IntOrString.from_string( - container.startup_probe.port - ) - if isinstance(container.startup_probe.port, str) - else k8s.IntOrString.from_number( - container.startup_probe.port + startup_probe=( + k8s.Probe( + http_get=k8s.HttpGetAction( + path=container.startup_probe.path, + port=k8s.IntOrString.from_number(node_http_port), ), - ), - period_seconds=container.startup_probe.period_seconds, - failure_threshold=container.startup_probe.failure_threshold, - timeout_seconds=container.startup_probe.timeout_seconds, - ) - if container.startup_probe is not None - else None, - readiness_probe=k8s.Probe( - http_get=k8s.HttpGetAction( - path=container.readiness_probe.path, - port=k8s.IntOrString.from_string( - container.readiness_probe.port - ) - if isinstance(container.readiness_probe.port, str) - else k8s.IntOrString.from_number( - container.readiness_probe.port + period_seconds=container.startup_probe.period_seconds, + failure_threshold=container.startup_probe.failure_threshold, + timeout_seconds=container.startup_probe.timeout_seconds, + ) + if container.startup_probe is not None + else None + ), + readiness_probe=( + k8s.Probe( + http_get=k8s.HttpGetAction( + path=container.readiness_probe.path, + port=k8s.IntOrString.from_number(node_http_port), ), - ), - period_seconds=container.readiness_probe.period_seconds, - failure_threshold=container.readiness_probe.failure_threshold, - timeout_seconds=container.readiness_probe.timeout_seconds, - ) - if container.readiness_probe is not None - else None, - liveness_probe=k8s.Probe( - http_get=k8s.HttpGetAction( - path=container.liveness_probe.path, - port=k8s.IntOrString.from_string( - container.liveness_probe.port - ) - if isinstance(container.liveness_probe.port, str) - else k8s.IntOrString.from_number( - container.liveness_probe.port + period_seconds=container.readiness_probe.period_seconds, + failure_threshold=container.readiness_probe.failure_threshold, + timeout_seconds=container.readiness_probe.timeout_seconds, + ) + if container.readiness_probe is not None + else None + ), + liveness_probe=( + k8s.Probe( + http_get=k8s.HttpGetAction( + path=container.liveness_probe.path, + port=k8s.IntOrString.from_number(node_http_port), ), - ), - period_seconds=container.liveness_probe.period_seconds, - failure_threshold=container.liveness_probe.failure_threshold, - timeout_seconds=container.liveness_probe.timeout_seconds, - ) - if container.liveness_probe is not None - else None, + period_seconds=container.liveness_probe.period_seconds, + failure_threshold=container.liveness_probe.failure_threshold, + timeout_seconds=container.liveness_probe.timeout_seconds, + ) + if container.liveness_probe is not None + else None + ), volume_mounts=[ k8s.VolumeMount( name=mount.name, @@ -151,28 +154,32 @@ def set_k8s_deployment(self): volumes=list( chain( ( - k8s.Volume( - name=f"{self.node.id}-{volume.name}", - config_map=k8s.ConfigMapVolumeSource( - name=f"{self.node.id}-{volume.name}" - ), + ( + k8s.Volume( + name=f"{self.node.id}-{volume.name}", + config_map=k8s.ConfigMapVolumeSource( + name=f"{self.node.id}-{volume.name}" + ), + ) + for volume in self.topology.deployment.configmap_volumes ) - for volume in self.topology.deployment.configmap_volumes - ) - if self.topology.deployment.configmap_volumes is not None - else None, + if self.topology.deployment.configmap_volumes is not None + else None + ), ( - k8s.Volume( - name=f"{self.node.id}-{volume.name}", - persistent_volume_claim=k8s.PersistentVolumeClaimVolumeSource( - claim_name=f"{self.node.id}-{volume.name}", - read_only=volume.read_only, - ), + ( + k8s.Volume( + name=f"{self.node.id}-{volume.name}", + persistent_volume_claim=k8s.PersistentVolumeClaimVolumeSource( + claim_name=f"{self.node.id}-{volume.name}", + read_only=volume.read_only, + ), + ) + for volume in self.topology.deployment.pvc_volumes ) - for volume in self.topology.deployment.pvc_volumes - ) - if self.topology.deployment is not None - else None, + if self.topology.deployment is not None + else None + ), ) ), ), diff --git a/deployments/sequencer/config/sequencer.py b/deployments/sequencer/config/sequencer.py index 57ad681587..2afb9286a1 100644 --- a/deployments/sequencer/config/sequencer.py +++ b/deployments/sequencer/config/sequencer.py @@ -12,12 +12,16 @@ class SequencerDevConfig(Config): def __init__(self, mount_path: str, config_file_path: str = ""): super().__init__( - schema=json.loads(open(os.path.join(CONFIG_DIR, "default_config.json"), "r").read()), - config=json.loads(open(os.path.join(CONFIG_DIR, "presets", "config.json"), "r").read()) - if not config_file_path - else json.loads(open(os.path.abspath(config_file_path)).read()), + global_config=json.loads( + open(os.path.join(CONFIG_DIR, "default_config.json"), "r").read() + ), + config=( + json.loads(open(os.path.join(CONFIG_DIR, "presets", "config.json"), "r").read()) + if not config_file_path + else json.loads(open(os.path.abspath(config_file_path)).read()) + ), mount_path=mount_path, ) def validate(self): - jsonschema.validate(self.config, schema=self.schema) + jsonschema.validate(self.config, schema=self.global_config) diff --git a/deployments/sequencer/main.py b/deployments/sequencer/main.py index fdcd20cf88..932a6bbd36 100644 --- a/deployments/sequencer/main.py +++ b/deployments/sequencer/main.py @@ -8,6 +8,7 @@ from config.sequencer import Config from app.service import ServiceApp +from services.topology_helpers import get_dev_config from services import topology, helpers @@ -31,15 +32,20 @@ def __init__( def main(): - if helpers.args.env == "dev": - system_preset = topology.SequencerDev() - elif helpers.args.env == "prod": - system_preset = topology.SequencerProd() + args = helpers.argument_parser() + if args.env == "dev": + system_preset = topology.SequencerDev(config=get_dev_config(args.config_file)) + elif args.env == "prod": + raise NotImplementedError("Production environment not supported.") + # system_preset = topology.SequencerProd() app = App(yaml_output_type=YamlOutputType.FOLDER_PER_CHART_FILE_PER_RESOURCE) SequencerNode( - scope=app, name="sequencer-node", namespace=helpers.args.namespace, topology=system_preset + scope=app, + name="sequencer-node", + namespace=args.namespace, + topology=system_preset, ) app.synth() diff --git a/deployments/sequencer/references/sequencer-node/ConfigMap.sequencer-node-config.k8s.yaml b/deployments/sequencer/references/sequencer-node/ConfigMap.sequencer-node-config.k8s.yaml index d2defb92b3..b8b242e7bd 100644 --- a/deployments/sequencer/references/sequencer-node/ConfigMap.sequencer-node-config.k8s.yaml +++ b/deployments/sequencer/references/sequencer-node/ConfigMap.sequencer-node-config.k8s.yaml @@ -4,4 +4,4 @@ metadata: name: sequencer-node-config namespace: test data: - config: '{"chain_id": "0x5", "eth_fee_token_address": "0x6", "strk_fee_token_address": "0x7", "components.batcher.execution_mode": "Disabled", "components.batcher.local_server_config.#is_none": true, "components.consensus_manager.execution_mode": "Disabled", "components.gateway.execution_mode": "Disabled", "components.http_server.execution_mode": "Disabled", "components.mempool.execution_mode": "Disabled", "components.mempool_p2p.execution_mode": "Disabled", "components.consensus_manager.local_server_config.#is_none": true, "components.gateway.local_server_config.#is_none": true, "components.http_server.local_server_config.#is_none": true, "components.mempool.local_server_config.#is_none": true, "components.mempool_p2p.local_server_config.#is_none": true, "components.http_server.remote_server_config.#is_none": true, "batcher_config.storage.db_config.enforce_file_exists": false, "batcher_config.storage.db_config.path_prefix": "/data"}' + config: "{\"batcher_config.block_builder_config.bouncer_config.block_max_capacity.builtin_count.add_mod\": {\"description\": \"Max number of add mod builtin usage in a block.\", \"privacy\": \"Public\", \"value\": 156250}, \"batcher_config.block_builder_config.bouncer_config.block_max_capacity.builtin_count.bitwise\": {\"description\": \"Max number of bitwise builtin usage in a block.\", \"privacy\": \"Public\", \"value\": 39062}, \"batcher_config.block_builder_config.bouncer_config.block_max_capacity.builtin_count.ec_op\": {\"description\": \"Max number of EC operation builtin usage in a block.\", \"privacy\": \"Public\", \"value\": 2441}, \"batcher_config.block_builder_config.bouncer_config.block_max_capacity.builtin_count.ecdsa\": {\"description\": \"Max number of ECDSA builtin usage in a block.\", \"privacy\": \"Public\", \"value\": 1220}, \"batcher_config.block_builder_config.bouncer_config.block_max_capacity.builtin_count.keccak\": {\"description\": \"Max number of keccak builtin usage in a block.\", \"privacy\": \"Public\", \"value\": 1220}, \"batcher_config.block_builder_config.bouncer_config.block_max_capacity.builtin_count.mul_mod\": {\"description\": \"Max number of mul mod builtin usage in a block.\", \"privacy\": \"Public\", \"value\": 156250}, \"batcher_config.block_builder_config.bouncer_config.block_max_capacity.builtin_count.pedersen\": {\"description\": \"Max number of pedersen builtin usage in a block.\", \"privacy\": \"Public\", \"value\": 78125}, \"batcher_config.block_builder_config.bouncer_config.block_max_capacity.builtin_count.poseidon\": {\"description\": \"Max number of poseidon builtin usage in a block.\", \"privacy\": \"Public\", \"value\": 78125}, \"batcher_config.block_builder_config.bouncer_config.block_max_capacity.builtin_count.range_check\": {\"description\": \"Max number of range check builtin usage in a block.\", \"privacy\": \"Public\", \"value\": 156250}, \"batcher_config.block_builder_config.bouncer_config.block_max_capacity.builtin_count.range_check96\": {\"description\": \"Max number of range check 96 builtin usage in a block.\", \"privacy\": \"Public\", \"value\": 156250}, \"batcher_config.block_builder_config.bouncer_config.block_max_capacity.gas\": {\"description\": \"An upper bound on the total gas used in a block.\", \"privacy\": \"Public\", \"value\": 2500000}, \"batcher_config.block_builder_config.bouncer_config.block_max_capacity.message_segment_length\": {\"description\": \"An upper bound on the message segment length in a block.\", \"privacy\": \"Public\", \"value\": 3700}, \"batcher_config.block_builder_config.bouncer_config.block_max_capacity.n_events\": {\"description\": \"An upper bound on the total number of events generated in a block.\", \"privacy\": \"Public\", \"value\": 5000}, \"batcher_config.block_builder_config.bouncer_config.block_max_capacity.n_steps\": {\"description\": \"An upper bound on the total number of steps in a block.\", \"privacy\": \"Public\", \"value\": 2500000}, \"batcher_config.block_builder_config.bouncer_config.block_max_capacity.state_diff_size\": {\"description\": \"An upper bound on the total state diff size in a block.\", \"privacy\": \"Public\", \"value\": 4000}, \"batcher_config.block_builder_config.chain_info.chain_id\": {\"description\": \"The chain ID of the StarkNet chain.\", \"pointer_target\": \"chain_id\", \"privacy\": \"Public\"}, \"batcher_config.block_builder_config.chain_info.fee_token_addresses.eth_fee_token_address\": {\"description\": \"Address of the ETH fee token.\", \"pointer_target\": \"eth_fee_token_address\", \"privacy\": \"Public\"}, \"batcher_config.block_builder_config.chain_info.fee_token_addresses.strk_fee_token_address\": {\"description\": \"Address of the STRK fee token.\", \"pointer_target\": \"strk_fee_token_address\", \"privacy\": \"Public\"}, \"batcher_config.block_builder_config.execute_config.concurrency_config.chunk_size\": {\"description\": \"The size of the transaction chunk executed in parallel.\", \"privacy\": \"Public\", \"value\": 0}, \"batcher_config.block_builder_config.execute_config.concurrency_config.enabled\": {\"description\": \"Enables concurrency of transaction execution.\", \"privacy\": \"Public\", \"value\": false}, \"batcher_config.block_builder_config.execute_config.concurrency_config.n_workers\": {\"description\": \"Number of parallel transaction execution workers.\", \"privacy\": \"Public\", \"value\": 0}, \"batcher_config.block_builder_config.sequencer_address\": {\"description\": \"The address of the sequencer.\", \"pointer_target\": \"sequencer_address\", \"privacy\": \"Public\"}, \"batcher_config.block_builder_config.tx_chunk_size\": {\"description\": \"The size of the transaction chunk.\", \"privacy\": \"Public\", \"value\": 100}, \"batcher_config.block_builder_config.use_kzg_da\": {\"description\": \"Indicates whether the kzg mechanism is used for data availability.\", \"privacy\": \"Public\", \"value\": true}, \"batcher_config.block_builder_config.versioned_constants_overrides.invoke_tx_max_n_steps\": {\"description\": \"Maximum number of steps the invoke function is allowed to run.\", \"pointer_target\": \"versioned_constants_overrides.invoke_tx_max_n_steps\", \"privacy\": \"Public\"}, \"batcher_config.block_builder_config.versioned_constants_overrides.max_recursion_depth\": {\"description\": \"Maximum recursion depth for nested calls during blockifier validation.\", \"pointer_target\": \"versioned_constants_overrides.max_recursion_depth\", \"privacy\": \"Public\"}, \"batcher_config.block_builder_config.versioned_constants_overrides.validate_max_n_steps\": {\"description\": \"Maximum number of steps the validation function is allowed to run.\", \"pointer_target\": \"versioned_constants_overrides.validate_max_n_steps\", \"privacy\": \"Public\"}, \"batcher_config.global_contract_cache_size\": {\"description\": \"Cache size for the global_class_hash_to_class. Initialized with this size on creation.\", \"privacy\": \"Public\", \"value\": 400}, \"batcher_config.input_stream_content_buffer_size\": {\"description\": \"Sets the buffer size for the input transaction channel. Adding more transactions beyond this limit will block until space is available.\", \"privacy\": \"Public\", \"value\": 400}, \"batcher_config.max_l1_handler_txs_per_block_proposal\": {\"description\": \"The maximum number of L1 handler transactions to include in a block proposal.\", \"privacy\": \"Public\", \"value\": 3}, \"batcher_config.outstream_content_buffer_size\": {\"description\": \"The maximum number of items to include in a single get_proposal_content response.\", \"privacy\": \"Public\", \"value\": 100}, \"batcher_config.storage.db_config.chain_id\": {\"description\": \"The chain to follow. For more details see https://docs.starknet.io/documentation/architecture_and_concepts/Blocks/transactions/#chain-id.\", \"pointer_target\": \"chain_id\", \"privacy\": \"Public\"}, \"batcher_config.storage.db_config.enforce_file_exists\": false, \"batcher_config.storage.db_config.growth_step\": {\"description\": \"The growth step in bytes, must be greater than zero to allow the database to grow.\", \"privacy\": \"Public\", \"value\": 4294967296}, \"batcher_config.storage.db_config.max_size\": {\"description\": \"The maximum size of the node's storage in bytes.\", \"privacy\": \"Public\", \"value\": 1099511627776}, \"batcher_config.storage.db_config.min_size\": {\"description\": \"The minimum size of the node's storage in bytes.\", \"privacy\": \"Public\", \"value\": 1048576}, \"batcher_config.storage.db_config.path_prefix\": \"/data\", \"batcher_config.storage.mmap_file_config.growth_step\": {\"description\": \"The growth step in bytes, must be greater than max_object_size.\", \"privacy\": \"Public\", \"value\": 1073741824}, \"batcher_config.storage.mmap_file_config.max_object_size\": {\"description\": \"The maximum size of a single object in the file in bytes\", \"privacy\": \"Public\", \"value\": 268435456}, \"batcher_config.storage.mmap_file_config.max_size\": {\"description\": \"The maximum size of a memory mapped file in bytes. Must be greater than growth_step.\", \"privacy\": \"Public\", \"value\": 1099511627776}, \"batcher_config.storage.scope\": {\"description\": \"The categories of data saved in storage.\", \"privacy\": \"Public\", \"value\": \"StateOnly\"}, \"chain_id\": \"0x5\", \"compiler_config.max_bytecode_size\": {\"description\": \"Limitation of contract bytecode size.\", \"privacy\": \"Public\", \"value\": 81920}, \"components.batcher.execution_mode\": \"Disabled\", \"components.batcher.local_server_config.#is_none\": true, \"components.batcher.local_server_config.channel_buffer_size\": {\"description\": \"The communication channel buffer size.\", \"privacy\": \"Public\", \"value\": 32}, \"components.batcher.remote_client_config.#is_none\": {\"description\": \"Flag for an optional field.\", \"privacy\": \"TemporaryValue\", \"value\": true}, \"components.batcher.remote_client_config.idle_connections\": {\"description\": \"The maximum number of idle connections to keep alive.\", \"privacy\": \"Public\", \"value\": 18446744073709551615}, \"components.batcher.remote_client_config.idle_timeout\": {\"description\": \"The duration in seconds to keep an idle connection open before closing.\", \"privacy\": \"Public\", \"value\": 90}, \"components.batcher.remote_client_config.retries\": {\"description\": \"The max number of retries for sending a message.\", \"privacy\": \"Public\", \"value\": 3}, \"components.batcher.remote_client_config.socket\": {\"description\": \"The remote component server socket.\", \"privacy\": \"Public\", \"value\": \"0.0.0.0:8080\"}, \"components.batcher.remote_server_config.#is_none\": {\"description\": \"Flag for an optional field.\", \"privacy\": \"TemporaryValue\", \"value\": true}, \"components.batcher.remote_server_config.socket\": {\"description\": \"The remote component server socket.\", \"privacy\": \"Public\", \"value\": \"0.0.0.0:8080\"}, \"components.consensus_manager.execution_mode\": \"Disabled\", \"components.consensus_manager.local_server_config.#is_none\": true, \"components.consensus_manager.local_server_config.channel_buffer_size\": {\"description\": \"The communication channel buffer size.\", \"privacy\": \"Public\", \"value\": 32}, \"components.consensus_manager.remote_client_config.#is_none\": {\"description\": \"Flag for an optional field.\", \"privacy\": \"TemporaryValue\", \"value\": true}, \"components.consensus_manager.remote_client_config.idle_connections\": {\"description\": \"The maximum number of idle connections to keep alive.\", \"privacy\": \"Public\", \"value\": 18446744073709551615}, \"components.consensus_manager.remote_client_config.idle_timeout\": {\"description\": \"The duration in seconds to keep an idle connection open before closing.\", \"privacy\": \"Public\", \"value\": 90}, \"components.consensus_manager.remote_client_config.retries\": {\"description\": \"The max number of retries for sending a message.\", \"privacy\": \"Public\", \"value\": 3}, \"components.consensus_manager.remote_client_config.socket\": {\"description\": \"The remote component server socket.\", \"privacy\": \"Public\", \"value\": \"0.0.0.0:8080\"}, \"components.consensus_manager.remote_server_config.#is_none\": {\"description\": \"Flag for an optional field.\", \"privacy\": \"TemporaryValue\", \"value\": true}, \"components.consensus_manager.remote_server_config.socket\": {\"description\": \"The remote component server socket.\", \"privacy\": \"Public\", \"value\": \"0.0.0.0:8080\"}, \"components.gateway.execution_mode\": \"Disabled\", \"components.gateway.local_server_config.#is_none\": true, \"components.gateway.local_server_config.channel_buffer_size\": {\"description\": \"The communication channel buffer size.\", \"privacy\": \"Public\", \"value\": 32}, \"components.gateway.remote_client_config.#is_none\": {\"description\": \"Flag for an optional field.\", \"privacy\": \"TemporaryValue\", \"value\": true}, \"components.gateway.remote_client_config.idle_connections\": {\"description\": \"The maximum number of idle connections to keep alive.\", \"privacy\": \"Public\", \"value\": 18446744073709551615}, \"components.gateway.remote_client_config.idle_timeout\": {\"description\": \"The duration in seconds to keep an idle connection open before closing.\", \"privacy\": \"Public\", \"value\": 90}, \"components.gateway.remote_client_config.retries\": {\"description\": \"The max number of retries for sending a message.\", \"privacy\": \"Public\", \"value\": 3}, \"components.gateway.remote_client_config.socket\": {\"description\": \"The remote component server socket.\", \"privacy\": \"Public\", \"value\": \"0.0.0.0:8080\"}, \"components.gateway.remote_server_config.#is_none\": {\"description\": \"Flag for an optional field.\", \"privacy\": \"TemporaryValue\", \"value\": true}, \"components.gateway.remote_server_config.socket\": {\"description\": \"The remote component server socket.\", \"privacy\": \"Public\", \"value\": \"0.0.0.0:8080\"}, \"components.http_server.execution_mode\": \"Disabled\", \"components.http_server.local_server_config.#is_none\": true, \"components.http_server.local_server_config.channel_buffer_size\": {\"description\": \"The communication channel buffer size.\", \"privacy\": \"Public\", \"value\": 32}, \"components.http_server.remote_client_config.#is_none\": {\"description\": \"Flag for an optional field.\", \"privacy\": \"TemporaryValue\", \"value\": true}, \"components.http_server.remote_client_config.idle_connections\": {\"description\": \"The maximum number of idle connections to keep alive.\", \"privacy\": \"Public\", \"value\": 18446744073709551615}, \"components.http_server.remote_client_config.idle_timeout\": {\"description\": \"The duration in seconds to keep an idle connection open before closing.\", \"privacy\": \"Public\", \"value\": 90}, \"components.http_server.remote_client_config.retries\": {\"description\": \"The max number of retries for sending a message.\", \"privacy\": \"Public\", \"value\": 3}, \"components.http_server.remote_client_config.socket\": {\"description\": \"The remote component server socket.\", \"privacy\": \"Public\", \"value\": \"0.0.0.0:8080\"}, \"components.http_server.remote_server_config.#is_none\": true, \"components.http_server.remote_server_config.socket\": {\"description\": \"The remote component server socket.\", \"privacy\": \"Public\", \"value\": \"0.0.0.0:8080\"}, \"components.mempool.execution_mode\": \"Disabled\", \"components.mempool.local_server_config.#is_none\": true, \"components.mempool.local_server_config.channel_buffer_size\": {\"description\": \"The communication channel buffer size.\", \"privacy\": \"Public\", \"value\": 32}, \"components.mempool.remote_client_config.#is_none\": {\"description\": \"Flag for an optional field.\", \"privacy\": \"TemporaryValue\", \"value\": true}, \"components.mempool.remote_client_config.idle_connections\": {\"description\": \"The maximum number of idle connections to keep alive.\", \"privacy\": \"Public\", \"value\": 18446744073709551615}, \"components.mempool.remote_client_config.idle_timeout\": {\"description\": \"The duration in seconds to keep an idle connection open before closing.\", \"privacy\": \"Public\", \"value\": 90}, \"components.mempool.remote_client_config.retries\": {\"description\": \"The max number of retries for sending a message.\", \"privacy\": \"Public\", \"value\": 3}, \"components.mempool.remote_client_config.socket\": {\"description\": \"The remote component server socket.\", \"privacy\": \"Public\", \"value\": \"0.0.0.0:8080\"}, \"components.mempool.remote_server_config.#is_none\": {\"description\": \"Flag for an optional field.\", \"privacy\": \"TemporaryValue\", \"value\": true}, \"components.mempool.remote_server_config.socket\": {\"description\": \"The remote component server socket.\", \"privacy\": \"Public\", \"value\": \"0.0.0.0:8080\"}, \"components.mempool_p2p.execution_mode\": \"Disabled\", \"components.mempool_p2p.local_server_config.#is_none\": true, \"components.mempool_p2p.local_server_config.channel_buffer_size\": {\"description\": \"The communication channel buffer size.\", \"privacy\": \"Public\", \"value\": 32}, \"components.mempool_p2p.remote_client_config.#is_none\": {\"description\": \"Flag for an optional field.\", \"privacy\": \"TemporaryValue\", \"value\": true}, \"components.mempool_p2p.remote_client_config.idle_connections\": {\"description\": \"The maximum number of idle connections to keep alive.\", \"privacy\": \"Public\", \"value\": 18446744073709551615}, \"components.mempool_p2p.remote_client_config.idle_timeout\": {\"description\": \"The duration in seconds to keep an idle connection open before closing.\", \"privacy\": \"Public\", \"value\": 90}, \"components.mempool_p2p.remote_client_config.retries\": {\"description\": \"The max number of retries for sending a message.\", \"privacy\": \"Public\", \"value\": 3}, \"components.mempool_p2p.remote_client_config.socket\": {\"description\": \"The remote component server socket.\", \"privacy\": \"Public\", \"value\": \"0.0.0.0:8080\"}, \"components.mempool_p2p.remote_server_config.#is_none\": {\"description\": \"Flag for an optional field.\", \"privacy\": \"TemporaryValue\", \"value\": true}, \"components.mempool_p2p.remote_server_config.socket\": {\"description\": \"The remote component server socket.\", \"privacy\": \"Public\", \"value\": \"0.0.0.0:8080\"}, \"components.monitoring_endpoint.execution_mode\": {\"description\": \"The component execution mode.\", \"privacy\": \"Public\", \"value\": \"LocalExecutionWithRemoteEnabled\"}, \"components.monitoring_endpoint.local_server_config.#is_none\": {\"description\": \"Flag for an optional field.\", \"privacy\": \"TemporaryValue\", \"value\": false}, \"components.monitoring_endpoint.local_server_config.channel_buffer_size\": {\"description\": \"The communication channel buffer size.\", \"privacy\": \"Public\", \"value\": 32}, \"components.monitoring_endpoint.remote_client_config.#is_none\": {\"description\": \"Flag for an optional field.\", \"privacy\": \"TemporaryValue\", \"value\": true}, \"components.monitoring_endpoint.remote_client_config.idle_connections\": {\"description\": \"The maximum number of idle connections to keep alive.\", \"privacy\": \"Public\", \"value\": 18446744073709551615}, \"components.monitoring_endpoint.remote_client_config.idle_timeout\": {\"description\": \"The duration in seconds to keep an idle connection open before closing.\", \"privacy\": \"Public\", \"value\": 90}, \"components.monitoring_endpoint.remote_client_config.retries\": {\"description\": \"The max number of retries for sending a message.\", \"privacy\": \"Public\", \"value\": 3}, \"components.monitoring_endpoint.remote_client_config.socket\": {\"description\": \"The remote component server socket.\", \"privacy\": \"Public\", \"value\": \"0.0.0.0:8080\"}, \"components.monitoring_endpoint.remote_server_config.#is_none\": {\"description\": \"Flag for an optional field.\", \"privacy\": \"TemporaryValue\", \"value\": false}, \"components.monitoring_endpoint.remote_server_config.socket\": {\"description\": \"The remote component server socket.\", \"privacy\": \"Public\", \"value\": \"0.0.0.0:8080\"}, \"components.state_sync.execution_mode\": {\"description\": \"The component execution mode.\", \"privacy\": \"Public\", \"value\": \"LocalExecutionWithRemoteDisabled\"}, \"components.state_sync.local_server_config.#is_none\": {\"description\": \"Flag for an optional field.\", \"privacy\": \"TemporaryValue\", \"value\": false}, \"components.state_sync.local_server_config.channel_buffer_size\": {\"description\": \"The communication channel buffer size.\", \"privacy\": \"Public\", \"value\": 32}, \"components.state_sync.remote_client_config.#is_none\": {\"description\": \"Flag for an optional field.\", \"privacy\": \"TemporaryValue\", \"value\": true}, \"components.state_sync.remote_client_config.idle_connections\": {\"description\": \"The maximum number of idle connections to keep alive.\", \"privacy\": \"Public\", \"value\": 18446744073709551615}, \"components.state_sync.remote_client_config.idle_timeout\": {\"description\": \"The duration in seconds to keep an idle connection open before closing.\", \"privacy\": \"Public\", \"value\": 90}, \"components.state_sync.remote_client_config.retries\": {\"description\": \"The max number of retries for sending a message.\", \"privacy\": \"Public\", \"value\": 3}, \"components.state_sync.remote_client_config.socket\": {\"description\": \"The remote component server socket.\", \"privacy\": \"Public\", \"value\": \"0.0.0.0:8080\"}, \"components.state_sync.remote_server_config.#is_none\": {\"description\": \"Flag for an optional field.\", \"privacy\": \"TemporaryValue\", \"value\": true}, \"components.state_sync.remote_server_config.socket\": {\"description\": \"The remote component server socket.\", \"privacy\": \"Public\", \"value\": \"0.0.0.0:8080\"}, \"consensus_manager_config.consensus_config.consensus_delay\": {\"description\": \"Delay (seconds) before starting consensus to give time for network peering.\", \"privacy\": \"Public\", \"value\": 5}, \"consensus_manager_config.consensus_config.network_config.advertised_multiaddr\": {\"description\": \"The external address other peers see this node. If this is set, the node will not try to find out which addresses it has and will write this address as external instead\", \"privacy\": \"Public\", \"value\": \"\"}, \"consensus_manager_config.consensus_config.network_config.advertised_multiaddr.#is_none\": {\"description\": \"Flag for an optional field.\", \"privacy\": \"TemporaryValue\", \"value\": true}, \"consensus_manager_config.consensus_config.network_config.bootstrap_peer_multiaddr\": {\"description\": \"The multiaddress of the peer node. It should include the peer's id. For more info: https://docs.libp2p.io/concepts/fundamentals/peers/\", \"privacy\": \"Public\", \"value\": \"\"}, \"consensus_manager_config.consensus_config.network_config.bootstrap_peer_multiaddr.#is_none\": {\"description\": \"Flag for an optional field.\", \"privacy\": \"TemporaryValue\", \"value\": true}, \"consensus_manager_config.consensus_config.network_config.chain_id\": {\"description\": \"The chain to follow. For more details see https://docs.starknet.io/documentation/architecture_and_concepts/Blocks/transactions/#chain-id.\", \"pointer_target\": \"chain_id\", \"privacy\": \"Public\"}, \"consensus_manager_config.consensus_config.network_config.discovery_config.bootstrap_dial_retry_config.base_delay_millis\": {\"description\": \"The base delay in milliseconds for the exponential backoff strategy.\", \"privacy\": \"Public\", \"value\": 2}, \"consensus_manager_config.consensus_config.network_config.discovery_config.bootstrap_dial_retry_config.factor\": {\"description\": \"The factor for the exponential backoff strategy.\", \"privacy\": \"Public\", \"value\": 5}, \"consensus_manager_config.consensus_config.network_config.discovery_config.bootstrap_dial_retry_config.max_delay_seconds\": {\"description\": \"The maximum delay in seconds for the exponential backoff strategy.\", \"privacy\": \"Public\", \"value\": 5}, \"consensus_manager_config.consensus_config.network_config.discovery_config.heartbeat_interval\": {\"description\": \"The interval between each discovery (Kademlia) query in milliseconds.\", \"privacy\": \"Public\", \"value\": 100}, \"consensus_manager_config.consensus_config.network_config.idle_connection_timeout\": {\"description\": \"Amount of time in seconds that a connection with no active sessions will stay alive.\", \"privacy\": \"Public\", \"value\": 120}, \"consensus_manager_config.consensus_config.network_config.peer_manager_config.malicious_timeout_seconds\": {\"description\": \"The duration in seconds a peer is blacklisted after being marked as malicious.\", \"privacy\": \"Public\", \"value\": 31536000}, \"consensus_manager_config.consensus_config.network_config.peer_manager_config.unstable_timeout_millis\": {\"description\": \"The duration in milliseconds a peer blacklisted after being reported as unstable.\", \"privacy\": \"Public\", \"value\": 1000}, \"consensus_manager_config.consensus_config.network_config.quic_port\": {\"description\": \"The port that the node listens on for incoming quic connections.\", \"privacy\": \"Public\", \"value\": 10101}, \"consensus_manager_config.consensus_config.network_config.secret_key\": {\"description\": \"The secret key used for building the peer id. If it's an empty string a random one will be used.\", \"privacy\": \"Private\", \"value\": \"\"}, \"consensus_manager_config.consensus_config.network_config.session_timeout\": {\"description\": \"Maximal time in seconds that each session can take before failing on timeout.\", \"privacy\": \"Public\", \"value\": 120}, \"consensus_manager_config.consensus_config.network_config.tcp_port\": {\"description\": \"The port that the node listens on for incoming tcp connections.\", \"privacy\": \"Public\", \"value\": 10100}, \"consensus_manager_config.consensus_config.network_topic\": {\"description\": \"The network topic of the consensus.\", \"privacy\": \"Public\", \"value\": \"consensus\"}, \"consensus_manager_config.consensus_config.num_validators\": {\"description\": \"The number of validators in the consensus.\", \"privacy\": \"Public\", \"value\": 1}, \"consensus_manager_config.consensus_config.start_height\": {\"description\": \"The height to start the consensus from.\", \"privacy\": \"Public\", \"value\": 0}, \"consensus_manager_config.consensus_config.timeouts.precommit_timeout\": {\"description\": \"The timeout (seconds) for a precommit.\", \"privacy\": \"Public\", \"value\": 1.0}, \"consensus_manager_config.consensus_config.timeouts.prevote_timeout\": {\"description\": \"The timeout (seconds) for a prevote.\", \"privacy\": \"Public\", \"value\": 1.0}, \"consensus_manager_config.consensus_config.timeouts.proposal_timeout\": {\"description\": \"The timeout (seconds) for a proposal.\", \"privacy\": \"Public\", \"value\": 3.0}, \"consensus_manager_config.consensus_config.validator_id\": {\"description\": \"The validator id of the node.\", \"privacy\": \"Public\", \"value\": \"0x0\"}, \"eth_fee_token_address\": \"0x6\", \"gateway_config.chain_info.chain_id\": {\"description\": \"The chain ID of the StarkNet chain.\", \"pointer_target\": \"chain_id\", \"privacy\": \"Public\"}, \"gateway_config.chain_info.fee_token_addresses.eth_fee_token_address\": {\"description\": \"Address of the ETH fee token.\", \"pointer_target\": \"eth_fee_token_address\", \"privacy\": \"Public\"}, \"gateway_config.chain_info.fee_token_addresses.strk_fee_token_address\": {\"description\": \"Address of the STRK fee token.\", \"pointer_target\": \"strk_fee_token_address\", \"privacy\": \"Public\"}, \"gateway_config.stateful_tx_validator_config.max_nonce_for_validation_skip\": {\"description\": \"Maximum nonce for which the validation is skipped.\", \"privacy\": \"Public\", \"value\": \"0x1\"}, \"gateway_config.stateful_tx_validator_config.versioned_constants_overrides.invoke_tx_max_n_steps\": {\"description\": \"Maximum number of steps the invoke function is allowed to run.\", \"pointer_target\": \"versioned_constants_overrides.invoke_tx_max_n_steps\", \"privacy\": \"Public\"}, \"gateway_config.stateful_tx_validator_config.versioned_constants_overrides.max_recursion_depth\": {\"description\": \"Maximum recursion depth for nested calls during blockifier validation.\", \"pointer_target\": \"versioned_constants_overrides.max_recursion_depth\", \"privacy\": \"Public\"}, \"gateway_config.stateful_tx_validator_config.versioned_constants_overrides.validate_max_n_steps\": {\"description\": \"Maximum number of steps the validation function is allowed to run.\", \"pointer_target\": \"versioned_constants_overrides.validate_max_n_steps\", \"privacy\": \"Public\"}, \"gateway_config.stateless_tx_validator_config.max_calldata_length\": {\"description\": \"Limitation of calldata length.\", \"privacy\": \"Public\", \"value\": 4000}, \"gateway_config.stateless_tx_validator_config.max_contract_class_object_size\": {\"description\": \"Limitation of contract class object size.\", \"privacy\": \"Public\", \"value\": 4089446}, \"gateway_config.stateless_tx_validator_config.max_sierra_version.major\": {\"description\": \"The major version of the configuration.\", \"privacy\": \"Public\", \"value\": 1}, \"gateway_config.stateless_tx_validator_config.max_sierra_version.minor\": {\"description\": \"The minor version of the configuration.\", \"privacy\": \"Public\", \"value\": 5}, \"gateway_config.stateless_tx_validator_config.max_sierra_version.patch\": {\"description\": \"The patch version of the configuration.\", \"privacy\": \"Public\", \"value\": 18446744073709551615}, \"gateway_config.stateless_tx_validator_config.max_signature_length\": {\"description\": \"Limitation of signature length.\", \"privacy\": \"Public\", \"value\": 4000}, \"gateway_config.stateless_tx_validator_config.min_sierra_version.major\": {\"description\": \"The major version of the configuration.\", \"privacy\": \"Public\", \"value\": 1}, \"gateway_config.stateless_tx_validator_config.min_sierra_version.minor\": {\"description\": \"The minor version of the configuration.\", \"privacy\": \"Public\", \"value\": 1}, \"gateway_config.stateless_tx_validator_config.min_sierra_version.patch\": {\"description\": \"The patch version of the configuration.\", \"privacy\": \"Public\", \"value\": 0}, \"gateway_config.stateless_tx_validator_config.validate_non_zero_l1_data_gas_fee\": {\"description\": \"If true, validates that a transaction has non-zero L1 Data (Blob) resource bounds.\", \"privacy\": \"Public\", \"value\": false}, \"gateway_config.stateless_tx_validator_config.validate_non_zero_l1_gas_fee\": {\"description\": \"If true, validates that a transaction has non-zero L1 resource bounds.\", \"privacy\": \"Public\", \"value\": true}, \"gateway_config.stateless_tx_validator_config.validate_non_zero_l2_gas_fee\": {\"description\": \"If true, validates that a transaction has non-zero L2 resource bounds.\", \"privacy\": \"Public\", \"value\": false}, \"http_server_config.ip\": {\"description\": \"The http server ip.\", \"privacy\": \"Public\", \"value\": \"0.0.0.0\"}, \"http_server_config.port\": {\"description\": \"The http server port.\", \"privacy\": \"Public\", \"value\": 8080}, \"mempool_p2p_config.network_buffer_size\": {\"description\": \"Network buffer size.\", \"privacy\": \"Public\", \"value\": 10000}, \"mempool_p2p_config.network_config.advertised_multiaddr\": {\"description\": \"The external address other peers see this node. If this is set, the node will not try to find out which addresses it has and will write this address as external instead\", \"privacy\": \"Public\", \"value\": \"\"}, \"mempool_p2p_config.network_config.advertised_multiaddr.#is_none\": {\"description\": \"Flag for an optional field.\", \"privacy\": \"TemporaryValue\", \"value\": true}, \"mempool_p2p_config.network_config.bootstrap_peer_multiaddr\": {\"description\": \"The multiaddress of the peer node. It should include the peer's id. For more info: https://docs.libp2p.io/concepts/fundamentals/peers/\", \"privacy\": \"Public\", \"value\": \"\"}, \"mempool_p2p_config.network_config.bootstrap_peer_multiaddr.#is_none\": {\"description\": \"Flag for an optional field.\", \"privacy\": \"TemporaryValue\", \"value\": true}, \"mempool_p2p_config.network_config.chain_id\": {\"description\": \"The chain to follow. For more details see https://docs.starknet.io/documentation/architecture_and_concepts/Blocks/transactions/#chain-id.\", \"pointer_target\": \"chain_id\", \"privacy\": \"Public\"}, \"mempool_p2p_config.network_config.discovery_config.bootstrap_dial_retry_config.base_delay_millis\": {\"description\": \"The base delay in milliseconds for the exponential backoff strategy.\", \"privacy\": \"Public\", \"value\": 2}, \"mempool_p2p_config.network_config.discovery_config.bootstrap_dial_retry_config.factor\": {\"description\": \"The factor for the exponential backoff strategy.\", \"privacy\": \"Public\", \"value\": 5}, \"mempool_p2p_config.network_config.discovery_config.bootstrap_dial_retry_config.max_delay_seconds\": {\"description\": \"The maximum delay in seconds for the exponential backoff strategy.\", \"privacy\": \"Public\", \"value\": 5}, \"mempool_p2p_config.network_config.discovery_config.heartbeat_interval\": {\"description\": \"The interval between each discovery (Kademlia) query in milliseconds.\", \"privacy\": \"Public\", \"value\": 100}, \"mempool_p2p_config.network_config.idle_connection_timeout\": {\"description\": \"Amount of time in seconds that a connection with no active sessions will stay alive.\", \"privacy\": \"Public\", \"value\": 120}, \"mempool_p2p_config.network_config.peer_manager_config.malicious_timeout_seconds\": {\"description\": \"The duration in seconds a peer is blacklisted after being marked as malicious.\", \"privacy\": \"Public\", \"value\": 31536000}, \"mempool_p2p_config.network_config.peer_manager_config.unstable_timeout_millis\": {\"description\": \"The duration in milliseconds a peer blacklisted after being reported as unstable.\", \"privacy\": \"Public\", \"value\": 1000}, \"mempool_p2p_config.network_config.quic_port\": {\"description\": \"The port that the node listens on for incoming quic connections.\", \"privacy\": \"Public\", \"value\": 10001}, \"mempool_p2p_config.network_config.secret_key\": {\"description\": \"The secret key used for building the peer id. If it's an empty string a random one will be used.\", \"privacy\": \"Private\", \"value\": \"\"}, \"mempool_p2p_config.network_config.session_timeout\": {\"description\": \"Maximal time in seconds that each session can take before failing on timeout.\", \"privacy\": \"Public\", \"value\": 120}, \"mempool_p2p_config.network_config.tcp_port\": {\"description\": \"The port that the node listens on for incoming tcp connections.\", \"privacy\": \"Public\", \"value\": 10000}, \"monitoring_endpoint_config.ip\": {\"description\": \"The monitoring endpoint ip address.\", \"privacy\": \"Public\", \"value\": \"0.0.0.0\"}, \"monitoring_endpoint_config.port\": {\"description\": \"The monitoring endpoint port.\", \"privacy\": \"Public\", \"value\": 8082}, \"rpc_state_reader_config.json_rpc_version\": {\"description\": \"The json rpc version.\", \"privacy\": \"Public\", \"value\": \"\"}, \"rpc_state_reader_config.url\": {\"description\": \"The url of the rpc server.\", \"privacy\": \"Public\", \"value\": \"\"}, \"sequencer_address\": {\"description\": \"A required param! The sequencer address.\", \"param_type\": \"String\", \"privacy\": \"TemporaryValue\"}, \"strk_fee_token_address\": \"0x7\", \"versioned_constants_overrides.invoke_tx_max_n_steps\": {\"description\": \"Maximum number of steps the invoke function is allowed to run.\", \"privacy\": \"TemporaryValue\", \"value\": 10000000}, \"versioned_constants_overrides.max_recursion_depth\": {\"description\": \"Maximum recursion depth for nested calls during blockifier validation.\", \"privacy\": \"TemporaryValue\", \"value\": 50}, \"versioned_constants_overrides.validate_max_n_steps\": {\"description\": \"Maximum number of steps the validation function is allowed to run.\", \"privacy\": \"TemporaryValue\", \"value\": 1000000}}" diff --git a/deployments/sequencer/references/sequencer-node/Deployment.sequencer-node-deployment.k8s.yaml b/deployments/sequencer/references/sequencer-node/Deployment.sequencer-node-deployment.k8s.yaml index c2bec23431..cb464782b2 100644 --- a/deployments/sequencer/references/sequencer-node/Deployment.sequencer-node-deployment.k8s.yaml +++ b/deployments/sequencer/references/sequencer-node/Deployment.sequencer-node-deployment.k8s.yaml @@ -22,26 +22,25 @@ spec: failureThreshold: 5 httpGet: path: /monitoring/alive - port: 8082 + port: 8080 periodSeconds: 10 timeoutSeconds: 5 name: sequencer-node-server ports: - containerPort: 8080 - - containerPort: 8081 - containerPort: 8082 readinessProbe: failureThreshold: 5 httpGet: path: /monitoring/ready - port: 8082 + port: 8080 periodSeconds: 10 timeoutSeconds: 5 startupProbe: failureThreshold: 10 httpGet: path: /monitoring/nodeVersion - port: 8082 + port: 8080 periodSeconds: 10 timeoutSeconds: 5 volumeMounts: diff --git a/deployments/sequencer/services/helpers.py b/deployments/sequencer/services/helpers.py index 268d8dce55..880c5709a4 100644 --- a/deployments/sequencer/services/helpers.py +++ b/deployments/sequencer/services/helpers.py @@ -15,6 +15,3 @@ def argument_parser(): ) return parser.parse_args() - - -args = argument_parser() diff --git a/deployments/sequencer/services/objects.py b/deployments/sequencer/services/objects.py index fc5152dde5..ece7c20253 100644 --- a/deployments/sequencer/services/objects.py +++ b/deployments/sequencer/services/objects.py @@ -41,12 +41,17 @@ class PersistentVolumeClaim: @dataclasses.dataclass class Config: - schema: Dict[Any, Any] + global_config: Dict[Any, Any] config: Dict[Any, Any] mount_path: str - def get(self): - return self.config + def _merged_config(self) -> Dict[Any, Any]: + _config = self.global_config.copy() + _config.update(self.config) + return _config + + def get_config(self): + return self._merged_config() def validate(self): pass diff --git a/deployments/sequencer/services/topology.py b/deployments/sequencer/services/topology.py index af034644a6..68c3056193 100644 --- a/deployments/sequencer/services/topology.py +++ b/deployments/sequencer/services/topology.py @@ -11,7 +11,7 @@ class ServiceTopology: default_factory=topology_helpers.get_deployment ) config: typing.Optional[objects.Config] = dataclasses.field( - default_factory=topology_helpers.get_config + default_factory=topology_helpers.get_dev_config ) service: typing.Optional[objects.Service] = dataclasses.field( default_factory=topology_helpers.get_service diff --git a/deployments/sequencer/services/topology_helpers.py b/deployments/sequencer/services/topology_helpers.py index 2779138008..5bd5b74ead 100644 --- a/deployments/sequencer/services/topology_helpers.py +++ b/deployments/sequencer/services/topology_helpers.py @@ -13,17 +13,17 @@ def get_pvc() -> objects.PersistentVolumeClaim: ) -def get_config() -> objects.Config: +def get_dev_config(config_file_path: str) -> objects.Config: return SequencerDevConfig( - mount_path="/config/sequencer/presets/", config_file_path=helpers.args.config_file + mount_path="/config/sequencer/presets/", config_file_path=config_file_path ) -def get_ingress() -> objects.Ingress: +def get_ingress(url: str = "test.gcp-integration.sw-dev.io") -> objects.Ingress: return objects.Ingress( annotations={ "kubernetes.io/tls-acme": "true", - "cert-manager.io/common-name": f"{helpers.args.namespace}.gcp-integration.sw-dev.io", + "cert-manager.io/common-name": f"{url}", "cert-manager.io/issue-temporary-certificate": "true", "cert-manager.io/issuer": "letsencrypt-prod", "acme.cert-manager.io/http01-edit-in-place": "true", @@ -31,7 +31,7 @@ def get_ingress() -> objects.Ingress: class_name=None, rules=[ objects.IngressRule( - host=f"{helpers.args.namespace}.gcp-integration.sw-dev.io", + host=url, paths=[ objects.IngressRuleHttpPath( path="/monitoring/", @@ -42,12 +42,7 @@ def get_ingress() -> objects.Ingress: ], ) ], - tls=[ - objects.IngressTls( - hosts=[f"{helpers.args.namespace}.gcp-integration.sw-dev.io"], - secret_name="sequencer-tls", - ) - ], + tls=[objects.IngressTls(hosts=[url], secret_name="sequencer-tls")], ) @@ -57,10 +52,14 @@ def get_service() -> objects.Service: selector={}, ports=[ objects.PortMapping( - name="http", port=const.HTTP_SERVICE_PORT, container_port=const.HTTP_CONTAINER_PORT + name="http", + port=const.HTTP_SERVICE_PORT, + container_port=const.HTTP_CONTAINER_PORT, ), objects.PortMapping( - name="rpc", port=const.RPC_SERVICE_PORT, container_port=const.RPC_CONTAINER_PORT + name="rpc", + port=const.RPC_SERVICE_PORT, + container_port=const.RPC_CONTAINER_PORT, ), objects.PortMapping( name="monitoring", @@ -108,7 +107,9 @@ def get_deployment() -> objects.Deployment: ), volume_mounts=[ objects.VolumeMount( - name="config", mount_path="/config/sequencer/presets/", read_only=True + name="config", + mount_path="/config/sequencer/presets/", + read_only=True, ), objects.VolumeMount(name="data", mount_path="/data", read_only=False), ],