Is it possible to connect vscode (on a local machine) with Google Colab (the free service) runtime?

前端 未结 5 783
情歌与酒
情歌与酒 2021-01-30 05:30

I know on GCP, we can set up a vscode server and connect to that. But what I\'m after here, is to know whether it is possible to connect to the runtime instance on Google Colab

5条回答
  •  谎友^
    谎友^ (楼主)
    2021-01-30 06:33

    I've just found another method without using ssh.

    # Install jupyterlab and ngrok
    !pip install jupyterlab==2.2.9 pyngrok -q
    
    # Run jupyterlab in background
    !nohup jupyter lab --ip=0.0.0.0 &
    
    # Make jupyterlab accessible via ngrok
    from pyngrok import ngrok
    print(ngrok.connect(8888))
    

    It will then show a JupyterLab URL

    http://f1fe6fb39df6.ngrok.io  # for example
    

    You can click it to run JupyterLab now. Or use the URL with VSCode for remote Jupyter kernel.

提交回复
热议问题