Skip to content
This repository was archived by the owner on Jan 26, 2026. It is now read-only.
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
53 commits
Select commit Hold shift + click to select a range
b4338c3
Error propagation: refactored to use exceptions for job launch.
Apr 17, 2018
2eae5c7
Corrections to clean lint (via pylint).
Apr 17, 2018
5852ff3
Current setup doesn't like non-relative imports.
Apr 17, 2018
052a099
Do indeed need to append modules to sys.path
Apr 17, 2018
ef8de9d
Added SLURM scripts for state queries.
Apr 18, 2018
60dfcbd
Corrected semantic errors.
Apr 18, 2018
664f92a
Allowing num nodes and res detection.
Apr 18, 2018
32d8081
slurmjobcontroller.py modifications to permit a partition and qos con…
Apr 18, 2018
7352bbf
slurmjobcontroller.py included Cray specific functionality from 1.1.13
Apr 18, 2018
3957dd9
sbatch timeout, plus stripping query output
Apr 18, 2018
52d3041
Merge branch 'master' into master
sean-m-brennan Apr 18, 2018
effa11f
Merge pull request #1 from jennfshr/master
sean-m-brennan Apr 18, 2018
a4c2339
Added QOS query
Apr 18, 2018
5d9b724
Cleaned up poor merge
Apr 18, 2018
6915527
Timeout on sbatch submission requires subprocess32 package.
Apr 19, 2018
4a0c6c8
CHanged DST QOS to existing 'high'.
Apr 19, 2018
6d83ef3
Ignore local site directory
Apr 23, 2018
54f5b1d
Remove site-specific SLURM info
Apr 23, 2018
ea7796c
Merge branch 'master' of github.com:sean-m-brennan/Pavilion
Apr 23, 2018
c949ffe
Needed default value for set_num_nodes
Apr 25, 2018
97fe110
Added slurm account specification plus defaults.
May 14, 2018
9089585
Made test configs (including default) machine agnostic.
May 14, 2018
c04229d
Allows for no input file to be specified, which just uses the preconf…
Jun 19, 2018
8179799
Debugged several run scenarios. Most tests in test_suites work.
Jun 21, 2018
a981177
Updated the README.md.
Jun 21, 2018
97c00a8
Modified README.md for readability.
Jun 21, 2018
7c619fa
Testing README.md.
Jun 21, 2018
e0120c4
Reformatting README.md.
Jun 21, 2018
34c45fe
Fixing README title.
Jun 21, 2018
9764b85
Further README.md modification.
Jun 21, 2018
e0ccf68
Further README.md modification.
Jun 21, 2018
71339c0
Modified mode file names to be more informative and updated the READM…
Jun 21, 2018
47a7c36
Added in files previously referenced but forgot to include.
Jun 21, 2018
70e6aa0
Added the files referenced in the previous commit attempt.
Jun 21, 2018
44b4b6e
Added scheduling policy links for each host.
Jun 21, 2018
7be9257
Adding links to READMEs.
Jun 21, 2018
77644b3
Modified view_test_suite to accept new CLI call format.
Aug 7, 2018
05b2a35
Removed test suites to keep in a separate repository.
Aug 9, 2018
551efb9
Modified testConfig file to find configurations based on the environm…
Aug 9, 2018
be3fb13
Added listTestSuite plugin. Use with PAV_CFG_ROOT environment variable.
Aug 9, 2018
c08d319
Enabled list_test_suite functionality.
Aug 9, 2018
d6bcab4
Added list_host_suite and list_mode_suite functions.
Aug 9, 2018
5ecc9cf
Modified get_results plugin to use PAV_CFG_ROOT and formatted PAV_CFG…
Aug 10, 2018
42f5bd6
Modified list_test_suite plugin to provided better, and better organi…
Aug 13, 2018
d009139
Initial correction for slurm info
Aug 16, 2018
a58d4d6
Modified view_test_suite to include customizations and started allowi…
Aug 16, 2018
8a9305a
Slurm info working now
Aug 16, 2018
4d14696
No longer tracking .pyc files in plugins directory.
Aug 16, 2018
315c380
Modified testConfig to allow for run.test_args to be a list.
Aug 30, 2018
4b71cb9
Testing change to testConfig for test_args list.
Aug 30, 2018
f4105f4
Modified testConfig again.
Aug 30, 2018
56089d4
Test args now can be a list, which can be from the inheritance mechanic.
Aug 31, 2018
6dedd67
Merge pull request #2 from nicholas-sly/master
sean-m-brennan Sep 4, 2018
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
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
*.pyc
PAV/scripts/site
54 changes: 34 additions & 20 deletions PAV/modules/basejobcontroller.py
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,8 @@
from subprocess import Popen, PIPE
import subprocess

