Usage

PDS4 Packager provides three different command line executables

pds4-packager-config-synchronizer

The configuration synchronizer tool is a script that downloads and sets up the latest approved PDS4 Packager tool configuration.

It does not require any execution parameter but, in order to be able to retrieve the required configuration data, an internet connection is necessary.

Please find an execution example below:

$ pds4\-packager/bin/pds4\-packager-config-synchronizer

NOTE: It is recommended to maintain PDS4 packager configuration up do date.

pds4-packager

The packaging tool is a script that checks the products are valid against the current configuration and builds the delivery package.

Running the script without parameters show the usage help:

$ pds4\-packager/bin/pds4\-packager
usage: pds4\-packager -i input_dir -o output_dir [-d] [-l] [-s] [-h] [-V] [-v]
-d,--dictionary-stack-id Validate products using this dictionary stack id
-h,--help
-i,--input Directory that contains the PDS4 products to package
-l,--local
-o,--output Directory where the delivery package will be generated
-s,--skip-validation
-V,--verbose
-v,--version

pds4-packager supports the following parameters:

A dictionary stack is a set of dictionaries bundled together in a similar way to an information model version.

The current definition of the diccionary stack is available in section 2 of the BepiColombo Annex to the PSA PDS4 Archiving Guide.

NOTE: Skipping validation is not recommended as, if the products are not good enough, the packaging phase might fail in unexpected ways.

This is an execution example:

$ pds4\-packager/bin/pds4\-packager -i /bepicolombo/data/ -o /bepicolombo/delivery/

pds4-packager-validate

The validation tool is a script that checks the products are valid against the current configuration but does not generate a delivery package.

Running the script without parameters show the usage help:

$ pds4\-packager/bin/pds4\-packager-validate
usage: pds4\-packager-validate [-D] [-d] [-h] [-v] [-v] [-i] inputdir
-D,--disable-data-check Do not check product if data is consistent with product definition
-d,--dictionary-stack-id Validate products using this dictionary stack with id
-h,--help
-i,--input Directory that contains the PDS4 products to validate
-V,--verbose
-v,--version

As can be seen, pds4-packager-validate supports the following parameters:

A dictionary stack is a set of dictionaries bundled together similar to a information model version.

The current definition of the diccionary stack is available in section 2 of the BepiColombo Annex to the PSA PDS4 Archiving Guide.

The tool execution should look as follows:

$ pds4\-packager/bin/pds4\-packager-validate -i /bepicolombo/data/
[INFO ] e.b.p.v.c.ValidationCli: Validation configuration: PDS4 packager validate: 0.1.0 NASA validate: 1.14.0
[INFO ] e.b.p.v.c.ValidationCli: PDS4 products in /bepicolombo/data passed validation
[INFO ] e.b.p.v.c.ValidationCli: Validation took 00:00:14.684

Advanced usage

Changing log configuration

pds4-packager uses apache log4j2 as logging implementation and its configuration file (log4j2.xml) is stored under pds4-packager/conf. The user can update the configuration file following log4j2 configuration manual.

Example: Changing logging to output without colours
  1. Open log4j2.xml
  2. Replace pattern in Pattern_Layout tag from
    [%highlight{%-5level}] %style{%C{1.{cyan}: %msg%n%throwable
    to
    [%-5level] %style{%C{1.: %msg%n%throwable

Passing additional java options to pds4-packager

On startup pds4-packager reads the environment variable JAVA_OPTS for additional configuration of the Java Virtual Machine. Using this variable the user can modify the amount of memory allocated to pds4-packager or pass additional configuration to it.

Example: Modifying the maximum memory allocated to pds4-packager

If pds4-packager throws an OutOfMemoryError while packaging a set of products, the user can override the default memory configuration ( 1/4 of the installed memory ) with:

Example: Modifying the default temporary directory

The user can change the location of the temporary directory used by pds4-packager ( Unix/Mac: /tmp Windows: <UserDirectory>/Temp ) with: