arvados-cli 0.1.20170217221854 → 0.1.20170306153140

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 +14 -10
  3. metadata +3 -3
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 45435d65357352b05d8eebef46d89db815cb6365
4
- data.tar.gz: a9ac69498675598739845ff3eda8f18630cb1d36
3
+ metadata.gz: dd64584b9e428c7707f189999534af8f6ded7779
4
+ data.tar.gz: 6f20fd2aba6a1b3d6eb66a9222db67fe36553237
5
5
  SHA512:
6
- metadata.gz: e20d9966a940b8e6d895d98c54183da6b7c449229c2106da2cc1b2fab982efc1aa651d0ab8f110af5f2515564717e361a06539b8b86670e5c73d51e0b4b3586e
7
- data.tar.gz: 18de405ef4002290a0a2b1edad432e3375cd4f7c93bf6bc93d016876503c1a0f555d010745dde360b306959fd4cc134c57f13f9470ea241783e60eb5731a65d9
6
+ metadata.gz: dcd47ed72777f78b542fc4571b275d10421b15902d87063ea16bc411cf43e4a871ba894068f76d7da42ad0c2b5244cee5fddd3d6a9e7899a2a03de42c7ed3852
7
+ data.tar.gz: e48a4707eba9148e108dcd90a494aaccb9857e5096acb55f83fa0d89b77e7b9ccfe1f81b6d438448b8256e72ef3b1cf413929a78dc1aaee51e6a69d1e4c20be7
data/bin/crunch-job CHANGED
@@ -417,18 +417,22 @@ if ($docker_locator = $Job->{docker_image_locator}) {
417
417
  Log (undef, "docker image hash is $docker_hash");
418
418
  $docker_stream =~ s/^\.//;
419
419
  my $docker_install_script = qq{
420
- if $docker_bin images -q --no-trunc --all | grep -xF \Q$docker_hash\E >/dev/null; then
421
- exit 0
420
+ loaded() {
421
+ id=\$($docker_bin inspect --format="{{.ID}}" \Q$docker_hash\E) || return 1
422
+ echo "image ID is \$id"
423
+ [[ \${id} = \Q$docker_hash\E ]]
424
+ }
425
+ if loaded >&2 2>/dev/null; then
426
+ echo >&2 "image is already present"
427
+ exit 0
422
428
  fi
423
- declare -a exit_codes=("\${PIPESTATUS[@]}")
424
- if [ 0 != "\${exit_codes[0]}" ]; then
425
- exit "\${exit_codes[0]}" # `docker images` failed
426
- elif [ 1 != "\${exit_codes[1]}" ]; then
427
- exit "\${exit_codes[1]}" # `grep` encountered an error
428
- else
429
- # Everything worked fine, but grep didn't find the image on this host.
430
- arv-get \Q$docker_locator$docker_stream/$docker_hash.tar\E | $docker_bin load
429
+ echo >&2 "docker image is not present; loading"
430
+ arv-get \Q$docker_locator$docker_stream/$docker_hash.tar\E | $docker_bin load
431
+ if ! loaded >&2; then
432
+ echo >&2 "`docker load` exited 0, but image is not found (!)"
433
+ exit 1
431
434
  fi
435
+ echo >&2 "image loaded successfully"
432
436
  };
433
437
 
434
438
  my ($exited, $stdout, $stderr) = srun_sync(
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.20170217221854
4
+ version: 0.1.20170306153140
5
5
  platform: ruby
6
6
  authors:
7
7
  - Arvados Authors
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-02-17 00:00:00.000000000 Z
11
+ date: 2017-03-06 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: arvados
@@ -164,7 +164,7 @@ dependencies:
164
164
  - - "~>"
165
165
  - !ruby/object:Gem::Version
166
166
  version: '0.8'
167
- description: Arvados command line tools, git commit d0ba6eaac1387ad817de1c2df2d7f4f00800aaa5
167
+ description: Arvados command line tools, git commit a4a3227c634d8cfd54a23205be727e910032cbe9
168
168
  email: gem-dev@curoverse.com
169
169
  executables:
170
170
  - arv