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

Uperf scale variables #250

Merged
merged 21 commits into from
Feb 12, 2021
Merged
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
19 changes: 18 additions & 1 deletion snafu/uperf_wrapper/trigger_uperf.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,13 @@ def __init__(self, args):
self.num_pairs = args.num_pairs
self.multus_client = args.multus_client
self.networkpolicy = args.networkpolicy
self.nodes_in_iter = args.nodes_in_iter
mrbojangles3 marked this conversation as resolved.
Show resolved Hide resolved
self.pod_density = args.pod_density
self.colocate = args.colocate
self.step_size = args.step_size
self.density_range = args.density_range
self.node_range = args.node_range
self.pod_id = args.pod_id

def _json_payload(self, results, data, sample):
processed = []
Expand Down Expand Up @@ -70,7 +77,15 @@ def _json_payload(self, results, data, sample):
"server_node": self.server_node,
"num_pairs": self.num_pairs,
"multus_client": self.multus_client,
"networkpolicy": self.networkpolicy
"networkpolicy": self.networkpolicy,
"density": int(self.pod_density),
"nodes_in_iter":int(self.nodes_in_iter),

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this gives error as pod_density default value is ""

"step_size" : self.step_size,
"colocate" : self.colocate,
"density_range" : [int(x) for x in self.density_range.split('-')],
"node_range" : [int(x) for x in self.node_range.split('-')],
"pod_id" : int(self.pod_id)

}
datapoint.update(data)
processed.append(datapoint)
Expand All @@ -80,6 +95,8 @@ def _json_payload(self, results, data, sample):
return processed

def _run_uperf(self):
# short to long cli option for uperf:
# verbose, all stats, raw output in ms, throughput collection interval is 1 second
cmd = "uperf -v -a -R -i 1 -m {}".format(self.workload)
process = subprocess.Popen(cmd, shell=True, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
stdout, stderr = process.communicate()
Expand Down
12 changes: 12 additions & 0 deletions snafu/uperf_wrapper/uperf_wrapper.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,18 @@ def __init__(self, parent_parser):
self.args.num_pairs = os.getenv("num_pairs", "")
self.args.multus_client = os.getenv("multus_client", "")
self.args.networkpolicy = os.getenv("networkpolicy", "")
self.args.nodes_in_iter = os.getenv("node_count", "")
self.args.pod_density = os.getenv("pod_count", "")

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

initialize pod_count to default value 0 to avoid above type conversion error

self.args.colocate = os.getenv("colocate","False")
self.args.step_size = os.getenv("stepsize","")
# density_range and node_range are defined and exported in the cr file
# it will appear in ES as startvalue-endvalue, for example
# 5-10, for a run that began with 5 nodes involved and ended with 10
self.args.density_range = os.getenv("density_range","")
self.args.node_range = os.getenv("node_range","")
# each node will run with density number of pods, this is the 0 based
# number of that pod, useful for displaying throughput of each density
self.args.pod_id = os.getenv("my_pod_idx","")

def run(self):
uperf_wrapper_obj = Trigger_uperf(self.args)
Expand Down