To use any GCloud component, 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 have to re-install it. The problem does not appear immediately, generally each day I have to install it and it exist between installed components for the whole day, and the day after I see it is not installed any more!
Any idea?
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:
.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.