Gridmap_Utils - A utility module for the gx-map system
The Gridmap_Utils module is part of the gx-map system. The module is installed in lib/Gridmap_Utils.pm under the gx-map installation directory.
This module is not intended to be used outside the gx-map system itself. All interfaces are subject to change without notice. The definitive documentation is the source; each function is described there (at least briefly) in a comment block. A few features can be described here.
The gx-map system depends on high-precision timestamps to determine the order in which mapping requests are to be applied. Most timestamps are stored as raw Unix timestamps (seconds since 1970-01-01 00:00:00 GMT). This may be annotated with a human-readable string of the form Ddd YYYY-MM-DD HH:MM:SS UTC, but this is ignored by the software.
For some purposes, a timestamp is stored in microsecond resolution, using Perl's Time::HiRes module.
See the source, Gridmap_Utils.pm, for more details.
Internally, gx-map stores most of its data in records implemented as Perl hashes, or as references to Perl hashes, where the keys and values are field names and values, respectively.
These records can be read and written to a files as plain text. For example, this is how the requests.log file is generated; see the gx-map-requests-log man page for details on the format.
A slightly different external format can be used for a single record rather than for a list of records. The '{' and '}' delimiters are omitted.
The Read_Records()
and Write_Records()
functions are used to
convert between the internal format using hash references and the
external plain-text format.
The gx-map system, especially the gx-check-requests command, uses
files downloaded from ftp or web servers. Rather than re-downloading
the files each time they're used, the Cache_File()
function
implements a caching mechanism. Cached copies of downloaded files
are stored under the gx-map-data/cache/ subdirectory. The name
of each cache file is derived from the URL; the mapping is similar
to the quoted-printable encoding.
The Cache_File()
function takes a single argument, a URL.
It returns a record (a hash reference) which includes the name of the
cached copy of the specified file as well as some status information.
If the file can't be downloaded, the client can use a previously
cached copy. Additional information is tracked to avoid reporting
the same error multiple times.
All downloads are performed using the curl command. The <curl> command is first used to check the modification time of the remote file; if this matches that of a previously downloaded copy, it's not downloaded again.
The curl command is invoked with the "--insecure"
option, which
causes it to ignore any server certificates for an https URL.
This is necessary (or at least convenient) for web servers that
use unrecognized certificates. Since gx-ca-update validates
the checksums and signatures for all the files it downloads, this
shouldn't create a security problem.
See the source, Gridmap_Utils.pm, for more details.
The Gridmap_Utils module provides a number of other utility functions dealing with user accounts, file timestamps, distinguished name formats, e-mail notification, and error handling.
gx-request(1), gx-check-requests(8), gx-gen-mapfile(8), gx-ca-update(8), gx-map-requests-log(5)
Keith Thompson, San Diego Supercomputer Center, <kst@sdsc.edu>
See the file LICENSE in the gx-map distribution, installed in the etc/gx-map subdirectory.