arvados-cli 0.1.20160302171627 → 0.1.20160302214005

Sign up to get free protection for your applications and to get access to all the features.
Files changed (3) hide show
  1. checksums.yaml +4 -4
  2. data/bin/crunch-job +32 -27
  3. metadata +2 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 5d7cf3d250304a66887286e13ecdfc1da39a9624
4
- data.tar.gz: f17e37107acba14052fd85dc525bd64998706c49
3
+ metadata.gz: 934d2d0195d5d124aa9c48264e9e414d97ccd7a5
4
+ data.tar.gz: dfede012720bfd95eace32c676c41d905c7d3ef9
5
5
  SHA512:
6
- metadata.gz: c190742af3c5f4253c8f05f0e57e1f5d566bdb0db6aadd24f91e6c2c5ee8445f967e621cbac0e7124874a5533efa3052d171b425e418b173b9760072d7884ba3
7
- data.tar.gz: c25440d9c5ff3e18807be0a8399494f4da816f2cb790c60866ce919baa02de653ad881baf7214ff193600693dc7ca09cbd24d02dda75ad07116247eae9fe2e69
6
+ metadata.gz: a9486905dc79dc8c58059f73e622e3dfc56d35de679bde9b7dfd771fd2f53510e13e8998f841715eadf7df5f661f1c3712dafea6b9bfe5dfcd8edcd39a75d2ba
7
+ data.tar.gz: 70be25de9c616b3f703f7d9bc4b22152d9bb20636a932424e8d9e5b5ef9e972c1b3c62b0407f3e776524718efb013bd9a807767d2e04256fd596da3a7ecbdd40
data/bin/crunch-job CHANGED
@@ -1134,7 +1134,9 @@ sub update_progress_stats
1134
1134
  sub reapchildren
1135
1135
  {
1136
1136
  my $children_reaped = 0;
1137
- while ((my $pid = waitpid (-1, WNOHANG)) > 0)
1137
+ my @successful_task_uuids = ();
1138
+
1139
+ while((my $pid = waitpid (-1, WNOHANG)) > 0)
1138
1140
  {
1139
1141
  my $childstatus = $?;
1140
1142
 
@@ -1207,8 +1209,9 @@ sub reapchildren
1207
1209
  push @jobstep_todo, $jobstepidx;
1208
1210
  $Job->{'tasks_summary'}->{'failed'}++;
1209
1211
  }
1210
- else
1212
+ else # task_success
1211
1213
  {
1214
+ push @successful_task_uuids, $Jobstep->{'arvados_task'}->{uuid};
1212
1215
  ++$thisround_succeeded;
1213
1216
  $slot[$proc{$pid}->{slot}]->{node}->{losing_streak} = 0;
1214
1217
  $slot[$proc{$pid}->{slot}]->{node}->{hold_until} = 0;
@@ -1231,34 +1234,36 @@ sub reapchildren
1231
1234
  push @freeslot, $proc{$pid}->{slot};
1232
1235
  delete $proc{$pid};
1233
1236
 
1234
- if ($task_success) {
1235
- # Load new tasks
1236
- my $newtask_list = [];
1237
- my $newtask_results;
1238
- do {
1239
- $newtask_results = api_call(
1240
- "job_tasks/list",
1241
- 'where' => {
1242
- 'created_by_job_task_uuid' => $Jobstep->{'arvados_task'}->{uuid}
1243
- },
1244
- 'order' => 'qsequence',
1245
- 'offset' => scalar(@$newtask_list),
1246
- );
1247
- push(@$newtask_list, @{$newtask_results->{items}});
1248
- } while (@{$newtask_results->{items}});
1249
- foreach my $arvados_task (@$newtask_list) {
1250
- my $jobstep = {
1251
- 'level' => $arvados_task->{'sequence'},
1252
- 'failures' => 0,
1253
- 'arvados_task' => $arvados_task
1254
- };
1255
- push @jobstep, $jobstep;
1256
- push @jobstep_todo, $#jobstep;
1257
- }
1258
- }
1259
1237
  $progress_is_dirty = 1;
1260
1238
  }
1261
1239
 
1240
+ if (scalar(@successful_task_uuids) > 0)
1241
+ {
1242
+ Log (undef, sprintf("%d tasks exited (%d succeeded), checking for new tasks from API server.", $children_reaped, scalar(@successful_task_uuids)));
1243
+ # Load new tasks
1244
+ my $newtask_list = [];
1245
+ my $newtask_results;
1246
+ do {
1247
+ $newtask_results = api_call(
1248
+ "job_tasks/list",
1249
+ 'filters' => [["created_by_job_task_uuid","in",\@successful_task_uuids]],
1250
+ 'order' => 'qsequence',
1251
+ 'offset' => scalar(@$newtask_list),
1252
+ );
1253
+ push(@$newtask_list, @{$newtask_results->{items}});
1254
+ } while (@{$newtask_results->{items}});
1255
+ Log (undef, sprintf("Got %d new tasks from API server.", scalar(@$newtask_list)));
1256
+ foreach my $arvados_task (@$newtask_list) {
1257
+ my $jobstep = {
1258
+ 'level' => $arvados_task->{'sequence'},
1259
+ 'failures' => 0,
1260
+ 'arvados_task' => $arvados_task
1261
+ };
1262
+ push @jobstep, $jobstep;
1263
+ push @jobstep_todo, $#jobstep;
1264
+ }
1265
+ }
1266
+
1262
1267
  return $children_reaped;
1263
1268
  }
1264
1269
 
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.20160302171627
4
+ version: 0.1.20160302214005
5
5
  platform: ruby
6
6
  authors:
7
7
  - Arvados Authors
@@ -178,7 +178,7 @@ dependencies:
178
178
  - - "<"
179
179
  - !ruby/object:Gem::Version
180
180
  version: 1.0.0
181
- description: Arvados command line tools, git commit 9ddb8e3b5106f885401927a513ac0d94a59133ed
181
+ description: Arvados command line tools, git commit ec51cd72eabf0f0bbebf7cd979d1a23a1319a416
182
182
  email: gem-dev@curoverse.com
183
183
  executables:
184
184
  - arv