示例#1
0
    def setServiceParent(self, p):
        d = service.AsyncMultiService.setServiceParent(self, p)
        self.model = model.Model(self)
        self.changes = changes.ChangesConnectorComponent(self)
        self.changesources = changesources.ChangeSourcesConnectorComponent(
            self)
        self.schedulers = schedulers.SchedulersConnectorComponent(self)
        self.sourcestamps = sourcestamps.SourceStampsConnectorComponent(self)
        self.buildsets = buildsets.BuildsetsConnectorComponent(self)
        self.buildrequests = buildrequests.BuildRequestsConnectorComponent(
            self)
        self.state = state.StateConnectorComponent(self)
        self.builds = builds.BuildsConnectorComponent(self)
        self.workers = workers.WorkersConnectorComponent(self)
        self._registerOldWorkerAttr("workers", name="buildslaves")
        self.users = users.UsersConnectorComponent(self)
        self.masters = masters.MastersConnectorComponent(self)
        self.builders = builders.BuildersConnectorComponent(self)
        self.steps = steps.StepsConnectorComponent(self)
        self.tags = tags.TagsConnectorComponent(self)
        self.logs = logs.LogsConnectorComponent(self)

        self.cleanup_timer = internet.TimerService(self.CLEANUP_PERIOD,
                                                   self._doCleanup)
        self.cleanup_timer.clock = self.master.reactor
        self.cleanup_timer.setServiceParent(self)
        return d
示例#2
0
    def setServiceParent(self, p):
        yield super().setServiceParent(p)
        self.model = model.Model(self)
        self.changes = changes.ChangesConnectorComponent(self)
        self.changesources = changesources.ChangeSourcesConnectorComponent(
            self)
        self.schedulers = schedulers.SchedulersConnectorComponent(self)
        self.sourcestamps = sourcestamps.SourceStampsConnectorComponent(self)
        self.buildsets = buildsets.BuildsetsConnectorComponent(self)
        self.buildrequests = buildrequests.BuildRequestsConnectorComponent(
            self)
        self.state = state.StateConnectorComponent(self)
        self.builds = builds.BuildsConnectorComponent(self)
        self.workers = workers.WorkersConnectorComponent(self)
        self.users = users.UsersConnectorComponent(self)
        self.masters = masters.MastersConnectorComponent(self)
        self.builders = builders.BuildersConnectorComponent(self)
        self.steps = steps.StepsConnectorComponent(self)
        self.tags = tags.TagsConnectorComponent(self)
        self.logs = logs.LogsConnectorComponent(self)

        self.cleanup_timer = internet.TimerService(self.CLEANUP_PERIOD,
                                                   self._doCleanup)
        self.cleanup_timer.clock = self.master.reactor
        yield self.cleanup_timer.setServiceParent(self)
示例#3
0
 def finish_setup(_):
     self.db.changes = changes.ChangesConnectorComponent(self.db)
     self.db.builds = builds.BuildsConnectorComponent(self.db)
     self.db.sourcestamps = \
         sourcestamps.SourceStampsConnectorComponent(self.db)
     self.master = self.db.master
     self.master.db = self.db
示例#4
0
    def __init__(self, master, basedir):
        service.MultiService.__init__(self)
        self.setName('db')
        self.master = master
        self.basedir = basedir

        # not configured yet - we don't build an engine until the first
        # reconfig
        self.configured_url = None

        # set up components
        self._engine = None # set up in reconfigService
        self.pool = None # set up in reconfigService
        self.cleanup_timer = None
        self.model = model.Model(self)
        self.changes = changes.ChangesConnectorComponent(self)
        self.schedulers = schedulers.SchedulersConnectorComponent(self)
        self.sourcestamps = sourcestamps.SourceStampsConnectorComponent(self)
        self.sourcestampsets = sourcestampsets.SourceStampSetsConnectorComponent(self)
        self.buildsets = buildsets.BuildsetsConnectorComponent(self)
        self.buildrequests = buildrequests.BuildRequestsConnectorComponent(self)
        self.state = state.StateConnectorComponent(self)
        self.builds = builds.BuildsConnectorComponent(self)
        self.users = users.UsersConnectorComponent(self)
        self.mastersconfig = mastersconfig.MastersConfigConnectorComponent(self)
示例#5
0
    def __init__(self, master, basedir):
        service.AsyncMultiService.__init__(self)
        self.setName('db')
        self.master = master
        self.basedir = basedir

        # not configured yet - we don't build an engine until the first
        # reconfig
        self.configured_url = None

        # set up components
        self._engine = None  # set up in reconfigService
        self.pool = None  # set up in reconfigService
        self.model = model.Model(self)
        self.changes = changes.ChangesConnectorComponent(self)
        self.changesources = changesources.ChangeSourcesConnectorComponent(
            self)
        self.schedulers = schedulers.SchedulersConnectorComponent(self)
        self.sourcestamps = sourcestamps.SourceStampsConnectorComponent(self)
        self.buildsets = buildsets.BuildsetsConnectorComponent(self)
        self.buildrequests = buildrequests.BuildRequestsConnectorComponent(
            self)
        self.state = state.StateConnectorComponent(self)
        self.builds = builds.BuildsConnectorComponent(self)
        self.buildslaves = buildslaves.BuildslavesConnectorComponent(self)
        self.users = users.UsersConnectorComponent(self)
        self.masters = masters.MastersConnectorComponent(self)
        self.builders = builders.BuildersConnectorComponent(self)
        self.steps = steps.StepsConnectorComponent(self)
        self.logs = logs.LogsConnectorComponent(self)

        self.cleanup_timer = internet.TimerService(self.CLEANUP_PERIOD,
                                                   self._doCleanup)
        self.cleanup_timer.setServiceParent(self)
    def setUpComponents(self):
        yield self.setUpConnectorComponent(table_names=[
            'buildrequests', 'buildrequest_claims', 'buildsets',
            'buildset_properties', 'sourcestamps', 'sourcestamp_changes',
            'builds', 'sourcestampsets'
        ])

        self.db.buildrequests = buildrequests.BuildRequestsConnectorComponent(
            self.db)
        self.db.buildsets = buildsets.BuildsetsConnectorComponent(self.db)
        self.db.sourcestamps = sourcestamps.SourceStampsConnectorComponent(
            self.db)
        self.db.builds = builds.BuildsConnectorComponent(self.db)
        self.db.master.getObjectId = lambda: defer.succeed(self.MASTER_ID)
        self.botmaster = mock.Mock(name='botmaster')
        self.botmaster.builders = {}
        self.master = self.botmaster.master = mock.Mock(name='master')
        self.master.is_changing_services = False
        self.master.db = self.db
        self.master.caches = cache.CacheManager()
        self.master.config.mergeRequests = None
        self.processedBuilds = []
        self.mergedBuilds = []
        self.addRunningBuilds = False
        self.slaves = {}
