add option queue
This commit is contained in:
parent
5dc843cff3
commit
f3e867ed97
@ -39,6 +39,8 @@ parser.add_argument('-hip', '--host_ip', default='auto', type=str,
|
|||||||
help = 'host IP address if cannot be automatically guessed, specify the IP of submission machine')
|
help = 'host IP address if cannot be automatically guessed, specify the IP of submission machine')
|
||||||
parser.add_argument('-v', '--verbose', default=0, choices=[0, 1], type=int,
|
parser.add_argument('-v', '--verbose', default=0, choices=[0, 1], type=int,
|
||||||
help = 'print more messages into the console')
|
help = 'print more messages into the console')
|
||||||
|
parser.add_argument('-q', '--queue', default='default', type=str,
|
||||||
|
help = 'the queue we want to submit the job to')
|
||||||
parser.add_argument('-ac', '--auto_file_cache', default=1, choices=[0, 1], type=int,
|
parser.add_argument('-ac', '--auto_file_cache', default=1, choices=[0, 1], type=int,
|
||||||
help = 'whether automatically cache the files in the command to hadoop localfile, this is on by default')
|
help = 'whether automatically cache the files in the command to hadoop localfile, this is on by default')
|
||||||
parser.add_argument('-f', '--files', default = [], action='append',
|
parser.add_argument('-f', '--files', default = [], action='append',
|
||||||
@ -122,6 +124,7 @@ def submit_yarn(nworker, worker_args, worker_env):
|
|||||||
cmd += ' -file %s' % f
|
cmd += ' -file %s' % f
|
||||||
cmd += ' -jobname %s ' % args.jobname
|
cmd += ' -jobname %s ' % args.jobname
|
||||||
cmd += ' -tempdir %s ' % args.tempdir
|
cmd += ' -tempdir %s ' % args.tempdir
|
||||||
|
cmd += ' -queue %s ' % args.queue
|
||||||
cmd += (' '.join(['./run_hdfs_prog.py'] + args.command + worker_args))
|
cmd += (' '.join(['./run_hdfs_prog.py'] + args.command + worker_args))
|
||||||
if args.verbose != 0:
|
if args.verbose != 0:
|
||||||
print cmd
|
print cmd
|
||||||
|
|||||||
@ -1,4 +1,8 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
if [ ! -d bin ]; then
|
||||||
|
mkdir bin
|
||||||
|
fi
|
||||||
|
|
||||||
CPATH=`${HADOOP_HOME}/bin/hadoop classpath`
|
CPATH=`${HADOOP_HOME}/bin/hadoop classpath`
|
||||||
javac -cp $CPATH -d bin src/org/apache/hadoop/yarn/rabit/*
|
javac -cp $CPATH -d bin src/org/apache/hadoop/yarn/rabit/*
|
||||||
jar cf rabit-yarn.jar -C bin .
|
jar cf rabit-yarn.jar -C bin .
|
||||||
|
|||||||
@ -48,6 +48,8 @@ public class Client {
|
|||||||
private String userName = "";
|
private String userName = "";
|
||||||
// job name
|
// job name
|
||||||
private String jobName = "";
|
private String jobName = "";
|
||||||
|
// queue
|
||||||
|
private String queue = "default";
|
||||||
/**
|
/**
|
||||||
* constructor
|
* constructor
|
||||||
* @throws IOException
|
* @throws IOException
|
||||||
@ -158,6 +160,8 @@ public class Client {
|
|||||||
this.jobName = args[++i];
|
this.jobName = args[++i];
|
||||||
} else if(args[i].equals("-tempdir")) {
|
} else if(args[i].equals("-tempdir")) {
|
||||||
this.tempdir = args[++i];
|
this.tempdir = args[++i];
|
||||||
|
} else if(args[i].equals("-queue")) {
|
||||||
|
this.queue = args[++i];
|
||||||
} else {
|
} else {
|
||||||
sargs.append(" ");
|
sargs.append(" ");
|
||||||
sargs.append(args[i]);
|
sargs.append(args[i]);
|
||||||
@ -210,7 +214,7 @@ public class Client {
|
|||||||
appContext.setApplicationName(jobName + ":RABIT-YARN");
|
appContext.setApplicationName(jobName + ":RABIT-YARN");
|
||||||
appContext.setAMContainerSpec(amContainer);
|
appContext.setAMContainerSpec(amContainer);
|
||||||
appContext.setResource(capability);
|
appContext.setResource(capability);
|
||||||
appContext.setQueue("default");
|
appContext.setQueue(queue);
|
||||||
//appContext.setUser(userName);
|
//appContext.setUser(userName);
|
||||||
LOG.info("Submitting application " + appId);
|
LOG.info("Submitting application " + appId);
|
||||||
yarnClient.submitApplication(appContext);
|
yarnClient.submitApplication(appContext);
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user