arvados-cli 0.1.20140603110100 → 0.1.20140603160755

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (3) hide show
  1. checksums.yaml +4 -4
  2. data/bin/crunch-job +24 -7
  3. metadata +2 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 71dfc12f59d30b8923a6e7396811dbb522167171
4
- data.tar.gz: f7b02e47f844ee1f51144dfd57e39acd143b0a64
3
+ metadata.gz: 5b102c049fb1474dde6387bcf04eb8fb4fbaf6b8
4
+ data.tar.gz: 4c9886bb4a024837061b9b62cd3da4b9412ac695
5
5
  SHA512:
6
- metadata.gz: 5fbcdc30e1ab8e8a1131b8bb1b319f542432d774f28c94bb656f1037f7121d1b35307ed0635ebc1c151c1cd5f1a25f39ead203f148d353b49d97bf721234d7f8
7
- data.tar.gz: 9c0ca35d14d329eb9b93302aacd08d6d901dd2c1bbf8c26eb5ca60ae3af449dd48966fbd35fcad63d31d19fedfe4e42348c8013a6b59976d002b2b038fae69f8
6
+ metadata.gz: a420ecd6b4e996bed10ed546236afe2ef037782a1a69622a05a924e0f9a8684b9adf3952bd0ae71b1275abd0958f4ebe8b56a282be67808ea37ecccd870458e6
7
+ data.tar.gz: 8337f875d4d1aa7de6f8427450821d258a9e0b6a6895a01c0f6845b0735f25c23c25c8305df9502a10fbdd2cb6390b5c4f2665753173504c77abc9bb91e0bb83
data/bin/crunch-job CHANGED
@@ -76,6 +76,7 @@ use strict;
76
76
  use POSIX ':sys_wait_h';
77
77
  use Fcntl qw(F_GETFL F_SETFL O_NONBLOCK);
78
78
  use Arvados;
79
+ use Digest::MD5 qw(md5_hex);
79
80
  use Getopt::Long;
80
81
  use IPC::Open2;
81
82
  use IO::Select;
@@ -799,21 +800,37 @@ goto ONELEVEL if !defined $main::success;
799
800
 
800
801
  release_allocation();
801
802
  freeze();
803
+ my $collated_output = &collate_output();
804
+
802
805
  if ($job_has_uuid) {
803
- $Job->update_attributes('output' => &collate_output(),
804
- 'running' => 0,
805
- 'success' => $Job->{'output'} && $main::success,
806
+ $Job->update_attributes('running' => 0,
807
+ 'success' => $collated_output && $main::success,
806
808
  'finished_at' => scalar gmtime)
807
809
  }
808
810
 
809
- if ($Job->{'output'})
811
+ if ($collated_output)
810
812
  {
811
813
  eval {
812
- my $manifest_text = `arv keep get ''\Q$Job->{'output'}\E`;
813
- $arv->{'collections'}->{'create'}->execute('collection' => {
814
- 'uuid' => $Job->{'output'},
814
+ open(my $orig_manifest, '-|', 'arv', 'keep', 'get', $collated_output)
815
+ or die "failed to get collated manifest: $!";
816
+ # Read the original manifest, and strip permission hints from it,
817
+ # so we can put the result in a Collection.
818
+ my @manifest_lines = ();
819
+ while (my $manifest_line = <$orig_manifest>) {
820
+ my @words = split(/ /, $manifest_line, -1);
821
+ foreach my $ii (0..$#words) {
822
+ if ($words[$ii] =~ /^[0-9a-f]{32}\+/) {
823
+ $words[$ii] =~ s/\+A[0-9a-f]{40}@[0-9a-f]{8}\b//;
824
+ }
825
+ }
826
+ push(@manifest_lines, join(" ", @words));
827
+ }
828
+ my $manifest_text = join("", @manifest_lines);
829
+ my $output = $arv->{'collections'}->{'create'}->execute('collection' => {
830
+ 'uuid' => md5_hex($manifest_text),
815
831
  'manifest_text' => $manifest_text,
816
832
  });
833
+ $Job->update_attributes('output' => $output->{uuid});
817
834
  if ($Job->{'output_is_persistent'}) {
818
835
  $arv->{'links'}->{'create'}->execute('link' => {
819
836
  'tail_kind' => 'arvados#user',
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: arvados-cli
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.20140603110100
4
+ version: 0.1.20140603160755
5
5
  platform: ruby
6
6
  authors:
7
7
  - Arvados Authors
@@ -146,7 +146,7 @@ dependencies:
146
146
  - - "~>"
147
147
  - !ruby/object:Gem::Version
148
148
  version: '0.8'
149
- description: This is the Arvados SDK CLI gem, git revision ab2550bca241736c162a435d62fc3ccb4ac5dc8e
149
+ description: This is the Arvados SDK CLI gem, git revision a4378cd48648a9ca315713535f651d1bbace322f
150
150
  email: gem-dev@curoverse.com
151
151
  executables:
152
152
  - arv