diff --git a/benchmark/cosbench.py b/benchmark/cosbench.py index 2087252e..0aefa85e 100644 --- a/benchmark/cosbench.py +++ b/benchmark/cosbench.py @@ -28,6 +28,8 @@ def __init__(self, cluster, config): self.objects = config["objects_max"] self.mode = config["mode"] self.user = settings.cluster.get('user') + self.rgw = settings.cluster.get('rgws')[0] + self.use_existing = settings.cluster.get('use_existing') self.run_dir = '%s/osd_ra-%08d/op_size-%s/concurrent_procs-%03d/containers-%05d/objects-%05d/%s' % (self.run_dir, int(self.osd_ra), self.op_size, int(self.total_procs), int(self.containers),int(self.objects), self.mode) self.out_dir = '%s/osd_ra-%08d/op_size-%s/concurrent_procs-%03d/containers-%05d/objects-%05d/%s' % (self.archive_dir, int(self.osd_ra), self.op_size, int(self.total_procs), int(self.containers),int(self.objects), self.mode) @@ -46,7 +48,17 @@ def prerun_check(self): pass logger.debug("%s", cosconf) if "username" in cosconf and "password" in cosconf and "url" in cosconf: + + if not self.use_existing: + user, subuser = cosconf["username"].split(':') + stdout, stderr = common.pdsh("%s@%s" % (self.user, self.rgw),"radosgw-admin user create --uid='%s' --display-name='%s'" % (user, user)).communicate() + stdout, stderr = common.pdsh("%s@%s" % (self.user, self.rgw),"radosgw-admin subuser create --uid=%s --subuser=%s --access=full" % (user, cosconf["username"])).communicate() + stdout, stderr = common.pdsh("%s@%s" % (self.user, self.rgw),"radosgw-admin key create --uid=%s --subuser=%s --key-type=swift" % (user, cosconf["username"])).communicate() + stdout, stderr = common.pdsh("%s@%s" % (self.user, self.rgw),"radosgw-admin user modify --uid=%s --max-buckets=100000" % (user)).communicate() + stdout, stderr = common.pdsh("%s@%s" % (self.user, self.rgw),"radosgw-admin subuser modify --uid=%s --subuser=%s --secret=%s --key-type=swift" % (user, cosconf["username"], cosconf["password"])).communicate() + stdout, stderr = common.pdsh("%s@%s" % (self.user, self.config["controller"]),"curl -D - -H 'X-Auth-User: %s' -H 'X-Auth-Key: %s' %s" % (cosconf["username"], cosconf["password"], cosconf["url"])).communicate() + else: logger.error("Auth Configuration in Yaml file is not in correct format") sys.exit() diff --git a/example/wip-cosbench/cosbench_ex.yaml b/example/wip-cosbench/cosbench_ex.yaml new file mode 100644 index 00000000..939bde62 --- /dev/null +++ b/example/wip-cosbench/cosbench_ex.yaml @@ -0,0 +1,47 @@ +cluster: + user: 'cbt' + head: "cadmin" + clients: ["cadmin"] + osds: ["inf1", "inf2", "inf3"] + mons: + inf1: + a: "192.168.110.51:6789" + inf2: + b: "192.168.110.52:6789" + inf3: + c: "192.168.110.53:6789" + rgws: ["inf1", "inf2", "inf3"] + osds_per_node: 1 + fs: 'xfs' + mkfs_opts: '-f -i size=2048 -n size=64k' + mount_opts: '-o inode64,noatime,logbsize=256k' + conf_file: '/home/cbt/cbt/runs/test2.ceph.conf' + iterations: 1 + use_existing: True + clusterid: "ceph" + tmp_dir: "/tmp/cbt" + pool_profiles: + rbd: + pg_size: 64 + pgp_size: 64 + replication: 2 +benchmarks: + cosbench: + obj_size: [64KB] + osd_ra: [4096] + workers: 1 + containers_max: 10 + objects_max: 100 + mode: [write] + cosbench_dir: '/home/cbt/cb/0.4.1.0' + cosbench_xml_dir: '/home/cbt/cb/xml_dir' + controller: "cadmin" + auth: + config: username=cosbench:operator;password=intel2012;url=http://192.168.110.51:7480/auth/v1.0;retry=9 + template: [default] + rampup: 10 + runtime: 100 + rampdown: 10 + containers: ["u(1,100)"] + objects: ["u(1,100)"] + ratio: [100] diff --git a/example/wip-cosbench/cosbench_ex_ceph.conf b/example/wip-cosbench/cosbench_ex_ceph.conf new file mode 100644 index 00000000..fdb12c38 --- /dev/null +++ b/example/wip-cosbench/cosbench_ex_ceph.conf @@ -0,0 +1,54 @@ +[global] + osd pool default size = 1 + auth cluster required = none + auth service required = none + auth client required = none + keyring = /tmp/cbt/ceph/keyring + osd pg bits = 8 + osd pgp bits = 8 + log to syslog = false + log file = /tmp/cbt/ceph/log/$name.log + public network = 192.168.110.0/24 + cluster network = 192.168.110.0/24 + rbd cache = true + osd scrub load threshold = 0.01 + osd scrub min interval = 137438953472 + osd scrub max interval = 137438953472 + osd deep scrub interval = 137438953472 + osd max scrubs = 16 + filestore merge threshold = 40 + filestore split multiple = 8 + osd op threads = 8 + mon pg warn max object skew = 100000 + mon pg warn min per osd = 0 + mon pg warn max per osd = 32768 + +[mon] + mon data = /tmp/cbt/ceph/mon.$id + +[mon.a] + host = inf1 + mon addr = 192.168.110.51:6789 + +[mon.b] + host = inf2 + mon addr = 192.168.110.52:6789 + +[mon.c] + host = inf3 + mon addr = 192.168.110.53:6789 + +[osd.0] + host = inf1 + osd data = /tmp/cbt/mnt/osd-device-0-data + osd journal = /dev/disk/by-partlabel/osd-device-0-journal + +[osd.1] + host = inf2 + osd data = /tmp/cbt/mnt/osd-device-0-data + osd journal = /dev/disk/by-partlabel/osd-device-0-journal + +[osd.2] + host = inf3 + osd data = /tmp/cbt/mnt/osd-device-0-data + osd journal = /dev/disk/by-partlabel/osd-device-0-journal