Search code examples
google-cloud-platformgoogle-cloud-datalab

Datalab cannot see symlink in tree view


I started a Datalab server on GCE using the quickstart guide. Then I created an additional disk, mounted it with these instructions and created a symlink in /root/datalab which points to a folder on that disk. However, I cannot access its contents.

(edited after more exploration)

Datalab is running inside of a Docker container, which probably maps /root/datalab to /content/datalab, so obviously a symlink doesn't actually display the contents of the folder on the host machine, because it points to a non-existing folder inside of the container filespace.

The question then rather becomes how to mount the additional diskspace to the datalab container.


Solution

  • Step #3 from that quickstart has you download a YAML file that defines how the containers run inside of that VM.

    You want to modify that file (before creating your VM) to specify the additional mounts. That file is a YAML-formatted Kubernetes pod config.

    Two things need to be added to it:

    1. A new entry in the "volumes" array defining the Docker volume on the host
    2. A new entry in the "volumeMounts" array for the "datalab-kernel-gateway" container defining the mount point for that volume in the container.

    For an example of what this will look like, look at the "varlog" volume in that file, and see how it is specified to be mounted by the "logger" container.