Search code examples
dockergoogle-colaboratorygoogle-compute-enginegoogle-container-optimized-os

Where are files saved when using Google Colab with a Custom GCE VM


I am using Google Colab in combination with a Custom GCE VM based on the instructions here. I now need a way to retrieve files from the VM without using the Colab interface due to a bug described in this issue and this issue. I've reviewed the answers from this similar question about file storage on hosted instances, but I don't think it helps me in this case.

I've attempted to SSH into the machine to find files, but I can't locate the /content directory that I expect to see in root. After digging through the file system I found the /mnt/stateful_partition/var/lib/docker directory is using the amount of disk space I expect to reflect the size of the data with a file object called colab-vmdisk that looks promising. I'm not sure how to proceed, but given the file path I expect there's a docker-based solution here that I don't know.


Solution

  • Google Colab from GCE is in its own docker container as you found. If you want to access the files in the google colab session, run docker ps and copy the container id from the bottom row. As for copying a file over, do docker cp (your container id):/path/to/google/colab/folder/ /path/to/gce/