From f336df8da72d5149c87b9cb04f86c981172f9201 Mon Sep 17 00:00:00 2001 From: gmega Date: Fri, 14 Feb 2025 12:14:52 -0300 Subject: [PATCH] fix: adjust Codex logging cooldown, insert polling backoff on download completion, define default Codex experiment --- benchmarks/codex/codex_node.py | 2 +- benchmarks/codex/config.py | 2 +- benchmarks/core/experiments/experiments.py | 6 +++--- benchmarks/deluge/config.py | 2 +- config/codex/experiments.k8s.yaml | 3 ++- k8s/charts/codex/values.yaml | 8 ++++---- 6 files changed, 12 insertions(+), 11 deletions(-) diff --git a/benchmarks/codex/codex_node.py b/benchmarks/codex/codex_node.py index f44850b..3c2e924 100644 --- a/benchmarks/codex/codex_node.py +++ b/benchmarks/codex/codex_node.py @@ -130,7 +130,7 @@ class CodexDownloadHandle(DownloadHandle): completion = self.completion() return completion.downloaded == completion.total - return await_predicate(_predicate, timeout) + return await_predicate(_predicate, timeout, polling_interval=1) @property def node(self) -> Node: diff --git a/benchmarks/codex/config.py b/benchmarks/codex/config.py index c4ec31a..9f8cd77 100644 --- a/benchmarks/codex/config.py +++ b/benchmarks/codex/config.py @@ -74,7 +74,7 @@ class CodexExperimentConfig(ExperimentBuilder[CodexDisseminationExperiment]): ) logging_cooldown: int = Field( - gt=0, + ge=0, default=0, description="Time to wait after the last download completes before tearing down the experiment.", ) diff --git a/benchmarks/core/experiments/experiments.py b/benchmarks/core/experiments/experiments.py index 318abae..5188f0d 100644 --- a/benchmarks/core/experiments/experiments.py +++ b/benchmarks/core/experiments/experiments.py @@ -83,7 +83,7 @@ class ExperimentEnvironment(ExperimentComponent): def await_ready(self, timeout: float = 0) -> bool: """Awaits for all components to be ready, or until a timeout is reached.""" logging.info( - f"Awaiting for components to be ready:\n {'\n'.join(self._component_names(self.not_ready))}" + f"Awaiting for components to be ready:\n {self._component_names(self.not_ready, sep='\n')}" ) if not await_predicate(self.is_ready, timeout, self.polling_interval): @@ -110,8 +110,8 @@ class ExperimentEnvironment(ExperimentComponent): return components[: self.ping_max] @staticmethod - def _component_names(components: List[ExperimentComponent]) -> str: - return ", ".join(str(component) for component in components) + def _component_names(components: List[ExperimentComponent], sep: str = ", ") -> str: + return sep.join(str(component) for component in components) def run(self, experiment: Experiment): """Runs the :class:`Experiment` within this :class:`ExperimentEnvironment`.""" diff --git a/benchmarks/deluge/config.py b/benchmarks/deluge/config.py index 887121e..32fdda2 100644 --- a/benchmarks/deluge/config.py +++ b/benchmarks/deluge/config.py @@ -84,7 +84,7 @@ class DelugeExperimentConfig(ExperimentBuilder[DelugeDisseminationExperiment]): ) logging_cooldown: int = Field( - gt=0, + ge=0, default=0, description="Time to wait after the last download completes before tearing down the experiment.", ) diff --git a/config/codex/experiments.k8s.yaml b/config/codex/experiments.k8s.yaml index 63e222f..a26a8f9 100644 --- a/config/codex/experiments.k8s.yaml +++ b/config/codex/experiments.k8s.yaml @@ -4,7 +4,8 @@ codex_experiment: seeders: ${SEEDERS} file_size: ${FILE_SIZE} repetitions: ${REPETITIONS} - logging_cooldown: 10 + # No need for cooldown as Codex takes forever to remove files, so there's plenty of time to log stuff. :-) + logging_cooldown: 0 nodes: network_size: ${NETWORK_SIZE} diff --git a/k8s/charts/codex/values.yaml b/k8s/charts/codex/values.yaml index 622014f..34ce308 100644 --- a/k8s/charts/codex/values.yaml +++ b/k8s/charts/codex/values.yaml @@ -1,9 +1,9 @@ experiment: - networkSize: 5 + networkSize: 10 fileSize: "100MB" - seeders: 1 - seederSets: 1 - repetitions: 1 + seeders: 4 + seederSets: 4 + repetitions: 10 blockTTL: 360000 blockMaintenanceInterval: 360000