Chapter 2: Working With HPSS
|
HSI can be used in an interactive session with a response for each request entered at the keyboard; it can also be used in single-line execution mode interactively or within shell scripts, or called from an executing program, using the system() function..
As HSI processes a request, it engages in a network dialogue with various
components of the HPSS system. At times, due to network or other activity,
it may appear as though HSI is `hung', although internally all functions are
issued with timeout and retry logic which will quit after a reasonable time
has expired with no response. You, as an interactive user, can take action
to stop the continued wait and retry cycle. The actions available depend on
which operating system you are using; normally typing ^C (control-C) will
cause the current command to be interrupted.
The HSI command line has the following general format:
hsi [options] [command [parameter(s)]] [ ; command [parameter(s)]] ...
In interactive mode, if no commands are encountered, HSI will prompt for input, ending the session when the END command (or one of its aliases) is entered.
HSI can also be used in one-liner mode by placing all of the commands on the startup line, separated by semicolons (";"). Note that it may be necessary to enclose the entire command string in quotes to protect it from interpretation by the shell - see Section 8.7 - Operating Considerations for One-Liners for more information.
In one-liner mode, all commands on the startup line are processed, then HSI
terminates execution. This is the normal mode for shell scripts and batch
jobs.
Note: A "one-liner" can extend beyond a single line
of text, by way of a normal Unix escaped return - a return character immediately
following a "\" - up to the usual limit of around 250 characters.
It is more efficient to put many commands into a single HSI one-liner than to
use several HSI sessions in succession to accomplish the same actions.
Options are used to set initial operating modes for HSI, and are listed below:
Note: No options are needed to access the NERSC HPSS
system archive. The command "hsi" by itself will connect to the
archive system. The command "hsi hpss" will connect to the NERSC
HPSS system named hpss.
| -L Specific to NERSC |
Forces regeneration of local credentials used for
automatic authentication at NERSC. These credentials are store in
|
| -A authmethod Not needed to access either of the NERSC HPSS systems. |
(non-DCE HSI version only) Specifies the authentication
method to be used. The authmethod parameter is not case-sensitive.
Possible settings are:
|
| -d | enables debugging messages at startup. The |
| -e | Enables echoing of lines read from |
| -F char Default = ":" |
specifies the pathname separator for specifying different local and HPSS pathnames for the same file |
| -g number | sets the maximum number of matched entries allowed for filename "globbing" (pattern-matching). This option is usually unneeded, but was provided for abnormal situations. |
| -h hostname or hostname/port Not needed to access either of the NERSC HPSS systems. |
(Non-DCE version only). Specifies the hostname or
host IP address and (optionally) the port for connecting to the non-DCE
server. The default port number assigned by the IANA is 1217. This option
can also be specified by setting the |
| -kkeytab_path | Specifies the path to the DCE keytab file to be used
to obtain credentials. This applies to both the DCE and non-DCE versions
of HSI; however, it only has meaning for the non-DCE HSI if |
| -l login_name Default = login id currently in use on local system or shell session. |
Specifies an alternate login name to use. For DCE
combo authentication and keytab authentication, this name is the DCE
principal to be used.
For Kerberos authentication, it is the Kerberos principal name, and
should be of the form |
| -q | sets "quiet" mode. In this mode, non-essential messages are suppressed, for example, the "Username" message and the HPSS announcement messages will not be displayed if this option is selected |
| -s size | specifies the maximum file size to be used when piping standard input to the hsi client. This option is used to split large piped files into multiple HPSS files. |
When HSI begins execution, it reads the system-wide startup file: /usr/lib/hsirc and the user's private startup file (if it exists): ~/.hsirc Both of these files are stored in local storage, not in the user's HPSS space.
HSI also will look for a startup file in the user's HPSS home directory after authentication has completed successfully.
Startup files are used to contain startup options for HSI. Input lines in
the file consist of comments and directives.
option = value
Note that the spaces surrounding the "=" are required.
Currently recognized options are:
The default prompt string ? can be replaced with a string of the user's choosing. Metacharacters of the form "%x are expanded each time the prompt is displayed. The following metacharacters are currently supported:
For example, to set the default prompt to the current HPSS working directory,
followed by the string "->", the following line could be inserted
in the .hsirc file:
PS1 = "%W->"
[ PAGE TOP ]
An HSI request is your input to HPSS to accomplish a desired function. You sign on to a computer and run the HSI utility program to communicate with HPSS. HSI can be used interactively, but it can also be used in single-line execution mode or called from an executing program or a command-language script (for example, as part of a batch job).
You start HSI by entering
hsi <return>
After login validation has completed, you will receive any startup messages and the prompt (normally a question mark "? ") indicating that HSI is ready to accept input. (See the PS1 keyword, and the .hsirc startup file for info on changing the prompt string).
You can then enter HSI commands. When you are ready to finish, enter
 quit <return>
(Note that there are aliases for the "quit" command, such as "end", which will all cause HSI to terminate.)
[ PAGE TOP ]
The basic format for all HSI requests is
[ PAGE TOP ]
HSI returns a response for each request entered. The response shows whether the request was executed successfully or was not completed due to some error. If an error occurred, the response indicates why the request failed.
The basic format of a normal response is
Refer to Chapter 4, HSI Responses, for more information about responses and to HSI Return Codes for a listing of HSI error responses.
[ PAGE TOP ]
HPSS supports a hierarchical storage structure called a tree, which consists of segments called nodes:
A file descriptor node is created when a file is first stored on HPSS. It contains information about the file, such as its size and hierarchy ID, but not the actual file data. File descriptor nodes cannot have descendants.
File trees, when illustrated, are customarily shown as inverted. The root
is shown at the top with descendant nodes beneath it. Connecting branches
show the relationships between the nodes and the root (see the Simple Tree
example). If you need to save only a few files, you can probably use a simple
tree (one with no subdirectories). Complex trees (those with subdirectories)
are described in Chapter 5: Tree Structures, Directories
and Paths
Note: This tree morphology is similar to that use in most computer file systems, but HPSS differs other file systems in significant ways. For example, some information about files stored in HPSS is stored in a database that is separate from the actual file storage. This makes some operations more efficient, and others more expensive, and represents design choices based on the expected uses of HPSS.
[ PAGE TOP ]
2.8 Paths and Working Directories
To store or retrieve a file in an HPSS tree, you may specify to HSI the complete path from the root node to the file node. The name of each node is preceded by a slash (/) and then chained together from the root downward to form the complete path. The maximum length of each node name is 255 characters. The maximum total path length, including slashes, is 1023 characters.In the simple tree shown in the Simple Tree example, the complete path to the file "Data1" is
Example: using the default Working Directory path name
There are nine other Working Directories. Using them is optional and requires planning, but they are helpful when dealing with multiple trees or with requests that require two paths. See Chapter 5, Tree Structures, Directories, and Paths, for more information.
[ PAGE TOP ]
2.9 HPSS Security and File Sharing
To execute an HSI command successfully, the user must have access to the affected files or directories as per normal UNIX file systems:In addition, you may be placed as a member of one or more administrative groups, each of which is known to HPSS by a Group ID, or GID. When HPSS validates your access rights to files, it takes into account all GIDs of which you are a member. The list of groups to which you belong is also referred to as your group vector.
If you expect to share files with other users, you will need to understand access rights. All files are protected against unauthorized access. You can give other users access through the proper combination of permission bits. See Chapter 6, Security and File Sharing, for more information.
Note: Each NERSC User is assigned to a "Group" within HPSS that is associated with the user's "repository", the accounting entity in which CPU time and storage allocations are maintained. However, special HPSS "Project Groups" are also available for the express purpose of expediting files sharing among specific groups of users, even if they belong to different repositories. A Project Group provides a separate "home" directory, independent from those of the member individuals. Storage usage charges incurred by a Project Group are levied against a specified repository, usually that of the individual who requested its creation. Project Groups require special setup, which is done only on request. To inquire about this, send email to consult@nersc.gov.
HPSS supports ACLs for multilevel security. However, ACL support is not included in HSI at this time.
[ PAGE TOP ]
Interactive use of HSI involves the following activities:
Example: interactive use of HSI
[ PAGE TOP ]
In single-line execution mode (one-liners), the HSI invocation and all the requests are included in one execute line. When a <RETURN> is entered, each request is executed, HSI ends, and control returns to the operating system of the local computer. You can continue request input on a second line with a backslash (\) as the last character of the line, and single-line execution will still be in effect (see Request Format Rules in Section 3.2).
The execute line for single- line execution has the form:
In the following example, the one-liner accomplishes some of the same tasks as the interactive session shown in the previous example. The space following "hsi" and the semicolons between requests are required. Additional spaces are permitted. The command is placed in double quotes to preclude interpretation by a Unix command shell interpreter program.
Example: single-line execution
Note: Commands may often be abbreviated, as in "s" for "save", or shortened, as in "del" for "delete".
[ PAGE TOP ]
HSI may also be used in scripts and batch files.
Note: NERSC recommends caution in using HSI in batch scripts, as HPSS delay will stall a parallel job, but the lost time will count against the job's requested runtime.
[ PAGE TOP ]