arvados-cli 0.1.20140811234926 → 0.1.20140812091227

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 +13 -11
  3. metadata +3 -3
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: d8aac45278fe5c37fa11f5db1960355f4b540997
4
- data.tar.gz: 090d89e060113d99429175cc7baaedcef0307c9e
3
+ metadata.gz: a54d204bc47cb5d1f271ebff704b547ecc57a113
4
+ data.tar.gz: bd221ef8fa3fe22c4b23d37013eb2cc1abfdced8
5
5
  SHA512:
6
- metadata.gz: 837dc3f79e24fb8f30e0d91a81dfb73114d4bdf702d3239bcb0faacfdc156a8b3a1578c7e03b2082550a8a012a388820c5a04d780622b9a8bf7e162bd0f2ddc6
7
- data.tar.gz: 0b03f7d519aafc26c65cae9171caa832933ea6d0803fcfb6c696e39e23238143e4345eed1e3c5049ebf3f22f98013fbfefcdf1cc165381ddb71edd573a98a5d7
6
+ metadata.gz: 3404b992ede6e0accb516fb2ee93c9ace7e2211a83ac20d770317a88b0c46ae019c427fe640de22e1a177ae5bcb0c505a082fa100cc74fedb9d8939cacb4db38
7
+ data.tar.gz: f9fa9924d67878175f64e8f4c9250d40918c700bd99d7d99c7b5fe18704e111ab1d73d42b745429b8e7a5d2d4c7286d673f9d3965b1874bf6a0d32fa162e185f
data/bin/crunch-job CHANGED
@@ -84,6 +84,8 @@ use File::Temp;
84
84
  use Fcntl ':flock';
85
85
  use File::Path qw( make_path );
86
86
 
87
+ use constant EX_TEMPFAIL => 75;
88
+
87
89
  $ENV{"TMPDIR"} ||= "/tmp";
88
90
  unless (defined $ENV{"CRUNCH_TMP"}) {
89
91
  $ENV{"CRUNCH_TMP"} = $ENV{"TMPDIR"} . "/crunch-job";
@@ -151,24 +153,24 @@ if ($job_has_uuid)
151
153
  $Job = $arv->{'jobs'}->{'get'}->execute('uuid' => $jobspec);
152
154
  if (!$force_unlock) {
153
155
  # If some other crunch-job process has grabbed this job (or we see
154
- # other evidence that the job is already underway) we exit 111 so
155
- # crunch-dispatch (our parent process) doesn't mark the job as
156
- # failed.
156
+ # other evidence that the job is already underway) we exit
157
+ # EX_TEMPFAIL so crunch-dispatch (our parent process) doesn't
158
+ # mark the job as failed.
157
159
  if ($Job->{'is_locked_by_uuid'}) {
158
- Log(undef, "Job is locked by " . $Job->{'is_locked_by_uuid'} . ", exiting 111");
159
- exit(111);
160
+ Log(undef, "Job is locked by " . $Job->{'is_locked_by_uuid'});
161
+ exit EX_TEMPFAIL;
160
162
  }
161
163
  if ($Job->{'success'} ne undef) {
162
164
  Log(undef, "Job 'success' flag (" . $Job->{'success'} . ") is not null");
163
- exit(111);
165
+ exit EX_TEMPFAIL;
164
166
  }
165
167
  if ($Job->{'running'}) {
166
168
  Log(undef, "Job 'running' flag is already set");
167
- exit(111);
169
+ exit EX_TEMPFAIL;
168
170
  }
169
171
  if ($Job->{'started_at'}) {
170
172
  Log(undef, "Job 'started_at' time is already set (" . $Job->{'started_at'} . ")");
171
- exit(111);
173
+ exit EX_TEMPFAIL;
172
174
  }
173
175
  }
174
176
  }
@@ -281,8 +283,8 @@ if ($job_has_uuid)
281
283
  # Claim this job, and make sure nobody else does
282
284
  unless ($Job->update_attributes('is_locked_by_uuid' => $User->{'uuid'}) &&
283
285
  $Job->{'is_locked_by_uuid'} == $User->{'uuid'}) {
284
- Log(undef, "Error while updating / locking job, exiting 111");
285
- exit(111);
286
+ Log(undef, "Error while updating / locking job, exiting ".EX_TEMPFAIL);
287
+ exit EX_TEMPFAIL;
286
288
  }
287
289
  $Job->update_attributes('started_at' => scalar gmtime,
288
290
  'running' => 1,
@@ -893,7 +895,7 @@ else {
893
895
  Log (undef, "finish");
894
896
 
895
897
  save_meta();
896
- exit 0;
898
+ exit ($Job->{'success'} ? 1 : 0);
897
899
 
898
900
 
899
901
 
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.20140811234926
4
+ version: 0.1.20140812091227
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-11 00:00:00.000000000 Z
11
+ date: 2014-08-12 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 b349b49b54f5bebc624f4afb981dddea1bfc0d61
169
+ description: This is the Arvados SDK CLI gem, git revision ed1580a38c1aae0910cef83605622a41d927fba3
170
170
  email: gem-dev@curoverse.com
171
171
  executables:
172
172
  - arv