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
  • 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
  • Installing VSCode extensions
  • Persistent terminal sessions
  • Set tmux as your default terminal
  • Interactive Python development
  • Creating an interactive IPython window in VS Code
  • Accessing a local webserver in the browser
  • Debugging Python in VSCode

Was this helpful?

  1. User Guides
  2. Application-specific guides

VSCode

Tips and tricks for VS Code applications on Nuvolos

PreviousRStudioNextStata

Last updated 1 month ago

Was this helpful?

VSCode applications are available on Nuvolos as the suggested GUI integrated development environment for Python. All VS Code applications come with a conda environment already in place in which you can .

Installing VSCode extensions

Nuvolos runs in VSCode applications, which is a server-based fork of the traditional VSCode app. It comes with its own marketplace, so not every extension you find at will be available in the extension browser of the Nuvolos app.

However, most extensions are made available on GitHub and other sources as .vsix files. Once you have downloaded the .vsix file, you can easily add it to code-server:

  1. Upload the .vsix file to Nuvolos

  2. Use the Install from VSIX option in the app to install from the .vsix file

Persistent terminal sessions

Set tmux as your default terminal

You can configure tmux as your default terminal in VSCode with the following steps

  1. Verify with the command which tmux if tmux is installed already. If not, you can install it with conda install tmux

  2. In VSCode, press Ctrl + Shift + P and search for Open User Settings (JSON)

  3. In the opened JSON, add the following block

"terminal.integrated.profiles.linux": {
    "tmux": {
        "path": "tmux",
        "args": ["new-session", "-A", "-s", "${workspaceFolder}"],
        "icon": "terminal-tmux",
    },
},
"terminal.integrated.defaultProfile.linux": "tmux",
  1. You can open folder ABC in VSCode and start a new terminal, start a long-running script there

  2. Change workspace folder to DEF in VSCode and start a new terminal. You'll get a different tmux session here

  3. Change back to folder ABC in VSCode. If you open a terminal, you should see the outputs of your long-running script

Interactive Python development

Creating an interactive IPython window in VS Code

VS Code comes equipped with a conda package manager. In order to be able to start interactive IPython windows, you will first need to install some packages into the VS Code app. To do so, take the following steps:

  1. Open a VS Code command prompt either by finding View > Command Palette in the menu, or by hitting the Ctrl + Shift + P key combination.

  2. In the VS Code command palette, type Jupyter: Create and the autocomplete should offer you the Create Interactive Window option.

  3. You might be prompted to install ipykernel, in this case proceed to do so (this might take a minute or so to complete). If you have omitted step 3, you can later:

  4. Open a terminal in VS Code. You can do this by finding Terminal > New Terminal in the menu or hitting the Ctrl + Shift + ` key combination. In the terminal type conda install --freeze-installed ipykernel and wait for the process to complete. After that, you should be able to perform steps 1 and 2 without any further issues.

Accessing a local webserver in the browser

Sometimes you need to work with a local webserver in your VSCode application (e.g. view tensorboard or a streamlit app). Due to how Nuvolos applications are encapsulated, you cannot just start a new server processes in your Nuvolos app and access it from your local browser.

The good news is that VSCode can automatically set up the solution for this problem, called port forwarding. This means, all you need to do is start your local webserver, and VSCode will automatically expose it for you. You can check under the ports tab what kind of forwardings VSCode has created.

Example: open a terminal and execute python3 -m http.server 9000 in it. You'll see a pop-up in the lower right corner notifying you how to access the started webserver:

Debugging Python in VSCode

If you want to debug python scripts, VSCode is a good candidate as it has a nice visual interface to debug running code. Here are the steps to set up your environment:

  1. The default configuration will try to debug the file in your active editor window as a Python script.

  2. You can further tweak the debugger settings by creating your own configuration via clicking the cogwheel button next to RUN AND DEBUG:

  3. Select your custom configuration in the dropdown

By default, VSCode terminals are vanilla Bash sessions on Nuvolos, which are prone to stop when not used for a longer while. If you plan to run shell commands for hours and want to monitor their output, it's recommended to use or screen.

Now every time you open a new terminal, it'll be by default a tmux session. Every will have a different named session with the above configuration, e.g.:

The VS Code application is an excellent interactive development environment. You can find a detailed and complete guide for interactive development with IPython , the following documentation helps you get started quickly in the context of the Nuvolos apps.

You can click on the Open in Browser button or the icon on the ports tab to access your server from the browser.

Install the VSCode extension. Once you install it, you should have a new context menu in the debug tab:

One typical configuration you want to configure is the current working directory (cwd) of the debugger. If your script only works when invoked from a particular directory, either hard-code it or use the ${fileDirname} variable to set it to the folder of the launched file. To learn more about debugging in VSCode, consult th documentation:

tmux
workspace folder
here
Python Debugger
https://code.visualstudio.com/docs/editor/debugging#_launch-configurations
install your required packages
code-server
https://marketplace.visualstudio.com/
Use Install from VSIX to install from binaries
VSCode enables you to easily access local webservers via the browser
The debugger tab is usually right under the Source Control tab
Add your custom configuration to fine-tune settings
Custom configuration that changes the CWD to the debugged file's folder first