Skip to content

Commit 4c52c38

Browse files
committed
chore(serverless): remove cloud_config option
since scylla-driver is going to remove this configuration option we are removing it from SCT code Ref: scylladb/python-driver#590 (cherry picked from commit 0b4a70a)
1 parent 44b7861 commit 4c52c38

File tree

10 files changed

+28
-253
lines changed

10 files changed

+28
-253
lines changed

docs/configuration_options.md

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1959,15 +1959,6 @@ Defines whether we enable the alternator feature using scylla-operator or not.
19591959
**type:** boolean
19601960

19611961

1962-
## **k8s_connection_bundle_file** / SCT_K8S_CONNECTION_BUNDLE_FILE
1963-
1964-
Serverless configuration bundle file
1965-
1966-
**default:** N/A
1967-
1968-
**type:** _file
1969-
1970-
19711962
## **k8s_db_node_service_type** / SCT_K8S_DB_NODE_SERVICE_TYPE
19721963

19731964
Defines the type of the K8S 'Service' objects type used for ScyllaDB pods. Empty value means 'do not set and allow scylla-operator to choose'.

functional_tests/scylla_operator/test_functional.py

Lines changed: 0 additions & 68 deletions
Original file line numberDiff line numberDiff line change
@@ -1004,74 +1004,6 @@ def test_operator_managed_tls(db_cluster: ScyllaPodCluster, tmp_path: path.Path)
10041004
log.debug(output)
10051005

10061006

1007-
@pytest.mark.required_operator("v1.8.0")
1008-
@pytest.mark.requires_tls_and_sni
1009-
def test_cloud_bundle_connectivity_python(db_cluster: ScyllaPodCluster):
1010-
1011-
assert db_cluster.connection_bundle_file, "cloud bundle wasn't found"
1012-
1013-
with db_cluster.cql_connection_patient(db_cluster.nodes[0]) as session:
1014-
res = session.execute("SELECT * FROM system.local")
1015-
output = res.all()
1016-
log.debug(output)
1017-
assert len(output) == 1
1018-
1019-
1020-
@pytest.mark.required_operator("v1.8.0")
1021-
@pytest.mark.requires_tls_and_sni
1022-
def test_cloud_bundle_connectivity_cassandra_stress(tester):
1023-
1024-
assert tester.db_cluster.connection_bundle_file, "cloud bundle wasn't found"
1025-
1026-
cmd = (
1027-
"""cassandra-stress write cl=ONE duration=1m -schema 'replication(strategy=NetworkTopologyStrategy,replication_factor=1) """
1028-
"""compaction(strategy=SizeTieredCompactionStrategy)' -mode cql3 native """
1029-
"""-rate threads=10 -pop seq=1..10000000 -log interval=5"""
1030-
)
1031-
1032-
stress_obj = tester.run_stress_thread(cmd, stop_test_on_failure=False)
1033-
output, _ = stress_obj.parse_results()
1034-
1035-
assert "latency mean" in output[0]
1036-
assert float(output[0]["latency mean"]) > 0
1037-
1038-
assert "latency 99th percentile" in output[0]
1039-
assert float(output[0]["latency 99th percentile"]) > 0
1040-
1041-
1042-
@pytest.mark.required_operator("v1.8.0")
1043-
@pytest.mark.requires_tls_and_sni
1044-
def test_cloud_bundle_connectivity_scylla_bench(tester):
1045-
1046-
assert tester.db_cluster.connection_bundle_file, "cloud bundle wasn't found"
1047-
1048-
cmd = (
1049-
"scylla-bench -workload=sequential -mode=write -replication-factor=1 -partition-count=10 "
1050-
"-clustering-row-count=5555 -clustering-row-size=uniform:10..20 -concurrency=10 "
1051-
"-connection-count=10 -consistency-level=one -rows-per-request=10 -timeout=60s -duration=1m"
1052-
)
1053-
1054-
stress_obj = tester.run_stress_thread(cmd, stop_test_on_failure=False)
1055-
summaries, errors = stress_obj.parse_results()
1056-
assert not errors
1057-
assert summaries[0]["Clustering row size"] == "Uniform(min=10, max=20)"
1058-
1059-
# TODO: add verification that the output say it's using the cloud bundle
1060-
# (need to add that to log output in scylla-bench)
1061-
1062-
1063-
@pytest.mark.required_operator("v1.8.0")
1064-
@pytest.mark.requires_tls_and_sni
1065-
def test_cloud_bundle_connectivity_cqlsh(db_cluster: ScyllaPodCluster):
1066-
1067-
assert db_cluster.connection_bundle_file, "cloud bundle wasn't found"
1068-
1069-
res = db_cluster.nodes[0].run_cqlsh("SELECT * FROM system.local")
1070-
1071-
assert not res.stderr
1072-
assert '(1 rows)' in res.stdout
1073-
1074-
10751007
def test_can_recover_from_fatal_pod_termination(db_cluster):
10761008
target_node = db_cluster.nodes[-1]
10771009
experiment = PodFailureExperiment(pod=target_node, duration="60s")

