JupyterLab Overview and Common Operations

JupyterLab is an interactive development environment. It is a next-generation product of Jupyter Notebook. JupyterLab enables you to compile notebooks, operate terminals, edit MarkDown text, open interaction modes, and view CSV files and images.

JupyterLab will be a mainstream development environment for developers. JupyterLab supports more flexible and powerful project operations, but has the same components as Jupyter Notebook.

ModelArts supports Jupyter Notebook and JupyterLab. You can use different tools to develop code in the same notebook instance.

Opening JupyterLab

  1. Log in to the ModelArts management console. In the left navigation pane, choose DevEnviron > Notebooks to switch to the Notebooks page.
  2. Select a notebook instance in the Running state and click Open in the Operation column to access the notebook instance.
  3. On the Jupyter page, click Open JupyterLab in the upper right corner to access the JupyterLab page of the notebook instance.
    Figure 1 Accessing JupyterLab
  4. The Launcher page is automatically displayed, as shown in the following figure. You can use all open source functions. For details, see JupyterLab Documentation.
    Figure 2 JupyterLab home page

Creating and Opening a Notebook Instance

On the JupyterLab home page, click an applicable AI engine in the Notebook area to create a notebook file with the corresponding framework.

The AI framework supported by each notebook instance varies according to the working environment. The following figure is only an example. Select an AI framework based on the site requirements. For details about all framework versions and Python versions supported by ModelArts, see Supported AI Engines.

Figure 3 Selecting an AI engine and creating a notebook instance

The created notebook file is displayed in the navigation tree on the left.

Figure 4 Creating a notebook file

Creating a Notebook File and Opening the Console

A console is essentially a Python terminal. After a statement is entered, the corresponding output is displayed, which is similar to the native IDE of Python.

On the JupyterLab home page, click an applicable AI engine in the Console area to create a notebook file with the corresponding framework.

The AI framework supported by each notebook instance varies according to the working environment. The following figure is only an example. Select an AI framework based on the site requirements.

Figure 5 Selecting an AI engine and creating a console

After the file is created, the console page is displayed.

Figure 6 Creating a notebook file (console)

Uploading a File

On the JupyterLab page, you can click Upload File in the upper left corner and select a local file to upload.

The size of the file to be uploaded using this function is limited. If the file size exceeds the limit, you are advised to use other methods to upload the file. For details, see Uploading Data to JupyterLab.

Figure 7 Uploading a file

Editing a File

JupyterLab allows you to open multiple notebook instances or files (such as HTML, TXT, and Markdown files) in the same window and display them on different tab pages.

Using JupyterLab, you can orchestrate multiple files. In the file display area on the right, you can drag a file to adjust its position. You can open multiple files at the same time.

Figure 8 Orchestration of multiple files

When writing code in a notebook instance, you can create multiple views of a file to synchronously edit the file and view the execution result in real time.

To open multiple views, open the file and choose File > New View for Notebook.

Figure 9 Multiple views of a file

Common Icons and Plug-ins of JupyterLab

Figure 10 Common icons and plug-ins of JupyterLab
Table 1 Icon description

Icon

Description

Opens the Launcher page. Then you can quickly create notebook instances, consoles, or other files.

Creates a folder.

Uploads a file. For details, see Uploading a File.

Updates a folder.

Git plug-in, which can be used to connect to the GitHub code library associated with the notebook instance. For details, see Using the Git Plug-in.

Table 2 Common plug-ins in the plug-in area

Plug-in

Description

Lists files. You can click here to display the list of all files in the notebook instance.

Lists ModelArts examples. You can click any example in the list to view its code and version mapping.

Displays the terminals and kernels that are running in the current instance.

Git plug-in, which can be used to quickly use the GitHub code library. For details, see Using the Git Plug-in.

Quick start command.

Displays the tab page listing the files that are being opened.

Document organization.