rstudio / rstudio-docker-products

Docker images for RStudio Professional Products

Home Page:https://hub.docker.com/u/rstudio

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Jupyter Notebook terminal doesn't work in GCP Cloud Workstations image

blairj09 opened this issue · comments

When starting a new terminal from Jupyter Notebook in the GCP Cloud Workstation image, the terminal opens but shows a few errors and doesn't allow for user input:
image

It seems that this error is stemming from a lacking configuration in Jupyter Notebooks. It's attempting to use sh instead of bash, but still bootstraps all of the contents of /etc/profile.d that Google has baked into the image, most of which uses syntax not supported by sh. We'll just need to figure out how to reconfigure how the Terminal's login shell to fix this I think.

This is now fixed, we just had to configure the default shell command for Jupyter to be /bin/bash instead of /bin/sh. We now copy the following JSON file into /opt/python/jupyter/etc/jupyter/jupyter_notebook_config.json at the end of the image build:

{
  "NotebookApp": {
    "nbserver_extensions":{
      "rsconnect_jupyter": true
    },
    "terminado_settings": {
      "shell_command": ["/bin/bash"]
    }
  },
  "ServerApp": {
    "terminado_settings": {
      "shell_command": ["/bin/bash"]
    }
  }
}

We're setting the shell in both NotebookApp and ServerApp because it's being moved to ServerApp in future versions of Jupyter Notebook (7+ I think).

Thanks for the fix - confirmed this today in ianprstudio/gcw-workbench:2022.03.0-6