arvados-cli 0.1.20140826202602 → 0.1.20140827170424

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: bd9ebb9dddabe78ad6456c8b5c23279b368b5305
4
- data.tar.gz: 2c834b9059f65215ef592b2af0e7d8a9aebe4ef8
3
+ metadata.gz: 90cc9aaaf46a6cf3ec9bf6061312ccdceb0f48bf
4
+ data.tar.gz: 8f9cbaf8c21301b8e1d3a9caf7937447bc64b757
5
5
  SHA512:
6
- metadata.gz: cfe2966a72aa3e109bf42d00fac24309aacebb07557190db14a94c7bfd4579ebe535c2a8be68fcde68f5f818de20252b00771b2385fdecdc05b7b1043c744d7d
7
- data.tar.gz: c8e032348584d3b812e75be31371773b783c918a3a6d4c82c1d562d3979f2bc1aaf75dbd4f6331f4aa1c58b09510babed4df61a740b25d7bd316839604cb6ea8
6
+ metadata.gz: 858b280278788af73c75afd2b67a3b16ccc76d461c116e7884736b008ae8f734df529286e8fc273a248a3ca1e7af77ddd627d090d19f42de4a2492bae104a990
7
+ data.tar.gz: 3ad8893233125003588dc393245703b76debe28b79a6fd73faaf4c094625ecf5c174c6de253a23ea64bb6178e70ef4d9656e9fc85d1676a6ca8b05ea007af1df
@@ -518,7 +518,6 @@ class WhRunPipelineInstance
518
518
  :script_version => c[:script_version],
519
519
  :repository => c[:repository],
520
520
  :nondeterministic => c[:nondeterministic],
521
- :output_is_persistent => c[:output_is_persistent] || false,
522
521
  :runtime_constraints => c[:runtime_constraints],
523
522
  :owner_uuid => owner_uuid,
