Skip to content

Commit

Permalink
contrib/intel/jenkins: Add hardware type to summary
Browse files Browse the repository at this point in the history
Signed-off-by: Zach Dworkin <[email protected]>
  • Loading branch information
zachdworkin committed Jul 21, 2023
1 parent 92fed11 commit 44a4a42
Show file tree
Hide file tree
Showing 2 changed files with 40 additions and 4 deletions.
2 changes: 2 additions & 0 deletions contrib/intel/jenkins/runtests.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
import subprocess
import run
import common
import shlex

class ParseDict(argparse.Action):
def __call__(self, parser, namespace, values, option_string=None):
Expand Down Expand Up @@ -63,6 +64,7 @@ def __call__(self, parser, namespace, values, option_string=None):
hosts = []
if 'slurm' in os.environ['FABRIC']:
slurm_nodes = os.environ['SLURM_JOB_NODELIST'] # example cb[1-4,11]
common.run_command(shlex.split(f"sinfo --Format=Features -n {slurm_nodes}"))
if int(os.environ['SLURM_NNODES']) == 1:
hosts.append(slurm_nodes)
else:
Expand Down
42 changes: 38 additions & 4 deletions contrib/intel/jenkins/summary.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,10 @@ def __subclasshook__(cls, subclass):
return (
hasattr(subclass, "print_results")
and callable(subclass.print_results)
and hasattr(subclass, "check_features")
and callable(subclass.check_features)
and hasattr(subclass, "check_node")
and callable(subclass.check_node)
and hasattr(subclass, "check_name")
and callable(subclass.check_name)
and hasattr(subclass, "check_pass")
Expand Down Expand Up @@ -89,6 +93,8 @@ def __init__(self, logger, log_dir, prov, file_name, stage_name):
self.excluded_tests = []
self.test_name ='no_test'
self.name = 'no_name'
self.features = "no_features_found"
self.node = "no_node_found"

def print_results(self):
total = self.passes + self.fails
Expand All @@ -99,11 +105,13 @@ def print_results(self):
percent = self.passes/total * 100
if (verbose):
self.logger.log(
f"<>{self.stage_name}: ", lpad=1, ljust=40, end_delimiter = ''
f"<>{self.stage_name} : {self.node} : [{self.features}] : ",
lpad=1, ljust=80, end_delimiter = ''
)
else:
self.logger.log(
f"{self.stage_name}: ", lpad=1, ljust=40, end_delimiter = ''
f"{self.stage_name} : {self.node} : [{self.features}] : ",
lpad=1, ljust=80, end_delimiter = ''
)
self.logger.log(f"{self.passes}:{total} ", ljust=10, end_delimiter = '')
self.logger.log(f": {percent:.2f}% : ", ljust=12, end_delimiter = '')
Expand All @@ -129,6 +137,14 @@ def print_results(self):
for test in self.excluded_tests:
self.logger.log(f'{test}', lpad=3)

def check_features(self, previous, line):
if ('avail_features') in previous:
self.features = line.strip()

def check_node(self, line):
if ('slurm_nodelist' in line):
self.node = line.strip().split('=')[1]

def check_name(self, line):
return

Expand All @@ -149,9 +165,14 @@ def check_line(self, line):
self.check_exclude(line)

def read_file(self):
previous = ""
with open(self.file_path, 'r') as log_file:
for line in log_file:
self.check_line(line.lower())
line = line.lower()
self.check_features(previous, line)
self.check_node(line)
self.check_line(line)
previous = line

def summarize(self):
if not self.exists:
Expand Down Expand Up @@ -396,9 +417,14 @@ def check_line(self, line, log_file):
self.check_fails(line)

def read_file(self):
previous = ""
with open(self.file_path, 'r') as log_file:
for line in log_file:
self.check_line(line.lower(), log_file)
line = line.lower()
super().check_features(previous, line)
super().check_node(line)
self.check_line(line, log_file)
previous = line

for key in self.shmem_type.keys():
self.passes += self.shmem_type[key]['passes']
Expand Down Expand Up @@ -520,6 +546,14 @@ class DaosSummarizer(Summarizer):
def __init__(self, logger, log_dir, prov, file_name, stage_name):
super().__init__(logger, log_dir, prov, file_name, stage_name)

if (self.exists):
if ('verbs' in file_name):
self.node = cloudbees_config.prov_node_map['verbs']
if ('tcp' in file_name):
self.node = cloudbees_config.prov_node_map['tcp']

self.features = cloudbees_config.node_features

def check_name(self, line):
if "reading ." in line:
self.test_name = line.split('/')[len(line.split('/')) - 1] \
Expand Down

0 comments on commit 44a4a42

Please sign in to comment.