def env_to_inventory(): props = common.load_yaml('properties.yml') cluster_user = props['cluster_user'] prometheus_user = props['prometheus_user'] env = common.load_yaml('environment.yml') cluster_private_ips = env['cluster_private_ips'] cluster_public_ips = env['cluster_public_ips'] key = "/eng/scylla/scylla-ansible-roles/ansible-scylla-node/foo/key" inventory = "#inventory.ini\n" inventory = "[scylla-manager]\n" prometheus_public_ip = env['prometheus_public_ip'] inventory = f"{prometheus_public_ip} ansible_connection=ssh ansible_user={prometheus_user} ansible_ssh_private_key_file={key}\n\n" inventory += "[scylla]\n" extra = f"ansible_connection=ssh ansible_user={cluster_user} ansible_ssh_private_key_file={key} dc=us-east1 rack=rack-b" for public_ip in cluster_public_ips: line = f"{public_ip} {extra}\n" inventory += line inventory_file = open('inventory.ini', 'w') inventory_file.write(inventory) inventory_file.close()
#!/bin/python3 from scyllaso import common from scyllaso import scylla from scyllaso.cs import CassandraStress from scyllaso.common import Iteration from scyllaso import prometheus # Load the properties props = common.load_yaml('properties.yml') items = props["items"] duration = props["duration"] warmup_seconds = props["warmup_seconds"] rate = props["rate"] ops = props["ops"] profile = props["profile"] # Load information about the created machines. env = common.load_yaml('environment.yml') cluster_private_ips = env['cluster_private_ips'] cluster_string = ",".join(cluster_private_ips) # Start with a clear prometheus. prometheus.clear(env, props) # Restart to cluster to make sure the Scylla starts fresh # e.g. the memtable is flushed. scylla.restart_cluster(env['cluster_public_ips'], props['cluster_user'], props['ssh_options']) iteration = Iteration(props["benchmark_name"])
from scyllaso import common from scyllaso.cs import CassandraStress from scyllaso.common import Iteration from scyllaso.scylla import Scylla from scyllaso.cassandra import Cassandra from datetime import datetime print("Test started at:", datetime.now().strftime("%H:%M:%S")) if len(sys.argv) < 2: raise Exception("Usage: ./benchmark_replace_node.py [PROFILE_NAME]") profile_name = sys.argv[1] # Load properties props = common.load_yaml(f'{profile_name}.yml') env = common.load_yaml(f'environment_{profile_name}.yml') start_count = len(env['cluster_private_ips']) - 1 cluster_private_ips = env['cluster_private_ips'][:start_count] cluster_string = ",".join(cluster_private_ips[:start_count]) new_node_private_ips = env['cluster_private_ips'][start_count:] cluster_public_ips = env['cluster_public_ips'][:start_count] new_node_public_ips = env['cluster_public_ips'][start_count:] all_public_ips = env['cluster_public_ips'] all_private_ips = env['cluster_private_ips'] loadgenerator_public_ips = env['loadgenerator_public_ips']
def cli(): props = common.load_yaml('properties.yml') env = common.load_yaml('environment.yml') pssh = PSSH(env['loadgenerator_public_ips'], props['load_generator_user'], props['ssh_options']) pssh.exec(f'killall -q -9 java') pssh.exec(f'killall -q -9 go/bin/scylla-bench')