I explained in an earlier post how I am using GCP's Cloud Shell for all of my command-line needs all the time. Whenever you start your cloud shell, Google Cloud Platform (GCP) spins up a small compute instance with the Cloud Shell image for you. This is using a g1-small sized compute engine which provides 0.5 vCPUs and 1.7GB of memory. That's more than enough for most command-line tasks. But you'll hit these limits when you also want to run programs or even containers locally on the Cloud Shell instance.
rost@cloudshell:~$ free -h total used free shared buff/cache available Mem: 1.7G 195M 1.2G 80K 240M 1.3G Swap: 767M 143M 624M rost@cloudshell:~$ free -h total used free shared buff/cache available Mem: 3.6G 225M 2.9G 1.3M 474M 3.2G Swap: 767M 0B 767MAfter enabling Boost Mode, just run the docker container as shown below. Docker images are stored in /var/lib/docker which is not part of the 5GB persistent home directory. I see this as a good thing as otherwise your home directory would fill up quickly. So chances are that the docker image has to get pulled again when you have not used Cloud Shell for a while and a new compute instance was provisioned for you. I am forwarding port 3000 (grafana) from the container to 8080 of the cloud shell instance. This allows me to use the convenient "web preview" feature in Cloud Shell without having to worry about copying ephemeral IP addresses and such.
rost@cloudshell:~$ docker run -p 8080:3000 -ti brost/stream-etl:ksql bash Unable to find image 'brost/stream-etl:ksql' locally ksql: Pulling from brost/stream-etl ad74af05f5a2: Pulling fs layer d02e292e7b5e: Pull complete 8de7f5c81ab0: Pull complete ed0b76dc2730: Pull complete cfc44fa8a002: Pull complete [...] Digest: sha256:eeb4453503327912744bb03f0b1d769a3d88dc0ec297dede3fb945e3fb0545fd Status: Downloaded newer image for brost/stream-etl:ksql [ ok ] Starting MySQL database server: mysqld .. [info] Checking for tables which need an upgrade, are corrupt or were not closed cleanly.. [ ok ] Starting Grafana Server:. [ ok ] Starting Elasticsearch Server:. Starting zookeeper zookeeper is [UP] Starting kafka kafka is [UP] Starting schema-registry schema-registry is [UP] Starting kafka-rest kafka-rest is [UP] Starting connect connect is [UP] root@ac86f0078c9b:/#
Google's Cloud Shell is already a nifty tool for doing command line work from any device in the cloud. When you are pushing the default resource limits of the instance, you can double CPU and memory capacity temporarily by restarting your Cloud Shell in Boost mode.
Ready to optimize your use of Google Cloud's AI tools?