Invokes run function using a JSON file config.

  Args:
    args: CLI args, which can be a JSON file containing an object whose
        attributes are the parameters to the run function. If multiple JSON
        files are passed, their contents are concatenated.
  Returns:
    0 if succeeded or nonzero if failed.
  Raises:
    Exception: If input data is missing.

def main(args):
  """Invokes run function using a JSON file config.

  Args:
    args: CLI args, which can be a JSON file containing an object whose
        attributes are the parameters to the run function. If multiple JSON
        files are passed, their contents are concatenated.
  Returns:
    0 if succeeded or nonzero if failed.
  Raises:
    Exception: If input data is missing.
  """
  if not args:
    raise Exception('Please specify at least one JSON config path')
  inputs = []
  program = []
  outputs = []
  for arg in args:
    with open(arg) as fd:
      config = json.load(fd)
    inputs.extend(config.get('inputs', []))
    program.extend(config.get('program', []))
    outputs.extend(config.get('outputs', []))
  if not program:
    raise Exception('Please specify a program')
  return run(inputs, program, outputs)