from testConfig import decode_metavalue


def copy_file(src, dest):
try:
Expand All @@ -82,8 +84,17 @@ def copy_file(src, dest):
print('Error: %s' % e.strerror)


class JobController:

class JobException(Exception):
def __init__(self, exit_code, output):
super(JobException, self).__init__(output)
self.err_code = exit_code
self.err_str = os.strerror(exit_code)
self.msg = output



class JobController(object):
""" class to define the common actions for any job type """

@staticmethod
Expand Down Expand Up @@ -118,7 +129,7 @@ def __init__(self, uid, configs, job_log_file):
is_exec = os.access(mycmd, os.X_OK)
if not is_exec:
print mycmd + " Run command not executable!"
self.logger.error('%s %s not executable' % (self.lh + ":", mycmd))
self.logger.error(self.lh + ": " + mycmd + " not executable")
raise RuntimeError('Run command not executable')

self.logger.info(self.lh + " : init phase")
Expand All @@ -132,7 +143,7 @@ def __init__(self, uid, configs, job_log_file):
os.environ['GZ_TESTNAME'] = self.name
os.environ['PV_TESTEXEC'] = self.configs['run']['cmd']
os.environ['GZ_TESTEXEC'] = self.configs['run']['cmd']
pt = type(self.configs['run']['test_args'])
#pt = type(self.configs['run']['test_args'])
try:
# ++ PV_TEST_ARGS : Test arguments for job extracted from test suite
os.environ['GZ_TEST_PARAMS'] = self.configs['run']['test_args']
Expand Down Expand Up @@ -170,11 +181,14 @@ def setup_working_space(self):
return

# now setup and do the move
os.environ['PV_RUNHOME'] = ws + "/" + self.name + "__" + run_cmd.split("/",1)[0] + "." + JobController.now()
os.environ['PV_RUNHOME'] = ws + "/" + self.name + "__" + \
run_cmd.split("/", 1)[0] + "." + \
JobController.now()

print 'Working Space: %s' % os.environ['PV_RUNHOME']

self.logger.info(self.lh + " : " + 'Create temporary Working Space - ' + os.environ['PV_RUNHOME'])
self.logger.info(self.lh + " : " + 'Create temporary Working Space - '
+ os.environ['PV_RUNHOME'])
try:
os.makedirs(os.environ['PV_RUNHOME'], 0o775)
except OSError:
Expand All @@ -194,12 +208,14 @@ def setup_working_space(self):
from_loc = src_dir + "/"
if exclude_ws:
cmd = "rsync -a --exclude '" + \
exclude_ws + "' --exclude '*.[ocfh]' --exclude '*.bck' --exclude '*.tar' "
exclude_ws + "' --exclude '*.[ocfh]' --exclude" + \
" '*.bck' --exclude '*.tar' "
else:
cmd = "rsync -a --exclude '*.[ocfh]' --exclude 'pv_ws' --exclude '*.bck' --exclude '*.tar' "
cmd = "rsync -a --exclude '*.[ocfh]' --exclude 'pv_ws'" + \
" --exclude '*.bck' --exclude '*.tar' "
cmd += from_loc + " " + to_loc

self.logger.debug('%s : %s' % (self.lh, cmd))
self.logger.debug(self.lh + " : " + cmd)

# run the command
p = Popen(cmd, stdout=PIPE, stderr=PIPE, shell=True)
Expand All @@ -208,8 +224,9 @@ def setup_working_space(self):
if p.returncode or errors:
print "Error: failed copying data to working space!"
print [p.returncode, errors, output]
self.logger.info(self.lh + " failed copying data to working space!, skipping job: " + self.name +
"(Hint: check the job logfile)")
self.logger.info(self.lh + " failed copying data to working space!"
+ "skipping job: " + self.name +
"(Hint: check the job logfile)")
# self.logger.info(self.lh + p.returncode + errors + output)

