Use all nodes for s3 creds

This commit is contained in:
Andrey Berezin 2023-09-19 18:14:32 +03:00 committed by Andrey Berezin
parent fc1f373477
commit 602de43bff
3 changed files with 10 additions and 2 deletions

View file

@ -22,6 +22,7 @@ class ScenarioRunner(ABC):
def prepare( def prepare(
self, self,
load_params: LoadParams, load_params: LoadParams,
cluster_nodes: list[ClusterNode],
nodes_under_load: list[ClusterNode], nodes_under_load: list[ClusterNode],
k6_dir: str, k6_dir: str,
): ):

View file

@ -72,6 +72,7 @@ class DefaultRunner(RunnerBase):
def prepare( def prepare(
self, self,
load_params: LoadParams, load_params: LoadParams,
cluster_nodes: list[ClusterNode],
nodes_under_load: list[ClusterNode], nodes_under_load: list[ClusterNode],
k6_dir: str, k6_dir: str,
): ):
@ -81,7 +82,7 @@ class DefaultRunner(RunnerBase):
with reporter.step("Init s3 client on loaders"): with reporter.step("Init s3 client on loaders"):
storage_node = nodes_under_load[0].service(StorageNode) storage_node = nodes_under_load[0].service(StorageNode)
s3_public_keys = [ s3_public_keys = [
node.service(S3Gate).get_wallet_public_key() for node in nodes_under_load node.service(S3Gate).get_wallet_public_key() for node in cluster_nodes
] ]
grpc_peer = storage_node.get_rpc_endpoint() grpc_peer = storage_node.get_rpc_endpoint()
@ -290,6 +291,7 @@ class LocalRunner(RunnerBase):
def prepare( def prepare(
self, self,
load_params: LoadParams, load_params: LoadParams,
cluster_nodes: list[ClusterNode],
nodes_under_load: list[ClusterNode], nodes_under_load: list[ClusterNode],
k6_dir: str, k6_dir: str,
): ):

View file

@ -26,6 +26,7 @@ class BackgroundLoadController:
load_params: LoadParams load_params: LoadParams
original_load_params: LoadParams original_load_params: LoadParams
verification_params: LoadParams verification_params: LoadParams
cluster_nodes: list[ClusterNode]
nodes_under_load: list[ClusterNode] nodes_under_load: list[ClusterNode]
load_counter: int load_counter: int
loaders_wallet: WalletInfo loaders_wallet: WalletInfo
@ -39,12 +40,14 @@ class BackgroundLoadController:
k6_dir: str, k6_dir: str,
load_params: LoadParams, load_params: LoadParams,
loaders_wallet: WalletInfo, loaders_wallet: WalletInfo,
cluster_nodes: list[ClusterNode],
nodes_under_load: list[ClusterNode], nodes_under_load: list[ClusterNode],
runner: ScenarioRunner, runner: ScenarioRunner,
) -> None: ) -> None:
self.k6_dir = k6_dir self.k6_dir = k6_dir
self.original_load_params = load_params self.original_load_params = load_params
self.load_params = copy.deepcopy(self.original_load_params) self.load_params = copy.deepcopy(self.original_load_params)
self.cluster_nodes = cluster_nodes
self.nodes_under_load = nodes_under_load self.nodes_under_load = nodes_under_load
self.load_counter = 1 self.load_counter = 1
self.loaders_wallet = loaders_wallet self.loaders_wallet = loaders_wallet
@ -99,7 +102,9 @@ class BackgroundLoadController:
self.endpoints = self._get_endpoints( self.endpoints = self._get_endpoints(
self.load_params.load_type, self.load_params.endpoint_selection_strategy self.load_params.load_type, self.load_params.endpoint_selection_strategy
) )
self.runner.prepare(self.load_params, self.nodes_under_load, self.k6_dir) self.runner.prepare(
self.load_params, self.cluster_nodes, self.nodes_under_load, self.k6_dir
)
self.runner.init_k6_instances(self.load_params, self.endpoints, self.k6_dir) self.runner.init_k6_instances(self.load_params, self.endpoints, self.k6_dir)
@run_optionally(optionals.OPTIONAL_BACKGROUND_LOAD_ENABLED) @run_optionally(optionals.OPTIONAL_BACKGROUND_LOAD_ENABLED)