test: use cfgsync template

This commit is contained in:
Roman 2025-02-21 10:10:34 +11:00
parent e83e0b0b23
commit cc8ff45d76
No known key found for this signature in database
GPG Key ID: B8FE070B54E11B75
5 changed files with 46 additions and 5 deletions

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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):

View File

@ -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))