Server Configuration
Overview
To simplify the user experience, many sites may opt to provide predefined ParaView server configurations for their users, which can be done with an external XML file - see Server Startup. Although server configuration is new to ParaView, similar functionality already exists in ParaView Enterprise. This page proposes an XML schema for storing server configurations that is based on the existing functionality.
Example
Following is an example of the proposed server configuration XML:
<Servers> <Server name="localhost (forward)" resource="cs://localhost" owner="site"> <CommandStartup> <Command exec="cmd" timeout="120" delay="3"> <Arguments> <Argument value="/c" /> <Argument value="start" /> <Argument value="/b" /> <Argument value="pvserver" /> <Argument value="--server-port=$PV_SERVER_PORT$" /> <Argument value="--use-offscreen-rendering" /> </Arguments> </Command> </CommandStartup> </Server> <Server name="localhost (forward - with port selection)" resource="cs://localhost" owner="site"> <CommandStartup> <Options> <Option name="PV_SERVER_PORT" label="Port"> <Range type="int" min="1" max="65535" step="1" default="11111" /> </Option> </Options> <Command exec="cmd" timeout="120" delay="3"> <Arguments> <Argument value="/c" /> <Argument value="start" /> <Argument value="/b" /> <Argument value="pvserver" /> <Argument value="--server-port=$PV_SERVER_PORT$" /> <Argument value="--use-offscreen-rendering" /> </Arguments> </Command> </CommandStartup> </Server> <Server name="localhost (forward - with connect ID)" resource="cs://localhost" owner="site"> <CommandStartup> <Options> <Option name="PV_CONNECT_ID" label="Connect ID"> <Range type="int" min="1" max="65535" step="1" default="random" /> </Option> </Options> <Command exec="cmd" timeout="120" delay="3"> <Arguments> <Argument value="/c" /> <Argument value="start" /> <Argument value="/b" /> <Argument value="pvserver" /> <Argument value="--server-port=$PV_SERVER_PORT$" /> <Argument value="--use-offscreen-rendering" /> <Argument value="--connect-id=$PV_CONNECT_ID$" /> </Arguments> </Command> </CommandStartup> </Server> <Server name="localhost (reverse)" resource="csrc://localhost" owner="user"> <ManualStartup/> </Server> <Server name="localhost (reverse - with port selection)" resource="csrc://localhost" owner="user"> <ManualStartup> <Options> <Option name="PV_SERVER_PORT" label="Port"> <Range type="int" min="1" max="65535" step="1" default="11111" /> </Option> </Options> </ManualStartup> </Server> <Server name="jupiter" resource="cs://jupiter" owner="site" > <CommandStartup> <Options> <Option name="NODES" label="Number of Nodes"> <Range type="int" min="1" max="1024" step="1" default="1" /> </Option> <Option name="MINUTES" label="Number of Minutes"> <Range type="int" min="1" max="3600" step="15" default="60" /> </Option> <Option name="COMPURATE" label="Comp-U-Rate"> <Range type="double" min="1" max="99999999" step="0.1" precision="1" default="1.5" /> </Option> <Option name="PROJECTTASK" label="Project/Task"> <String default="123/4.5" /> </Option> <Option name="FLAVORENDER" label="Enable Flav-O-Render"> <Boolean true="--flav-o-render" false="" default="true"/> </Option> <Option name="FLAVOR" label="Flavor"> <Enumeration default="cherry"> <Entry value="cherry" label="Cherry" /> <Entry value="lime" label="Lime" /> <Entry value="rutabaga" label="Rutabaga" /> </Enumeration> </Option> <Option name="NUTTINESS" label="Nuttiness" readonly="true" > <Range type="int" min="1" max="65535" step="1" default="random" /> </Option> </Options> <Command exec="cmd" timeout="120" delay="5"> <Arguments> <Argument value="/c" /> <Argument value="start" /> <Argument value="/b" /> <Argument value="mystartup" /> <Argument value="--server-port=$PV_SERVER_PORT$" /> <Argument value="--nodes=$NODES$" /> <Argument value="--minutes=$MINUTES$" /> <Argument value="--compurate=$COMPURATE$" /> <Argument value="--project-task=$PROJECTTASK$" /> <Argument value="$FLAVORENDER$" /> <Argument value="--flavor=$FLAVOR$" /> <Argument value="--nuttiness=$NUTTINESS$" /> </Arguments> </Command> </CommandStartup> </Server> </Servers>
Notes
- The <Servers> tag is the root element of the document, which contains zero-to-many <Server> tags.
- Each <Server> tag represents a configured server:
- The "name" attribute uniquely identifies the server configuration, and is displayed in the user interface.
- The "resource" attribute specifies the type of server connection, server host(s) and optional port(s) for making a connection. See Server Resources.
- The "owner" attribute specifies where the configuration originated, current valid values are "builtin" (the configuration was hard-coded into the application), "site" (the configuration was setup by site administrators), or "user" (the configuration was setup by the user). The client uses this information to set policy, e.g: "builtin" and "site" configurations are read-only, only "user" configurations are stored in per-user preferences, etc.
- The <CommandStartup> tag is used to run an external command to start a server.
- An optional <Options> tag can be used to prompt the user for options required at startup.
- Each <Option> tag represents an option that the user will be prompted to modify before startup.
- The "name" attribute defines the name of the option, which will become its variable name when used as an environment variable, and for purposes of string-substitution in <Argument> tags.
- The "label" attribute defines a human-readable label for the option, which will be used in the user interface.
- The optional "readonly" attribute can be used to designate options which are user-visible, but cannot be modified.
- A <Range> tag designates a numeric option that is only valid over a range of values.
- The "type" attribute controls the type of number controlled. Valid values are "int" for integers and "double" for floating-point numbers, respectively.
- The "min" and "max" attributes specify the minimum and maximum allowable values for the option (inclusive).
- The "step" attribute specifies the preferred amount to increment / decrement values in the user interface.
- The "default" attribute specifies the initial value of the option.
- As a special-case for integer ranges, a default value of "random" will generate a random number as the default each time the user is prompted for a value. This is particularly useful with PV_CONNECT_ID.
- A <String> tag designates an option that accepts freeform text as its value.
- The "default" attribute specifies the initial value of the option.
- A <Boolean> tag designates an option that is either on/off or true/false.
- The "true" attribute specifies what the option value will be if enabled by the user.
- The "false" attribute specifies what the option value will be if disabled by the user.
- The "default" attribute specifies the initial value of the option, either "true" or "false".
- An <Enumeration> tag designates an option that can be one of a finite set of values.
- The "default" attribute specifies the initial value of the option, which must be one of its enumerated values.
- Each <Entry> tag describes one allowed value.
- The "name" tag specifies the value for that choice.
- The "label" tag provides human-readable text that will be displayed in the user interface for that choice.
- Each <Option> tag represents an option that the user will be prompted to modify before startup.
- A <Command> tag is used to specify the external command and its startup arguments.
- The "exec" attribute specifies the filename of the command to be run. The system PATH will be used to search for the command, unless an absolute path is specified.
- The "timeout" attribute specifies the maximum amount of time (in seconds) that the client will wait for the server to start (currently not implemented).
- The "delay" attribute specifies a delay (in seconds) between the time the startup command completes and the time that the client attempts a connection to the server.
- <Argument> tags are command-line arguments that will be passed to the startup command.
- String substitution is performed on each argument, replacing each $STRING$ with the value of a predefined or user-defined variable.
- Arguments whose value is an empty string are not passed to the startup command.
- An optional <Options> tag can be used to prompt the user for options required at startup.
- The <ManualStartup> tag indicates that the user will manually start the given server prior to connecting.
- An optional <Options> tag can be used to prompt the user for options required at startup. Note that PV_SERVER_PORT, PV_DATA_SERVER_PORT, PV_RENDER_SREVER_PORT, and PV_CONNECT_ID are the only variables that make sense in this context.
- Other startup type tags may be added in the future to support e.g: builtin SSH client functionality.
Runtime Environment
When a startup command is run, its environment will include all of the variables defined by <Option> tags, plus the following predefined variables:
- PV_CONNECTION_URI
- PV_CONNECTION_SCHEME
- PV_SERVER_HOST
- PV_SERVER_PORT
- PV_DATA_SERVER_HOST
- PV_DATA_SERVER_PORT
- PV_RENDER_SERVER_HOST
- PV_RENDER_SERVER_PORT
- PV_USERNAME (currently not implemented)
- PV_CONNECT_ID
If an <Option> tag defines a variable with the same name as a predefined variable, the <Option> tag value takes precedence. This can be used to override defaults that are normally hidden from the user. As an example, a server configuration might specify a PV_SERVER_PORT option, to allow the user to override the default port.