RStudio/Google Cloud. Preserve changes across stopping and starting VM instance.

I am using RStudio (free version) in Google Cloud.

I created a VM instance using the Docker image rocker/ml, and it is working fine. However, if I create a new folder in RStudio or upload a file, it has vanished next time I start the VM instance.

Also, if I install any R packages , they disappear as well.

Is there any way to preserve such changes across stopping and starting instances?
I am new to the cloud, so any advice appreciated.
Thanks

Is this using googleComputeEngineR? If so the default is to not have persistent files saved in the cloud as you could easily fill up your disk. If you need the files all the time you could include them in a custom Docker image, or use googleCloudStorageR instead to store the files. If you want to preserve the state of the RStudio Server as you have set it up (folders/files etc) then you can commit the Docker image underneath to be launched later (see saving a running instance to the container registry). Otherwise please raise an issue on the GitHub issue page.

Thanks Mark. No I wasn't using googleComputeEngineR. But at least I realize I am not doing anything stupid. I will look into the solutions you suggest, especially the idea of saving a running instance to the container registry.

The VM has a Standard Persistent Disk of 20GB. What is this for? I see I can take a "snapshot" of it, but what exactly would be preserved? Would that be the basis of a solution?

Ah ok! Sorry it was very similar question to what is often asked on googleComputeEngineR.

You did install via Docker though so I think similar applies - when using rocker/ml the Docker container is not persisted unless you start it again and not create a new container (docker start vs docker run).

But I suggest its better long term to treat each instance as not permanent and use Google Cloud Storage for file storage as you can then be a lot more flexible, and make your own Dockerfile derived from rocker/ml if you need certain libraries or files installed all the time.

This topic was automatically closed 21 days after the last reply. New replies are no longer allowed.

If you have a query related to it or one of the replies, start a new topic and refer back with a link.