if len(args) > 0:
    parser.error("Didn't expect any positional args (%r)." % (args,))

  options.concurrency = _getDefaultConcurrency(options.concurrency)

  needRestart = True
  while needRestart:
    with ModelSchedulerService(concurrency=options.concurrency) as scheduler:
      needRestart = scheduler.run()



if __name__ == "__main__":
  LoggingSupport.initService()

  logger = _getLogger()
  logger.setLogPrefix('<%s, SERVICE=SCHED> ' % getStandardLogPrefix())

  try:
    logger.info("{TAG:SWAP.SCHED.START}")
    main(sys.argv)
  except SystemExit as e:
    if e.code != 0:
      logger.exception("{TAG:SWAP.SCHED.STOP.ABORT}")
      raise
  except:
    logger.exception("{TAG:SWAP.SCHED.STOP.ABORT}")
    raise

  logger.info("{TAG:SWAP.SCHED.STOP.OK}")
Exemplo n.º 2
0
    if len(args) > 0:
        parser.error("Didn't expect any positional args (%r)." % (args, ))

    if options.modelID is None:
        parser.error("Missing model ID in command-line")

    with ModelRunner(modelID=options.modelID) as runner:
        runner.run()


if __name__ == "__main__":
    # NOTE: we initialize logging as a service so that our logging output will be
    # funneled via console to our parent process (model_scheduler service)
    LoggingSupport.initService()

    logger = _getLogger()
    logger.setLogPrefix('<%s, SERVICE=MRUN> ' % getStandardLogPrefix())

    try:
        logger.info("{TAG:SWAP.MR.START} argv=%r", sys.argv)
        main(sys.argv)
    except SystemExit as e:
        if e.code != 0:
            logger.exception("{TAG:SWAP.MR.STOP.ABORT}")
            raise
    except:
        logger.exception("{TAG:SWAP.MR.STOP.ABORT}")
        raise

    logger.info("{TAG:SWAP.MR.STOP.OK}")
Exemplo n.º 3
0
  (_options, args) = parser.parse_args(args)

  if len(args) > 0:
    parser.error("Didn't expect any positional args (%r)." % (args,))

  try:
    AnomalyService().run()
  except Exception:
    _getLogger().exception("Error in Anomaly Service run()")
    raise



if __name__ == "__main__":
  LoggingSupport.initService()

  logger = _getLogger()
  logger.setLogPrefix("%s, SERVICE=ANOMALY" % getStandardLogPrefix())


  try:
    logger.info("{TAG:ANOM.START} argv=%r", sys.argv)
    main(sys.argv[1:])
  except KeyboardInterrupt as e:
    logger.info("Terminated via %r", e, exc_info=True)
  except:
    logger.exception("{TAG:ANOM.STOP.ABORT}")
    raise

  logger.info("{TAG:ANOM.STOP.OK}")
Exemplo n.º 4
0
    parser.error("Didn't expect any positional args (%r)." % (args,))

  if options.modelID is None:
    parser.error("Missing model ID in command-line")

  with ModelRunner(modelID=options.modelID) as runner:
    runner.run()



if __name__ == "__main__":
  # NOTE: we initialize logging as a service so that our logging output will be
  # funneled via console to our parent process (model_scheduler service)
  LoggingSupport.initService()

  logger = _getLogger()
  logger.setLogPrefix('<%s, SERVICE=MRUN> ' % getStandardLogPrefix())

  try:
    logger.info("{TAG:SWAP.MR.START} argv=%r", sys.argv)
    main(sys.argv)
  except SystemExit as e:
    if e.code != 0:
      logger.exception("{TAG:SWAP.MR.STOP.ABORT}")
      raise
  except:
    logger.exception("{TAG:SWAP.MR.STOP.ABORT}")
    raise

  logger.info("{TAG:SWAP.MR.STOP.OK}")
Exemplo n.º 5
0
    if len(args) > 0:
        parser.error("Didn't expect any positional args (%r)." % (args, ))

    options.concurrency = _getDefaultConcurrency(options.concurrency)

    needRestart = True
    while needRestart:
        with ModelSchedulerService(
                concurrency=options.concurrency) as scheduler:
            needRestart = scheduler.run()


if __name__ == "__main__":
    LoggingSupport.initService()

    logger = _getLogger()
    logger.setLogPrefix('<%s, SERVICE=SCHED> ' % getStandardLogPrefix())

    try:
        logger.info("{TAG:SWAP.SCHED.START}")
        main(sys.argv)
    except SystemExit as e:
        if e.code != 0:
            logger.exception("{TAG:SWAP.SCHED.STOP.ABORT}")
            raise
    except:
        logger.exception("{TAG:SWAP.SCHED.STOP.ABORT}")
        raise

    logger.info("{TAG:SWAP.SCHED.STOP.OK}")
Exemplo n.º 6
0
    parser = OptionParser(helpString)

    (_options, args) = parser.parse_args(args)

    if len(args) > 0:
        parser.error("Didn't expect any positional args (%r)." % (args, ))

    try:
        AnomalyService().run()
    except Exception:
        _getLogger().exception("Error in Anomaly Service run()")
        raise


if __name__ == "__main__":
    LoggingSupport.initService()

    logger = _getLogger()
    logger.setLogPrefix("%s, SERVICE=ANOMALY" % getStandardLogPrefix())

    try:
        logger.info("{TAG:ANOM.START} argv=%r", sys.argv)
        main(sys.argv[1:])
    except KeyboardInterrupt as e:
        logger.info("Terminated via %r", e, exc_info=True)
    except:
        logger.exception("{TAG:ANOM.STOP.ABORT}")
        raise

    logger.info("{TAG:ANOM.STOP.OK}")