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:

Option

Req?

Default

Description

-s

Yes

N/A

Script file to run

-m

No

4

Worker heap size in GB

-l

No

INFO

Local 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.

-r

No

The 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.

-t

No

Auto-detect from file extension

Session/script type. Presently supported is "Groovy" or "Python".

-o

No

N/A

File 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.

-e

No

N/A

File 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.

-sp

No

Initial script location

Directory from which scripts should be sourced*

-k

No**

IRIS_KEYFILE environment variable

Deephaven private key file

-h

No

RemoteQueryDispatcherParameters.host configuration property

Query server host on which to run the script.

-p

No

RemoteQueryDispatcherParameters.queryPort configuration property

Query server port on which to run the script.

-tds

Yes

N/A.

Set table data service source. This can be any tds configured in the data routing file. Common values are “query” and “local”.

-j

Yes

N/A

Add JVM arguments. Note: This takes full JVM argument after it; e.g., -j -Dorg.roaringbitmap.ImmutableContainer.enabled=true

-jp

Yes

N/A

Select a JVM profile. Note: A JVM profile name with spaces in it can be enclosed in double-quotes.

* 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).

** 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: 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.

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

Logging

Under a typical configuration, iris_exec outputs its log to the /var/log/deephaven/misc directory. This can be customized by modifying the property file (by default /etc/sysconfig/illumon.d/resources/IRIS-CLI.prop), or by passing in the logDir Java parameter. Log messages are also copied to stdout so they can also be captured that way.


Last Updated: 16 February 2021 18:07 -04:00 UTC    Deephaven v.1.20200928  (See other versions)

Deephaven Documentation     Copyright 2016-2020  Deephaven Data Labs, LLC     All Rights Reserved