usage: submit --my-queue testbox=vm-2p8g jobs/borrow-1h.yaml
if use this parameter, your job will be add to the queue which is $tbox_group~$USER
Signed-off-by: Xiao Shenwei xiaoshenwei96@163.com --- sbin/submit | 12 ++++++++++++ 1 file changed, 12 insertions(+)
diff --git a/sbin/submit b/sbin/submit index 9bba1018..53ea5bf0 100755 --- a/sbin/submit +++ b/sbin/submit @@ -16,6 +16,7 @@ opt_output_dir = nil opt_auto_define_files = false opt_monitor = false opt_monitor_query = {} +personal_job = false actions = ['output', 'stop']
options = OptionParser.new do |opts| @@ -54,6 +55,11 @@ options = OptionParser.new do |opts| ARGV.shift end end + + opts.on('--my-queue', 'add to personal queue') do + personal_job = true + end + end
options.parse!(ARGV) @@ -93,6 +99,11 @@ def find_jobfile(jobfile) exit 1 end
+def add_personal_queue(job) + queue = "#{job['tbox_group']}~#{ENV['USER']}" + job['queue'] = queue +end + ARGV.each do |jobfile| jobfile = find_jobfile(jobfile) jobs = Job2sh.new @@ -134,6 +145,7 @@ ARGV.each do |jobfile| job_hash_list << job_hash job_hash = job_hash.merge(sh_hash)
+ add_personal_queue(job_hash) if personal_job # save job to yaml if opt_output_dir prefix = File.join(opt_output_dir, File.basename(jobfile, '.yaml'))