Create Custom RUR Output Plugins
Details all requirements for a site-created RUR output plugin.
Output plugins allow RUR data to be outputted to an arbitrary backing store. This can be a storage device or another piece of software that then consumes the RUR data. The output plugin is passed a number of command line arguments that describe the application/job run and provide a list of input working files (the output of data plugin post processing components). The plugin takes the data in the working files and exports it to the destination specified in the RUR configuration file for the specific output plugin.
Data passed to custom output plugins can be optionally configured to be JSON-formatted by adding the use_json argument to the [global] section of the configuration file and setting it to
True, yes, 1, or enable.
Output Plugin
#
# Copyright (c) 2013 Cray Inc. All rights reserved.
#
# Sample output plugin
#
#!/usr/bin/env python
import sys, os
from rur_plugins import rur_output_args
def main():
apid, jobid, uid, cmdname, inputfilelist, timeout, \
parg = rur_output_args(sys.argv[1:])
outfile = open(parg, "a")
for inputfile in inputfilelist:
infile = open(inputfile, "r")
lines = infile.readlines()
for line in lines:
outfile.write(line)
infile.close()
outfile.close()