Skip to main content

Use Datalayer from JupyterLab

Datalayer integrates seamlessly as a JupyterLab extension, allowing you to manage and interact with Remote Kernels directly from your familiar JupyterLab interface. The extension mirrors the functionality available on Datalayer once you log in.

Installation

To install the Datalayer extension, ensure you have python>=3.9 and pip installed on your machine. Then, run the following command in your terminal:

# Use --upgrade if you want to update an existing installation to the latest version.
pip install datalayer jupyterlab

Start JupyterLab

Start JupyterLab as usual.

jupyter lab

You can provide traits to configure the server that delivers the Kernels as well as additional options for the display.

jupyter lab \
--DatalayerExtensionApp.run_url="https://oss.datalayer.run" \
--DatalayerExtensionApp.white_label=False \
--DatalayerExtensionApp.Launcher.category="GPU" \
--DatalayerExtensionApp.Launcher.name="GPU Kernels" \
--DatalayerExtensionApp.Launcher.icon_svg_url="https://raw.githubusercontent.com/datalayer/icons/main/svg/data2/circle-white.svg" \

The traits can be provided in a configuration as well, see the Jupyter common directories and file locations.

Datalayer Launcher

JupyterLab users are familiar with accessing the launcher, which displays various tiles for creating new Notebooks for example, as shown below.

Enjoy examples on this GitHub example repository.

We have also published a specific Blog Post Deep Dive into our Examples Collection on October 25, 2024.

Datalayer introduces a new section and tile at the top of the JupyterLab launcher. Click on the "Jupyter Kernels" tile to access the Datalayer UI.

Authentication

You can easily log in or sign up for Datalayer directly within the JupyterLab extension. Your account details are shared between the Datalayer website and the extension, ensuring a consistent and unified experience across both platforms.

Launch Remote Kernels

Refer to the Kernels section to learn how to launch Remote Kernels.

Use Remote Kernels

Assign a Remote Kernel to a Notebook

Once your Remote Kernel is up and running, you can change the kernel of any Notebook to a Remote Kernel by using the kernel picker located in the top-right corner of the Notebook interface. Simply assign a running Remote Kernel.

You can also launch a new Remote Kernel directly from the kernel picker by selecting an environment in the 'Assign a new Kernel' section. You'll have the option to configure kernel settings, such as time reservation (see the Kernels page for more details).

Variables Transfer

When you switch to a Remote Kernel, you have the option to transfer the variables from the current kernel to the new one. This feature is useful when you want to keep the state of your variables.

warning

Variable transfers are currently limited to 7 MB. This limit is expected to increase in the future, and the option to add data to the Remote Environment will also be introduced.

Assign a Remote Kernel to a Cell

Datalayer allows you to selectively run specific cells on Remote Kernels. This hybrid approach optimizes both performance and cost by using Remote resources only when necessary. Learn more about this feature in our blog post.

To assign a cell to a Remote Kernel, simply use the cell menu as shown below.

Variables Transfer

You can also transfer variables between cells running on different kernels. This feature is particularly useful when you want to use variables you defined in previous cells.