Bundle.sh Script
Bundles are essentially tar/gz archives of information that are built according to the specification defined on the MADARA site. You can extract information from bundles in 2 ways: the MADARA bundle.sh
scripts or tar
directly.
The MADARA bundle.sh script is invoked as $MADARA_ROOT/scripts/linux/bundle.sh
and has an interactive help menu that can be called with -h
, --help
, or help
. To unpack an archive, you can specify the bundle file with -f
or -b
combined with the -u
option for unpacking.
$MADARA_ROOT/scripts/linux/bundle.sh -u -f bundles/from_ros/swat_reliability_rc_v3.3.0__pikachu-16-0005__2018-07-25-14-29-19.sbz
The bundles are by default created as tar gzipped archives. tar has some useful features that you may want to use, including either unpacking or listing the contents of the bundle.
Listing Contents of the Bundle
tar -ztvf bundles/from_ros/swat_reliability_rc_v3.3.0__pikachu-16-0005__2018-07-25-14-29-19.sbz
Extracting Contents of the Bundle
tar -xvf bundles/from_ros/swat_reliability_rc_v3.3.0__pikachu-16-0005__2018-07-25-14-29-19.sbz
The $MADARA_ROOT/scripts/linux/bundle.sh
tool automates much of the bundling
process and encapsulates the features of $MADARA_ROOT/bin/mabundle
for
reading files from a standard Bundle directory structure and generating
appropriate basic information into the datapackage.json
manifest file
that resides in the root directory of a Bundle. This may sound complicated,
but all you need to know is that bundle.sh
is all you need to call. The
process involves two steps: 1) creating a directory that is compliant with
the Bundle specification and then 2) running bundle.sh
with the appropriate arguments.
For anything coming directly out of the drone (e.g., an STK file), put it
in data/output/{agent.prefix}
. For anything that was input into the drone,
put it in data/input/{agent.prefix}
. For anything that was post-processed,
put it in data/processed/{agent.prefix}
or an appropriate directory under
data/processed
such as data/processed/group
or data/processed/mission
.
See the Bundle specification for specifics, but most bundles for agent-generated data
will exist in a data structure that looks something like this (simplest form):
datapackage.json # the manifest of the bundle (generated by mabundle)
data/output/agent.0/full_mission.stk
To generate the datapackage.json and bundle everything up, use the bundle.sh
script found at $MADARA_ROOT/scripts/linux/bundle.sh
. It can be run with
no arguments from within the directory you want to generate the bundle
and datapackage.json
, but you'll probably want to at least specify the
bundle file location where you want to save things. A common generation
interaction may look like this:
cd the_directory_where_data_directory_exists
$MADARA_ROOT/scripts/linux/bundle.sh -f my_new_flight.sbz
The bundle.sh
script encapsulates the functionality of mabundle
and can
support all of its args for specifying contributors, sources of the bundle,
versioning, keywords, etc. So, any of the arguments in the following list
are valid and will help populate your bundle's datapackage.json
with useful
information that can be retrieved later about what the bundle contains and
who is responsible for its contents.
Other useful args for bundle.sh
[-ac|--contributor json] json of contributor info
[-as|--source json] json of source of resources
[-d|--dest-path path] directory to generate manifest to
[-e|--description text] description of bundle contents
[-h|--help] print help menu (i.e., this menu)
[-k|--keyword word] a keyword to associate with the bundle
[-l|--license json] json of a license
[-s|--source-path path] directory to read files from
[-t|--title title] the manifest title
[-v|--version MAJ.MIN.REV] sets version to MAJOR.MINOR.REV