Skip to content

Commit

Permalink
Read node IPs from the env variable
Browse files Browse the repository at this point in the history
  • Loading branch information
ema-pe committed Nov 26, 2024
1 parent d8ec2b8 commit 0c704cf
Showing 1 changed file with 13 additions and 5 deletions.
18 changes: 13 additions & 5 deletions operator/docker/files/plot-results.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,7 @@
import matplotlib.pyplot as plt

# Dictionary with nodes' names and corresponding IP addresses
nodes_dict = {
'Node light': '172.16.238.10',
'Node mid': '172.16.238.11',
'Node heavy': '172.16.238.12',
}
nodes_dict = {}

# Necessary for plots of parallel attacks (merged results), specifies the maximum rate on a single node
max_load_on_node = 600
Expand Down Expand Up @@ -297,4 +293,16 @@ def main(argv):


if __name__ == '__main__':
raw_nodes = os.getenv("NODES")
if raw_nodes is None:
print("Missing 'NODES' env variable, exiting...")
exit(1)
nodes = raw_nodes.split(":")
if len(nodes) != 3:
print("Only 3 nodes are supported, exiting...")
exit(1)
nodes_dict["Node light"] = nodes[0]
nodes_dict["Node mid"] = nodes[1]
nodes_dict["Node heavy"] = nodes[2]

main(sys.argv[1:])

0 comments on commit 0c704cf

Please sign in to comment.