Running local command line scripts

Deephaven provides a utility for running local "one-and-done" scripts via the command line. This function is accessible via iris_exec as follows:

/usr/illumon/latest/bin/iris_exec run_local_script [<launch args>] -- -s script.groovy [<options>] [<variable> <value>, …]

Options

The -s option specifying the script file is required. There are other options as described below.

OptionReq?DefaultDescription
-sYesN/AScript file to run
-mNo4Worker heap size in GB
-lNoINFOLocal log level - the log level to apply locally. Server messages are also affected; they will be logged locally with a [SERVER] prefix if they match the specified priority at the server and the client.
-rNoThe same as that specified for Local (INFO if not specified).Remote log level - the log level to apply in the server when running the script.
-tNoAuto-detect from file extensionSession/script type. Presently supported is "Groovy" or "Python".
-oNoN/AFile to which script standard output should be directed. This output is also directed to the standard log, but this allows you to get a "clean" output from the script.
-eNoN/AFile to which script standard error should be directed. This output is also directed to the standard log, but this allows you to get a "clean" output from the script.
-spNoInitial script locationDirectory from which scripts should be sourced*
-kNo**IRIS_KEYFILE environment variableDeephaven private key file
-hNoRemoteQueryDispatcherParameters.host configuration propertyQuery server host on which to run the script.
-pNoRemoteQueryDispatcherParameters.queryPort configuration propertyQuery server port on which to run the script.
-tdsYesN/ASet table data service source. This can be any tds configured in the data routing file. Common values are “query” and “local”.
-jYesN/AAdd JVM arguments. Note: This takes full JVM argument after it; e.g., -j -Dorg.roaringbitmap.ImmutableContainer.enabled=true
-jpYesN/ASelect a JVM profile. Note: A JVM profile name with spaces in it can be enclosed in double-quotes.

Note 1

You can include common functionality in your Groovy scripts with the source("stuff.groovy") command. These scripts are sourced from the client filesystem relative to the initial script (or the location specified with the -sp option, if present).

Note 2

Running a script on the Deephaven query server requires authentication which is provided by a private key file. You may set the path to this file in the environment variable IRIS_KEYFILE or specify it on the command line with the -k option. If present, the option overrides the environment variable.

Note 3

While this command executes a script located on the client filesystem, it is run on a Deephaven server, typically by the dbquery or dbmerge user, so resources on the client system are not typically available, with the exception of other scripts, via the source command.

Note 4

This command also accepts positional arguments representing values that will be bound as global variables in the specified script. For example, the following will run the script fun.groovy with the variable msg bound to the value "Hello World" and pi to 3.14159 (both as strings).

/usr/illumon/latest/bin/iris_exec run_script -- -s fun.groovy msg "Hello World" pi 3.14159