Exemplo n.º 1
0
def daemon():
    global conn
    dbfile = stoneridge.get_config('mqproxy', 'db')
    conn = sqlite3.connect(dbfile)

    stoneridge.StreamLogger.bottle_inject()

    port = stoneridge.get_config_int('mqproxy', 'port')
    bottle.run(host='0.0.0.0', port=port)
def daemon():
    global conn
    dbfile = stoneridge.get_config('mqproxy', 'db')
    conn = sqlite3.connect(dbfile)

    stoneridge.StreamLogger.bottle_inject()

    port = stoneridge.get_config_int('mqproxy', 'port')
    bottle.run(host='0.0.0.0', port=port)
 def __init__(self, srid, nightly, ldap, sha, netconfigs, operating_systems,
              attempt):
     self.srid = srid
     self.nightly = nightly
     self.ldap = ldap
     self.sha = sha
     self.netconfigs = netconfigs
     self.operating_systems = operating_systems
     self.attempt = attempt
     self.interval = stoneridge.get_config_int('cloner', 'interval')
Exemplo n.º 4
0
    def __init__(self, nightly, srid, operating_systems, netconfigs,
                 ldap, sha, attempt):
        self.host = stoneridge.get_config('cloner', 'host')
        self.nightly = nightly
        self.outroot = stoneridge.get_config('cloner', 'output')
        self.srid = srid
        self.outdir = os.path.join(self.outroot, srid)
        self.keep = stoneridge.get_config_int('cloner', 'keep', default=50)
        self.max_attempts = stoneridge.get_config_int('cloner', 'attempts')
        self.operating_systems = operating_systems
        self.netconfigs = netconfigs
        self.ldap = ldap
        self.sha = sha
        self.attempt = attempt

        if not os.path.exists(self.outroot):
            os.mkdir(self.outroot)

        root = stoneridge.get_config('cloner', 'root')
        if nightly:
            self.path = '/'.join([root, 'nightly', 'latest-mozilla-central'])
        else:
            self.path = '/'.join([root, 'try-builds', '%s-%s' % (ldap, sha)])

        logging.debug('host: %s' % (self.host,))
        logging.debug('path: %s' % (self.path,))
        logging.debug('nightly: %s' % (self.nightly,))
        logging.debug('srid: %s' % (self.srid,))
        logging.debug('output root: %s' % (self.outroot,))
        logging.debug('output directory: %s' % (self.outdir,))
        logging.debug('keep history: %s' % (self.keep,))
        logging.debug('max attempts: %s' % (self.max_attempts,))
        logging.debug('operating systems: %s' % (self.operating_systems,))
        logging.debug('netconfigs: %s' % (self.netconfigs,))
        logging.debug('ldap: %s' % (self.ldap,))
        logging.debug('sha: %s' % (self.sha,))
        logging.debug('attempt: %s' % (self.attempt,))

        self.prefix = ''
