summaryrefslogtreecommitdiffstats
path: root/src/test/crimson/cbt
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-07 18:45:59 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-07 18:45:59 +0000
commit19fcec84d8d7d21e796c7624e521b60d28ee21ed (patch)
tree42d26aa27d1e3f7c0b8bd3fd14e7d7082f5008dc /src/test/crimson/cbt
parentInitial commit. (diff)
downloadceph-19fcec84d8d7d21e796c7624e521b60d28ee21ed.tar.xz
ceph-19fcec84d8d7d21e796c7624e521b60d28ee21ed.zip
Adding upstream version 16.2.11+ds.upstream/16.2.11+dsupstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'src/test/crimson/cbt')
-rw-r--r--src/test/crimson/cbt/radosbench_4K_read.yaml36
-rw-r--r--src/test/crimson/cbt/radosbench_4K_write.yaml34
-rwxr-xr-xsrc/test/crimson/cbt/t2c.py78
3 files changed, 148 insertions, 0 deletions
diff --git a/src/test/crimson/cbt/radosbench_4K_read.yaml b/src/test/crimson/cbt/radosbench_4K_read.yaml
new file mode 100644
index 000000000..219ce643a
--- /dev/null
+++ b/src/test/crimson/cbt/radosbench_4K_read.yaml
@@ -0,0 +1,36 @@
+meta:
+- desc: |
+ Run radosbench benchmark using cbt.
+ 4K read workload.
+
+tasks:
+- cbt:
+ benchmarks:
+ radosbench:
+ concurrent_ops: 16
+ concurrent_procs: 2
+ op_size: [4096]
+ pool_profile: 'replicated'
+ read_time: 30
+ read_only: true
+ readmode: 'rand'
+ prefill_time: 3
+ acceptable:
+ bandwidth: '(or (greater) (near 0.05))'
+ iops_avg: '(or (greater) (near 0.05))'
+ iops_stddev: '(or (less) (near 2.00))'
+ latency_avg: '(or (less) (near 0.05))'
+ cpu_cycles_per_op: '(or (less) (near 0.05))'
+ monitoring_profiles:
+ perf:
+ nodes:
+ - osds
+ args: 'stat -p {pid} -o {perf_dir}/perf_stat.{pid}'
+ cluster:
+ osds_per_node: 3
+ iterations: 1
+ pool_profiles:
+ replicated:
+ pg_size: 128
+ pgp_size: 128
+ replication: 'replicated'
diff --git a/src/test/crimson/cbt/radosbench_4K_write.yaml b/src/test/crimson/cbt/radosbench_4K_write.yaml
new file mode 100644
index 000000000..526982b10
--- /dev/null
+++ b/src/test/crimson/cbt/radosbench_4K_write.yaml
@@ -0,0 +1,34 @@
+meta:
+- desc: |
+ Run radosbench benchmark using cbt.
+ 4K write workload.
+
+tasks:
+- cbt:
+ benchmarks:
+ radosbench:
+ concurrent_ops: 16
+ concurrent_procs: 2
+ op_size: [4096]
+ pool_profile: 'replicated'
+ write_time: 3
+ write_only: true
+ acceptable:
+ bandwidth: '(or (greater) (near 0.05))'
+ iops_avg: '(or (greater) (near 0.05))'
+ iops_stddev: '(or (less) (near 2.00))'
+ latency_avg: '(or (less) (near 0.05))'
+ cpu_cycles_per_op: '(or (less) (near 0.05))'
+ monitoring_profiles:
+ perf:
+ nodes:
+ - osds
+ args: 'stat -p {pid} -o {perf_dir}/perf_stat.{pid}'
+ cluster:
+ osds_per_node: 3
+ iterations: 1
+ pool_profiles:
+ replicated:
+ pg_size: 128
+ pgp_size: 128
+ replication: 'replicated'
diff --git a/src/test/crimson/cbt/t2c.py b/src/test/crimson/cbt/t2c.py
new file mode 100755
index 000000000..0d4ee49e5
--- /dev/null
+++ b/src/test/crimson/cbt/t2c.py
@@ -0,0 +1,78 @@
+#!/usr/bin/env python3
+
+from __future__ import print_function
+import argparse
+import os
+import os.path
+import socket
+import sys
+import yaml
+
+
+class Translator(object):
+ def __init__(self, build_dir):
+ self.build_dir = build_dir
+
+ def translate(self, config):
+ cluster = config.get('cluster', {})
+ benchmarks = config.get('benchmarks', [])
+ monitoring_profiles = config.get('monitoring_profiles', {})
+ return dict(cluster=self._create_cluster_config(cluster),
+ benchmarks=benchmarks,
+ monitoring_profiles=monitoring_profiles)
+
+ def _create_cluster_config(self, cluster):
+ # prepare the "cluster" section consumed by CBT
+ localhost = socket.getfqdn()
+ num_osds = cluster.get('osds_per_node', 3)
+ items_to_copy = ['iterations', 'pool_profiles']
+ conf = dict((k, cluster[k]) for k in items_to_copy if k in cluster)
+ conf.update(dict(
+ head=localhost,
+ osds=[localhost],
+ osds_per_node=num_osds,
+ mons=[localhost],
+ clients=[localhost],
+ rebuild_every_test=False,
+ conf_file=os.path.join(self.build_dir, 'ceph.conf'),
+ ceph_cmd=os.path.join(self.build_dir, 'bin', 'ceph'),
+ rados_cmd=os.path.join(self.build_dir, 'bin', 'rados'),
+ pid_dir=os.path.join(self.build_dir, 'out')
+ ))
+ return conf
+
+def get_cbt_tasks(path):
+ with open(path) as input:
+ teuthology_config = yaml.load(input)
+ for task in teuthology_config['tasks']:
+ for name, conf in task.items():
+ if name == 'cbt':
+ yield conf
+
+def main():
+ parser = argparse.ArgumentParser(description='translate teuthology yaml to CBT yaml')
+ parser.add_argument('--build-dir',
+ default=os.getcwd(),
+ required=False,
+ help='Directory where CMakeCache.txt is located')
+ parser.add_argument('--input',
+ required=True,
+ help='The path to the input YAML file')
+ parser.add_argument('--output',
+ required=True,
+ help='The path to the output YAML file')
+ options = parser.parse_args(sys.argv[1:])
+ cbt_tasks = [task for task in get_cbt_tasks(options.input)]
+ if not cbt_tasks:
+ print('cbt not found in "tasks" section', file=sys.stderr)
+ return sys.exit(1)
+ elif len(cbt_tasks) > 1:
+ print('more than one cbt task found in "tasks" section', file=sys.stderr)
+ return sys.exit(1)
+ translator = Translator(options.build_dir)
+ cbt_config = translator.translate(cbt_tasks[0])
+ with open(options.output, 'w') as output:
+ yaml.dump(cbt_config, output)
+
+if __name__ == '__main__':
+ main()