From b15df03094340584b5f56efd43dd2ca72cb62e2d Mon Sep 17 00:00:00 2001 From: Rodrigo Tobar Date: Mon, 8 Jul 2019 15:36:02 +0800 Subject: [PATCH] Incorporating start_dfms_cluster as "dlg cluster" This was a long due change. Now that start_dfms_cluster is in better shape we can more easily incorporate it into our dlg tool, and offer it more widely. In time the module will probably change name (it's the only "dfms" reference we still have in the code), but "dlg cluster" will remain. Signed-off-by: Rodrigo Tobar --- dlg/deploy/pawsey/start_dfms_cluster.py | 8 ++++---- dlg/tool.py | 1 + 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/dlg/deploy/pawsey/start_dfms_cluster.py b/dlg/deploy/pawsey/start_dfms_cluster.py index dc40348ee..c3925ffd1 100644 --- a/dlg/deploy/pawsey/start_dfms_cluster.py +++ b/dlg/deploy/pawsey/start_dfms_cluster.py @@ -241,9 +241,8 @@ def get_remote(opts): else: # == 'slurm' return remotes.SlurmRemote(opts, my_ip) -def main(): +def run(parser, args): - parser = argparse.ArgumentParser() parser.add_argument("-l", "--log_dir", help="Log directory (required)") # if this parameter is present, it means we want to get monitored @@ -308,7 +307,7 @@ def main(): parser.add_argument('-r', '--remote-mechanism', help='The mechanism used by this script to coordinate remote processes', choices=['mpi', 'slurm', 'lfs'], default='mpi') - options = parser.parse_args() + options = parser.parse_args(args) if options.check_interfaces: print("From netifaces: %s" % get_ip_via_netifaces()) @@ -388,4 +387,5 @@ def main(): utils.wait_or_kill(proc, 1e8, period=5) if __name__ == '__main__': - main() + print('WARNING: Prefer the dlg cluster command instead') + run(argparse.ArgumentParser(), sys.argv) diff --git a/dlg/tool.py b/dlg/tool.py index 684079895..8fbaaa298 100644 --- a/dlg/tool.py +++ b/dlg/tool.py @@ -165,6 +165,7 @@ def wrapped(*args, **kwargs): cmdwrap('proxy', 'A reverse proxy to be used in restricted environments to contact the Drop Managers')('dlg.deploy.pawsey.dfms_proxy:run') cmdwrap('monitor', 'A proxy to be used in conjunction with the dlg proxy in restricted environments')('dlg.deploy.pawsey.dfms_monitor:run') cmdwrap('lgweb', 'A Web server for the Logical Graph Editor')('dlg.dropmake.web.lg_web:run') +cmdwrap('cluster', 'Starts a DALiuGE cluster in HPC environments')('dlg.deploy.pawsey.start_dfms_cluster:run') @cmdwrap('version', 'Reports the DALiuGE version and exits') def version(parser, args):