Artem Melnichenko
Artem Melnichenko

Reputation: 50

How can i run 'gcloud' and 'gsutil' command at datalab instance?

I've created datalab instance with the latest cli release. However, when I connect to it via gcloud compute ssh command, I cannot run commands like 'gcloud' and 'gsutil'. I'm receiving following message -bash: gcloud: command not found. How can I make it work?

Upvotes: 1

Views: 1101

Answers (2)

Kamran
Kamran

Reputation: 3527

As described in this article by using --image-name flag you can specify the image which you wish to create the Datalab VM instance from. If the flag is not used, the VM will be created using Container-Optimized OS. As mentioned in this article Container-Optimized OS provides a toolbox wrapper to run debugging tools of your choice. For example, you can run the following command series to use gcloud and gsutils tools.

  • first run toolbox
  • then run gcloud or gsutil

Upvotes: 4

Omar Jarjur
Omar Jarjur

Reputation: 1066

The VM is running a very small operating system (Container Optimized OS), which is designed to just run Docker containers.

That means that if you want to run tools like gcloud or gsutil, you are expected to run them inside of a Docker container that has them installed.

In the specific case of a Datalab instance, there should be a container running named datalab that has these tools installed.

After SSH'ing to the VM, you can connect to that container by running this command:

docker exec -it datalab /bin/bash

Upvotes: 2

Related Questions