524
523
  }, {
@@ -562,37 +561,34 @@ class WhRunPipelineInstance
562
561
  # This is my first time discovering that the job
563
562
  # succeeded. (At the top of this loop, I was still
564
563
  # waiting for it to finish.)
565
- if c[:output_is_persistent]
566
- # I need to make sure a resources/wants link is in
567
- # place to protect the output from garbage
568
- # collection. (Normally Crunch does this for me, but
569
- # here I might be reusing the output of someone else's
570
- # job and I need to make sure it's understood that the
571
- # output is valuable to me, too.)
572
- wanted = c[:job][:output]
573
- debuglog "checking for existing persistence link for #{wanted}"
574
- @my_user_uuid ||= $arv.user.current[:uuid]
575
- links = $arv.link.list(limit: 1,
576
- filters:
577
- [%w(link_class = resources),
578
- %w(name = wants),
579
- %w(tail_uuid =) + [@my_user_uuid],
580
- %w(head_uuid =) + [wanted]
581
- ])[:items]
582
- if links.any?
583
- debuglog "link already exists, uuid #{links.first[:uuid]}"
584
- else
585
- newlink = $arv.link.create link: \
586
- {
587
- link_class: 'resources',
588
- name: 'wants',
589
- tail_kind: 'arvados#user',
590
- tail_uuid: @my_user_uuid,
591
- head_kind: 'arvados#collection',
592
- head_uuid: wanted,
593
- owner_uuid: owner_uuid
564
+
565
+ debuglog "names: #{@instance[:name]} #{@template[:name]}", 0
566
+ if (not @instance[:name].nil?) and (not @instance[:name].empty?)
567
+ pipeline_name = @instance[:name]
568
+ else
569
+ fetch_template(@instance[:pipeline_template_uuid])
570
+ pipeline_name = @template[:name]
571
+ end
572
+ if c[:output_name] != false
573
+ output_name = c[:output_name] || "Output of #{cname} of #{pipeline_name}"
574
+ # Create a collection located in the same project as the pipeline with the contents of the output.
575
+ portable_data_hash = c[:job][:output]
576
+ collections = $arv.collection.list(limit: 1,
577
+ filters: [['portable_data_hash', '=', portable_data_hash]],
578
+ select: ["portable_data_hash", "manifest_text"]
579
+ )[:items]
580
+ if collections.any?
581
+ newcollection = {
582
+ owner_uuid: owner_uuid,
583
+ name: "#{output_name} at #{c[:job][:finished_at]}",
584
+ portable_data_hash: collections.first[:portable_data_hash],
585
+ manifest_text: collections.first[:manifest_text]
594
586
  }
595
- debuglog "added link, uuid #{newlink[:uuid]}"
587
+ debuglog "Creating collection #{newcollection}", 0
588
+ newcollection_actual = $arv.collection.create collection: newcollection
589
+ c[:output_uuid] = newcollection_actual[:uuid]
590
+ else
591
+ debuglog "Could not find a collection with portable data hash #{portable_data_hash}", 0
596
592
  end
597
593
  end
598
594
  end
data/bin/crunch-job CHANGED
@@ -853,37 +853,15 @@ else {
853
853
  eval {
854
854
  open(my $orig_manifest, '-|', 'arv-get', $collated_output)
855
855
  or die "failed to get collated manifest: $!";
856
- # Read the original manifest, and strip permission hints from it,
857
- # so we can put the result in a Collection.
858
- my @stripped_manifest_lines = ();
859
856
  my $orig_manifest_text = '';
860
857
  while (my $manifest_line = <$orig_manifest>) {
861
858
  $orig_manifest_text .= $manifest_line;
862
- my @words = split(/ /, $manifest_line, -1);
863
- foreach my $ii (0..$#words) {
864
- if ($words[$ii] =~ /^[0-9a-f]{32}\+/) {
865
- $words[$ii] =~ s/\+A[0-9a-f]{40}@[0-9a-f]{8}\b//;
866
- }
867
- }
868
- push(@stripped_manifest_lines, join(" ", @words));
869
859
  }
870
- my $stripped_manifest_text = join("", @stripped_manifest_lines);
871
860
  my $output = $arv->{'collections'}->{'create'}->execute('collection' => {
872
- 'uuid' => md5_hex($stripped_manifest_text),
873
861
  'manifest_text' => $orig_manifest_text,
874
862
  });
875
- Log(undef, "output " . $output->{uuid});
876
- $Job->update_attributes('output' => $output->{uuid}) if $job_has_uuid;
877
- if ($Job->{'output_is_persistent'}) {
878
- $arv->{'links'}->{'create'}->execute('link' => {
879
- 'tail_kind' => 'arvados#user',
880
- 'tail_uuid' => $User->{'uuid'},
881
- 'head_kind' => 'arvados#collection',
882
- 'head_uuid' => $Job->{'output'},
883
- 'link_class' => 'resources',
884
- 'name' => 'wants',
885
- });
886
- }
863
+ Log(undef, "output " . $output->{portable_data_hash});
864
+ $Job->update_attributes('output' => $output->{portable_data_hash}) if $job_has_uuid;
887
865
  };
888
866
  if ($@) {
889
867
  Log (undef, "Failed to register output manifest: $@");
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: arvados-cli
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.20140826202602
4
+ version: 0.1.20140827170424
5
5
  platform: ruby
6
6
  authors:
7
7
  - Arvados Authors
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-08-26 00:00:00.000000000 Z
11
+ date: 2014-08-27 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: arvados
@@ -166,7 +166,7 @@ dependencies:
166
166
  - - "<"
167
167
  - !ruby/object:Gem::Version
168
168
  version: 1.0.0
169
- description: This is the Arvados SDK CLI gem, git revision 63330000144108862a4e2b02a7a8fa124d01163e
169
+ description: This is the Arvados SDK CLI gem, git revision 0042e4b42d9f4d3900aefc68617cb28c5a61a522
170
170
  email: gem-dev@curoverse.com
171
171
  executables:
172
172
  - arv