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

Update cosbench.py to add cosbench user/subuser if use_existing is False #63

Closed
wants to merge 2 commits into from
Closed
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
12 changes: 12 additions & 0 deletions benchmark/cosbench.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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()
Expand Down
47 changes: 47 additions & 0 deletions example/wip-cosbench/cosbench_ex.yaml
Original file line number Diff line number Diff line change
@@ -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]
54 changes: 54 additions & 0 deletions example/wip-cosbench/cosbench_ex_ceph.conf
Original file line number Diff line number Diff line change
@@ -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