Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(docker): multiple fixes to docker_backend_local.yaml #7315

Merged
merged 4 commits into from
Apr 2, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
test_duration: 90

prepare_write_cmd:
- "cassandra-stress write cl=QUORUM n=1048576 -schema 'replication(strategy=NetworkTopologyStrategy,replication_factor=3)' -mode cql3 native -rate threads=80 -pop seq=1..5048570 -col 'n=FIXED(8) size=FIXED(128)' -log interval=5"
- "scylla-bench -workload=sequential -mode=write -replication-factor=3 -partition-count=10000 -clustering-row-count=100 -clustering-row-size=uniform:128..2048 -concurrency=10 -connection-count=10 -consistency-level=quorum -rows-per-request=10 -timeout=30s -validate-data"
- "cassandra-stress write cl=QUORUM n=1048576 -schema 'replication(strategy=NetworkTopologyStrategy,replication_factor=3)' -mode cql3 native -rate threads=30 throttle=2000/s -pop seq=1..5048570 -col 'n=FIXED(8) size=FIXED(128)' -log interval=5"
- "scylla-bench -workload=sequential -mode=write -replication-factor=3 -partition-count=10000 -clustering-row-count=100 -clustering-row-size=uniform:128..2048 -concurrency=10 -connection-count=10 -consistency-level=quorum -rows-per-request=10 -timeout=30s -validate-data -max-rate=1000"

stress_cmd:
- "cassandra-stress write cl=QUORUM duration=60m -schema 'replication(strategy=NetworkTopologyStrategy,replication_factor=3)' -mode cql3 native -rate threads=30 throttle=2000/s -pop seq=1..5048570 -col 'n=FIXED(8) size=FIXED(128)' -log interval=5"
Expand All @@ -21,11 +21,17 @@ nemesis_filter_seeds: false
nemesis_during_prepare: true

# NOTE: the parameters reduce footprint of scylla cluster for docker backend, comparing to default values
append_scylla_args: '--smp 1 --memory 5G'
append_scylla_args: '--smp 1 --memory 2G'
use_mgmt: false
monitor_swap_size: 0

# NOTE: encryption should be disabled until
# https://github.com/scylladb/scylla-cluster-tests/issues/7287 is fixed
server_encrypt: false
client_encrypt: false

# TODO: remove this when we'll run this in jenkins
enable_argus: false

# cause of issue https://github.com/scylladb/scylla-monitoring/issues/2246, we should use the older monitoring version
monitor_branch: 'branch-4.5'
14 changes: 10 additions & 4 deletions sdcm/cluster.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@
# Copyright (c) 2016 ScyllaDB

# pylint: disable=too-many-lines
from __future__ import annotations

import contextlib
import queue
import logging
Expand Down Expand Up @@ -2602,7 +2604,7 @@ def check_node_health(self, retries: int = CHECK_NODE_HEALTH_RETRIES) -> None:
CHECK_NODE_HEALTH_RETRY_DELAY, self.name)
time.sleep(CHECK_NODE_HEALTH_RETRY_DELAY)

def get_nodes_status(self):
def get_nodes_status(self) -> dict[BaseNode, dict]:
nodes_status = {}
try:
statuses = self.parent_cluster.get_nodetool_status(verification_node=self)
Expand Down Expand Up @@ -2660,7 +2662,7 @@ def get_peers_info(self):
return peers_details

@retrying(n=5, sleep_time=10, raise_on_exceeded=False)
def get_gossip_info(self):
def get_gossip_info(self) -> dict[BaseNode, dict]:
gossip_info = self.run_nodetool('gossipinfo', verbose=False, warning_event_on_exception=(Exception,),
publish_event=False)
LOGGER.debug("get_gossip_info: %s", gossip_info)
Expand Down Expand Up @@ -3180,7 +3182,7 @@ def tags(self) -> Dict[str, str]:
def dead_nodes_ip_address_list(self):
return [node.ip_address for node in self.dead_nodes_list]

def get_ip_to_node_map(self):
def get_ip_to_node_map(self) -> dict[str, BaseNode]:
"""returns {ip: node} map for all nodes in cluster to get node by ip"""
return {ip: node for node in self.nodes for ip in node.get_all_ip_addresses()}

Expand Down Expand Up @@ -3219,8 +3221,12 @@ def get_rack_names_per_datacenter_and_rack_idx(self, db_nodes: list[BaseNode] |
db_nodes = db_nodes if db_nodes else self.nodes
status = db_nodes[0].get_nodes_status()

# intersection of asked nodes and nodes returned by nodetool status
# since topology might change during this command execution
actual_db_nodes = set(status.keys()).intersection(db_nodes)

rack_names_mapping = {}
for (region, rack), nodes in self.nodes_by_racks_idx_and_regions(nodes=db_nodes).items():
for (region, rack), nodes in self.nodes_by_racks_idx_and_regions(nodes=actual_db_nodes).items():
rack_names_mapping[(region, rack)] = status[nodes[0]]['rack']

return rack_names_mapping
Expand Down
9 changes: 0 additions & 9 deletions sdcm/utils/remote_logger.py
Original file line number Diff line number Diff line change
Expand Up @@ -275,13 +275,6 @@ def __init__(self, node, target_log_file: str):
super().__init__(target_log_file)


class DockerScyllaLogger(CommandNodeLoggerBase):
# pylint: disable=invalid-overridden-method
@cached_property
def _logger_cmd(self) -> str:
return f'docker logs -f {self._node.name} 2>&1 | grep scylla >>{self._target_log_file}'


class DockerGeneralLogger(CommandNodeLoggerBase):
# pylint: disable=invalid-overridden-method
@cached_property
Expand Down Expand Up @@ -577,8 +570,6 @@ def _logger_cmd(self) -> str:

def get_system_logging_thread(logs_transport, node, target_log_file): # pylint: disable=too-many-return-statements
if logs_transport == 'docker':
if 'db-node' in node.name:
return DockerScyllaLogger(node, target_log_file)
return DockerGeneralLogger(node, target_log_file)
if logs_transport == 'kubectl':
return KubectlGeneralLogger(node, target_log_file)
Expand Down
3 changes: 2 additions & 1 deletion sdcm/utils/remotewebbrowser.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,8 @@ def web_driver_docker_client(self) -> Optional[DockerClient]:
class RemoteBrowser:
def __init__(self, node, use_tunnel=True):
self.node = node
self.use_tunnel = bool(self.node.ssh_login_info and use_tunnel)
backend = self.node.parent_cluster.params.get("cluster_backend")
self.use_tunnel = bool(self.node.ssh_login_info and use_tunnel and backend not in ('docker',))

@cached_property
def browser(self):
Expand Down