Bug #12467

crunch-run not waiting for Docker image to finish loading.

Added by Peter Amstutz about 4 years ago. Updated about 4 years ago.

Status:
Resolved
Priority:
Normal
Assigned To:
Category:
-
Target version:
Start date:
10/19/2017
Due date:
% Done:

100%

Estimated time:
(Total: 0.00 h)
Story points:
-

Description

It is failing to load Docker image, even though the image load seemingly succeeds:

2017-10-19T16:41:46.528938874Z Fetching Docker image from collection '997e3bc9579153e723b599b300d9123d+342'
2017-10-19T16:41:46.549138991Z Using Docker image id 'sha256:20a23446d37fac4cb2ec6462310aaee7119f4594948765a3397b13f9baec4812'
2017-10-19T16:41:46.549599576Z Loading Docker image from keep
2017-10-19T16:41:49.814403711Z Creating Docker container
2017-10-19T16:41:49.816658048Z While creating container: Error: No such image: sha256:20a23446d37fac4cb2ec6462310aaee7119f4594948765a3397b13f9baec4812

It seems that loading is asynchronous, the ImageLoad method returns after the data has been transmitted but before the layers have been decompressed. We need to wait for a response indicating that loading is finished.


Subtasks

Task #12468: Review 12467-read-imgload-responseResolvedTom Clegg

Associated revisions

Revision 6fd6ddce
Added by Peter Amstutz about 4 years ago

Merge branch '12467-read-imgload-response' closes #12467

Arvados-DCO-1.1-Signed-off-by: Peter Amstutz <>

History

#1 Updated by Peter Amstutz about 4 years ago

  • Description updated (diff)

#2 Updated by Peter Amstutz about 4 years ago

  • Status changed from New to In Progress
  • Assigned To set to Peter Amstutz

12467-read-imgload-response @ d64215e8f0057cc7b4c6295932bc7f44d27a1eb5

#3 Updated by Tom Clegg about 4 years ago

Better form to do "defer response.Body.Close()" before ioutil.ReadAll(), so it gets closed even if read fails.

I think the error message has copy-paste-itis: "While reading response to container image into Docker: %v"

I'm guessing it means "error reading response from docker.ImageLoad: %v"

You don't need to say string(rbody) -- %s prints a []byte as a string.

#4 Updated by Peter Amstutz about 4 years ago

Tom Clegg wrote:

Better form to do "defer response.Body.Close()" before ioutil.ReadAll(), so it gets closed even if read fails.

I think the error message has copy-paste-itis: "While reading response to container image into Docker: %v"

I'm guessing it means "error reading response from docker.ImageLoad: %v"

You don't need to say string(rbody) -- %s prints a []byte as a string.

All fixed, plus a bonus fix log.Printf -> runner.CrunchLog.Printf

12467-read-imgload-response @ a976b02dc7ecba18277aceeaf086ab76fe4bf3f0

#5 Updated by Tom Clegg about 4 years ago

LGTM

#6 Updated by Anonymous about 4 years ago

  • Status changed from In Progress to Resolved
  • % Done changed from 0 to 100

Applied in changeset arvados|commit:6fd6ddcebda57df4ecb2303dc229420c2c13af7b.

Also available in: Atom PDF