Fixing PBench UPerf
Getting this to work, so we can implement it into a CI system +Adding message_sies +Adding instances +Password now optional Change-Id: Ib6da8a40d24ea3a27cfe14d07662a3dfb26ef690
This commit is contained in:
parent
f90b8b75d9
commit
9ef9517ecf
@ -272,6 +272,8 @@ rally:
|
|||||||
external_network: "public"
|
external_network: "public"
|
||||||
protocols: "tcp"
|
protocols: "tcp"
|
||||||
num_pairs: 1
|
num_pairs: 1
|
||||||
|
message_sizes: "64,1024,16384"
|
||||||
|
instances: "1,8,16,32,64"
|
||||||
test_types: "stream"
|
test_types: "stream"
|
||||||
samples: 1
|
samples: 1
|
||||||
send_results: True
|
send_results: True
|
||||||
|
@ -1,4 +1,5 @@
|
|||||||
# Helper Scripts
|
Helper Scripts
|
||||||
|
==============
|
||||||
|
|
||||||
The nova user-file, this file is incomplete, intentionally. The user must provide their internal PBench repo, which will have their PBench creds.
|
The nova user-file, this file is incomplete, intentionally. The user must provide their internal PBench repo, which will have their PBench creds.
|
||||||
|
|
||||||
|
@ -41,7 +41,6 @@ class BrowbeatPlugin(neutron_utils.NeutronScenario,
|
|||||||
flavor,
|
flavor,
|
||||||
zones,
|
zones,
|
||||||
user,
|
user,
|
||||||
password,
|
|
||||||
test_types,
|
test_types,
|
||||||
protocols,
|
protocols,
|
||||||
samples,
|
samples,
|
||||||
@ -49,6 +48,9 @@ class BrowbeatPlugin(neutron_utils.NeutronScenario,
|
|||||||
test_name,
|
test_name,
|
||||||
send_results=True,
|
send_results=True,
|
||||||
num_pairs=1,
|
num_pairs=1,
|
||||||
|
password="",
|
||||||
|
message_sizes=None,
|
||||||
|
instances=None,
|
||||||
elastic_host=None,
|
elastic_host=None,
|
||||||
elastic_port=None,
|
elastic_port=None,
|
||||||
cloudname=None,
|
cloudname=None,
|
||||||
@ -126,16 +128,17 @@ class BrowbeatPlugin(neutron_utils.NeutronScenario,
|
|||||||
self._wait_for_ssh(jump_ssh)
|
self._wait_for_ssh(jump_ssh)
|
||||||
|
|
||||||
# Write id_rsa to get to guests.
|
# Write id_rsa to get to guests.
|
||||||
|
self._run_command_over_ssh(jump_ssh, {'remote_path': "rm -rf ~/.ssh"})
|
||||||
self._run_command_over_ssh(jump_ssh, {'remote_path': "mkdir ~/.ssh"})
|
self._run_command_over_ssh(jump_ssh, {'remote_path': "mkdir ~/.ssh"})
|
||||||
jump_ssh.run(
|
jump_ssh.run(
|
||||||
"cat > ~/.ssh/id_rsa",
|
"cat > ~/.ssh/id_rsa",
|
||||||
stdin=self.context["user"]["keypair"]["private"])
|
stdin=self.context["user"]["keypair"]["private"])
|
||||||
self._run_command_over_ssh(jump_ssh,
|
|
||||||
{'remote_path': "chmod 0600 ~/.ssh/id_rsa"})
|
jump_ssh.execute("chmod 0600 ~/.ssh/id_rsa")
|
||||||
|
|
||||||
# Check status of guest
|
# Check status of guest
|
||||||
ready = False
|
ready = False
|
||||||
retry = 5
|
retry = 10
|
||||||
while (not ready):
|
while (not ready):
|
||||||
for sip in servers + clients:
|
for sip in servers + clients:
|
||||||
cmd = "ssh -o StrictHostKeyChecking=no {}@{} /bin/true".format(
|
cmd = "ssh -o StrictHostKeyChecking=no {}@{} /bin/true".format(
|
||||||
@ -146,20 +149,22 @@ class BrowbeatPlugin(neutron_utils.NeutronScenario,
|
|||||||
"Error : Issue reaching {} the guests through the Jump host".format(sip))
|
"Error : Issue reaching {} the guests through the Jump host".format(sip))
|
||||||
return 1
|
return 1
|
||||||
if s1_exitcode is 0:
|
if s1_exitcode is 0:
|
||||||
|
LOG.info("Server: {} ready".format(sip))
|
||||||
ready = True
|
ready = True
|
||||||
else:
|
else:
|
||||||
|
LOG.info("Error reaching server: {} error {}".format(sip,s1_stderr))
|
||||||
retry = retry - 1
|
retry = retry - 1
|
||||||
time.sleep(5)
|
time.sleep(10)
|
||||||
|
|
||||||
# Register pbench across FIP
|
# Register pbench across FIP
|
||||||
for sip in servers + clients:
|
for sip in servers + clients:
|
||||||
cmd = "{}/util-scripts/pbench-register-tool-set --remote={}".format(
|
cmd = "{}/util-scripts/pbench-register-tool-set --remote={}".format(
|
||||||
pbench_path, sip)
|
pbench_path, sip)
|
||||||
self._run_command_over_ssh(jump_ssh, {'remote_path': cmd})
|
jump_ssh.execute(cmd)
|
||||||
|
|
||||||
# Quick single test
|
# Quick single test
|
||||||
# debug = "--message-sizes=1024 --instances=1"
|
# debug = "--message-sizes=1024 --instances=1"
|
||||||
debug = None
|
debug = ""
|
||||||
|
|
||||||
# Start uperf against private address
|
# Start uperf against private address
|
||||||
uperf = "{}/bench-scripts/pbench-uperf --clients={} --servers={} --samples={} {}".format(
|
uperf = "{}/bench-scripts/pbench-uperf --clients={} --servers={} --samples={} {}".format(
|
||||||
@ -169,35 +174,43 @@ class BrowbeatPlugin(neutron_utils.NeutronScenario,
|
|||||||
protocols,
|
protocols,
|
||||||
test_name)
|
test_name)
|
||||||
|
|
||||||
|
if message_sizes is not None :
|
||||||
|
uperf += " --message-sizes={}".format(
|
||||||
|
message_sizes)
|
||||||
|
|
||||||
|
if instances is not None:
|
||||||
|
uperf += " --instances={}".format(
|
||||||
|
instances)
|
||||||
|
|
||||||
# Execute pbench-uperf
|
# Execute pbench-uperf
|
||||||
# execute returns, exitcode,stdout,stderr
|
# execute returns, exitcode,stdout,stderr
|
||||||
LOG.info("Starting Rally - PBench UPerf")
|
LOG.info("Starting Rally - PBench UPerf")
|
||||||
exitcode, stdout_uperf, stderr = self._run_command_over_ssh(
|
uperf_exitcode, stdout_uperf, stderr = jump_ssh.execute(uperf)
|
||||||
jump_ssh, {"remote_path": uperf})
|
|
||||||
|
|
||||||
# Prepare results
|
# Prepare results
|
||||||
cmd = "cat {}/uperf_{}*/result.csv".format(pbench_results, test_name)
|
cmd = "cat {}/uperf_{}*/result.csv".format(pbench_results, test_name)
|
||||||
exitcode, stdout, stderr = self._run_command_over_ssh(
|
exitcode, stdout, stderr = jump_ssh.execute(cmd)
|
||||||
jump_ssh, {'remote_path': cmd})
|
|
||||||
|
|
||||||
if send_results and exitcode is not 1:
|
if send_results :
|
||||||
cmd = "cat {}/uperf_{}*/result.json".format(
|
if uperf_exitcode is not 1:
|
||||||
pbench_results, test_name)
|
cmd = "cat {}/uperf_{}*/result.json".format(
|
||||||
exitcode, stdout_json, stderr = self._run_command_over_ssh(
|
pbench_results, test_name)
|
||||||
jump_ssh, {'remote_path': cmd})
|
LOG.info("Running command : {}".format(cmd))
|
||||||
|
exitcode, stdout_json, stderr = jump_ssh.execute(cmd)
|
||||||
|
LOG.info("Result: {}".format(stderr))
|
||||||
|
|
||||||
es_ts = datetime.datetime.utcnow()
|
es_ts = datetime.datetime.utcnow()
|
||||||
config = {
|
config = {
|
||||||
'elasticsearch': {
|
'elasticsearch': {
|
||||||
'host': elastic_host, 'port': elastic_port}, 'browbeat': {
|
'host': elastic_host, 'port': elastic_port}, 'browbeat': {
|
||||||
'cloud_name': cloudname, 'timestamp': es_ts}}
|
'cloud_name': cloudname, 'timestamp': es_ts}}
|
||||||
elastic = Elastic(config, 'pbench')
|
elastic = Elastic(config, 'pbench')
|
||||||
json_result = StringIO.StringIO(stdout_json)
|
json_result = StringIO.StringIO(stdout_json)
|
||||||
json_data = json.load(json_result)
|
json_data = json.load(json_result)
|
||||||
for iteration in json_data:
|
for iteration in json_data:
|
||||||
elastic.index_result(iteration)
|
elastic.index_result(iteration,test_name,'results/')
|
||||||
else:
|
else:
|
||||||
LOG.error("Error with PBench Results")
|
LOG.error("Error with PBench Results")
|
||||||
|
|
||||||
# Parse results
|
# Parse results
|
||||||
result = StringIO.StringIO('\n'.join(stdout.split('\n')[1:]))
|
result = StringIO.StringIO('\n'.join(stdout.split('\n')[1:]))
|
||||||
@ -216,5 +229,5 @@ class BrowbeatPlugin(neutron_utils.NeutronScenario,
|
|||||||
"label": "Gbps",
|
"label": "Gbps",
|
||||||
"data": report})
|
"data": report})
|
||||||
|
|
||||||
cmd = "{}/util-scripts/pbench-move-results".format(pbench_path)
|
cmd = "{}/util-scripts/pbench-move-results".format(pbench_path)
|
||||||
self._run_command_over_ssh(jump_ssh, {"remote_path": cmd})
|
self._run_command_over_ssh(jump_ssh, {"remote_path": cmd})
|
||||||
|
@ -24,6 +24,8 @@ BrowbeatPlugin.nova_create_pbench_uperf:
|
|||||||
test_types: '{{test_types}}'
|
test_types: '{{test_types}}'
|
||||||
protocols: '{{protocols}}'
|
protocols: '{{protocols}}'
|
||||||
samples: '{{samples}}'
|
samples: '{{samples}}'
|
||||||
|
message_sizes: '{{message_sizes}}'
|
||||||
|
instances: '{{instances}}'
|
||||||
test_name: '{{test_name}}'
|
test_name: '{{test_name}}'
|
||||||
send_results: {{send_results}}
|
send_results: {{send_results}}
|
||||||
cloudname: '{{cloudname}}'
|
cloudname: '{{cloudname}}'
|
||||||
|
Loading…
Reference in New Issue
Block a user