Ophidia Terminal

Note

In the following configuration files the passwords are ‘abcd’; you are recommended to change them in case Ophidia service has to be used in a production public environment.

Possible configuration of environment variables:

export OPH_TERM_PS1=yellow
export OPH_USER=oph-test
export OPH_PASSWD=abcd
export OPH_SERVER_HOST=server.hostname
export OPH_SERVER_PORT=11732
export OPH_EXEC_MODE=sync
export OPH_NCORES=4
export OPH_TERM_VIEWER=coloured
export OPH_TERM_FORMAT=classic
export OPH_TERM_IMGS=open
export OPH_GRAPH_LAYOUT=horizontal_compact
export OPH_RESPONSE_BUFFER=1024
export OPH_WORKFLOW_AUTOVIEW=on

server.hostname is the hostname of Ophidia Server node. You can set it to 127.0.0.1 for an all-in-one instance of Ophidia platform.

Description of environment variables:

OPH_TERM_PS1          ← color of the prompt (default is red)
OPH_USER              ← username to be used to access Ophidia Server
OPH_PASSWD            ← password to be used to access Ophidia Server
OPH_SERVER_HOST       ← IP address/DNS name of the host where Ophidia Server is running
OPH_SERVER_PORT       ← port number of Ophidia Server
OPH_SESSION_ID        ← identifier of current session (initialized after the first remote request)
OPH_EXEC_MODE         ← execution mode: async for asynchronous mode (default) or sync for synchronous mode
OPH_NCORES            ← number of cores per task to be used by default (if the variable is not set then 1 core per task will be adopted)
OPH_CWD               ← current working directory (default is /home/<user>)
OPH_DATACUBE          ← current value of parameter "cube" (taken from output of operators that create a new datacube)
OPH_TERM_VIEWER       ← output renderer: dump (view output as it is, in json format), basic (view output in tabular format), coloured (basic + colors), extended (same as basic + info about data sources, consumers, producers, objkeys...), extended_coloured (extended + colors)
OPH_TERM_FORMAT       ← format of the command 'view': classic (print all the data in JSON Response), compact (print the JSON Response without the Workflow Task List);
OPH_TERM_IMGS         ← save and/or auto-open images created from graphs/trees originated by some operators; set to "no_op" (images are not created), "open" (images are created, saved on disk and automatically opened) or "save" (images are created and saved on disk but not opened)
OPH_GRAPH_LAYOUT      ← node arrangement within images (horizontal vs vertical)
OPH_RESPONSE_BUFFER   ← maximum size (in kB) of the buffer used to store a JSON Response
OPH_WORKFLOW_AUTOVIEW ← automatic and periodic rendering of workflow status after submission; the option can be activated only in case of asynchronous execution and auto-opened images

Additional information on these variables can be obtained by using the on-line help as in the following example:

OPH_TERM > help OPH_WORKFLOW_AUTOVIEW

Login parameters can be specified at startup with command line options:

-u ← OPH_USER
-p ← OPH_PASSWD
-H ← OPH_SERVER_HOST
-P ← OPH_SERVER_PORT

These values overwrite corresponding values set into the user environment.

To execute a command without entering oph_term it can be used the option -e:

oph_term -e "oph_operator ..."

Make sure you have necessary environment variables set according to your needs.

To execute a workflow (written in a JSON file according to the Ophidia Workflow JSON Schema) you have to specify the following command line option -w:

oph_term -w filename.json

In this case filename.json is assumed to be stored in the current working folder, but the local path to a JSON file in other folder can be used.

Possible workflow parameters can be set by using the option -a as follows:

oph_term -w filename.json -a "parameter1,parameter2,parameter3..."

Use commas to separate the values of workflow parameters.

Alternatively, you can adopt the option -e as follows

oph_term -e "./filename.json parameter1 parameter2 parameter3..."

provided that local path is also given (current working folder ”./” in this example).

The credentials [OPH_USER, OPH_PASSWD] must be registered in authorization data of Ophidia Server stored in $prefix/authz/users.dat.

oph_term will save the history of all submitted commands in the user HOME, in the file .oph_term_history.

At each startup, if the environment variables OPH_SERVER_HOST and OPH_SERVER_PORT are set, oph_term will try to download the latest version of Ophidia operators XML definitions, in order to autocomplete commands. All XMLs are saved in the user HOME, in the folder .oph_term_xml, and organized per server-hostname.