From c8efc013675f9aa53964d0bad3a6d870e8d5519d Mon Sep 17 00:00:00 2001 From: tqchen Date: Mon, 9 Mar 2015 14:36:44 -0700 Subject: [PATCH] more complicated yarn script --- tracker/rabit_yarn.py | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/tracker/rabit_yarn.py b/tracker/rabit_yarn.py index 3a4937278..81f590851 100755 --- a/tracker/rabit_yarn.py +++ b/tracker/rabit_yarn.py @@ -14,7 +14,13 @@ import rabit_tracker as tracker WRAPPER_PATH = os.path.dirname(__file__) + '/../wrapper' YARN_JAR_PATH = os.path.dirname(__file__) + '/../yarn/rabit-yarn.jar' -assert os.path.exists(YARN_JAR_PATH), ("cannot find \"%s\", please run build.sh on the yarn folder" % YARN_JAR_PATH) +if not os.path.exists(YARN_JAR_PATH): + warnings.warn("cannot find \"%s\", I will try to run build" % YARN_JAR_PATH) + cmd = 'cd %s;./build.sh' % (os.path.dirname(__file__) + '/../yarn/') + print cmd + subprocess.check_call(cmd, shell = True, env = os.environ) + assert os.path.exists(YARN_JAR_PATH), "failed to build rabit-yarn.jar, try it manually" + hadoop_binary = 'hadoop' # code hadoop_home = os.getenv('HADOOP_HOME') @@ -116,7 +122,8 @@ def submit_yarn(nworker, worker_args, worker_env): cmd += ' -jobname %s ' % args.jobname cmd += ' -tempdir %s ' % args.tempdir cmd += (' '.join(args.command + worker_args)) - print cmd + if args.verbose != 0: + print cmd subprocess.check_call(cmd, shell = True, env = env) tracker.submit(args.nworker, [], fun_submit = submit_yarn, verbose = args.verbose, hostIP = args.host_ip)