NERSC / podman-hpc

Other
34 stars 5 forks source link

return nonzero exit code from failed pull #63

Closed lastephey closed 1 year ago

lastephey commented 1 year ago

Addresses https://github.com/NERSC/podman-hpc/issues/57

Thanks for the report @wholtz

Have tested:

stephey@nid001013:/mscratch/sd/s/stephey> podman-hpc pull docker.io/debian:not_a_real_tag
Trying to pull docker.io/library/debian:not_a_real_tag...
Error: initializing source docker://debian:not_a_real_tag: reading manifest not_a_real_tag in docker.io/library/debian: manifest unknown: manifest unknown
Pull failed.
stephey@nid001013:/mscratch/sd/s/stephey> echo $?
125
stephey@nid001013:/mscratch/sd/s/stephey> podman-hpc pull ubuntu:latest 
Trying to pull docker.io/library/ubuntu:latest...
Getting image source signatures
Copying blob dbf6a9befcde skipped: already exists  
Copying config 3b418d7b46 done  
Writing manifest to image destination
Storing signatures
3b418d7b466ac6275a6bfcb0c86fbe4422ff6ea0af444a294f82d3bf5173ce74
INFO: Migrating image to /mscratch/sd/s/stephey/storage
stephey@nid001013:/mscratch/sd/s/stephey> echo $?
0
stephey@nid001013:/mscratch/sd/s/stephey> 
lastephey commented 1 year ago

Actually I'm going to address https://github.com/NERSC/podman-hpc/issues/56 in this PR too.

lastephey commented 1 year ago

I decided not to fully address https://github.com/NERSC/podman-hpc/issues/56 since that would bring podman-hpc out of alignment with Podman. However, I did incorporate their suggestion to route pull output via stdout and stderr rather than with Click. I think this gives users a little more flexibility.

lastephey commented 1 year ago

Ok tested and ready for review:

stephey@nid001013:~> podman-hpc pull quay.io/podman/hello:latest 
c098961c7f4cf309b966502d01ec5a36cca74ab9385fb286c5aa07bf915cd9a6
Trying to pull quay.io/podman/hello:latest...
Getting image source signatures
Copying blob sha256:32c07ec4961ddabfb3bb898fbbac172cad872e732a2ac5b8b8cc7e379a5aacff
Copying config sha256:c098961c7f4cf309b966502d01ec5a36cca74ab9385fb286c5aa07bf915cd9a6
Writing manifest to image destination
Storing signatures
INFO: Migrating image to /mscratch/sd/s/stephey/storage
stephey@nid001013:~> echo $?
0
stephey@nid001013:~> podman-hpc pull quay.io/podman/hello:latest > /dev/null
Trying to pull quay.io/podman/hello:latest...
Getting image source signatures
Copying blob sha256:32c07ec4961ddabfb3bb898fbbac172cad872e732a2ac5b8b8cc7e379a5aacff
Copying config sha256:c098961c7f4cf309b966502d01ec5a36cca74ab9385fb286c5aa07bf915cd9a6
Writing manifest to image destination
Storing signatures
stephey@nid001013:~> podman-hpc pull quay.io/podman/hello:fake
Trying to pull quay.io/podman/hello:fake...
Error: initializing source docker://quay.io/podman/hello:fake: reading manifest fake in quay.io/podman/hello: manifest unknown: manifest unknown
Pull failed
stephey@nid001013:~> echo $?
125
stephey@nid001013:~> podman-hpc pull quay.io/podman/hello:fake > /dev/null
Trying to pull quay.io/podman/hello:fake...
Error: initializing source docker://quay.io/podman/hello:fake: reading manifest fake in quay.io/podman/hello: manifest unknown: manifest unknown
Pull failed
stephey@nid001013:~> 
wholtz commented 1 year ago

I found a way to do this with podman, but it doesn't work on podman-hpc so I opened issue #64.