Skip to content

Commit

Permalink
1.4.85
Browse files Browse the repository at this point in the history
  • Loading branch information
tmaeno committed Sep 2, 2021
1 parent 3ca815d commit 2c9256f
Show file tree
Hide file tree
Showing 9 changed files with 41 additions and 344 deletions.
4 changes: 4 additions & 0 deletions ChangeLog.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
** Release Notes

1.4.86
* pflow -> pchain
* server-side check for pchain

1.4.85
* making pandatools symlink for backward-compatibility

Expand Down
5 changes: 4 additions & 1 deletion pandaclient/Client.py
Original file line number Diff line number Diff line change
Expand Up @@ -1512,11 +1512,12 @@ def send_file_recovery_request(task_id, dry_run=False, verbose=False):


# send workflow request
def send_workflow_request(params, relay_host=None, verbose=False):
def send_workflow_request(params, relay_host=None, check=False, verbose=False):
"""Send a workflow request
args:
params: a workflow request dictionary
relay_host: relay hostname to send request
check: only check the workflow description
verbose: True to see verbose message
returns:
status code
Expand All @@ -1539,6 +1540,8 @@ def send_workflow_request(params, relay_host=None, verbose=False):
url += '/put_workflow_request'
try:
data = {'data': json.dumps(params)}
if check:
data['check'] = True
status, output = curl.post(url, data, compress_body=True, is_json=True)
if status != 0:
tmp_log.error(output)
Expand Down
2 changes: 1 addition & 1 deletion pandaclient/PandaToolsPkgInfo.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
release_version = "1.4.85"
release_version = "1.4.86"
40 changes: 29 additions & 11 deletions pandaclient/PflowScript.py → pandaclient/PchainScript.py
Original file line number Diff line number Diff line change
Expand Up @@ -92,10 +92,6 @@ def main():
print("Version: %s" % PandaToolsPkgInfo.release_version)
sys.exit(0)

if options.checkOnly:
pflow_checker.check(options.cwl, options.yaml, options.outDS, options.debugCheck, tmpLog)
sys.exit(0)

# check grid-proxy
PsubUtils.check_proxy(options.verbose, options.vomsRoles)

Expand Down Expand Up @@ -174,7 +170,11 @@ def _onExit(dir, del_command):
prun_exec_str += ' --noSubmit'
if options.verbose:
prun_exec_str += ' -v'
taskParamMap = PrunScript.main(get_taskparams=True, ext_args=shlex.split(prun_exec_str))
arg_dict = {'get_taskparams': True,
'ext_args': shlex.split(prun_exec_str)}
if options.checkOnly:
arg_dict['dry_mode'] = True
taskParamMap = PrunScript.main(**arg_dict)
del taskParamMap['noInput']
del taskParamMap['nEvents']
del taskParamMap['nEventsPerJob']
Expand All @@ -193,19 +193,37 @@ def _onExit(dir, del_command):
print('%s : %s' % (tmpKey, taskParamMap[tmpKey]))
sys.exit(0)

tmpLog.info("submit {0}".format(options.outDS))
tmpStat, tmpOut = Client.send_workflow_request(params, options.relayHost, options.verbose)
data = {'relay_host': options.relayHost, 'verbose': options.verbose}
if not options.checkOnly:
action_type = 'submit'
else:
action_type = 'check'
data['check'] = True

# action
tmpLog.info("{} workflow {}".format(action_type, options.outDS))
tmpStat, tmpOut = Client.send_workflow_request(params, **data)

# result
exitCode = None
if tmpStat != 0:
tmpStr = "task submission failed with {0}".format(tmpStat)
tmpStr = "workflow {} failed with {}".format(action_type, tmpStat)
tmpLog.error(tmpStr)
exitCode = 1
if tmpOut[0]:
tmpStr = tmpOut[1]
tmpLog.info(tmpStr)
if not options.checkOnly:
tmpStr = tmpOut[1]
tmpLog.info(tmpStr)
else:
check_stat = tmpOut[1]['status']
check_log = 'check log from the server\n' + tmpOut[1]['log']
tmpLog.info(check_log)
if check_stat:
tmpLog.info('successfully verified workflow description')
else:
tmpLog.error('workflow description is corrupted')
else:
tmpStr = "task submission failed. {0}".format(tmpOut[1])
tmpStr = "workflow {} failed. {}".format(action_type, tmpOut[1])
tmpLog.error(tmpStr)
exitCode = 1
return exitCode
89 changes: 0 additions & 89 deletions pandaclient/pflow_checker.py

This file was deleted.

4 changes: 2 additions & 2 deletions scripts/pflow → scripts/pchain
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ esac
done

if [ -z "$PANDA_PY3" ]; then
/usr/bin/python -u -W ignore -c "from pandaclient.PflowScript import main; main()" "$@"
/usr/bin/python -u -W ignore -c "from pandaclient.PchainScript import main; main()" "$@"
else
/usr/bin/python3 -u -W ignore -c "from pandaclient.PflowScript import main; main()" "$@"
/usr/bin/python3 -u -W ignore -c "from pandaclient.PchainScript import main; main()" "$@"
fi
6 changes: 1 addition & 5 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,7 @@ def run (self):
'scripts/pbook',
'scripts/pathena',
'scripts/phpo',
'scripts/pflow',
'scripts/pchain',
],
data_files = [ ('etc/panda', ['templates/panda_setup.sh.template',
'templates/panda_setup.csh.template',
Expand All @@ -193,10 +193,6 @@ def run (self):
'share/ConfigExtractor.py',
]
),
('etc/panda/share/cwl', ['share/cwl/prun.cwl',
'share/cwl/phpo.cwl',
]
),
],
cmdclass={
'install': install_panda,
Expand Down
93 changes: 0 additions & 93 deletions share/cwl/phpo.cwl

This file was deleted.

Loading

0 comments on commit 2c9256f

Please sign in to comment.