BEAR Portal: JupyterLab or RStudio

The BEAR Portal provides web-based access to a range of BlueBEAR services. This page will give information on running either JupyterLab or RStudio in the Portal and assumes that you have already logged in.

Using JupyterLab or RStudio in the BEAR Portal

From the menu bar, at the top of the page, select the 'Interactive Apps' menu. From this menu select either JupyterLab or Rstudio Server. If you cannot see the 'Interactive Apps' menu when you log in to the BEAR Portal this means that you need to follow the steps listed in the Access to the BEAR Portal section.

portal-home-interactivemenuThis will bring up a page for you to specify options for your job, such as the BEAR project to use; the length of time you want to be able to use this for; the QOS to run the job against; and the number of cores to use in your job. If you are using JupyterLab then you can specify which kernel it should use; if you are using RStudio Server then you can specify which version of R to use. Additionally, RStudio allows you to specify that meta modules are loaded and these are selected using the relevant tick boxes - the description of each meta module will link to an information page, from which you can find information on the extra packages or libraries that the meta module will make available in your RStudio instance. To load additional modules in JupyterLab, please use the JupyterLab Lmod extension (see towards the bottom of this page for further info).

portal-jupyterlab

 

Once you are happy with the options select then you should hit the launch button at the bottom of the page. When you have done this a BlueBEAR job will be submitted to the cluster. The length of time you will have to wait for this job to start will depend on the resources you have requested - the more cores, or asking for GPUs, will mean that you'll have to wait longer for the resource to become available. When it is you'll see an option to connect to JupyterLab or RStudio Server.

portal-rstudio

Selecting the 'Connect to ...' option will take you into the JupyterLab or RStudio Server instance. When you have finished you should select the 'Delete' option to stop the job and release the compute resources.

To see information relating to your BEAR Portal jobs please refer to the Portal Job Output page.

JupyterLab: loading modules

JupyterLab includes the Jupyter Lmod extension, which allows the loading of application modules (as listed on https://bear-apps.bham.ac.uk) from within the Jupyter graphical user interface. Once you've entered the JupyterLab session for the first time you will see the following screen, from where you can access the Lmod extension interface by clicking on the blue icon in the list on the left of the window:

portal-jupyter-lmod1Once the Lmod extension interface appears you can use the search bar at the top (see arrow 1) to filter the displayed modules and then click on "Load" to load a module and its dependencies (see arrow 2). Note that there will be a delay whilst the modules load, although there is no graphical indication that this is happening.

portal-jupyter-lmod2

N.B. if your Notebook is active (and has an active kernel) prior to loading a module using the above method then you will need to reload the kernel before the module can be used.

For further information, please see our video tutorial which covers JupyterLab usage in detail and is available to watch here:

BEAR Portal: JupyterLab intro

Known Issues and Advice

RStudio

  • It is not possible for a single user to run two instances of RStudio on the same compute node at once
  • If you see a message of 'The previous R session was abnormally terminated due to an unexpected crash' this is because a previous R session was not closed. To close an R session in RStudio select 'Quit Session' from the File menu.
  • If you see a message of 'unable to open connection to X11 display' when generating plots in RStudio then you can do one of the following:
    • add options(bitmapType='cairo') before plotting.
    • change the plot command to include type="cairo".
    • add the text: options(bitmapType='cairo') to the file ~/.Rprofile (creating it, if required). This will ensure that the setting persists across each time you load RStudio on BEAR Portal.
  • If you experience RStudio instantly crashing, freezing, or an empty window then delete the sessions folder that is inside the .rstudio or .local/share/rstudio folder in your home directory.
  • If the job is inactive for a significant period then you may find yourself logged out of the RStudio Server session - once this has happened the job is not recoverable. Due to this, any long running R job should either be submitted as a batch job or should regularly checkpoint the data, allowing you to restore this in a future job.

JupyterLab

  • JupyterLab starts in your home directory. To access storage outside your home directory, e.g. a RDS or CaStLeS project storage, you should create a symbolic link (symlink) from the required path inside your home directory, using the ln -s command.

Colleges

Professional Services