def __str__(self):
Expand Down Expand Up @@ -272,10 +289,9 @@ def run_epilog():
print "- Run epilog script: " + str(es)
os.system(es)
print "- epilog script complete"
except KeyError, e:
# print 'I got a KeyError - no: "%s"' % str(e)
print "- No epilog script configured"
pass
except KeyError:
# print 'I got a KeyError - no: "%s"' % str(e)
print "- No epilog script configured"

def setup_job_info(self):

Expand All @@ -297,10 +313,10 @@ def setup_job_info(self):
# Support for a Splunk data log or file
try:
if self.configs['splunk']['state']:
os.environ['SPLUNK_GDL'] = str(self.configs['splunk']['global_data_file'])
os.environ['SPLUNK_GDL'] = decode_metavalue(self.configs['splunk']['global_data_file'])
print '<global data file> ' + os.environ['SPLUNK_GDL']
except KeyError, e:
print 'basejobcontroller:setup_job_info, Splunk config error - no: "%s"' % str(e)
pass

@staticmethod
def cleanup():
Expand Down Expand Up @@ -332,10 +348,8 @@ def cleanup():
copy_file(file2save, to_loc)
except KeyError, e:
print 'I got a KeyError - "%s"' % str(e)
pass
except:
print 'Warning!, copy failed!'
pass

# remove the working space ONLY if it was created
try:
Expand Down Expand Up @@ -367,7 +381,7 @@ def generate_trend_data_file(cls):
for line in lf:
# td_regex = os.environ['TD_REGX']
# match = re.search(td_regex, line, re.IGNORECASE)
match_str = "(<td>\s+(.*))"
match_str = r"(<td>\s+(.*))"
match = re.search(match_str, line, re.IGNORECASE)
# match = re.search("^(<td>\s+(.*))", line, re.IGNORECASE)
if match:
Expand All @@ -391,7 +405,7 @@ def process_trend_data():
log_dir = os.environ['PV_JOB_RESULTS_LOG_DIR']
cmd = os.environ['PVINSTALL'] + "/PAV/scripts/splunk/td2splunkData " + log_dir
os.system(cmd)
except KeyError, e:
except KeyError:
# Never set up properly so just move on...
# print 'basejobcontroller:process_trend_data, KeyError - no: "%s"' % str(e)
pass
Expand Down
2 changes: 1 addition & 1 deletion PAV/modules/helperutilities.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ def which(program):
def is_exe(fpath):
return os.path.isfile(fpath) and os.access(fpath, os.X_OK)

fpath, fname = os.path.split(program)
fpath, _ = os.path.split(program)
if fpath:
if is_exe(program):
return program
Expand Down
9 changes: 4 additions & 5 deletions PAV/modules/ldms.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,12 +63,12 @@
import logging


class LDMS():
class LDMS(object):

def __init__(self, my_te):
my_name = self.__class__.__name__
self.logger = logging.getLogger('pav.' + my_name)
self.logger.info('initialize %s to run: ' % my_name)
self.logger.info('initialize ' + my_name + ' to run: ')

self.pid = str(os.getpid())
self.lh = my_name
Expand Down Expand Up @@ -104,7 +104,6 @@ def create_output_dir(self):
print " Error creating metrics directory : \n\t" + output_dir
self.logger.info(self.lh + " Error creating metrics directory : \n\t" + output_dir)
output_dir = ''
pass

print "Created ldms metrics dir: " + output_dir

Expand All @@ -128,14 +127,14 @@ def start():

text_file = open(outfile, "w")
try:
subprocess.Popen(os.environ['LDMS_START_CMD'], stdout=text_file, stdin=open(os.devnull), shell=True)
subprocess.Popen(os.environ['LDMS_START_CMD'], stdout=text_file,
stdin=open(os.devnull), shell=True)
except subprocess.CalledProcessError as e:
ret = e.returncode
if ret in (1, 2):
print("the command failed")
elif ret in (3, 4, 5):
print("the command failed very much")
pass

@staticmethod
def status(jid):
Expand Down
Loading