NUVOLOS
Sign In
  • Getting Started
    • Introduction to Nuvolos
    • Documentation structure
    • Nuvolos basic concepts
      • Organisational hierarchy
      • Applications
      • Distribution
      • Data integration
      • Snapshots
      • Background tasks
    • Navigate in Nuvolos
    • Quickstart tutorials
      • Research
      • Education (instructor)
      • Education (student)
  • Features
    • Applications
      • Application resources
      • Sessions
        • Session Logs
      • Install a software package
      • Create a persistent .bashrc
      • Automatic code execution
      • Long-running applications
      • Troubleshooting applications
      • New applications or licenses
      • Configuring applications
      • Exporting applications
      • Add-ons
        • MariaDB add-on
        • PostgreSQL add-on
        • OpenSearch add-on
        • MongoDB add-on
        • Redis add-on
        • PostGIS add-on
        • Rclone mount add-on
        • Neo4j add-on
    • File system and storage
      • File navigator
      • Large File Storage
      • Preview files
      • Mount Dropbox
      • Access S3 buckets with RClone
      • Access remote files with SSHFS
      • Access files on SharePoint Online
    • Object distribution
      • Distribution strategies
      • The distributed instance
    • Snapshots
      • Create a snapshot
      • Restore a snapshot
      • Delete a snapshot
    • Database integration
      • Create datasets
      • View tables
      • Build queries
      • Upload data
      • Access data from applications
        • Set up ODBC drivers
        • Obtain tokens for data access
        • Find database and schema path
      • DBeaver integration
    • Environment variables and secrets
    • Searching
      • Page
      • Find an application
      • Find an organisation
      • Find a space
      • Find an instance
      • Find a state
    • Video library
    • Nuvolos CLI and Python API
      • Installing the CLI
      • Using the CLI
  • User Guides
    • Research guides
      • Inviting a reviewer
      • GPU computation
    • Education guides
      • Setting assignments
        • Programmatical assignment handling
      • Documenting your course
      • Setting up group projects
        • Collaborative application editing
      • Configuring student applications
      • Archiving your course
      • Student guides
        • Joining a course
        • Working on assignments
        • Leaving a course
    • Application-specific guides
      • JupyterLab
      • RStudio
      • VSCode
      • Stata
      • MATLAB
      • Terminal
      • Terminal [tmux]
      • Apache Airflow
      • Apache Superset
      • D-Wave Inspector
      • MLFlow
      • Databricks Connect
      • Dynare.jl
      • CloudBeaver
      • InveLab
      • Overleaf
      • Metabase
      • DNDCv.CAN
      • OpenMetaData
      • Uploading data to the Large File Storage
    • Data guides
      • Setting up a dataset on Nuvolos
      • Importing data on Nuvolos
      • A complete database research workflow (Matlab & RStudio)
      • Accessing data as data.frames in R
      • Working with CRSP and Compustat
      • Working with the S&P 500®
  • Pricing and Billing
    • Pricing structure
    • Resource pools and budgets
    • Nuvolos Compute Units (NCUs)
  • Administration
    • Roles
      • Requesting roles
    • Organisation management
    • Space management
      • Invite to a space
      • Revoke a space user
      • HPC spaces
      • Resting spaces
    • Instance management
      • Invite to an instance
    • Enabling extra services
    • Monitoring resource usage
      • NCU Limits and Capacities
  • Reference
    • Application reference
      • InveLab
        • Dataset selection
        • Modules
          • Time-series visualisation
          • Moment estimation
          • Mean-variance frontiers
          • Frontiers
          • Dynamic strategy
          • Portfolio analysis
          • Performance analysis
          • Benchmarking
          • Carry trade strategies
          • Risk measures
          • Conditional volatility
          • Replication
          • Factor factory
          • Factor tilting
          • Valuation
    • Glossary
  • FAQs
    • FAQs
    • Troubleshooting
      • Login troubleshooting
        • I forgot my email address
        • I forgot my identity provider
        • I can't log in to Nuvolos
        • I forgot my password
        • I haven't received the password reset email
        • I haven't received the invitation email
      • Application troubleshooting
        • I can't see an application
        • I can't start an application
        • I can't create an application
        • I can't delete an application
        • I can't stop a running application
        • JupyterLab 3 troubleshooting
        • Spyder 3.7 troubleshooting
      • Administration troubleshooting
        • I can't see a space
        • I can't create a space
        • I can't delete a space
        • I can't invite admins to my space
        • I can't see an instance
        • I can't create an instance
        • I can't delete an instance
        • I can't invite users to an instance
        • I can't see distributed content in my instance
        • I can't see a snapshot
        • I can't create a snapshot
        • I can't delete a snapshot
        • I can't revoke a user role
        • I can't upload a file
        • I can't delete a file
        • I can't invite students to my course
      • Content troubleshooting
        • I can't find my files in my Linux home
        • I can't find my files among the Workspace files
        • I restored a snapshot by mistake
Powered by GitBook
On this page
  • Long-running notebooks
  • Adding a new launcher
  • Accessing a local webserver in the browser
  • Creating a ploty dash application from a notebook
  • Real-time kernel resource usage monitoring
  • Matplotlib plots with LaTeX

Was this helpful?

  1. User Guides
  2. Application-specific guides

JupyterLab

Tips for using JupyterLab on Nuvolos

PreviousApplication-specific guidesNextRStudio

Last updated 19 days ago

Was this helpful?

Long-running notebooks

If running notebooks via Jupyter, we recommend submitting the notebooks for computation using and specifying an explicit logfile when executing from the Jupyter terminal. This way you can disconnect from the Jupyter application and the notebook execution can continue whilst be able to monitor run progress.

