0

To use any GCloud componet, I have installed on Cloud Shell just once, and i could use it each time i open cloud shell. But for CBT component for BigTable, I don't know what is happening that each time I close the browser the CBT tool is not installed any more and I should re-install it. The problem does not appear immediately, generally each day I should install it and it exist between installed components for whole day, and the day after I see it is not any more installed! Any idea ?

dsesto
  • 7,864
  • 2
  • 33
  • 50
Majico
  • 3,810
  • 2
  • 24
  • 36
  • I attempted to reproduce this behavior but in my brief testing, after installing the cbt component it remained available after closing and reopening the cloud shell. Would you mind filing an issue using the Cloud Shell public issue tracker as described here? https://cloud.google.com/support/docs/issue-trackers#bug_reports Specifically you can use this link to file a new bug report for the cloud shell team to investigate: https://issuetracker.google.com/issues/new?component=187188&template=0 Thanks! – Ramesh Dharan Nov 13 '17 at 22:14
  • The problem does not appear immediately, generally each day I should install it and it exist between installed components for whole day, and the day after I see it is not any more installed! – Majico Nov 14 '17 at 13:59

1 Answers1

1

This problem is caused by Google terminating idle Cloud Shell instances when they are not being used. Termination happens after about 60 minutes of non-use.

Only data stored in the $HOME directory persists after a new Cloud Shell is launched.

To install cbt the following steps are recommended:

gcloud components update
gcloud components install cbt

Since these components are not being installed in $HOME, they do not persist after Cloud Shell is terminated.

There are two methods that I recommend to solve this problem:

  1. Google Cloud Shell is a Docker container. You can modify the docker image to customize to fit your needs. This method will allow you to install packages, tools, etc that are not located in your $HOME directory.
  2. Modify .bashrc to run a script located in the $HOME directory to install cbt each time a new instance is created.

Note: It appears as of now that cbt is included in the default Cloud Shell instance. This answer should help others understand what is happening and be able to install other programs, tools, etc. persistently.

John Hanley
  • 74,467
  • 6
  • 95
  • 159
  • You are right, cbt is included in the default cloud shell instance. anyway, thanks for your explanation. – Majico Oct 26 '18 at 08:53