diff --git a/cluster_config/cfgsync-template.yaml b/cluster_config/cfgsync-template.yaml new file mode 100644 index 0000000..308c315 --- /dev/null +++ b/cluster_config/cfgsync-template.yaml @@ -0,0 +1,31 @@ +port: 4400 +n_hosts: {{ num_hosts }} +timeout: 30 + +# ConsensusConfig related parameters +security_param: 10 +active_slot_coeff: 0.9 + +# DaConfig related parameters +subnetwork_size: {{ subnet_size }} +dispersal_factor: 2 +num_samples: 1 +num_subnets: 2 +old_blobs_check_interval_secs: 5 +blobs_validity_duration_secs: 60 +global_params_path: "/kzgrs_test_params" + +# Tracing +tracing_settings: + logger: Stdout + tracing: !Otlp + endpoint: http://tempo:4317/ + sample_ratio: 0.5 + service_name: node + filter: !EnvFilter + filters: + nomos: debug + metrics: !Otlp + endpoint: http://prometheus:9090/api/v1/otlp/v1/metrics + host_identifier: node + level: INFO \ No newline at end of file diff --git a/cluster_config/cfgsync.yaml b/cluster_config/cfgsync.yaml index 10840a5..64b1df0 100644 --- a/cluster_config/cfgsync.yaml +++ b/cluster_config/cfgsync.yaml @@ -7,7 +7,7 @@ security_param: 10 active_slot_coeff: 0.9 # DaConfig related parameters -subnetwork_size: 2 +subnetwork_size: 1024 dispersal_factor: 2 num_samples: 1 num_subnets: 2 diff --git a/requirements.txt b/requirements.txt index 2965db5..0733397 100644 --- a/requirements.txt +++ b/requirements.txt @@ -39,3 +39,4 @@ typing-inspect==0.9.0 typing_extensions==4.9.0 urllib3==2.2.2 virtualenv==20.25.0 +Jinja2~=3.1.5 \ No newline at end of file diff --git a/src/steps/common.py b/src/steps/common.py index a2f74f4..9ddb65d 100644 --- a/src/steps/common.py +++ b/src/steps/common.py @@ -8,15 +8,24 @@ from src.env_vars import CFGSYNC, NOMOS, NOMOS_EXECUTOR from src.libs.custom_logger import get_custom_logger from src.node.nomos_node import NomosNode +from jinja2 import Template + logger = get_custom_logger(__name__) def prepare_cluster_config(node_count, subnetwork_size=2): cwd = os.getcwd() config_dir = "cluster_config" - src = f"{cwd}/{config_dir}/cfgsync-{node_count}node{subnetwork_size}.yaml" - dst = f"{cwd}/{config_dir}/cfgsync.yaml" - shutil.copyfile(src, dst) + + with open(f"{cwd}/{config_dir}/cfgsync-template.yaml", "r") as file: + template_content = file.read() + template = Template(template_content) + + rendered = template.render(num_hosts=node_count, subnet_size=subnetwork_size) + logger.debug(f"Rendered template {rendered}") + + with open(f"{cwd}/{config_dir}/cfgsync.yaml", "w") as outfile: + outfile.write(rendered) def start_nodes(nodes): diff --git a/tests/networking_privacy/test_networking_privacy.py b/tests/networking_privacy/test_networking_privacy.py index aab916e..a912380 100644 --- a/tests/networking_privacy/test_networking_privacy.py +++ b/tests/networking_privacy/test_networking_privacy.py @@ -11,4 +11,4 @@ class TestNetworkingPrivacy(StepsDataAvailability): @pytest.mark.parametrize("setup_2_node_cluster", [1024], indirect=True) def test_consumed_bandwidth_dispersal(self, setup_2_node_cluster): delay(5) - self.disperse_data(DATA_TO_DISPERSE[1], to_app_id(1), to_index(0)) + # self.disperse_data(DATA_TO_DISPERSE[1], to_app_id(1), to_index(0))