papermill --stdout-file /files/my_job.out --stderr-file /files/my_job.err NOTEBOOK_PATH [OUTPUT_PATH]// Some code

Note that your Jupyter notebook wil only receive cell output updates as long as the notebook is kept open in the browser. If you reopen a notebook that is still calculating in the background, you won't receive cell output updates. This is standard Jupyter behavior, unrelated to Nuvolos. This is one of the reasons why using tools like Papermill makes sense for long-running notebooks.

Adding a new launcher

In some cases it might be useful to have multiple conda environments inside a single JupyterLab application and be able to launch notebooks from the JupyterLab launcher with kernels that run in these environments. We recommend that the kernel specification associated with the new conda environments created is always installed into the base conda environment (and not user / system prefix) to make sure that the kernel/launcher will function well after distributing an application. Our examples below follow this convention. If you don't want to share the application, then you can also follow instructions from other sources where typically the kernel specification is installed into the user home directory. The following can be done from a JupyterLab terminal and shortly afterwards a new Launcher should appear.

Python

In this case we recommend to create a new conda environment and install a launcher into the environment as following:

conda create env --name my_new_env

conda activate my_new_env

conda install ipykernel

ipython kernel install --prefix=/opt/conda --name "My New Env"

R

In this case we recommend to create a new conda environment and install a launcher into the environment as following:

conda create env --name my_new_env

conda activate my_new_env

conda install r-recommended r-irkernel

R -e 'IRkernel::installspec(prefix="/opt/conda")'​

Julia

Once you have a working Julia installation, execute the following command in Julia REPL:

using Pkg
Pkg.add("IJulia")           # Install IJulia package if not already installed
using IJulia
installkernel()             # Installs the default Julia kernel spec for Jupyter

Accessing a local webserver in the browser

Certain python packages come as webserver-based extensions, and you need to open them in a browser window to interact with them. Due to how Nuvolos applications are encapsulated, you cannot just start a new server process in your Nuvolos app and access it from your local browser.

  1. Make sure you're using a JupyterLab app with version > 3.0.0

  2. Install the webserver application (in this example, Tensorboard) in JupyterLab

    pip install tensorboard
  3. Install Jupyter Server Proxy (probably already installed)

    pip install jupyter-server-proxy
  4. Create a new file /opt/conda/etc/jupyter/jupyter_server_config.py with contents

    c.ServerProxy.servers = {
      'tensorboard': {
        'command': ['tensorboard', '--logdir', '/files/tensorboard_logdir', '--port', '{port}'],
        'timeout': 120
      }
    }
  5. Restart your Nuvolos application

  6. You should see a new launcher for Tensorboard

  7. Run your tensorflow computation and make note of the directory of your model run. Let's assume it's called /tmp/my_fit_1

  8. Create a symbolic link for your model directory with

    ln -s /tmp/my_fit_1 /files/tensorboard_logdir

    If you already have a link at /files/tensorboard_logdir, you'll need to remove it first with rm /files/tensorboard_logdir.

  9. Click on the 'tensorboard' launcher to open Tensorboard pointing at your model's run directory.

  10. To analyze a different run, repeat steps 7-9.

If the server application takes a lot of time to start, you might need to increase the timeout value in the example, otherwise you'll need to refresh the page periodically until the server starts.

Creating a ploty dash application from a notebook

Make sure you have the following packages installed (we suggest to do this via conda from the conda-forge channel).

  • plotly

  • dash

Once these are installed, install the JupyterDash extension:

pip install jupyter-dash

After this you need to make sure that your dash application has the following logic in it:

from jupyter_dash import JupyterDash
# ... your imports

# the next line is key for the application to be routed to JupyterLab properly
JupyterDash.infer_jupyter_proxy_config()

# ... your code


# now it's time to create the app object
# note that normally, you would create via app = Dash(__name__)
# here we instantiate a JupyterDash instance which already has the correct reverse proxy configuration
# you can use all normal arguments you would pass Dash to pass to JupyterDash
app = JupyterDash(__name__)

# ... your code

# run the app - the jupyterlab mode opens the app in a new tab
app.run_server(mode="jupyterlab")

Note that this procedure relies on the dash application being run in the context of a notebook.

Real-time kernel resource usage monitoring

pip install jupyter-resource-usage

After installing, restart your Nuvolos application. From then on, you'll see a new metering icon on the right sidecar:

Whenever a notebook tab is in focus, this extension displays CPU and RAM usage for the attached kernel, and also host-level CPU and RAM utilization.

This extension requires IPyKernel version 6.10.0 or above, so it might not work in older JupyterLab versions.

Matplotlib plots with LaTeX

  1. Install the packages required by mathplotlib: ​tlmgr install type1cm cm-super underscore dvipng

  2. Run the notebook cell with usetex=True again.

Since this is a fairly common problem in many infrastructures, there is already a solution for this called . As an example, we'll show now how to enable in your JupyterLab application.

In the example, the model run output files were put under /tmp deliberately. If your application emits lots of events, any filesystem slowness will negatively impact the performance of your training. For this reason, it's recommended to put these output files on the fastest storage medium available to your application: the local SSD drive under /tmp. Note that files under /tmp are not retained between Nuvolos application restarts. For this reason, make sure to use a tool like to move files to persistent storage whenever it's needed. Alternatively, reach out to support to get a quote on additional persistent SSD storage and use that for storing your event files.

JupyterLab has a great for monitoring resource usage in real time. You can install it with

If you wish to use when using matplotlib, you can install a LaTeX environment by following the instructions in our documentation:

papermill
Jupyter Server Proxy
Tensorboard
rsync
extension
LaTeX to render labels and other texts
Install TinyTex
Configure your notebook's environment
Tensorboard laucnher in the Notebook section
Real-time resource usage on kernel and host level in JupyterLab