sdcm/cluster.py

Lines changed: 8 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@
5656
from cassandra.cluster import Cluster as ClusterDriver
5757
from cassandra.cluster import NoHostAvailable
5858
from cassandra.policies import RetryPolicy
59-
from cassandra.policies import WhiteListRoundRobinPolicy, HostFilterPolicy, RoundRobinPolicy
59+
from cassandra.policies import WhiteListRoundRobinPolicy
6060
from cassandra.query import SimpleStatement
6161
from argus.common.enums import ResourceState
6262
from argus.client.sct.types import LogLink
@@ -2882,10 +2882,6 @@ def print_node_running_nemesis(self, node_ip):
28822882

28832883
return f' ({node.running_nemesis} nemesis target node)' if node.running_nemesis else ' (not target node)'
28842884

2885-
@property
2886-
def is_cqlsh_support_cloud_bundle(self):
2887-
return bool(self.parent_cluster.connection_bundle_file)
2888-
28892885
@property
28902886
def is_replacement_by_host_id_supported(self):
28912887
return ComparableScyllaVersion(self.scylla_version) > '5.2.0~dev'
@@ -2907,12 +2903,6 @@ def _gen_cqlsh_cmd(self, command, keyspace, timeout, connect_timeout):
29072903
command = '"{}"'.format(command.strip().replace('"', '\\"'))
29082904

29092905
cqlsh_cmd = self.add_install_prefix('/usr/bin/cqlsh')
2910-
if self.is_cqlsh_support_cloud_bundle:
2911-
connection_bundle_file = self.parent_cluster.connection_bundle_file
2912-
target_connection_bundle_file = str(Path('/tmp/') / connection_bundle_file.name)
2913-
self.remoter.send_files(str(connection_bundle_file), target_connection_bundle_file)
2914-
2915-
return f'{cqlsh_cmd} {options} -e {command} --cloudconf {target_connection_bundle_file}'
29162906
return f'{cqlsh_cmd} {options} -e {command} {host}'
29172907

29182908
def run_cqlsh(self, cmd, keyspace=None, timeout=120, verbose=True, split=False, connect_timeout=60,
@@ -3620,7 +3610,7 @@ def create_ssl_context(keyfile: str, certfile: str, truststore: str):
36203610
return ssl_context
36213611

36223612
def _create_session(self, node, keyspace, user, password, compression, protocol_version, load_balancing_policy=None, port=None, # noqa: PLR0913
3623-
ssl_context=None, node_ips=None, connect_timeout=None, verbose=True, connection_bundle_file=None):
3613+
ssl_context=None, node_ips=None, connect_timeout=None, verbose=True):
36243614
if not port:
36253615
port = node.CQL_PORT
36263616

