Search code examples
google-cloud-datalabgoogle-container-registry

Connecting to a container that is based on gcr.io public datalab image


I am trying to have a simple datalab image running from my private container registry and facing datalab connection issue. Please take a look at steps and let me know if you see any obvious issue.

The steps are:

  • Running on MAC machine:

    Dockerfile:

    FROM gcr.io/cloud-datalab/datalab:latest

    RUN apt-get update

    ENTRYPOINT [ "/datalab/run.sh" ]

  • Build container using the command (only Dockerfile in folder)

    gcloud container builds submit --tag gcr.io/orielresearch-188115/datalab_orig .

  • Running on google cloud shell: create a datalab contianer: datalab create --image-name datalab_orig datalab-test

The execution is stuck at: Waiting for Datalab to be reachable at http://localhost:8081/

when running with debug flag:

datalab connect datalab-gcsfuse2 --ssh-log-level=debug 

output the following error:

channel 1: open failed: connect failed: Connection refused debug1: channel 1: free: direct-tcpip: listening port 8081 for localhost port 8080, connect from 127.0.0.1 port 42885 to 127.0.0.1 port 8081, nchannels 2 debug1: Connection to port 8081 forwarding to localhost port 8080 requested.

Please let me know if you have any idea how to debug / what is wrong with the above process. Thanks, Eila


Solution

  • I had two issues: 1. I created datalab-gcsfuse2 from image that was available on the container registry using

    $datalab create --image-name docker-name datalab-gcsfuse2
    

    by default, the image is searched at gcr.io while my image was saved on us.gcr.io the way to fix this is

    $datalab create --image-name us.gcr.io/project-mame/docker-name datalab-gcsfuse2
    
    1. permission issue. The default service account for vm is
      [email protected]. Adding this to the IAM memebers and providing it with relevant permissions (project editor or less) resources. you can read more detailed on the github https://github.com/googledatalab/datalab/issues/1928

    Good luck,

    Eila