示例#7
0
    def __init__(self, master, db_url, basedir):
        service.MultiService.__init__(self)
        self.master = master
        self.basedir = basedir

        self._engine = enginestrategy.create_engine(db_url,
                                                    basedir=self.basedir)
        self.pool = pool.DBThreadPool(self._engine)

        # set up components
        self.model = model.Model(self)
        self.changes = changes.ChangesConnectorComponent(self)
        self.schedulers = schedulers.SchedulersConnectorComponent(self)
        self.sourcestamps = sourcestamps.SourceStampsConnectorComponent(self)
        self.buildsets = buildsets.BuildsetsConnectorComponent(self)
        self.buildrequests = buildrequests.BuildRequestsConnectorComponent(
            self)
        self.state = state.StateConnectorComponent(self)
        self.builds = builds.BuildsConnectorComponent(self)

        self.cleanup_timer = internet.TimerService(self.CLEANUP_PERIOD,
                                                   self.doCleanup)
        self.cleanup_timer.setServiceParent(self)

        self.changeHorizon = None  # default value; set by master
    def setUp(self):
        yield self.setUpConnectorComponent(table_names=[
            'sourcestamps', 'patches', 'masters', 'workers', 'buildsets',
            'builders', 'buildrequests', 'buildset_sourcestamps', 'builds'
        ])

        self.db.sourcestamps = \
            sourcestamps.SourceStampsConnectorComponent(self.db)
示例#9
0
    def __init__(self, master, db_url, basedir):
        service.MultiService.__init__(self)
        self.master = master
        self.basedir = basedir
        "basedir for this master - used for upgrades"

        self._engine = enginestrategy.create_engine(db_url,
                                                    basedir=self.basedir)
        self.pool = pool.DBThreadPool(self._engine)
        "thread pool (L{buildbot.db.pool.DBThreadPool}) for this db"

        self._oldpool = TempAdbapiPool(self._engine)

        self._sourcestamp_cache = util.LRUCache()  # TODO: remove
        self._active_operations = set(
        )  # protected by synchronized= TODO: remove
        self._pending_notifications = []  # TODO: remove
        self._subscribers = bbcollections.defaultdict(set)

        self._started = False

        # set up components
        self.model = model.Model(self)
        "L{buildbot.db.model.Model} instance"

        self.changes = changes.ChangesConnectorComponent(self)
        "L{buildbot.db.changes.ChangesConnectorComponent} instance"

        self.schedulers = schedulers.SchedulersConnectorComponent(self)
        "L{buildbot.db.schedulers.ChangesConnectorComponent} instance"

        self.sourcestamps = sourcestamps.SourceStampsConnectorComponent(self)
        "L{buildbot.db.sourcestamps.SourceStampsConnectorComponent} instance"

        self.buildsets = buildsets.BuildsetsConnectorComponent(self)
        "L{buildbot.db.sourcestamps.BuildsetsConnectorComponent} instance"

        self.buildrequests = buildrequests.BuildRequestsConnectorComponent(
            self)
        "L{buildbot.db.sourcestamps.BuildRequestsConnectorComponent} instance"

        self.state = state.StateConnectorComponent(self)
        "L{buildbot.db.state.StateConnectorComponent} instance"

        self.cleanup_timer = internet.TimerService(self.CLEANUP_PERIOD,
                                                   self.doCleanup)
        self.cleanup_timer.setServiceParent(self)

        self.changeHorizon = None  # default value; set by master
示例#10
0
    def setUp(self):
        yield self.setUpConnectorComponent(
            table_names=['changes', 'change_files',
                         'change_properties', 'scheduler_changes', 'schedulers',
                         'sourcestampsets', 'sourcestamps', 'patches', 'change_users',
                         'users', 'buildsets', 'workers', 'builders', 'masters',
                         'buildrequests', 'builds', 'buildset_sourcestamps',
                         'workers'])

        self.db.changes = changes.ChangesConnectorComponent(self.db)
        self.db.builds = builds.BuildsConnectorComponent(self.db)
        self.db.sourcestamps = \
            sourcestamps.SourceStampsConnectorComponent(self.db)
        self.master = self.db.master
        self.master.db = self.db
示例#11
0
 def finish_setup(_):
     self.db.sourcestamps = \
         sourcestamps.SourceStampsConnectorComponent(self.db)