@@ -38,27 +38,49 @@ def run(args: list):
3838
3939 profiles = load_profiles ()
4040 num_runs = config ['runs' ]
41- for n in range (num_runs ):
41+ for cloud in config ['cloud' ]:
42+ if cloud not in profiles :
43+ print (f"WARNING: No profile found for { cloud } " )
44+ continue
45+ if not set_active_profile (cloud ):
46+ print (f"ERROR: Unable to set the profile for { cloud } " )
47+ continue
48+ if lib .KUBECONFIG is None :
49+ print (f"ERROR: No kubeconfig set for { cloud } " )
50+ continue
4251 print ("------------------------" )
43- print (f"Benchmarking run #{ n + 1 } " )
44- for cloud in config ['cloud' ]:
45- if cloud not in profiles :
46- print (f"WARNING: no profile for instance { cloud } " )
52+ print (f"Benchmarking: { cloud } " )
53+ for conf in config ['job_configs' ]:
54+ job_conf_path = f"rules/{ conf } .yml"
55+ if not helm .update ([job_conf_path ]):
56+ print (f"WARNING: job conf not found { conf } " )
4757 continue
48- if not set_active_profile (cloud ):
49- print (f"WARNING: unable to set { cloud } as the active profile" )
50- if lib .KUBECONFIG is None :
51- print (f"WARNGING: no kubeconfig for instance { cloud } " )
52- continue
53- for job_conf in config ['job_configs' ]:
54- job_conf_path = f"rules/{ job_conf } .yml"
55- if not helm .update ([job_conf_path ]):
56- print (f"WARNING: job conf not found { job_conf } " )
57- continue
58- history_name_prefix = f"Run { n } { job_conf } "
58+ for n in range (num_runs ):
59+ history_name_prefix = f"{ n } { cloud } { conf } "
5960 for workflow_conf in config ['workflow_conf' ]:
6061 workflow .run ([workflow_conf , history_name_prefix ])
6162
63+ # for n in range(num_runs):
64+ # print("------------------------")
65+ # print(f"Benchmarking run #{n+1}")
66+ # for cloud in config['cloud']:
67+ # if cloud not in profiles:
68+ # print(f"WARNING: no profile for instance {cloud}")
69+ # continue
70+ # if not set_active_profile(cloud):
71+ # print(f"WARNING: unable to set {cloud} as the active profile")
72+ # if lib.KUBECONFIG is None:
73+ # print(f"WARNGING: no kubeconfig for instance {cloud}")
74+ # continue
75+ # for job_conf in config['job_configs']:
76+ # job_conf_path = f"rules/{job_conf}.yml"
77+ # if not helm.update([job_conf_path]):
78+ # print(f"WARNING: job conf not found {job_conf}")
79+ # continue
80+ # history_name_prefix = f"Run {n} {job_conf}"
81+ # for workflow_conf in config['workflow_conf']:
82+ # workflow.run([workflow_conf, history_name_prefix])
83+
6284
6385def test (args : list ):
6486 print (common .GALAXY_SERVER )
@@ -73,15 +95,19 @@ def summarize(args: list):
7395 :return: None
7496 """
7597 row = ['' ] * 12
98+ print ("Workflow,History,Server,Tool ID,State,Slots,Memory,Runtime,CPU,Memory Limit,Memory Max usage,Memory Soft Limit" )
7699 for file in os .listdir (METRICS_DIR ):
77100 input_path = os .path .join (METRICS_DIR , file )
78101 with open (input_path , 'r' ) as f :
79102 data = json .load (f )
80- row [0 ] = data ['workflow_id' ]
81- row [1 ] = data ['history_id' ]
82- row [2 ] = data ['server' ] if data ['server' ] is not None else 'https://iu1.usegvl.org/galaxy'
83- row [3 ] = data ['metrics' ]['tool_id' ]
84- row [4 ] = data ['metrics' ]['state' ]
103+ row [0 ] = data ['run' ]
104+ row [1 ] = data ['cloud' ]
105+ row [2 ] = data ['conf' ]
106+ row [3 ] = data ['workflow_id' ]
107+ row [4 ] = data ['history_id' ]
108+ row [5 ] = data ['server' ] if data ['server' ] is not None else 'https://iu1.usegvl.org/galaxy'
109+ row [6 ] = data ['metrics' ]['tool_id' ]
110+ row [7 ] = data ['metrics' ]['state' ]
85111 add_metrics_to_row (data ['metrics' ]['job_metrics' ], row )
86112 print (',' .join (row ))
87113
@@ -91,7 +117,8 @@ def add_metrics_to_row(metrics_list: list, row: list):
91117 for job_metrics in metrics_list :
92118 if job_metrics ['name' ] in accept_metrics :
93119 index = accept_metrics .index (job_metrics ['name' ])
94- row [index + 5 ] = job_metrics ['raw_value' ]
120+ row [index + 8 ] = job_metrics ['raw_value' ]
121+ # row.append(job_metrics['raw_value'])
95122
96123
97124
0 commit comments