DataBiosphere / dsub

Open-source command-line tool to run batch computing tasks and workflows on backend services such as Google Cloud.
Apache License 2.0
265 stars 44 forks source link

ERROR: gcloud crashed (TypeError): a bytes-like object is required, not 'str' #249

Closed carbocation closed 10 months ago

carbocation commented 2 years ago

When I run the "Hello World" test for the local provider, it works. When I run it on a custom image, it also works. But when I try to make it run on on any gcr.io/ image, it does not work. Instead, I get the following message in the runner-log.txt file:

WARNING: `gcloud docker` will not be supported for Docker client versions above 18.03.

As an alternative, use `gcloud auth configure-docker` to configure `docker` to
use `gcloud` as a credential helper, then use `docker` as you would for non-GCR
registries, e.g. `docker pull gcr.io/project-id/my-image`. Add
`--verbosity=error` to silence this warning: `gcloud docker
--verbosity=error -- pull gcr.io/project-id/my-image`.

See: https://cloud.google.com/container-registry/docs/support/deprecation-notices#gcloud-docker

ERROR: gcloud crashed (TypeError): a bytes-like object is required, not 'str'

If you would like to report this issue, please run the following command:
  gcloud feedback

To check gcloud for common problems, please run the following command:
  gcloud info --run-diagnostics

Given the contents of the error message, and the fact that I have docker version 20 installed, I think this error is not surprising. But is there a way to bypass dsub calling gcloud docker when running gcr.io images with the --local provider so that those of us with docker > 18.03 can use the --local provider?

wnojopra commented 2 years ago

Hi @carbocation! Thanks for reporting.

I don't believe there's a way to bypass this specifically at the moment. Fortunately, gcloud docker is explicitly called in one place in the local provider's runner script here. This can be changed to instead use docker (and perhaps set up the credential helpers).

I do see that using gcloud docker has been deprecated for a while now, so I expect this to be fixed in the next release.

carbocation commented 10 months ago

I don't have a great test case for this right now, but I do believe that the last gcloud docker call indeed has been removed, so this can probably be closed.

mbookman commented 10 months ago

Thanks!

Fixed by #261 (Release 0.4.9)