NC: View contents of a SNAPPROP environment


Altair Accelerator (formerly Runtime Network Computer) has two ways to capture a snapshot environment when submitting a job, so that the submit environment may be re-constructed when running the job.

We recommend using named environments where possible, but snapshot environments are convenient and require no advance setup, as named environments do.

The default method is SNAPSHOT, which uses a file named like 'envNNN.env' to capture the submit environment in /bin/sh syntax.  Such environment files are stored under the 'vnc_logs/snapshots' directory, or in the one specified by the optional env-var NC_SNAPSHOT_DIR and related env-vars (use 'vovshow -env SNAPSHOT' for more details).

Snapshot files are economical.  The name of the file is computed by hashing the var=value pairs of the environment, so all jobs having the same submit environment can share the same snapshot file.

The second method to capture environment snapshots is SNAPPROP, which saves the submit environment in a base64-encoded property, named 'SNAPSHOT', on the job. 

This has the advantage of being immune to filer-related issues like NFS delays, and over-aggressive cleanup scripts that may remove snapshot env files while a job is still queued.   It has some disadvantages too: increased memory consumption, which can be significant if jobs are numerous, because snapshot properties are not shared, and also the extra trip to vovserver to get the snapshot property, which adds loading.

Since the SNAPPROP environment is base64-encoded, it needs to be decoded to be viewed by humans.

NC has a built-in method for this:

  % nc info -e jobID

You can also get the base64-encoded environment for other processing by

  % nc cmd vovprop get jobID SNAPSHOT

For example (on Linux)

  % nc cmd vovprop get your-job-ID SNAPSHOT | base64 -d | more