@@ -3646,8 +3636,6 @@ def _create_session(self, node, keyspace, user, password, compression, protocol_
36463636
self.log.debug("ssl_context: %s", str(ssl_context))
36473637

36483638
kwargs = dict(contact_points=node_ips, port=port, ssl_context=ssl_context)
3649-
if connection_bundle_file:
3650-
kwargs = dict(scylla_cloud=connection_bundle_file)
36513639
cluster_driver = ClusterDriver(auth_provider=auth_provider,
36523640
compression=compression,
36533641
protocol_version=protocol_version,
@@ -3697,40 +3685,21 @@ def cql_connection(self, node, keyspace=None, user=None,
36973685
- If a connection bundle file is available in the parent cluster, it will be used for the connection.
36983686
- If no connection bundle file is provided, the method will use the WhiteListRoundRobinPolicy with the specified nodes.
36993687
"""
3700-
if connection_bundle_file := node.parent_cluster.connection_bundle_file:
3701-
wlrr = None
3702-
node_ips = []
3703-
else:
3704-
node_ips = self.get_node_cql_ips(nodes=whitelist_nodes)
3705-
wlrr = WhiteListRoundRobinPolicy(node_ips)
3688+
node_ips = self.get_node_cql_ips(nodes=whitelist_nodes)
3689+
wlrr = WhiteListRoundRobinPolicy(node_ips)
37063690
return self._create_session(node=node, keyspace=keyspace, user=user, password=password, compression=compression,
37073691
protocol_version=protocol_version, load_balancing_policy=wlrr, port=port, ssl_context=ssl_context,
3708-
node_ips=node_ips, connect_timeout=connect_timeout, verbose=verbose,
3709-
connection_bundle_file=connection_bundle_file)
3692+
node_ips=node_ips, connect_timeout=connect_timeout, verbose=verbose)
37103693

37113694
def cql_connection_exclusive(self, node, keyspace=None, user=None,
37123695
password=None, compression=True,
37133696
protocol_version=None, port=None,
37143697
ssl_context=None, connect_timeout=100, verbose=True):
3715-
if connection_bundle_file := node.parent_cluster.connection_bundle_file:
3716-
# TODO: handle the case of multiple datacenters
3717-
bundle_yaml = yaml.safe_load(connection_bundle_file.open('r', encoding='utf-8'))
3718-
node_domain = None
3719-
for _, connection_data in bundle_yaml.get('datacenters', {}).items():
3720-
node_domain = connection_data.get('nodeDomain').strip()
3721-
assert node_domain, f"didn't found nodeDomain in bundle [{connection_bundle_file}]"
3722-
3723-
def host_filter(host):
3724-
return str(host.host_id) == str(node.host_id) or node_domain == host.endpoint._server_name
3725-
wlrr = HostFilterPolicy(child_policy=RoundRobinPolicy(), predicate=host_filter)
3726-
node_ips = []
3727-
else:
3728-
node_ips = [node.cql_address]
3729-
wlrr = WhiteListRoundRobinPolicy(node_ips)
3698+
node_ips = [node.cql_address]
3699+
wlrr = WhiteListRoundRobinPolicy(node_ips)
37303700
return self._create_session(node=node, keyspace=keyspace, user=user, password=password, compression=compression,
37313701
protocol_version=protocol_version, load_balancing_policy=wlrr, port=port, ssl_context=ssl_context,
3732-
node_ips=node_ips, connect_timeout=connect_timeout, verbose=verbose,
3733-
connection_bundle_file=connection_bundle_file)
3702+
node_ips=node_ips, connect_timeout=connect_timeout, verbose=verbose)
37343703

37353704
@retrying(n=8, sleep_time=15, allowed_exceptions=(NoHostAvailable,))
37363705
def cql_connection_patient(self, node, keyspace=None,
@@ -4198,11 +4167,6 @@ def proposed_scylla_yaml(self) -> ScyllaYaml:
41984167
)
41994168
return ScyllaYaml(**cluster_params_builder.model_dump(exclude_unset=True, exclude_none=True))
42004169

4201-
@property
4202-
def connection_bundle_file(self) -> Path | None:
4203-
bundle_file = self.params.get("k8s_connection_bundle_file")
4204-
return Path(bundle_file) if bundle_file else None
4205-
42064170
@property
42074171
def racks(self) -> Set[int]:
42084172
return {node.rack for node in self.nodes}

sdcm/cluster_k8s/__init__.py

Lines changed: 0 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -2683,51 +2683,6 @@ def seed_nodes_addresses(self):
26832683
def seed_nodes(self):
26842684
return []
26852685

2686-
@cached_property
2687-
def connection_bundle_file(self) -> Path | None:
2688-
if bundle_file := super().connection_bundle_file:
2689-
return bundle_file
2690-
2691-
# TODO: support multiDC case
2692-
k8s_cluster = self.k8s_clusters[0]
2693-
bundle_cmd_output = k8s_cluster.kubectl(
2694-
f"get secret/{self.scylla_cluster_name}-local-cql-connection-configs-admin"
2695-
f" --template='{{{{ index .data \"{self.scylla_cluster_name}.sct.scylladb.com\" }}}}'",
2696-
namespace=self.namespace, ignore_status=True)
2697-
2698-
if bundle_cmd_output.failed:
2699-
return None
2700-
2701-
fd, file_name = tempfile.mkstemp(suffix='.yaml')
2702-
os.close(fd)
2703-
bundle_file = Path(file_name)
2704-
bundle_file.write_bytes(base64.decodebytes(bytes(bundle_cmd_output.stdout.strip(), encoding='utf-8')))
2705-
2706-
lb_external_hostname = k8s_cluster.kubectl(
2707-
"get service/haproxy-kubernetes-ingress "
2708-
"-o jsonpath='{.status.loadBalancer.ingress[0].hostname}'",
2709-
namespace=INGRESS_CONTROLLER_NAMESPACE)
2710-
2711-
sni_address = None
2712-
if not (lb_external_hostname.ok and lb_external_hostname.stdout):
2713-
lb_cluster_ip = k8s_cluster.kubectl(
2714-
"get service/haproxy-kubernetes-ingress --template='{{ index .spec.clusterIP }}'",
2715-
namespace=INGRESS_CONTROLLER_NAMESPACE)
2716-
if lb_cluster_ip.ok:
2717-
sni_address = lb_cluster_ip.stdout
2718-
else:
2719-
sni_address = lb_external_hostname.stdout
2720-
2721-
if sni_address:
2722-
# TODO: handle the case of multiple datacenters
2723-
# need to get the cluster ip from each k8s cluster
2724-
bundle_yaml = yaml.safe_load(bundle_file.open('r', encoding='utf-8'))
2725-
for _, connection_data in bundle_yaml.get('datacenters', {}).items():
2726-
connection_data['server'] = f'{sni_address.strip()}:9142'
2727-
yaml.dump(bundle_yaml, bundle_file.open('w', encoding='utf-8'))
2728-
2729-
return bundle_file
2730-
27312686
def node_setup(self, node: BaseScyllaPodContainer, verbose: bool = False, timeout: int = 3600):
27322687
if self.test_config.BACKTRACE_DECODING:
27332688
node.install_scylla_debuginfo()

sdcm/sct_config.py

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1034,9 +1034,6 @@ class SCTConfiguration(dict):
10341034
dict(name="k8s_enable_alternator", env="SCT_K8S_ENABLE_ALTERNATOR", type=boolean,
10351035
help="Defines whether we enable the alternator feature using scylla-operator or not."),
10361036

1037-
dict(name="k8s_connection_bundle_file", env="SCT_K8S_CONNECTION_BUNDLE_FILE", type=_file,
1038-
help="Serverless configuration bundle file", k8s_multitenancy_supported=True),
1039-
10401037
# NOTE: following 'k8s_db_node_service_type', 'k8s_db_node_to_node_broadcast_ip_type' and
10411038
# 'k8s_db_node_to_client_broadcast_ip_type' options are supported only starting with
10421039
# the 'v1.11.0-rc.0' scylla-operator version.

sdcm/scylla_bench_thread.py

Lines changed: 18 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -143,27 +143,24 @@ def __init__(self, stress_cmd, loader_set, timeout, node_list=None, round_robin=
143143
self.hdr_tags = ["co-fixed"]
144144

145145
def create_stress_cmd(self, stress_cmd, loader, cmd_runner):
146-
if self.connection_bundle_file:
147-
stress_cmd = f'{stress_cmd.strip()} -cloud-config-path={self.target_connection_bundle_file}'
148-
else:
149-
# Select first seed node to send the scylla-bench cmds
150-
ips = ",".join([n.cql_address for n in self.node_list])
151-
stress_cmd = f'{stress_cmd.strip()} -nodes {ips}'
152-
153-
if self.params.get("client_encrypt"):
154-
for ssl_file in loader.ssl_conf_dir.iterdir():
155-
if ssl_file.is_file():
156-
cmd_runner.send_files(str(ssl_file),
157-
str(SCYLLA_SSL_CONF_DIR / ssl_file.name),
158-
verbose=True)
159-
stress_cmd = f'{stress_cmd.strip()} -tls -tls-ca-cert-file {SCYLLA_SSL_CONF_DIR}/{TLSAssets.CA_CERT}'
160-
161-
if self.params.get("peer_verification"):
162-
stress_cmd = f'{stress_cmd.strip()} -tls-host-verification'
163-
if self.params.get("client_encrypt_mtls"):
164-
stress_cmd = (
165-
f'{stress_cmd.strip()} -tls-client-key-file {SCYLLA_SSL_CONF_DIR}/{TLSAssets.CLIENT_KEY} '
166-
f'-tls-client-cert-file {SCYLLA_SSL_CONF_DIR}/{TLSAssets.CLIENT_CERT}')
146+
# Select first seed node to send the scylla-bench cmds
147+
ips = ",".join([n.cql_address for n in self.node_list])
148+
stress_cmd = f'{stress_cmd.strip()} -nodes {ips}'
149+
150+
if self.params.get("client_encrypt"):
151+
for ssl_file in loader.ssl_conf_dir.iterdir():
152+
if ssl_file.is_file():
153+
cmd_runner.send_files(str(ssl_file),
154+
str(SCYLLA_SSL_CONF_DIR / ssl_file.name),
155+
verbose=True)
156+
stress_cmd = f'{stress_cmd.strip()} -tls -tls-ca-cert-file {SCYLLA_SSL_CONF_DIR}/{TLSAssets.CA_CERT}'
157+
158+
if self.params.get("peer_verification"):
159+
stress_cmd = f'{stress_cmd.strip()} -tls-host-verification'
160+
if self.params.get("client_encrypt_mtls"):
161+
stress_cmd = (
162+
f'{stress_cmd.strip()} -tls-client-key-file {SCYLLA_SSL_CONF_DIR}/{TLSAssets.CLIENT_KEY} '
163+
f'-tls-client-cert-file {SCYLLA_SSL_CONF_DIR}/{TLSAssets.CLIENT_CERT}')
167164

168165
return stress_cmd
169166

@@ -182,9 +179,6 @@ def _run_stress(self, loader, loader_idx, cpu_idx):
182179
)
183180
cmd_runner_name = loader.ip_address
184181

185-
if self.connection_bundle_file:
186-
cmd_runner.send_files(str(self.connection_bundle_file), self.target_connection_bundle_file)
187-
188182
if self.sb_mode == ScyllaBenchModes.WRITE and self.sb_workload == ScyllaBenchWorkloads.TIMESERIES:
189183
loader.parent_cluster.sb_write_timeseries_ts = write_timestamp = time.time_ns()
190184
LOGGER.debug("Set start-time: %s", write_timestamp)

sdcm/stress/base.py

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@
1414
import logging
1515
import random
1616
import concurrent.futures
17-
from pathlib import Path
1817
from functools import cached_property
1918
import uuid
2019

@@ -150,14 +149,6 @@ def db_node_to_query(self, loader):
150149
return node_to_query.cql_address
151150
return self.node_list[0].cql_address
152151

153-
@property
154-
def connection_bundle_file(self) -> Path:
155-
return self.node_list[0].parent_cluster.connection_bundle_file
156-
157-
@property
158-
def target_connection_bundle_file(self) -> str:
159-
return str(Path('/tmp/') / self.connection_bundle_file.name)
160-
161152
def configure_event_on_failure(self, stress_event: StressEvent, exc: Exception | Failure):
162153
error_msg = format_stress_cmd_error(exc)
163154
if (hasattr(exc, "result") and exc.result.failed) and exc.result.exited == 137:

sdcm/stress_thread.py

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@
1818
import contextlib
1919
from typing import Any
2020
from itertools import chain
21-
from pathlib import Path
2221

2322
from sdcm.db_stats import get_stress_cmd_params
2423
from sdcm.loader import CassandraStressExporter, CassandraStressHDRExporter
@@ -170,10 +169,7 @@ def adjust_cmd_node_option(self, stress_cmd, loader, cmd_runner):
170169
return stress_cmd
171170

172171
def adjust_cmd_connection_options(self, stress_cmd: str, loader, cmd_runner) -> str:
173-
if (connection_bundle_file := self.node_list[0].parent_cluster.connection_bundle_file) and '-node' not in stress_cmd:
174-
stress_cmd += f" -cloudconf file={Path('/tmp') / connection_bundle_file.name}"
175-
else:
176-
stress_cmd = self.adjust_cmd_node_option(stress_cmd, loader, cmd_runner)
172+
stress_cmd = self.adjust_cmd_node_option(stress_cmd, loader, cmd_runner)
177173
return stress_cmd
178174

179175
def create_stress_cmd(self, cmd_runner, keyspace_idx, loader):
@@ -325,10 +321,6 @@ def _run_cs_stress(self, loader, loader_idx, cpu_idx, keyspace_idx): # noqa: PL
325321
str(SCYLLA_SSL_CONF_DIR / ssl_file.name),
326322
verbose=True)
327323

328-
if connection_bundle_file := self.connection_bundle_file:
329-
cmd_runner.send_files(str(connection_bundle_file),
330-
self.target_connection_bundle_file, delete_dst=True, verbose=True)
331-
332324
if self.params.get("use_hdrhistogram"):
333325
stress_cmd = self._add_hdr_log_option(stress_cmd, remote_hdr_file_name)
334326
hdrh_logger_context = HDRHistogramFileLogger(

0 commit comments

Comments
 (0)