Exemplo n.º 5
0
    def __init__(self, nightly, srid, operating_systems, netconfigs, ldap, sha,
                 attempt):
        self.host = stoneridge.get_config('cloner', 'host')
        self.nightly = nightly
        self.outroot = stoneridge.get_config('cloner', 'output')
        self.srid = srid
        self.outdir = os.path.join(self.outroot, srid)
        self.keep = stoneridge.get_config_int('cloner', 'keep', default=50)
        self.max_attempts = stoneridge.get_config_int('cloner', 'attempts')
        self.operating_systems = operating_systems
        self.netconfigs = netconfigs
        self.ldap = ldap
        self.sha = sha
        self.attempt = attempt

        if not os.path.exists(self.outroot):
            os.mkdir(self.outroot)

        root = stoneridge.get_config('cloner', 'root')
        if nightly:
            self.path = '/'.join([root, 'nightly', 'latest-mozilla-central'])
        else:
            self.path = '/'.join([root, 'try-builds', '%s-%s' % (ldap, sha)])

        logging.debug('host: %s' % (self.host, ))
        logging.debug('path: %s' % (self.path, ))
        logging.debug('nightly: %s' % (self.nightly, ))
        logging.debug('srid: %s' % (self.srid, ))
        logging.debug('output root: %s' % (self.outroot, ))
        logging.debug('output directory: %s' % (self.outdir, ))
        logging.debug('keep history: %s' % (self.keep, ))
        logging.debug('max attempts: %s' % (self.max_attempts, ))
        logging.debug('operating systems: %s' % (self.operating_systems, ))
        logging.debug('netconfigs: %s' % (self.netconfigs, ))
        logging.debug('ldap: %s' % (self.ldap, ))
        logging.debug('sha: %s' % (self.sha, ))
        logging.debug('attempt: %s' % (self.attempt, ))

        self.prefix = ''
    def run(self):
        logging.debug('info gatherer running')
        bindir = stoneridge.get_config('run', 'bin')
        info_file = os.path.join(bindir, 'application.ini')
        logging.debug('parsing ini file at %s' % (info_file, ))
        cp = ConfigParser.SafeConfigParser()
        cp.read([info_file])

        build_info = {}
        build_info['name'] = cp.get('App', 'Name')
        build_info['version'] = cp.get('App', 'Version')
        build_info['revision'] = cp.get('App', 'SourceStamp')
        build_info['branch'] = stoneridge.get_config('run', 'netconfig')

        # Due to the way the graph server works, we need to create a unique
        # build id for each build/os/netconfig combination. We also want to
        # keep the unmodified build ID around for posterity.
        build_info['original_buildid'] = cp.get('App', 'BuildID')

        # Build ID is limited to 16 characters in the receiving database, and
        # our suffix is 2 characters, so we truncate the original to 14
        # characters before adding our suffix. It should already be only 14
        # characters, but we do this Just In Case.
        buildid_base = build_info['original_buildid'][:14]
        build_info['id'] = buildid_base + stoneridge.get_buildid_suffix()

        machine_info = {}
        machine_info['name'] = platform.node()
        machine_info['os'] = stoneridge.get_config('machine', 'os')
        machine_info['osversion'] = stoneridge.get_os_version()
        machine_info['platform'] = platform.machine()

        info = {
            'test_machine': machine_info,
            'test_build': build_info,
            'testrun': {},
            'date': stoneridge.get_config_int('run', 'tstamp')
        }
        logging.debug('gathered info: %s' % (info, ))

        outdir = stoneridge.get_config('run', 'out')
        if not os.path.exists(outdir):
            logging.debug('making outdir %s' % (outdir, ))
            os.mkdir(outdir)

        with file(os.path.join(outdir, 'info.json'), 'wb') as f:
            logging.debug('dumping json to file')
            json.dump(info, f)
Exemplo n.º 7
0
    def run(self):
        logging.debug('info gatherer running')
        bindir = stoneridge.get_config('run', 'bin')
        info_file = os.path.join(bindir, 'application.ini')
        logging.debug('parsing ini file at %s' % (info_file,))
        cp = ConfigParser.SafeConfigParser()
        cp.read([info_file])

        build_info = {}
        build_info['name'] = cp.get('App', 'Name')
        build_info['version'] = cp.get('App', 'Version')
        build_info['revision'] = cp.get('App', 'SourceStamp')
        build_info['branch'] = stoneridge.get_config('run', 'netconfig')

        # Due to the way the graph server works, we need to create a unique
        # build id for each build/os/netconfig combination. We also want to
        # keep the unmodified build ID around for posterity.
        build_info['original_buildid'] = cp.get('App', 'BuildID')

        # Build ID is limited to 16 characters in the receiving database, and
        # our suffix is 2 characters, so we truncate the original to 14
        # characters before adding our suffix. It should already be only 14
        # characters, but we do this Just In Case.
        buildid_base = build_info['original_buildid'][:14]
        build_info['id'] = buildid_base + stoneridge.get_buildid_suffix()

        machine_info = {}
        machine_info['name'] = platform.node()
        machine_info['os'] = stoneridge.get_config('machine', 'os')
        machine_info['osversion'] = stoneridge.get_os_version()
        machine_info['platform'] = platform.machine()

        info = {'test_machine': machine_info,
                'test_build': build_info,
                'testrun': {},
                'date': stoneridge.get_config_int('run', 'tstamp')}
        logging.debug('gathered info: %s' % (info,))

        outdir = stoneridge.get_config('run', 'out')
        if not os.path.exists(outdir):
            logging.debug('making outdir %s' % (outdir,))
            os.mkdir(outdir)

        with file(os.path.join(outdir, 'info.json'), 'wb') as f:
            logging.debug('dumping json to file')
            json.dump(info, f)
Exemplo n.º 8
0
 def __init__(self):
     self.workdir = stoneridge.get_config('stoneridge', 'work')
     self.keep = stoneridge.get_config_int('cleaner', 'keep')
 def __init__(self):
     self.workdir = stoneridge.get_config('stoneridge', 'work')
     self.keep = stoneridge.get_config_int('cleaner', 'keep')