예제 #1
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
예제 #2
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
예제 #3
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)
예제 #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)
예제 #6
0
    def setUp(self):
        yield self.setUpConnectorComponent(table_names=[
            'patches', 'sourcestamps', 'changes', 'change_properties',
            'change_files'
        ])

        self.db.changes = changes.ChangesConnectorComponent(self.db)
예제 #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
예제 #8
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
예제 #9
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
예제 #10
0
 def finish_setup(_):
     self.db.changes = changes.ChangesConnectorComponent(self.db)
예제 #11
0
 def finish_setup(_):
     self.db.changes = changes.ChangesConnectorComponent(self.db)
     self.db.sourcestamps = \
         sourcestamps.SourceStampsConnectorComponent(self.db)