Warn if docker is not available due to permissions or installation is missing
On Ubuntu I noticed cog failed with a vague message when attempting to use predict from one of the projects on replicate. There could be a check in cog to make sure docker is installed and the current user is able to execute commands. In my case I needed to run cog as root since docker was only accessible as root at that time.
The errors shown to the user with the latest version at the time: v0.0.18, were: Failed to determine if r8.im/... exists: exit status 1 as it fell back to file system checks, and when --debug was used, the docker inspect failed without any further messaging.
Thanks for opening this issue, @zknz. Here's some extra context from our conversation in Discord:
$ cog --debug predict r8.im/cjwbw/rudalle-sr@sha256:cf62c87dde3b7a9f0999519f291d7d4f84e5d1883cfa0c986ae79d8a92247966 -i [email protected] -i scale=4
$ docker image inspect r8.im/cjwbw/rudalle-sr@sha256:cf62c87dde3b7a9f0999519f291d7d4f84e5d1883cfa0c986ae79d8a92247966
ⅹ Failed to determine if r8.im/cjwbw/rudalle-sr@sha256:cf62c87dde3b7a9f0999519f291d7d4f84e5d1883cfa0c986ae79d8a92247966 exists: exit status 1
Cog version:
cog version 0.0.18 (built 2021-11-17T18:31:48Z)
Environment:
Ubuntu 21, GPU is an RTX 3090 and nvidia-docker is all setup
Another bit of user feedback: https://discord.com/channels/775512803439280149/852636181492793344/991718132878168137
tl;dr: Docker was installed but the service wasn't running, which caused Cog to fail with an incomprehensible error.