Install and use plugins
There are many ways to customize either the Deephaven build or packages to fit your use-cases. In this guide, we extend Deephaven to build a custom Docker image with JS plugins installed. For this guide, we will add the js-plugin-matplotlib. This makes the popular Matplotlib library available for use, providing more data visualization options within the Deephaven IDE, such as 3D plots and sophisticated scatter plots. As always, you'll be able to plot both your static and real-time data.
Plugins in Deephaven can extend the functionality of a running server, UI, client API, or all of them. Deephaven offers several pre-built plugins that can extend the platform's functionality. These are available to anyone using Deephaven Community Core.
Server-side plugins extend the functionality of the Deephaven server. For instance, plotting plugins add the ability to plot with new APIs such as Plotly Express, Matplotlib, and Seaborn. Authentication plugins add the ability to authenticate users with new authentication methods such as mTLS.
Client-side plugins extend the functionality of any of Deephaven's client APIs. For instance, the Groovy client API can be extended with plugins that allow the client to manage arbitrary objects in the server, or to interact with the server using a different serialization format.
Note
In some cases, you'll want to install packages rather than use plugins. Those instructions are covered in How to install packages.
To have complete control of the build process, you can Build and launch Deephaven from source code.
This guide covers the installation and use of pre-built plugins. For information on building your own plugins, see Create your own plugin.
Install a plugin
Note
Authentication plugins require additional configuration, which is outside the scope of this guide. For more information, see the documentation for each authentication plugin.
Extend Deephaven with Docker
First, follow the Launch Deephaven from pre-built images steps from the Docker install guide.
To open a Groovy session, run:
Once you have the docker-compose.yml file pulled down, define your own web Docker image in web/Dockerfile that includes the plugins you would like to use.
-
Create the subdirectory
webin the same folder as yourdocker-compose.yml:mkdir web -
Create the
Dockerfilefor web and open for editing:vi web/Dockerfile -
Paste the following into the
web/Dockerfileand save:
Many plugins will also require a server side component. To define the plugins used on the server, create a server/Dockerfile similar to above:
-
Create subdirectory
serverin the same folder as yourdocker-compose.yml:mkdir server -
Create the
Dockerfilefor server and open for editing:vi server/Dockerfile -
Paste the following into the
server/Dockerfileand save:
After building, you need to update your docker-compose file to specify using that build. Modify the existing docker-compose.yml file and replace the web and server definitions with the following:
When you're done, your directory structure should look like:
Everything's ready to go! Now you just need to run docker compose up as normal, and you will be using your custom image with your JS plugins installed.
Alternative Docker template
The following Dockerfile provides an alternative template for installing a plugin containing both Javascript and server components in a Deephaven Docker image:
You can use Docker to build and run the image:
If you are using Docker Compose, modify the docker-compose.yml file to build from a Dockerfile rather than pull the image from the registry:
From there, you can build and run with a single command:
Available plugins
The plugins repository
Deephaven hosts a plugins repository that contains many of the official plugins offered. It's a good place to find more information about the plugins and view their source code.
Note
Some plugins are not in the plugins repository but are still available for use. For instance, some authentication plugins are JAR files only available on Maven Central.
Two folders in the plugins directory are of particular interest:
- plugins: Contains the implementation of the plugins. This is where you can find each plugin's source code and additional documentation.
- templates: Contains templates for creating new plugins. This is a great starting point if you want to create your own plugin.
The available plugins are divided into sections below based on their functionality.
User interface
All of the following user interface plugins can be installed with pip with no extra work.
deephaven-plugin-ui: A plugin for real-time dashboards.deephaven-plugin-plotly-express: A plugin that makes Plotly Express compatible with Deephaven tables.deephaven-plugin-matplotlib: A plugin that makes Matplotlib and Seaborn compatible with Deephaven tables.
Authentication
Authentication plugins have a more complex installation process than other plugins. Please refer to the documentation links below for more information.
- Keycloak: A plugin that enables the use of Keycloak and OpenID Connect (OIDC) for authentication.
- mTLS: A plugin that enables mutual TLS (mTLS) authentication.
- Username/password: A plugin that enables username/password authentication.
Bidirectional plugin examples
Bidirectional plugins allow users to create custom RPC methods that enable clients to interact with and return objects on a running server. See the following for an example:
- Pickle RPC plugin: A plugin to remotely execute methods on a Deephaven server.
- Example bidirectional plugin: The same plugin presented in the Bidirectional plugins guide.
Using plugins with the Groovy client
When working with plugins from the Groovy client API, you'll typically interact with them through the session's plugin client functionality. Here's a general pattern for using plugins:
Basic plugin usage
Working with bidirectional plugins
For bidirectional plugins that support custom RPC methods, you'll typically create a proxy class that wraps the plugin client:
Gradle dependencies for plugin development
When developing Groovy clients that use plugins, you'll typically need these dependencies in your build.gradle: