Run scripts on Deephaven Enterprise workers

The run_local_script command runs a local Groovy or Python script on a remote Deephaven Enterprise worker. The tool sends the script body to the worker for evaluation. The tool creates a temporary Persistent Query for the worker and closes it when the script completes.

Usage

Authentication

Exactly one authentication flag is required:

FlagDescription
-u / --user <username>Authenticate with a username. Prompts for a password.
-k / --key-file <path>Authenticate with a private key file.
-a / --samlAuthenticate using SAML.

Options

FlagDescriptionDefault
-s / --script <path>Path to the local script to run. Required.—
-c / --connection-json <url>URL to the server's connection.json file.Local server configuration
-q / --query-server <name>Name of the target query server.Controller selection
-m / --heap-size <GB>JVM heap size in GB for the worker.4
-e / --worker-kind <kind>Worker engine type. Use DeephavenCommunity for Core+ workers, or a custom WorkerKind configured by your system administrator.DeephavenCommunity
-j / --jvm-arg <arg>Additional JVM argument for the worker. May be repeated.—
-t / --timeout <seconds>Worker creation timeout in seconds.60
-l / --log-file <path>File to write log messages from the worker.stdout

Script language

The script language is inferred from the file extension. Files ending in .groovy run as Groovy; all other files run as Python.

Python environment

run_local_script requires the Core+ Python client. When the current Python environment does not include the client, the command creates a temporary virtual environment, installs the client wheel from /usr/illumon/coreplus/latest/py/wheel, and deletes the environment when the script completes.

To reuse one virtual environment across runs, set DEEPHAVEN_CLIENT_VENV_DIR to a directory that the user running the command can write to. The first run creates the virtual environment in that directory, and later runs reuse it instead of rebuilding it:

Examples

Run a Python script

Run a Groovy script on a specific query server

Connect to a remote server

Use --connection-json to specify a remote server:

Increase heap size and pass JVM arguments

Exit codes

The command exits with 0 on success and 1 if the script throws an exception or fails to execute.