Skip to main content
Version: Java (Groovy)

Configure the Deephaven production application

This guide provides low-level details about the Deephaven production application bootstrap configuration and startup process. The Deephaven production application is the recommended way to run Deephaven for any production application, hence its name. It runs Deephaven directly from artifacts produced during each new release. These artifacts can be found in the GitHub releases page, listed under assets.

The production application offers a greater degree of control and performance than other methods, but requires more setup and consideration of low-level details. Users who wish to get up and running without needing to worry about these details should consider Deephaven's Docker images.

This guide assumes familiarity with installing and running the Deephaven production application. For an introductory guide on installing and running, see Install and run Deephaven with pre-built artifacts.

Prerequisites

Only Java is required to run the Deephaven production application. Deephaven recommends using the latest LTS version of Java. Java 11 or later is required.

The production application also requires Linux or Mac OS. Running on Windows requires Windows Subsystem for Linux (WSL)[1].

Production application configuration

The inner structure of the application is a root directory of the form server-jetty-<version>/ with further subdirectories:

  • bin/: Contains a start script used to launch the server.
  • lib/: Contains all of the JAR files that form the application classpath.
  • etc/[2]: Contains extra files that may be useful for configuring the server JVM.

Environment variables

The start script contains the logic to collect the arguments, assemble the classpath, and execute the java command to run the server. There are several environment variables that influence the start script:

Environment VariableDescriptionDefault ValueExample
JAVA_OPTSThe main JVM arguments. These are generated by the start script, but can be overridden.Deephaven-recommended arguments and property definitions.N/A. It is not recommended to set JAVA_OPTS.
START_OPTSAdditional user-supplied JVM arguments. These are added to the command line after JAVA_OPTS.NoneSTART_OPTS="-Xms4g -Xmx4g -Dmyproperty=myvalue -Ddeephaven.console.type=groovy"
EXTRA_CLASSPATHAdditional directories to include in the Java classpath (e.g., /apps/libs/*)NoneEXTRA_CLASSPATH="/apps/libs/*:/opt/my_java_libs/*

What the start script does

The end result of the start script is a command that looks something like:

java <required-opts> $JAVA_OPTS $START_OPTS -classpath <classpath> io.deephaven.server.jetty.JettyMain [optional-bootstrap-file]
  • <required-opts> are pre-defined JVM settings that cannot be changed. Deephaven requires these settings.
  • JAVA_OPTS are JVM arguments that can be overridden, but it is not recommended to set them.
  • START_OPTS are additional JVM arguments that the user can set. It's recommended to set these over JAVA_OPTS.
  • <classpath> is the constructed classpath. It cannot be changed, however, classpaths can be added with the EXTRA_CLASSPATH environment variable.
  • [optional-bootstrap-file] is an optional file with properties that will take precedent over other system properties. This option may be removed in a future release.

Deephaven server bootstrap configuration

Bootstrap configuration parameters are ones that get set early in the application startup lifecycle, before anything in a configuration file. The Deephaven server process has a few essential bootstrap configuration parameters. They have default values that the user may choose to change via either an environment variable or system property.

note

Bootstrapping configuration is limited in scope, and is a prerequisite to the Deephaven configuration file.

Bootstrap configuration parameterEnvironment variableSystem propertyDescriptionDefault value
Application nameDEEPHAVEN_APPLICATIONdeephaven.applicationThe name used to inform default values for other pieces of configurationdeephaven
Data directoryDEEPHAVEN_DATA_DIRdeephaven.dataDirThe directory where users and applications read and write dataOS-dependent
Cache directoryDEEPHAVEN_CACHE_DIRdeephaven.cacheDirThe directory where the Deephaven server reads and writes cache dataOS-dependent
Config directoryDEEPHAVEN_CONFIG_DIRdeephaven.configDirThe directory where the Deephaven server reads configuration filesOS-dependent
Quiet flagDEEPHAVEN_QUIETdeephaven.quietWhether to suppress bootstrap loggingfalse

OS-dependent directories

OSData directoryCache directoryConfig directory
Linux$HOME/.local/share/<application>/$HOME/.cache/<application>/$HOME/.config/<application>/
macOS$HOME/Library/Application Support/io.Deephaven-Data-Labs.<application>/$HOME/Library/Caches/io.Deephaven-Data-Labs.<application>/$HOME/Library/Application Support/io.Deephaven-Data-Labs.<application>/

Downstream uses of the production application

Docker images

The Deephaven Docker images are based on the production application, as described above, with Docker specific bootstrap values. For example, the images set the environment variables DEEPHAVEN_DATA_DIR=/data, DEEPHAVEN_CACHE_DIR=/cache, and DEEPHAVEN_CONFIG_DIR=/opt/deephaven/config.

For more information, see the Docker application documentation.

Footnotes

1: Windows native support may be possible in the future.

2: For those interested in the nitty gritty, check out the Gradle application plugin.