Skip to content

Commit

Permalink
progress tracked in docs/progress/10-31.md
Browse files Browse the repository at this point in the history
  • Loading branch information
dcvan24 committed Nov 1, 2018
1 parent e34f3e1 commit 1ee9ef5
Show file tree
Hide file tree
Showing 9 changed files with 61 additions and 60 deletions.
14 changes: 7 additions & 7 deletions benchmark/ansible/group_vars/all.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@ ansible_ssh_public_key_file: ~/.ssh/id_rsa.pub
ansible_ssh_user: centos
client:
dir: /
host: 10.52.100.3
n_parallel: 4
opts: mds_namespace=alpha
type: ceph
host: 10.52.100.9
n_parallel: 1
opts: vers=4
type: nfs
disks:
- delete_on_termination: true
mode: READ_WRITE
Expand Down Expand Up @@ -43,7 +43,7 @@ options:
version: 4.0
iozone:
docker_image: dchampion24/iozone:nfs
opts: -Rac -r 4k -s 32m
opts: -Rac -r 4k -s 512m
nfsv4:
mountpoint: /data
nfsd_image: heliumdatacommons/nfsd
Expand All @@ -70,6 +70,6 @@ project: helium-dc
running: true
supernet: 10.52.0.0/16
zone:
- name: us-east1-b
- end: 1
name: us-east1-b
start: 1
end: 1
4 changes: 4 additions & 0 deletions benchmark/ansible/playbooks/cephfs/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@
image: "{{ options.cephfs.daemon_image }}"
network_mode: host
command: mon
restart_policy: always
volumes:
- /opt/ceph/etc:/etc/ceph
- /opt/ceph/var/lib:/var/lib/ceph/
Expand All @@ -63,6 +64,7 @@
name: ceph-mgr
image: "{{ options.cephfs.daemon_image }}"
network_mode: host
restart_policy: always
command: mgr
volumes:
- /opt/ceph/etc:/etc/ceph
Expand Down Expand Up @@ -112,6 +114,7 @@
name: ceph-osd-{{ item }}
image: "{{ options.cephfs.daemon_image }}"
network_mode: host
restart_policy: always
pid_mode: host
privileged: true
command: osd
Expand All @@ -132,6 +135,7 @@
name: cephfs-{{ options.cephfs.name }}
image: "{{ options.cephfs.daemon_image }}"
network_mode: host
restart_policy: always
privileged: true
command: mds
volumes:
Expand Down
1 change: 1 addition & 0 deletions benchmark/ansible/playbooks/ganesha/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@
image: "{{ options.ganesha.docker_image }}"
network_mode: host
privileged: true
restart_policy: always
pull: true
volumes:
- "{{ options.ganesha.mountpoint }}:/data/nfs"
1 change: 1 addition & 0 deletions benchmark/ansible/playbooks/nfsv4/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@
image: "{{ options.nfsv4.nfsd_image }}"
network_mode: host
privileged: true
restart_policy: always
volumes:
- "{{ options.nfsv4.mountpoint }}:/data"
env:
Expand Down
4 changes: 4 additions & 0 deletions benchmark/ansible/playbooks/rbd/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@
name: ceph-mon
image: "{{ options.rbd.daemon_image }}"
network_mode: host
restart_policy: always
command: mon
volumes:
- /opt/ceph/etc:/etc/ceph
Expand All @@ -58,6 +59,7 @@
name: ceph-mgr
image: "{{ options.rbd.daemon_image }}"
network_mode: host
restart_policy: always
command: mgr
volumes:
- /opt/ceph/etc:/etc/ceph
Expand Down Expand Up @@ -111,6 +113,7 @@
pid_mode: host
privileged: true
command: osd
restart_policy: always
volumes:
- /opt/ceph/etc:/etc/ceph
- /opt/ceph/var/lib:/var/lib/ceph/
Expand Down Expand Up @@ -187,6 +190,7 @@
image: "{{ options.rbd.nfsd_image }}"
network_mode: host
privileged: true
restart_policy: always
volumes:
- "{{ options.rbd.mountpoint }}:/data"
env:
Expand Down
5 changes: 5 additions & 0 deletions benchmark/ansible/playbooks/rbdganesha/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@
name: ceph-mon
image: "{{ options.rbdganesha.daemon_image }}"
network_mode: host
restart_policy: always
command: mon
volumes:
- /opt/ceph/etc:/etc/ceph
Expand All @@ -56,6 +57,7 @@
- name: Run Ceph Manager
docker_container:
name: ceph-mgr
restart_policy: always
image: "{{ options.rbdganesha.daemon_image }}"
network_mode: host
command: mgr
Expand Down Expand Up @@ -94,6 +96,7 @@
name: ceph-zap-device
image: "{{ options.rbdganesha.daemon_image }}"
command: zap_device
restart_policy: always
privileged: true
auto_remove: true
volumes:
Expand All @@ -110,6 +113,7 @@
network_mode: host
pid_mode: host
privileged: true
restart_policy: always
command: osd
volumes:
- /opt/ceph/etc:/etc/ceph
Expand Down Expand Up @@ -171,6 +175,7 @@
name: nfs-ganesha
image: "{{ options.rbdganesha.ganesha_image }}"
network_mode: host
restart_policy: always
privileged: true
pull: true
volumes:
Expand Down
18 changes: 10 additions & 8 deletions benchmark/ansible/runner.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,11 @@

clients = {
# 'rbd': dict(host='10.52.100.16', type='nfs', dir='/', opts='vers=4'),
'cephfs': dict(host='10.52.100.3', type='ceph', dir='/', opts='mds_namespace=alpha'),
'cephfs': dict(host='10.52.100.11', type='ceph', dir='/', opts='mds_namespace=alpha'),
# 'nfsv4': dict(host='10.52.100.22', type='nfs', dir='/', opts='vers=4'),
# 'ganesha': dict(host='10.52.100.23', type='nfs', dir='/', opts='vers=4'),
'gfganesha': dict(host='10.52.100.11', type='nfs', dir='/data', opts='vers=4'),
'rbdganesha': dict(host='10.52.100.8', type='nfs', dir='/', opts='vers=4'),
'gfganesha': dict(host='10.52.100.3', type='nfs', dir='/data', opts='vers=4'),
'rbdganesha': dict(host='10.52.100.9', type='nfs', dir='/', opts='vers=4'),
}


Expand Down Expand Up @@ -51,8 +51,8 @@ def run_experiment():
start = False
if start:
sys.stdout.write(l)
sys.stdout.flush()
if not l and p.poll() is not None:
start = False
break
except KeyboardInterrupt as e:
p.kill()
Expand All @@ -65,6 +65,7 @@ def collect_output(name):
output_dir = [d for d in os.listdir(base_dir) if len(d) == 36]
if len(output_dir) == 0:
sys.stderr.write('Output directory for %s is not found'%name)
sys.stderr.flush()
sys.exit(1)
os.makedirs('%s/%s/%s'%(base_dir, exp_id, name), exist_ok=True)
print('Move %s/%s to %s/%s/%s'%(base_dir, output_dir[0], base_dir, exp_id, name))
Expand All @@ -90,17 +91,18 @@ def test_scalability():
dict(name='us-east1-b', start=1, end=1)
]
try:
n_parallel = 1
while n_parallel <= 16:
for _ in range(n_repeat):
for i in range(n_repeat):
n_parallel = 1
while n_parallel <= 16:
print('Parallel #: %d, repeat #: %d'%(n_parallel, i))
clis = shuffle_clients()
while clis:
name, params = clis.pop()
print('Testing %s ...'%name)
update_client_config(n_parallel=n_parallel, zone=zone, **params)
run_experiment()
collect_output(name)
n_parallel *= 2
n_parallel *= 2
except KeyboardInterrupt:
sys.stdout.write('Stopped\n')

Expand Down
30 changes: 15 additions & 15 deletions benchmark/tools/iozone/entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -37,20 +37,20 @@ if [ -n "${FS_TYPE}" ];then
fi
fi

rm -rf ${MOUNTPOINT}/${SUB_DIR} && mkdir -p ${MOUNTPOINT}/${SUB_DIR}
mkdir -p ${MOUNTPOINT}/${SUB_DIR}
cd ${MOUNTPOINT}/${SUB_DIR}

exec "${@}" | parse_output.py


function umount_fs() {
umount -f ${MOUNTPOINT} \
&& echo "${MOUNTPOINT} is umounted successfully" \
|| echo "Failed to unmount ${MOUNTPOINT}"
}


if [ -n "${FS_TYPE}" ];then
umount_fs
umount_fs
fi
${@} > /data/stats-${CLIENT_ID}.txt
python3 /bin/parse_output.py

#function umount_fs() {
# umount -f ${MOUNTPOINT} \
# && echo "${MOUNTPOINT} is umounted successfully" \
# || echo "Failed to unmount ${MOUNTPOINT}"
#}
#
#
#if [ -n "${FS_TYPE}" ];then
# umount_fs
# umount_fs
#fi
44 changes: 14 additions & 30 deletions benchmark/tools/iozone/parse_output.py
Original file line number Diff line number Diff line change
@@ -1,47 +1,31 @@
#!/usr/bin/env python3

import os
import sys
import json
import time


field_names = ('file_size', 'reclen', 'write', 'rewrite', 'read', 'reread', 'random_read',
'random_write', 'bkwd_read', 'record_rewrite', 'stride_read', 'fwrite', 'frewrite',
'fread', 'freread')


def read_stdin():
while True:
yield sys.stdin.readline().strip()


def parse_line(l):
res = {field_names[i]: int(f) for i, f in enumerate(l.split())}
sys.stdout.write(json.dumps(res) + '\n')
sys.stdout.flush()
return res


def filter_input():
def parse_output():
start = False
output = []
for l in read_stdin():
if 'reclen' in l:
start = True
continue
if not start: continue
if len(l.split()) < 14: break
output += [parse_line(l)]
return output


def write(output):
fn = '/data/stats-%s.json'%os.environ['CLIENT_ID']
with open(fn, 'w') as f:
json.dump(output, f, indent=2)
output_fn = '/data/stats-%s.txt'%os.environ['CLIENT_ID']
with open(output_fn) as f:
for l in f.readlines():
if 'reclen' in l:
start = True
continue
if not start: continue
if len(l.split()) < 14: break
output += [{field_names[i]: int(f) for i, f in enumerate(l.split())}]
if len(output) > 0:
json.dump(output, open('/data/stats-%s.json' % os.environ['CLIENT_ID'], 'w'), indent=2)
os.remove(output_fn)


if __name__ == '__main__':
write(filter_input())
parse_output()

0 comments on commit 1ee9ef5

Please sign in to comment.