예제 #1
0
  def __init__(self, logdir='logs', outputlog='buildlogmonitor.out',
               errorlog='buildlogmonitor.err', es=False, es_servers=None,
               output_dir=None, include_pass=None, **kwargs):
    self.logdir = os.path.abspath(logdir)
    self.logger = None
    self.es = es
    self.es_servers = es_servers
    self.output_dir = output_dir
    self.include_pass = include_pass

    self.job_queue = Queue()

    # setup logging
    if outputlog:
      self.logger = logging.getLogger('BuildLogMonitor')
      self.logger.setLevel(logging.DEBUG)
      loghandler = logging.handlers.RotatingFileHandler(
                   outputlog, maxBytes=1000000, backupCount=3)
      loghandler.setLevel(logging.DEBUG)
      formatter = logging.Formatter("%(asctime)s - %(name)s - %(levelname)s - %(message)s")
      loghandler.setFormatter(formatter)
      self.logger.addHandler(loghandler)

      if errorlog:
        errhandler = logging.FileHandler(errorlog, 'w')
        errhandler.setLevel(logging.ERROR)
        errhandler.setFormatter(formatter)
        self.logger.addHandler(errhandler)

    self.processes = [self._start_parser_process() for x in range(2)]

    PulseBuildMonitor.__init__(self, logger=self.logger, trees=trees_to_watch, **kwargs)

    signal.signal(signal.SIGTERM, self.sighandler)
예제 #2
0
  def __init__(self, extensionDir, platform='linux', config=None,
               autolog=False, emailresults=False, testfile=None,
               logfile=None, rlock=None, **kwargs):
    self.buildtype = 'opt'
    self.autolog = autolog
    self.emailresults = emailresults
    self.testfile = testfile
    self.logfile = logfile
    self.rlock = rlock
    self.extensionDir = extensionDir
    self.config = config
    self.tree = self.config.get('tree', ['services-central', 'places'])
    self.platform = self.config.get('platform', 'linux')
    self.label=('[email protected]|tps_build_monitor_' +
                socket.gethostname())

    self.logger = logging.getLogger('tps_pulse')
    self.logger.setLevel(logging.DEBUG)
    handler = logging.FileHandler('tps_pulse.log')
    self.logger.addHandler(handler)

    PulseBuildMonitor.__init__(self,
                               tree=self.tree,
                               label=self.label,
                               mobile=False,
                               logger=self.logger,
                               **kwargs)
예제 #3
0
    def __init__(self, buildCallback=None, testCallback=None,
                 pulseCallback=None, tests=None, products=None,
                 platforms=None, trees=None, label=None, mobile=False,
                 logger=None, buildtypes=None, talos=False,
                 buildTags=None, buildtags=None):
        self.platforms = platforms
        self.trees = trees
        self.mobile = mobile
        self.label = label
        self.buildtypes = buildtypes
        self.buildtags = buildtags
        self.buildCallback = buildCallback
        self.testCallback = testCallback
        self.pulseCallback = pulseCallback
        self.monitorThread = None
        self.tests = tests
        self.talos = talos
        self.products = products

        if not self.label:
            # generate a random label
            self.label = '%s_%s' % (
                ''.join(random.choice(string.letters) for i in xrange(12)),
                socket.gethostname())

        if isinstance(logger, basestring):
            # if 'logger' is a string, create a logging handler for it
            self.logger = logging.getLogger(logger)
            self.logger.setLevel(logging.DEBUG)
            handler = logging.FileHandler(logger)
            self.logger.addHandler(handler)
        else:
            # otherwise assume it is already a logging instance, or None
            self.logger = logger

        PulseBuildMonitor.__init__(self,
                                   trees=self.trees,
                                   label=self.label,
                                   logger=self.logger,
                                   buildtypes=self.buildtypes,
                                   platforms=self.platforms,
                                   talos=self.talos,
                                   tests=self.tests,
                                   buildtags=self.buildtags,
                                   products=self.products,
                                   builds=buildCallback is not None,
                                   unittests=testCallback is not None)
예제 #4
0
  def __init__(self, platform='linux', config=None,
               autolog=False, emailresults=False, testfile=None,
               logfile=None, resultfile=None, mobile=False,
               ignore_unused_engines=False, **kwargs):
    self.buildtype = ['opt']
    self.autolog = autolog
    self.emailresults = emailresults
    self.testfile = testfile
    self.logfile = logfile
    self.resultfile = resultfile
    self.mobile = mobile
    self.ignore_unused_engines = ignore_unused_engines
    self.config = config
    f = open(config, 'r')
    configcontent = f.read()
    f.close()
    configjson = json.loads(configcontent)
    self.tree = configjson.get('tree', ['services-central'])
    self.platform = [configjson.get('platform', 'linux')]
    self.label=('[email protected]|tps_build_monitor_' +
                socket.gethostname())

    self.logger = logging.getLogger('tps_pulse')
    self.logger.setLevel(logging.DEBUG)
    handler = logging.FileHandler('tps_pulse.log')
    self.logger.addHandler(handler)

    self.results = Covresults(configjson, self.autolog, self.emailresults, 
                              self.resultfile)

    PulseBuildMonitor.__init__(self,
                               trees=self.tree,
                               label=self.label,
                               logger=self.logger,
                               platforms=self.platform,
                               buildtypes=self.buildtype,
                               builds=True,
                               **kwargs)
예제 #5
0
    def __init__(self,
                 extensionDir,
                 platform='linux',
                 config=None,
                 autolog=False,
                 emailresults=False,
                 testfile=None,
                 logfile=None,
                 rlock=None,
                 **kwargs):
        self.buildtype = ['opt']
        self.autolog = autolog
        self.emailresults = emailresults
        self.testfile = testfile
        self.logfile = logfile
        self.rlock = rlock
        self.extensionDir = extensionDir
        self.config = config
        self.tree = self.config.get('tree', ['services-central'])
        self.platform = [self.config.get('platform', 'linux')]
        self.label = ('[email protected]|tps_build_monitor_' +
                      socket.gethostname())

        self.logger = logging.getLogger('tps_pulse')
        self.logger.setLevel(logging.DEBUG)
        handler = logging.FileHandler('tps_pulse.log')
        self.logger.addHandler(handler)

        PulseBuildMonitor.__init__(self,
                                   trees=self.tree,
                                   label=self.label,
                                   logger=self.logger,
                                   platforms=self.platform,
                                   buildtypes=self.buildtype,
                                   builds=True,
                                   **kwargs)
예제 #6
0
 def __init__(self, logger=None, port=8034, **kwargs):
     self.logger = logger
     self.port = port
     self.builds = {}
     PulseBuildMonitor.__init__(self, logger=self.logger, **kwargs)
     Thread.__init__(self)
예제 #7
0
 def __init__(self, logger=None, port=8034, **kwargs):
     self.logger = logger
     self.port = port
     self.builds = {}
     PulseBuildMonitor.__init__(self, logger=self.logger, **kwargs)
     Thread.__init__(self)