arvados-cli 0.1.20130717045244 → 0.1.20130718170718

Sign up to get free protection for your applications and to get access to all the features.
Files changed (2) hide show
  1. data/bin/arv-run-pipeline-instance +36 -15
  2. metadata +5 -5
@@ -18,12 +18,21 @@
18
18
  # to finish. Just find out whether jobs are finished,
19
19
  # queued, or running for each component
20
20
  #
21
- # [--create-only] Do not try to satisfy any components. Just create an
22
- # instance, print its UUID to stdout, and exit.
21
+ # [--create-instance-only] Do not try to satisfy any components. Just
22
+ # create an instance, print its UUID to
23
+ # stdout, and exit.
23
24
  #
24
25
  # [--no-wait] Make only as much progress as possible without entering
25
26
  # a sleep/poll loop.
26
27
  #
28
+ # [--no-reuse-finished] Do not reuse existing outputs to satisfy
29
+ # pipeline components. Always submit a new job
30
+ # or use an existing job which has not yet
31
+ # finished.
32
+ #
33
+ # [--no-reuse] Do not reuse existing jobs to satisfy pipeline
34
+ # components. Submit a new job for every component.
35
+ #
27
36
  # [--debug] Print extra debugging information on stderr.
28
37
  #
29
38
  # [--debug-level N] Increase amount of debugging information. Default
@@ -137,6 +146,14 @@ p = Trollop::Parser.new do
137
146
  "Do not wait for jobs to finish. Just look up status, submit new jobs if needed, and exit.",
138
147
  :short => :none,
139
148
  :type => :boolean)
149
+ opt(:no_reuse_finished,
150
+ "Do not reuse existing outputs to satisfy pipeline components. Always submit a new job or use an existing job which has not yet finished.",
151
+ :short => :none,
152
+ :type => :boolean)
153
+ opt(:no_reuse,
154
+ "Do not reuse existing jobs to satisfy pipeline components. Submit a new job for every component.",
155
+ :short => :none,
156
+ :type => :boolean)
140
157
  opt(:debug,
141
158
  "Print extra debugging information on stderr.",
142
159
  :type => :boolean)
@@ -152,7 +169,7 @@ p = Trollop::Parser.new do
152
169
  "UUID of pipeline instance.",
153
170
  :short => :none,
154
171
  :type => :string)
155
- opt(:create_only,
172
+ opt(:create_instance_only,
156
173
  "Do not try to satisfy any components. Just create a pipeline instance and output its UUID.",
157
174
  :short => :none,
158
175
  :type => :boolean)
@@ -164,8 +181,8 @@ end
164
181
  $debuglevel = $options[:debug_level] || ($options[:debug] && 1) || 0
165
182
 
166
183
  if $options[:instance]
167
- if $options[:template] or $options[:create_only]
168
- abort "#{$0}: syntax error: --instance cannot be combined with --template or --create-only."
184
+ if $options[:template] or $options[:create_instance_only]
185
+ abort "#{$0}: syntax error: --instance cannot be combined with --template or --create-instance-only."
169
186
  end
170
187
  elsif not $options[:template]
171
188
  abort "#{$0}: syntax error: you must supply a --template or --instance."
@@ -280,7 +297,7 @@ class JobCache
280
297
  if j.is_a? Hash and j[:uuid]
281
298
  @cache[j[:uuid]] = j
282
299
  else
283
- debuglog "create job: #{j[:errors] rescue nil}"
300
+ debuglog "create job: #{j[:errors] rescue nil}", 0
284
301
  nil
285
302
  end
286
303
  end
@@ -382,10 +399,12 @@ class WhRunPipelineInstance
382
399
 
383
400
  c.delete :wait
384
401
  second_place_job = nil # satisfies component, but not finished yet
385
- JobCache.where(:script => c[:script],
386
- :script_parameters => c[:script_parameters],
387
- :script_version_descends_from => c[:script_version_descends_from]).
388
- each do |candidate_job|
402
+
403
+ (@options[:no_reuse] ? [] : JobCache.
404
+ where(script: c[:script],
405
+ script_parameters: c[:script_parameters],
406
+ script_version_descends_from: c[:script_version_descends_from])
407
+ ).each do |candidate_job|
389
408
  candidate_params_downcase = Hash[candidate_job[:script_parameters].
390
409
  map { |k,v| [k.downcase,v] }]
391
410
  c_params_downcase = Hash[c[:script_parameters].
@@ -404,9 +423,11 @@ class WhRunPipelineInstance
404
423
  end
405
424
 
406
425
  if candidate_job[:success]
407
- job = candidate_job
408
- debuglog "component #{cname} satisfied by job #{job[:uuid]} version #{job[:script_version]}"
409
- c[:job] = job
426
+ unless @options[:no_reuse_finished]
427
+ job = candidate_job
428
+ debuglog "component #{cname} satisfied by job #{job[:uuid]} version #{job[:script_version]}"
429
+ c[:job] = job
430
+ end
410
431
  else
411
432
  second_place_job ||= candidate_job
412
433
  end
@@ -429,7 +450,7 @@ class WhRunPipelineInstance
429
450
  debuglog "component #{cname} new job #{job[:uuid]}"
430
451
  c[:job] = job
431
452
  else
432
- debuglog "component #{cname} new job failed: #{job[:errors]}"
453
+ debuglog "component #{cname} new job failed"
433
454
  end
434
455
  end
435
456
  end
@@ -526,7 +547,7 @@ begin
526
547
  end
527
548
  runner.apply_parameters(p.leftovers)
528
549
  runner.setup_instance
529
- if $options[:create_only]
550
+ if $options[:create_instance_only]
530
551
  runner.instance.save
531
552
  puts runner.instance[:uuid]
532
553
  else
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: arvados-cli
3
3
  version: !ruby/object:Gem::Version
4
- hash: 40261434090467
4
+ hash: 40261436341415
5
5
  prerelease:
6
6
  segments:
7
7
  - 0
8
8
  - 1
9
- - 20130717045244
10
- version: 0.1.20130717045244
9
+ - 20130718170718
10
+ version: 0.1.20130718170718
11
11
  platform: ruby
12
12
  authors:
13
13
  - Arvados Authors
@@ -15,7 +15,7 @@ autorequire:
15
15
  bindir: bin
16
16
  cert_chain: []
17
17
 
18
- date: 2013-07-17 00:00:00 Z
18
+ date: 2013-07-18 00:00:00 Z
19
19
  dependencies:
20
20
  - !ruby/object:Gem::Dependency
21
21
  name: google-api-client
@@ -112,7 +112,7 @@ dependencies:
112
112
  version: 2.0.3
113
113
  type: :runtime
114
114
  version_requirements: *id006
115
- description: This is the Arvados SDK CLI gem, git revision 169b8e0907cd03859c6b32366d278ca9f79b8ef3
115
+ description: This is the Arvados SDK CLI gem, git revision 5295f29d6af880896b8ae4a5a7f1f747deb9b3e7
116
116
  email: gem-dev@clinicalfuture.com
117
117
  executables:
118
118
  - arv