diff options
author | 2022-10-02 16:13:30 +0200 | |
---|---|---|
committer | 2022-10-02 16:13:30 +0200 | |
commit | 2202c53f0179002adde3095609d89fcee394b614 (patch) | |
tree | f37f02f4e84cc40ddc84f199972ed53f4fb6bead | |
parent | Fix a typo in gitlab patch (diff) | |
download | tinderbox-cluster-2202c53f0179002adde3095609d89fcee394b614.tar.gz tinderbox-cluster-2202c53f0179002adde3095609d89fcee394b614.tar.bz2 tinderbox-cluster-2202c53f0179002adde3095609d89fcee394b614.zip |
Add support for workes, nodes, images and flavors in db
Signed-off-by: Magnus Granberg <zorry@gentoo.org>
-rw-r--r-- | buildbot_gentoo_ci/config/builders.py | 41 | ||||
-rw-r--r-- | buildbot_gentoo_ci/config/workers.py | 81 | ||||
-rw-r--r-- | buildbot_gentoo_ci/db/connector.py | 2 | ||||
-rw-r--r-- | buildbot_gentoo_ci/db/model.py | 57 | ||||
-rw-r--r-- | buildbot_gentoo_ci/db/workers.py | 175 | ||||
-rw-r--r-- | master.cfg | 37 | ||||
-rw-r--r-- | patches/bb-props_master_fix.patch | 15 | ||||
-rw-r--r-- | sql/gentoo_ci_schema.sql | 308 |
8 files changed, 467 insertions, 249 deletions
diff --git a/buildbot_gentoo_ci/config/builders.py b/buildbot_gentoo_ci/config/builders.py index 82552fa..edcd0c1 100644 --- a/buildbot_gentoo_ci/config/builders.py +++ b/buildbot_gentoo_ci/config/builders.py @@ -1,11 +1,24 @@ -# Copyright 2021 Gentoo Authors +# Copyright 2022 Gentoo Authors # Distributed under the terms of the GNU General Public License v2 from twisted.internet import defer from buildbot.plugins import util from buildbot_gentoo_ci.config import buildfactorys -from buildbot_gentoo_ci.config.workers import gentoo_ci_workers + +def getWorkersLocal(worker_type, workers): + worker_list = [] + for worker in workers: + if worker['type'] == worker_type and worker['enable'] is True: + worker_list.append(worker['name']) + return worker_list + +def getWorkersDocker(worker_type, workers): + worker_list = [] + for worker in workers: + if worker['type'] == worker_type and worker['enable'] is True: + worker_list.append(worker['uuid']) + return worker_list @defer.inlineCallbacks def CanWorkerBuildProject(builder, wfb, request): @@ -16,8 +29,9 @@ def CanWorkerBuildProject(builder, wfb, request): print(wfb) for worker in project_workers: if wfb.worker.workername == worker['worker_uuid']: + print('Find a worker: YES') return True - print('no worker') + print('Find a worker: NO') return False # Use same worker as update_cpv_data was done by so we have same git commit @@ -25,15 +39,16 @@ def CanWorkerUpdateV(builder, wfb, request): print(request.properties['cp_worker']) print(wfb) if wfb.worker.workername == request.properties['cp_worker']: + print('Find a worker: YES') return True + print('Find a worker: NO') return False -def gentoo_builders(worker_data): +def gentoo_builders(worker_data_local, worker_data_docker): b = [] - g_ci_w = gentoo_ci_workers(worker_data) b.append(util.BuilderConfig( name='update_db_check', - workername=g_ci_w.getWorkersUuid('local')[0], + workername=getWorkersLocal('local', worker_data_local)[0], workerbuilddir='builds', collapseRequests=False, factory=buildfactorys.update_db_check() @@ -41,7 +56,7 @@ def gentoo_builders(worker_data): ) b.append(util.BuilderConfig( name='update_repo_check', - workername=g_ci_w.getWorkersUuid('local')[1], + workername=getWorkersLocal('local', worker_data_local)[1], workerbuilddir='builds', collapseRequests=True, factory=buildfactorys.update_repo_check() @@ -52,7 +67,7 @@ def gentoo_builders(worker_data): # (builders.UpdateRepos step) b.append(util.BuilderConfig( name='update_cpv_data', - workernames=g_ci_w.getWorkersUuid('log')[0], + workernames=getWorkersDocker('log', worker_data_docker)[0], workerbuilddir='builds', collapseRequests=False, factory=buildfactorys.update_db_cpv() @@ -61,7 +76,7 @@ def gentoo_builders(worker_data): # Use multiplay workers b.append(util.BuilderConfig( name='update_v_data', - workername=g_ci_w.getWorkersUuid('log')[0], + workername=getWorkersDocker('log', worker_data_docker)[0], workerbuilddir='builds', collapseRequests=False, canStartBuild=CanWorkerUpdateV, @@ -71,7 +86,7 @@ def gentoo_builders(worker_data): # Use multiplay workers b.append(util.BuilderConfig( name='build_request_data', - workernames=g_ci_w.getWorkersUuid('local'), + workernames=getWorkersLocal('local', worker_data_local), collapseRequests=False, factory=buildfactorys.build_request_check() ) @@ -79,7 +94,7 @@ def gentoo_builders(worker_data): # Use multiplay workers b.append(util.BuilderConfig( name='run_build_request', - workernames=g_ci_w.getWorkersUuid('docker'), + workernames=getWorkersDocker('build', worker_data_docker), canStartBuild=CanWorkerBuildProject, collapseRequests=False, factory=buildfactorys.run_build_request() @@ -88,7 +103,7 @@ def gentoo_builders(worker_data): # Use multiplay workers b.append(util.BuilderConfig( name='parse_build_log', - workernames=g_ci_w.getWorkersUuid('log')[1:], + workernames=getWorkersDocker('log', worker_data_docker)[1:], collapseRequests=False, factory=buildfactorys.parse_build_log() ) @@ -96,7 +111,7 @@ def gentoo_builders(worker_data): # For node workers b.append(util.BuilderConfig( name='run_build_stage4_request', - workernames=g_ci_w.getWorkersUuid('node'), + workernames=getWorkersLocal('local', worker_data_local), #FIXME: support more the one node #canStartBuild=CanWorkerBuildProject, collapseRequests=False, diff --git a/buildbot_gentoo_ci/config/workers.py b/buildbot_gentoo_ci/config/workers.py index ea05f89..3dcef1a 100644 --- a/buildbot_gentoo_ci/config/workers.py +++ b/buildbot_gentoo_ci/config/workers.py @@ -1,31 +1,9 @@ # Copyright 2022 Gentoo Authors # Distributed under the terms of the GNU General Public License v2 -from buildbot.plugins import worker, util - -class gentoo_ci_workers(): - def __init__(self, worker_data, **kwargs): - self.worker_data = worker_data - - def getWorkersUuid(self, worker_type): - worker_list = [] - for worker in self.worker_data: - if worker['type'] == worker_type and worker['enable'] is True: - worker_list.append(worker['uuid']) - print(worker_list) - return worker_list +from twisted.internet import defer - def getWorkersAllData(self, worker_type): - worker_list = [] - for worker in self.worker_data: - if worker['type'] == worker_type and worker['enable'] is True: - worker_list.append(worker) - print(worker_list) - return worker_list - -@util.renderer -def build_docker_images(props): - return 'bb-worker-' + props.getProperty('project_uuid') + ':latest' +from buildbot.plugins import worker, util @util.renderer def log_docker_images(props): @@ -55,14 +33,32 @@ def docker_volumes_repositorys(props): volumes_list.append(':'.join([src_dir, dest_dir])) return volumes_list -def gentoo_workers(worker_data): - w = [] - g_ci_w = gentoo_ci_workers(worker_data) +@util.renderer +@defer.inlineCallbacks +def getDockerHost(props, docker_worker): + print(docker_worker) + gentooci = props.master.namedServices['services'].namedServices['gentooci'] + worker_data = yield gentooci.db.workers.getWorkerByUuid(docker_worker['uuid']) + node = yield gentooci.db.workers.getNodeByWorkerUuid(worker_data['uuid']) + node_data = yield gentooci.db.workers.getNodeByUuid(node['node_uuid']) + print(worker_data) + print(node_data) + return node_data['host_url'] + +@util.renderer +@defer.inlineCallbacks +def GetBuildDockerImage(props, docker_worker): + gentooci = props.master.namedServices['services'].namedServices['gentooci'] + worker_data = yield gentooci.db.workers.getWorkerByUuid(docker_worker['uuid']) + image_data = yield gentooci.db.workers.getImageById(worker_data['image_id']) + print(image_data) + return image_data['tag'] - for local_worker in g_ci_w.getWorkersUuid('local'): - w.append(worker.LocalWorker(local_worker)) - for node_worker in g_ci_w.getWorkersAllData('node'): - w.append(worker.Worker(node_worker['uuid'], node_worker['password'])) +def gentoo_workers(worker_data_local, worker_data_docker): + w = [] + for local_worker in worker_data_local: + if local_worker['enable']: + w.append(worker.LocalWorker(local_worker['name'])) # docker workers docker_hostconfig = {} # For use of sandbox stuff @@ -71,24 +67,23 @@ def gentoo_workers(worker_data): # libseccomp overhead # https://github.com/seccomp/libseccomp/issues/153 docker_hostconfig['security_opt'] = ['seccomp=unconfined'] - for build_worker in g_ci_w.getWorkersAllData('docker'): - #FIXME: set settings in master.cfg - if build_worker['type'] == 'docker': - w.append(worker.DockerLatentWorker(build_worker['uuid'], - build_worker['password'], - docker_host='tcp://192.168.1.12:2375', - image=build_docker_images, + print(worker_data_docker) + for docker_worker in worker_data_docker: + #FIXME: get settings from db + if docker_worker['type'] == 'build': + w.append(worker.DockerLatentWorker(docker_worker['uuid'], + None, + docker_host=getDockerHost.withArgs(docker_worker), + image=GetBuildDockerImage.withArgs(docker_worker), volumes=docker_volumes, hostconfig=docker_hostconfig, followStartupLogs=True, masterFQDN='192.168.1.5', build_wait_timeout=3600 )) - for log_worker in g_ci_w.getWorkersAllData('log'): - #FIXME: set settings in master.cfg - if log_worker['type'] == 'log': - w.append(worker.DockerLatentWorker(log_worker['uuid'], - log_worker['password'], + if docker_worker['type'] == 'log': + w.append(worker.DockerLatentWorker(docker_worker['uuid'], + None, docker_host='tcp://192.168.1.12:2375', image=log_docker_images, volumes=docker_volumes_repositorys, diff --git a/buildbot_gentoo_ci/db/connector.py b/buildbot_gentoo_ci/db/connector.py index 7256cab..7665f84 100644 --- a/buildbot_gentoo_ci/db/connector.py +++ b/buildbot_gentoo_ci/db/connector.py @@ -38,6 +38,7 @@ from buildbot_gentoo_ci.db import versions from buildbot_gentoo_ci.db import keywords from buildbot_gentoo_ci.db import portages from buildbot_gentoo_ci.db import builds +from buildbot_gentoo_ci.db import workers upgrade_message = textwrap.dedent("""\ @@ -85,6 +86,7 @@ class DBConnector(service.ReconfigurableServiceMixin, self.keywords = keywords.KeywordsConnectorComponent(self) self.portages = portages.PortagesConnectorComponent(self) self.builds = builds.BuildsConnectorComponent(self) + self.workers = workers.WorkersConnectorComponent(self) @defer.inlineCallbacks def setup(self, config, check_version=True, verbose=True): diff --git a/buildbot_gentoo_ci/db/model.py b/buildbot_gentoo_ci/db/model.py index 3f1dc0a..87d7dbc 100644 --- a/buildbot_gentoo_ci/db/model.py +++ b/buildbot_gentoo_ci/db/model.py @@ -329,8 +329,61 @@ class Model(base.DBConnectorComponent): # unique id per project sa.Column('uuid', sa.String(36), primary_key=True, default=lambda: str(uuid.uuid4())), - sa.Column('type', sa.Enum('local','default','latent'), nullable=False), - sa.Column('enabled', sa.Boolean, default=False), + sa.Column('type', sa.Enum('log','build'), nullable=False), + sa.Column('enable', sa.Boolean, default=False), + sa.Column('flavor_id', sa.Integer, + sa.ForeignKey('workers_flavors.id', ondelete='CASCADE')), + sa.Column('image_id', sa.Integer, + sa.ForeignKey('workers_images.id', ondelete='CASCADE')), + ) + + workers_flavors = sautils.Table( + "workers_flavors", metadata, + # unique id per project + sa.Column('id', sa.Integer, primary_key=True), + sa.Column('name', sa.String(255), nullable=False), + sa.Column('ram', sa.Integer), + sa.Column('cpu', sa.Integer), + ) + + workers_images = sautils.Table( + "workers_images", metadata, + # unique id per project + sa.Column('id', sa.Integer, primary_key=True), + sa.Column('name', sa.String(255), nullable=False), + sa.Column('tag', sa.String(255), nullable=False), + sa.Column('dockerfile', sa.String(255), nullable=False), + sa.Column('bootstrap_tag', sa.String(255), nullable=False), + ) + + workers_configs = sautils.Table( + "workers_configs", metadata, + # unique id per project + sa.Column('id', sa.Integer, primary_key=True), + sa.Column('worker_uuid', sa.String(36), + sa.ForeignKey('workers.uuid', ondelete='CASCADE')), + sa.Column('type', sa.Enum('cap_add','security_opt'), nullable=False), + sa.Column('value', sa.String(255), nullable=False), + ) + + nodes = sautils.Table( + "nodes", metadata, + # unique id per project + sa.Column('uuid', sa.String(36), primary_key=True, + default=lambda: str(uuid.uuid4())), + sa.Column('name', sa.String(255), nullable=False), + sa.Column('host_url', sa.String(255), nullable=False), + sa.Column('enable', sa.Boolean, default=False), + ) + + nodes_workers = sautils.Table( + "nodes_workers", metadata, + # unique id per project + sa.Column('id', sa.Integer, primary_key=True), + sa.Column('node_uuid', sa.String(36), + sa.ForeignKey('nodes.uuid', ondelete='CASCADE')), + sa.Column('worker_uuid', sa.String(36), + sa.ForeignKey('workers.uuid', ondelete='CASCADE')), ) # Tables related to users diff --git a/buildbot_gentoo_ci/db/workers.py b/buildbot_gentoo_ci/db/workers.py new file mode 100644 index 0000000..afc7815 --- /dev/null +++ b/buildbot_gentoo_ci/db/workers.py @@ -0,0 +1,175 @@ +# This file has parts from Buildbot and is modifyed by Gentoo Authors. +# Buildbot is free software: you can redistribute it and/or modify it +# under the terms of the GNU General Public License as published by the +# Free Software Foundation, version 2. +# +# This program is distributed in the hope that it will be useful, but WITHOUT +# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS +# FOR A PARTICULAR PURPOSE. See the GNU General Public License for more +# details. +# +# You should have received a copy of the GNU General Public License along with +# this program; if not, write to the Free Software Foundation, Inc., 51 +# Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. +# +# Copyright Buildbot Team Members +# Origins: buildbot.db.* +# Modifyed by Gentoo Authors. +# Copyright 2021 Gentoo Authors + +import sqlalchemy as sa + +from twisted.internet import defer + +from buildbot.db import base + +class WorkersConnectorComponent(base.DBConnectorComponent): + + @defer.inlineCallbacks + def getWorkerByUuid(self, uuid): + def thd(conn): + tbl = self.db.model.workers + q = tbl.select() + q = q.where(tbl.c.uuid == uuid) + res = conn.execute(q) + row = res.fetchone() + if not row: + return None + return self._row2dict(conn, row) + res = yield self.db.pool.do(thd) + return res + + @defer.inlineCallbacks + def getWorkersByTypeAndEnable(self, type): + def thd(conn): + tbl = self.db.model.workers + q = tbl.select() + q = q.where(tbl.c.type == type) + q = q.where(tbl.c.enable == true) + return [self._row2dict(conn, row) + for row in conn.execute(q).fetchall()] + res = yield self.db.pool.do(thd) + return res + + @defer.inlineCallbacks + def getWorkersByNodeUuid(self, uuid): + def thd(conn): + tbl = self.db.model.nodes_workers + q = tbl.select() + q = q.where(tbl.c.node_uuid == uuid) + return [self._row2dict_node_worker(conn, row) + for row in conn.execute(q).fetchall()] + res = yield self.db.pool.do(thd) + return res + + @defer.inlineCallbacks + def getFlavorById(self, id): + def thd(conn): + tbl = self.db.model.workers_flavors + q = tbl.select() + q = q.where(tbl.c.id == id) + res = conn.execute(q) + row = res.fetchone() + if not row: + return None + return self._row2dict_flavor(conn, row) + res = yield self.db.pool.do(thd) + return res + + @defer.inlineCallbacks + def getImageById(self, id): + def thd(conn): + tbl = self.db.model.workers_images + q = tbl.select() + q = q.where(tbl.c.id == id) + res = conn.execute(q) + row = res.fetchone() + if not row: + return None + return self._row2dict_image(conn, row) + res = yield self.db.pool.do(thd) + return res + + @defer.inlineCallbacks + def getWorkerConfigByWorkerUuid(self, uuid): + def thd(conn): + tbl = self.db.model.worker_configs + q = tbl.select() + q = q.where(tbl.c.project_uuid == uuid) + return [self._row2dict_node_config(conn, row) + for row in conn.execute(q).fetchall()] + res = yield self.db.pool.do(thd) + return res + + + @defer.inlineCallbacks + def getNodeByUuid(self, uuid): + def thd(conn): + tbl = self.db.model.nodes + q = tbl.select() + q = q.where(tbl.c.uuid == uuid) + res = conn.execute(q) + row = res.fetchone() + if not row: + return None + return self._row2dict_node(conn, row) + res = yield self.db.pool.do(thd) + return res + + @defer.inlineCallbacks + def getNodeByWorkerUuid(self, uuid): + def thd(conn): + tbl = self.db.model.nodes_workers + q = tbl.select() + q = q.where(tbl.c.worker_uuid == uuid) + res = conn.execute(q) + row = res.fetchone() + if not row: + return None + return self._row2dict_node_worker(conn, row) + res = yield self.db.pool.do(thd) + return res + + def _row2dict(self, conn, row): + return dict( + uuid=row.uuid, + type=row.type, + enable=row.enable, + flavor_id=row.flavor_id, + image_id=row.image_id + ) + def _row2dict_flavor(self, conn, row): + return dict( + id=row.id, + name=row.name, + ram=row.ram, + cpu=row.cpu + ) + def _row2dict_image(self, conn, row): + return dict( + id=row.id, + name=row.name, + tag=row.tag, + dockerfile=row.dockerfile, + bootstrap_image_tag=row.bootstrap_image_tag + ) + def _row2dict_worker_config(self, conn, row): + return dict( + id=row.id, + worker_uuid=row.worker_uuid, + type=row.type, + value=row.value + ) + def _row2dict_node(self, conn, row): + return dict( + uuid=row.uuid, + name=row.name, + host_url=row.host_url, + enable=row.enable + ) + def _row2dict_node_worker(self, conn, row): + return dict( + id=row.id, + node_uuid=row.node_uuid, + worker_uuid=row.worker_uuid + ) @@ -3,22 +3,21 @@ from buildbot.plugins import util, secrets from buildbot_gentoo_ci.config import schedulers, workers, builders, service, change_source, reporters -# This is a sample buildmaster config file. It must be installed as -# 'master.cfg' in your buildmaster's base directory. - -#FIXME: Get workers from db or a file -worker_data = [ - {'uuid' : 'updatedb_1', 'password' : '', 'type' : 'local', 'enable' : True, }, - {'uuid' : 'updatedb_2', 'password' : '', 'type' : 'local', 'enable' : True, }, - {'uuid' : 'updatedb_3', 'password' : '', 'type' : 'local', 'enable' : True, }, - {'uuid' : 'updatedb_4', 'password' : '', 'type' : 'local', 'enable' : True, }, - {'uuid' : 'b89c2c1a-46e0-4ded-81dd-c51afeb7fcfa', 'password' : 'X', 'type' : 'log', 'enable' : True, }, - {'uuid' : 'b89c2c1a-46e0-4ded-81dd-c51afeb7fcfb', 'password' : 'X', 'type' : 'log', 'enable' : True, }, - {'uuid' : 'b89c2c1a-46e0-4ded-81dd-c51afeb7fcfc', 'password' : 'X', 'type' : 'log', 'enable' : True, }, - {'uuid' : 'a89c2c1a-46e0-4ded-81dd-c51afeb7fcfa', 'password' : 'X', 'type' : 'docker', 'enable' : True, }, - {'uuid' : 'a89c2c1a-46e0-4ded-81dd-c51afeb7fcfb', 'password' : 'X', 'type' : 'docker', 'enable' : True, }, - {'uuid' : 'a89c2c1a-46e0-4ded-81dd-c51afeb7fcfd', 'password' : 'X', 'type' : 'docker', 'enable' : True, }, - {'uuid' : 'c89c2c1a-46e0-4ded-81dd-c51afeb7fcfa', 'password' : 'X', 'type' : 'node', 'enable' : True, }, +worker_data_local = [ + {'name' : 'updatedb_1', 'type' : 'local', 'enable' : True, }, + {'name' : 'updatedb_2', 'type' : 'local', 'enable' : True, }, + {'name' : 'updatedb_3', 'type' : 'local', 'enable' : True, }, + {'name' : 'updatedb_4', 'type' : 'local', 'enable' : True, }, +] +#FIXME: Get workers from db +worker_data_docker = [ + {'uuid' : 'b89c2c1a-46e0-4ded-81dd-c51afeb7fcfa', 'type' : 'log', 'enable' : True, }, + {'uuid' : 'b89c2c1a-46e0-4ded-81dd-c51afeb7fcfb', 'type' : 'log', 'enable' : True, }, + {'uuid' : 'b89c2c1a-46e0-4ded-81dd-c51afeb7fcfc', 'type' : 'log', 'enable' : True, }, + {'uuid' : 'a89c2c1a-46e0-4ded-81dd-c51afeb7fcfa', 'type' : 'build', 'enable' : True, }, + {'uuid' : 'a89c2c1a-46e0-4ded-81dd-c51afeb7fcfb', 'type' : 'build', 'enable' : True, }, + {'uuid' : 'a89c2c1a-46e0-4ded-81dd-c51afeb7fcfc', 'type' : 'build', 'enable' : True, }, + {'uuid' : 'a89c2c1a-46e0-4ded-81dd-c51afeb7fcfd', 'type' : 'build', 'enable' : True, }, ] # This is the dictionary that the buildmaster pays attention to. We also use @@ -37,7 +36,7 @@ c['secretsProviders'].append(secrets.SecretInAFile(dirname="/var/lib/buildmaster # The 'workers' list defines the set of recognized workers. Each element is # a Worker object, specifying a unique worker name and password. The same # worker name and password must be configured on the worker. -c['workers'] = workers.gentoo_workers(worker_data) +c['workers'] = workers.gentoo_workers(worker_data_local, worker_data_docker) # 'protocols' contains information about protocols which master will use for # communicating with workers. You must define at least 'port' option that workers @@ -66,7 +65,7 @@ c['schedulers'] = schedulers.gentoo_schedulers() # what steps, and which workers can execute them. Note that any particular build will # only take place on one worker. -c['builders'] = builders.gentoo_builders(worker_data) +c['builders'] = builders.gentoo_builders(worker_data_local, worker_data_docker) ####### BUILDBOT SERVICES @@ -84,7 +83,7 @@ c['services'] = reporters.gentoo_reporters(r=c['services']) # home pages (linked to the 'titleURL'). c['title'] = "Gentoo CI" -c['titleURL'] = "https://gentoo-ci.gentoo.org" +c['titleURL'] = "https://ci.dev.gentoo.org" # the 'buildbotURL' string should point to the location where the buildbot's # internal web server is visible. This typically uses the port number set in diff --git a/patches/bb-props_master_fix.patch b/patches/bb-props_master_fix.patch new file mode 100644 index 0000000..f31d4ad --- /dev/null +++ b/patches/bb-props_master_fix.patch @@ -0,0 +1,15 @@ +diff --git a/buildbot/process/builder.py b/buildbot/process/builder.py +index df8f9c014..c16e4f64e 100644 +--- a/buildbot/process/builder.py ++++ b/buildbot/process/builder.py +@@ -288,6 +288,10 @@ class Builder(util_service.ReconfigurableServiceMixin, + # The instance type of the worker may depend on the properties of + # the build that substantiated it. + props = setupPropsIfNeeded(props) ++ # check if we have props.master when we call renderWorkerProps later ++ # set props.master if needed ++ if props.master is None: ++ props.master = self.master + can_start = yield worker.isCompatibleWithBuild(props) + if not can_start: + return False diff --git a/sql/gentoo_ci_schema.sql b/sql/gentoo_ci_schema.sql index 70a7401..fc10eff 100644 --- a/sql/gentoo_ci_schema.sql +++ b/sql/gentoo_ci_schema.sql @@ -5,8 +5,6 @@ -- Dumped from database version 13.3 -- Dumped by pg_dump version 13.5 --- Started on 2022-08-21 10:37:12 CEST - SET statement_timeout = 0; SET lock_timeout = 0; SET idle_in_transaction_session_timeout = 0; @@ -19,30 +17,6 @@ SET client_min_messages = warning; SET row_security = off; -- --- TOC entry 2475 (class 1262 OID 155811) --- Name: gentoo-ci; Type: DATABASE; Schema: -; Owner: buildbot --- - -CREATE DATABASE "gentoo-ci" WITH TEMPLATE = template0 ENCODING = 'UTF8' LOCALE = 'sv_SE.utf8'; - - -ALTER DATABASE "gentoo-ci" OWNER TO buildbot; - -\connect -reuse-previous=on "dbname='gentoo-ci'" - -SET statement_timeout = 0; -SET lock_timeout = 0; -SET idle_in_transaction_session_timeout = 0; -SET client_encoding = 'UTF8'; -SET standard_conforming_strings = on; -SELECT pg_catalog.set_config('search_path', '', false); -SET check_function_bodies = false; -SET xmloption = content; -SET client_min_messages = warning; -SET row_security = off; - --- --- TOC entry 655 (class 1247 OID 155813) -- Name: projects_builds_status; Type: TYPE; Schema: public; Owner: buildbot -- @@ -58,7 +32,6 @@ CREATE TYPE public.projects_builds_status AS ENUM ( ALTER TYPE public.projects_builds_status OWNER TO buildbot; -- --- TOC entry 658 (class 1247 OID 155824) -- Name: projects_pattern_search_type; Type: TYPE; Schema: public; Owner: buildbot -- @@ -73,7 +46,6 @@ CREATE TYPE public.projects_pattern_search_type AS ENUM ( ALTER TYPE public.projects_pattern_search_type OWNER TO buildbot; -- --- TOC entry 661 (class 1247 OID 155834) -- Name: projects_pattern_status; Type: TYPE; Schema: public; Owner: buildbot -- @@ -88,7 +60,6 @@ CREATE TYPE public.projects_pattern_status AS ENUM ( ALTER TYPE public.projects_pattern_status OWNER TO buildbot; -- --- TOC entry 664 (class 1247 OID 155844) -- Name: projects_pattern_type; Type: TYPE; Schema: public; Owner: buildbot -- @@ -114,7 +85,6 @@ CREATE TYPE public.projects_pattern_type AS ENUM ( ALTER TYPE public.projects_pattern_type OWNER TO buildbot; -- --- TOC entry 667 (class 1247 OID 155868) -- Name: projects_portage_directorys; Type: TYPE; Schema: public; Owner: buildbot -- @@ -127,7 +97,6 @@ CREATE TYPE public.projects_portage_directorys AS ENUM ( ALTER TYPE public.projects_portage_directorys OWNER TO buildbot; -- --- TOC entry 761 (class 1247 OID 550221) -- Name: projects_portage_package_directorys; Type: TYPE; Schema: public; Owner: buildbot -- @@ -142,7 +111,6 @@ CREATE TYPE public.projects_portage_package_directorys AS ENUM ( ALTER TYPE public.projects_portage_package_directorys OWNER TO buildbot; -- --- TOC entry 670 (class 1247 OID 155874) -- Name: projects_repositorys_pkgcheck; Type: TYPE; Schema: public; Owner: buildbot -- @@ -156,7 +124,6 @@ CREATE TYPE public.projects_repositorys_pkgcheck AS ENUM ( ALTER TYPE public.projects_repositorys_pkgcheck OWNER TO buildbot; -- --- TOC entry 673 (class 1247 OID 155882) -- Name: projects_status; Type: TYPE; Schema: public; Owner: buildbot -- @@ -170,7 +137,6 @@ CREATE TYPE public.projects_status AS ENUM ( ALTER TYPE public.projects_status OWNER TO buildbot; -- --- TOC entry 777 (class 1247 OID 1708870) -- Name: repositorys_method; Type: TYPE; Schema: public; Owner: postgres -- @@ -185,7 +151,6 @@ CREATE TYPE public.repositorys_method AS ENUM ( ALTER TYPE public.repositorys_method OWNER TO postgres; -- --- TOC entry 774 (class 1247 OID 1708856) -- Name: repositorys_mode; Type: TYPE; Schema: public; Owner: postgres -- @@ -198,7 +163,6 @@ CREATE TYPE public.repositorys_mode AS ENUM ( ALTER TYPE public.repositorys_mode OWNER TO postgres; -- --- TOC entry 676 (class 1247 OID 155890) -- Name: repositorys_type; Type: TYPE; Schema: public; Owner: buildbot -- @@ -211,7 +175,6 @@ CREATE TYPE public.repositorys_type AS ENUM ( ALTER TYPE public.repositorys_type OWNER TO buildbot; -- --- TOC entry 679 (class 1247 OID 155894) -- Name: versions_keywords_status; Type: TYPE; Schema: public; Owner: buildbot -- @@ -226,7 +189,6 @@ CREATE TYPE public.versions_keywords_status AS ENUM ( ALTER TYPE public.versions_keywords_status OWNER TO buildbot; -- --- TOC entry 767 (class 1247 OID 698031) -- Name: versions_metadata_type; Type: TYPE; Schema: public; Owner: buildbot -- @@ -242,16 +204,24 @@ CREATE TYPE public.versions_metadata_type AS ENUM ( ALTER TYPE public.versions_metadata_type OWNER TO buildbot; -- --- TOC entry 758 (class 1247 OID 488393) +-- Name: workers_config_type; Type: TYPE; Schema: public; Owner: buildbot +-- + +CREATE TYPE public.workers_config_type AS ENUM ( + 'cap_add', + 'security_opt' +); + + +ALTER TYPE public.workers_config_type OWNER TO buildbot; + +-- -- Name: workers_type; Type: TYPE; Schema: public; Owner: buildbot -- CREATE TYPE public.workers_type AS ENUM ( - 'default', - 'local', - 'latent', - 'chroot', - 'docker' + 'log', + 'build' ); @@ -262,7 +232,6 @@ SET default_tablespace = ''; SET default_table_access_method = heap; -- --- TOC entry 200 (class 1259 OID 155903) -- Name: categorys; Type: TABLE; Schema: public; Owner: buildbot -- @@ -275,7 +244,6 @@ CREATE TABLE public.categorys ( ALTER TABLE public.categorys OWNER TO buildbot; -- --- TOC entry 201 (class 1259 OID 155906) -- Name: keywords; Type: TABLE; Schema: public; Owner: buildbot -- @@ -288,7 +256,6 @@ CREATE TABLE public.keywords ( ALTER TABLE public.keywords OWNER TO buildbot; -- --- TOC entry 202 (class 1259 OID 155909) -- Name: migrate_version; Type: TABLE; Schema: public; Owner: buildbot -- @@ -302,7 +269,33 @@ CREATE TABLE public.migrate_version ( ALTER TABLE public.migrate_version OWNER TO buildbot; -- --- TOC entry 203 (class 1259 OID 155915) +-- Name: nodes; Type: TABLE; Schema: public; Owner: buildbot +-- + +CREATE TABLE public.nodes ( + name character varying, + host_url character varying, + enable boolean, + uuid character varying(36) NOT NULL +); + + +ALTER TABLE public.nodes OWNER TO buildbot; + +-- +-- Name: nodes_workers; Type: TABLE; Schema: public; Owner: buildbot +-- + +CREATE TABLE public.nodes_workers ( + id integer NOT NULL, + worker_uuid character varying(36), + node_uuid character varying(36) +); + + +ALTER TABLE public.nodes_workers OWNER TO buildbot; + +-- -- Name: packages; Type: TABLE; Schema: public; Owner: buildbot -- @@ -319,7 +312,6 @@ CREATE TABLE public.packages ( ALTER TABLE public.packages OWNER TO buildbot; -- --- TOC entry 204 (class 1259 OID 155918) -- Name: portages_makeconf; Type: TABLE; Schema: public; Owner: buildbot -- @@ -332,7 +324,6 @@ CREATE TABLE public.portages_makeconf ( ALTER TABLE public.portages_makeconf OWNER TO buildbot; -- --- TOC entry 205 (class 1259 OID 155921) -- Name: portages_makeconf_id_seq; Type: SEQUENCE; Schema: public; Owner: buildbot -- @@ -348,8 +339,6 @@ CREATE SEQUENCE public.portages_makeconf_id_seq ALTER TABLE public.portages_makeconf_id_seq OWNER TO buildbot; -- --- TOC entry 2477 (class 0 OID 0) --- Dependencies: 205 -- Name: portages_makeconf_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: buildbot -- @@ -357,7 +346,6 @@ ALTER SEQUENCE public.portages_makeconf_id_seq OWNED BY public.portages_makeconf -- --- TOC entry 206 (class 1259 OID 155923) -- Name: projects; Type: TABLE; Schema: public; Owner: buildbot -- @@ -381,7 +369,6 @@ CREATE TABLE public.projects ( ALTER TABLE public.projects OWNER TO buildbot; -- --- TOC entry 207 (class 1259 OID 155929) -- Name: projects_builds; Type: TABLE; Schema: public; Owner: buildbot -- @@ -403,7 +390,6 @@ CREATE TABLE public.projects_builds ( ALTER TABLE public.projects_builds OWNER TO buildbot; -- --- TOC entry 208 (class 1259 OID 155933) -- Name: projects_builds_id_seq; Type: SEQUENCE; Schema: public; Owner: buildbot -- @@ -419,8 +405,6 @@ CREATE SEQUENCE public.projects_builds_id_seq ALTER TABLE public.projects_builds_id_seq OWNER TO buildbot; -- --- TOC entry 2478 (class 0 OID 0) --- Dependencies: 208 -- Name: projects_builds_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: buildbot -- @@ -428,7 +412,6 @@ ALTER SEQUENCE public.projects_builds_id_seq OWNED BY public.projects_builds.id; -- --- TOC entry 209 (class 1259 OID 155935) -- Name: projects_emerge_options; Type: TABLE; Schema: public; Owner: buildbot -- @@ -444,7 +427,6 @@ CREATE TABLE public.projects_emerge_options ( ALTER TABLE public.projects_emerge_options OWNER TO buildbot; -- --- TOC entry 210 (class 1259 OID 155938) -- Name: projects_emerge_options_id_seq; Type: SEQUENCE; Schema: public; Owner: buildbot -- @@ -460,8 +442,6 @@ CREATE SEQUENCE public.projects_emerge_options_id_seq ALTER TABLE public.projects_emerge_options_id_seq OWNER TO buildbot; -- --- TOC entry 2479 (class 0 OID 0) --- Dependencies: 210 -- Name: projects_emerge_options_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: buildbot -- @@ -469,7 +449,6 @@ ALTER SEQUENCE public.projects_emerge_options_id_seq OWNED BY public.projects_em -- --- TOC entry 211 (class 1259 OID 155940) -- Name: projects_pattern; Type: TABLE; Schema: public; Owner: buildbot -- @@ -488,7 +467,6 @@ CREATE TABLE public.projects_pattern ( ALTER TABLE public.projects_pattern OWNER TO buildbot; -- --- TOC entry 212 (class 1259 OID 155943) -- Name: projects_pattern_id_seq; Type: SEQUENCE; Schema: public; Owner: buildbot -- @@ -504,8 +482,6 @@ CREATE SEQUENCE public.projects_pattern_id_seq ALTER TABLE public.projects_pattern_id_seq OWNER TO buildbot; -- --- TOC entry 2480 (class 0 OID 0) --- Dependencies: 212 -- Name: projects_pattern_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: buildbot -- @@ -513,7 +489,6 @@ ALTER SEQUENCE public.projects_pattern_id_seq OWNED BY public.projects_pattern.i -- --- TOC entry 213 (class 1259 OID 155945) -- Name: projects_portage; Type: TABLE; Schema: public; Owner: buildbot -- @@ -528,7 +503,6 @@ CREATE TABLE public.projects_portage ( ALTER TABLE public.projects_portage OWNER TO buildbot; -- --- TOC entry 214 (class 1259 OID 155948) -- Name: projects_portage_id_seq; Type: SEQUENCE; Schema: public; Owner: buildbot -- @@ -544,8 +518,6 @@ CREATE SEQUENCE public.projects_portage_id_seq ALTER TABLE public.projects_portage_id_seq OWNER TO buildbot; -- --- TOC entry 2481 (class 0 OID 0) --- Dependencies: 214 -- Name: projects_portage_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: buildbot -- @@ -553,7 +525,6 @@ ALTER SEQUENCE public.projects_portage_id_seq OWNED BY public.projects_portage.i -- --- TOC entry 215 (class 1259 OID 155950) -- Name: projects_portages_env; Type: TABLE; Schema: public; Owner: buildbot -- @@ -569,7 +540,6 @@ CREATE TABLE public.projects_portages_env ( ALTER TABLE public.projects_portages_env OWNER TO buildbot; -- --- TOC entry 216 (class 1259 OID 155953) -- Name: projects_portages_env_id_seq; Type: SEQUENCE; Schema: public; Owner: buildbot -- @@ -585,8 +555,6 @@ CREATE SEQUENCE public.projects_portages_env_id_seq ALTER TABLE public.projects_portages_env_id_seq OWNER TO buildbot; -- --- TOC entry 2482 (class 0 OID 0) --- Dependencies: 216 -- Name: projects_portages_env_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: buildbot -- @@ -594,7 +562,6 @@ ALTER SEQUENCE public.projects_portages_env_id_seq OWNED BY public.projects_port -- --- TOC entry 217 (class 1259 OID 155955) -- Name: projects_portages_makeconf; Type: TABLE; Schema: public; Owner: buildbot -- @@ -609,7 +576,6 @@ CREATE TABLE public.projects_portages_makeconf ( ALTER TABLE public.projects_portages_makeconf OWNER TO buildbot; -- --- TOC entry 218 (class 1259 OID 155958) -- Name: projects_portages_makeconf_id_seq; Type: SEQUENCE; Schema: public; Owner: buildbot -- @@ -625,8 +591,6 @@ CREATE SEQUENCE public.projects_portages_makeconf_id_seq ALTER TABLE public.projects_portages_makeconf_id_seq OWNER TO buildbot; -- --- TOC entry 2483 (class 0 OID 0) --- Dependencies: 218 -- Name: projects_portages_makeconf_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: buildbot -- @@ -634,7 +598,6 @@ ALTER SEQUENCE public.projects_portages_makeconf_id_seq OWNED BY public.projects -- --- TOC entry 230 (class 1259 OID 550229) -- Name: projects_portages_package; Type: TABLE; Schema: public; Owner: buildbot -- @@ -650,7 +613,6 @@ CREATE TABLE public.projects_portages_package ( ALTER TABLE public.projects_portages_package OWNER TO buildbot; -- --- TOC entry 219 (class 1259 OID 155960) -- Name: projects_repositorys; Type: TABLE; Schema: public; Owner: buildbot -- @@ -669,7 +631,6 @@ CREATE TABLE public.projects_repositorys ( ALTER TABLE public.projects_repositorys OWNER TO buildbot; -- --- TOC entry 220 (class 1259 OID 155963) -- Name: projects_repositorys_id_seq; Type: SEQUENCE; Schema: public; Owner: buildbot -- @@ -685,8 +646,6 @@ CREATE SEQUENCE public.projects_repositorys_id_seq ALTER TABLE public.projects_repositorys_id_seq OWNER TO buildbot; -- --- TOC entry 2484 (class 0 OID 0) --- Dependencies: 220 -- Name: projects_repositorys_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: buildbot -- @@ -694,7 +653,6 @@ ALTER SEQUENCE public.projects_repositorys_id_seq OWNED BY public.projects_repos -- --- TOC entry 229 (class 1259 OID 484107) -- Name: projects_workers; Type: TABLE; Schema: public; Owner: buildbot -- @@ -708,7 +666,6 @@ CREATE TABLE public.projects_workers ( ALTER TABLE public.projects_workers OWNER TO buildbot; -- --- TOC entry 221 (class 1259 OID 155965) -- Name: repositorys; Type: TABLE; Schema: public; Owner: buildbot -- @@ -734,7 +691,6 @@ CREATE TABLE public.repositorys ( ALTER TABLE public.repositorys OWNER TO buildbot; -- --- TOC entry 222 (class 1259 OID 155971) -- Name: repositorys_gitpullers; Type: TABLE; Schema: public; Owner: buildbot -- @@ -754,7 +710,6 @@ CREATE TABLE public.repositorys_gitpullers ( ALTER TABLE public.repositorys_gitpullers OWNER TO buildbot; -- --- TOC entry 223 (class 1259 OID 155978) -- Name: repositorys_gitpullers_id_seq; Type: SEQUENCE; Schema: public; Owner: buildbot -- @@ -770,8 +725,6 @@ CREATE SEQUENCE public.repositorys_gitpullers_id_seq ALTER TABLE public.repositorys_gitpullers_id_seq OWNER TO buildbot; -- --- TOC entry 2485 (class 0 OID 0) --- Dependencies: 223 -- Name: repositorys_gitpullers_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: buildbot -- @@ -779,7 +732,6 @@ ALTER SEQUENCE public.repositorys_gitpullers_id_seq OWNED BY public.repositorys_ -- --- TOC entry 224 (class 1259 OID 155980) -- Name: users; Type: TABLE; Schema: public; Owner: buildbot -- @@ -794,7 +746,6 @@ CREATE TABLE public.users ( ALTER TABLE public.users OWNER TO buildbot; -- --- TOC entry 225 (class 1259 OID 155988) -- Name: users_uid_seq; Type: SEQUENCE; Schema: public; Owner: buildbot -- @@ -810,8 +761,6 @@ CREATE SEQUENCE public.users_uid_seq ALTER TABLE public.users_uid_seq OWNER TO buildbot; -- --- TOC entry 2486 (class 0 OID 0) --- Dependencies: 225 -- Name: users_uid_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: buildbot -- @@ -819,7 +768,6 @@ ALTER SEQUENCE public.users_uid_seq OWNED BY public.users.uid; -- --- TOC entry 226 (class 1259 OID 155990) -- Name: versions; Type: TABLE; Schema: public; Owner: buildbot -- @@ -837,7 +785,6 @@ CREATE TABLE public.versions ( ALTER TABLE public.versions OWNER TO buildbot; -- --- TOC entry 227 (class 1259 OID 155996) -- Name: versions_keywords; Type: TABLE; Schema: public; Owner: buildbot -- @@ -852,7 +799,6 @@ CREATE TABLE public.versions_keywords ( ALTER TABLE public.versions_keywords OWNER TO buildbot; -- --- TOC entry 232 (class 1259 OID 702199) -- Name: versions_metadata_id_seq; Type: SEQUENCE; Schema: public; Owner: buildbot -- @@ -867,7 +813,6 @@ CREATE SEQUENCE public.versions_metadata_id_seq ALTER TABLE public.versions_metadata_id_seq OWNER TO buildbot; -- --- TOC entry 231 (class 1259 OID 698041) -- Name: versions_metadata; Type: TABLE; Schema: public; Owner: buildbot -- @@ -882,21 +827,64 @@ CREATE TABLE public.versions_metadata ( ALTER TABLE public.versions_metadata OWNER TO buildbot; -- --- TOC entry 228 (class 1259 OID 484104) -- Name: workers; Type: TABLE; Schema: public; Owner: buildbot -- CREATE TABLE public.workers ( - uuid character varying(36), + uuid character varying(36) NOT NULL, enable boolean, - type public.workers_type + type public.workers_type, + flavor_id integer, + image_id integer ); ALTER TABLE public.workers OWNER TO buildbot; -- --- TOC entry 2228 (class 2604 OID 155999) +-- Name: workers_configs; Type: TABLE; Schema: public; Owner: buildbot +-- + +CREATE TABLE public.workers_configs ( + id integer NOT NULL, + worker_uuid character varying(36), + type public.workers_config_type, + value character varying +); + + +ALTER TABLE public.workers_configs OWNER TO buildbot; + +-- +-- Name: workers_flavers; Type: TABLE; Schema: public; Owner: buildbot +-- + +CREATE TABLE public.workers_flavers ( + id integer NOT NULL, + name character varying, + ram integer, + cpu integer +); + + +ALTER TABLE public.workers_flavers OWNER TO buildbot; + +-- +-- Name: workers_images; Type: TABLE; Schema: public; Owner: buildbot +-- + +CREATE TABLE public.workers_images ( + id integer NOT NULL, + name character varying, + tag character varying, + dockerfile character varying, + bootstrap_tag character varying +); + + +ALTER TABLE public.workers_images OWNER TO buildbot; + +-- -- Name: portages_makeconf id; Type: DEFAULT; Schema: public; Owner: buildbot -- @@ -904,7 +892,6 @@ ALTER TABLE ONLY public.portages_makeconf ALTER COLUMN id SET DEFAULT nextval('p -- --- TOC entry 2230 (class 2604 OID 156000) -- Name: projects_builds id; Type: DEFAULT; Schema: public; Owner: buildbot -- @@ -912,7 +899,6 @@ ALTER TABLE ONLY public.projects_builds ALTER COLUMN id SET DEFAULT nextval('pub -- --- TOC entry 2231 (class 2604 OID 156001) -- Name: projects_emerge_options id; Type: DEFAULT; Schema: public; Owner: buildbot -- @@ -920,7 +906,6 @@ ALTER TABLE ONLY public.projects_emerge_options ALTER COLUMN id SET DEFAULT next -- --- TOC entry 2232 (class 2604 OID 156002) -- Name: projects_pattern id; Type: DEFAULT; Schema: public; Owner: buildbot -- @@ -928,7 +913,6 @@ ALTER TABLE ONLY public.projects_pattern ALTER COLUMN id SET DEFAULT nextval('pu -- --- TOC entry 2233 (class 2604 OID 156003) -- Name: projects_portage id; Type: DEFAULT; Schema: public; Owner: buildbot -- @@ -936,7 +920,6 @@ ALTER TABLE ONLY public.projects_portage ALTER COLUMN id SET DEFAULT nextval('pu -- --- TOC entry 2234 (class 2604 OID 156004) -- Name: projects_portages_env id; Type: DEFAULT; Schema: public; Owner: buildbot -- @@ -944,7 +927,6 @@ ALTER TABLE ONLY public.projects_portages_env ALTER COLUMN id SET DEFAULT nextva -- --- TOC entry 2235 (class 2604 OID 156005) -- Name: projects_portages_makeconf id; Type: DEFAULT; Schema: public; Owner: buildbot -- @@ -952,7 +934,6 @@ ALTER TABLE ONLY public.projects_portages_makeconf ALTER COLUMN id SET DEFAULT n -- --- TOC entry 2236 (class 2604 OID 156006) -- Name: projects_repositorys id; Type: DEFAULT; Schema: public; Owner: buildbot -- @@ -960,7 +941,6 @@ ALTER TABLE ONLY public.projects_repositorys ALTER COLUMN id SET DEFAULT nextval -- --- TOC entry 2238 (class 2604 OID 156007) -- Name: repositorys_gitpullers id; Type: DEFAULT; Schema: public; Owner: buildbot -- @@ -968,7 +948,6 @@ ALTER TABLE ONLY public.repositorys_gitpullers ALTER COLUMN id SET DEFAULT nextv -- --- TOC entry 2241 (class 2604 OID 156008) -- Name: users uid; Type: DEFAULT; Schema: public; Owner: buildbot -- @@ -976,7 +955,6 @@ ALTER TABLE ONLY public.users ALTER COLUMN uid SET DEFAULT nextval('public.users -- --- TOC entry 2244 (class 2606 OID 156010) -- Name: categorys categorys_pkey; Type: CONSTRAINT; Schema: public; Owner: buildbot -- @@ -985,7 +963,6 @@ ALTER TABLE ONLY public.categorys -- --- TOC entry 2246 (class 2606 OID 156012) -- Name: categorys categorys_unique; Type: CONSTRAINT; Schema: public; Owner: buildbot -- @@ -994,7 +971,6 @@ ALTER TABLE ONLY public.categorys -- --- TOC entry 2248 (class 2606 OID 156014) -- Name: keywords keywords_pkey; Type: CONSTRAINT; Schema: public; Owner: buildbot -- @@ -1003,7 +979,6 @@ ALTER TABLE ONLY public.keywords -- --- TOC entry 2250 (class 2606 OID 156016) -- Name: keywords keywords_unique; Type: CONSTRAINT; Schema: public; Owner: buildbot -- @@ -1012,7 +987,6 @@ ALTER TABLE ONLY public.keywords -- --- TOC entry 2252 (class 2606 OID 156018) -- Name: migrate_version migrate_version_pkey; Type: CONSTRAINT; Schema: public; Owner: buildbot -- @@ -1021,7 +995,22 @@ ALTER TABLE ONLY public.migrate_version -- --- TOC entry 2254 (class 2606 OID 156020) +-- Name: nodes nodes_pkey; Type: CONSTRAINT; Schema: public; Owner: buildbot +-- + +ALTER TABLE ONLY public.nodes + ADD CONSTRAINT nodes_pkey PRIMARY KEY (uuid); + + +-- +-- Name: nodes_workers nodes_workers_pkey; Type: CONSTRAINT; Schema: public; Owner: buildbot +-- + +ALTER TABLE ONLY public.nodes_workers + ADD CONSTRAINT nodes_workers_pkey PRIMARY KEY (id); + + +-- -- Name: packages packages_pkey; Type: CONSTRAINT; Schema: public; Owner: buildbot -- @@ -1030,7 +1019,6 @@ ALTER TABLE ONLY public.packages -- --- TOC entry 2256 (class 2606 OID 156022) -- Name: packages packages_unique; Type: CONSTRAINT; Schema: public; Owner: buildbot -- @@ -1039,7 +1027,6 @@ ALTER TABLE ONLY public.packages -- --- TOC entry 2258 (class 2606 OID 156024) -- Name: portages_makeconf portages_makeconf_pkey; Type: CONSTRAINT; Schema: public; Owner: buildbot -- @@ -1048,7 +1035,6 @@ ALTER TABLE ONLY public.portages_makeconf -- --- TOC entry 2260 (class 2606 OID 156026) -- Name: portages_makeconf portages_makeconf_unique; Type: CONSTRAINT; Schema: public; Owner: buildbot -- @@ -1057,7 +1043,6 @@ ALTER TABLE ONLY public.portages_makeconf -- --- TOC entry 2266 (class 2606 OID 156028) -- Name: projects_builds projects_builds_pkey; Type: CONSTRAINT; Schema: public; Owner: buildbot -- @@ -1066,7 +1051,6 @@ ALTER TABLE ONLY public.projects_builds -- --- TOC entry 2268 (class 2606 OID 156030) -- Name: projects_builds projects_builds_unique; Type: CONSTRAINT; Schema: public; Owner: buildbot -- @@ -1075,7 +1059,6 @@ ALTER TABLE ONLY public.projects_builds -- --- TOC entry 2270 (class 2606 OID 156032) -- Name: projects_emerge_options projects_emerge_options_pkey; Type: CONSTRAINT; Schema: public; Owner: buildbot -- @@ -1084,7 +1067,6 @@ ALTER TABLE ONLY public.projects_emerge_options -- --- TOC entry 2272 (class 2606 OID 156034) -- Name: projects_emerge_options projects_emerge_options_unique; Type: CONSTRAINT; Schema: public; Owner: buildbot -- @@ -1093,7 +1075,6 @@ ALTER TABLE ONLY public.projects_emerge_options -- --- TOC entry 2274 (class 2606 OID 156036) -- Name: projects_pattern projects_pattern_pkey; Type: CONSTRAINT; Schema: public; Owner: buildbot -- @@ -1102,7 +1083,6 @@ ALTER TABLE ONLY public.projects_pattern -- --- TOC entry 2276 (class 2606 OID 156038) -- Name: projects_pattern projects_pattern_unique; Type: CONSTRAINT; Schema: public; Owner: buildbot -- @@ -1111,7 +1091,6 @@ ALTER TABLE ONLY public.projects_pattern -- --- TOC entry 2262 (class 2606 OID 156040) -- Name: projects projects_pkey; Type: CONSTRAINT; Schema: public; Owner: buildbot -- @@ -1120,7 +1099,6 @@ ALTER TABLE ONLY public.projects -- --- TOC entry 2316 (class 2606 OID 550233) -- Name: projects_portages_package projects_portage_package_pkey; Type: CONSTRAINT; Schema: public; Owner: buildbot -- @@ -1129,7 +1107,6 @@ ALTER TABLE ONLY public.projects_portages_package -- --- TOC entry 2278 (class 2606 OID 156042) -- Name: projects_portage projects_portage_pkey; Type: CONSTRAINT; Schema: public; Owner: buildbot -- @@ -1138,7 +1115,6 @@ ALTER TABLE ONLY public.projects_portage -- --- TOC entry 2280 (class 2606 OID 156044) -- Name: projects_portage projects_portage_unique; Type: CONSTRAINT; Schema: public; Owner: buildbot -- @@ -1147,7 +1123,6 @@ ALTER TABLE ONLY public.projects_portage -- --- TOC entry 2282 (class 2606 OID 156046) -- Name: projects_portages_env projects_portages_env_pkey; Type: CONSTRAINT; Schema: public; Owner: buildbot -- @@ -1156,7 +1131,6 @@ ALTER TABLE ONLY public.projects_portages_env -- --- TOC entry 2284 (class 2606 OID 156048) -- Name: projects_portages_env projects_portages_env_unique; Type: CONSTRAINT; Schema: public; Owner: buildbot -- @@ -1165,7 +1139,6 @@ ALTER TABLE ONLY public.projects_portages_env -- --- TOC entry 2286 (class 2606 OID 156050) -- Name: projects_portages_makeconf projects_portages_makeconf_pkey; Type: CONSTRAINT; Schema: public; Owner: buildbot -- @@ -1174,7 +1147,6 @@ ALTER TABLE ONLY public.projects_portages_makeconf -- --- TOC entry 2288 (class 2606 OID 156052) -- Name: projects_portages_makeconf projects_portages_makeconf_unique; Type: CONSTRAINT; Schema: public; Owner: buildbot -- @@ -1183,7 +1155,6 @@ ALTER TABLE ONLY public.projects_portages_makeconf -- --- TOC entry 2290 (class 2606 OID 156054) -- Name: projects_repositorys projects_repositorys_pkey; Type: CONSTRAINT; Schema: public; Owner: buildbot -- @@ -1192,7 +1163,6 @@ ALTER TABLE ONLY public.projects_repositorys -- --- TOC entry 2292 (class 2606 OID 156056) -- Name: projects_repositorys projects_repositorys_unique; Type: CONSTRAINT; Schema: public; Owner: buildbot -- @@ -1201,7 +1171,6 @@ ALTER TABLE ONLY public.projects_repositorys -- --- TOC entry 2264 (class 2606 OID 156058) -- Name: projects projects_unique; Type: CONSTRAINT; Schema: public; Owner: buildbot -- @@ -1210,7 +1179,6 @@ ALTER TABLE ONLY public.projects -- --- TOC entry 2314 (class 2606 OID 484111) -- Name: projects_workers projects_workers_pkey; Type: CONSTRAINT; Schema: public; Owner: buildbot -- @@ -1219,7 +1187,6 @@ ALTER TABLE ONLY public.projects_workers -- --- TOC entry 2298 (class 2606 OID 156060) -- Name: repositorys_gitpullers repositorys_gitpullers_pkey; Type: CONSTRAINT; Schema: public; Owner: buildbot -- @@ -1228,7 +1195,6 @@ ALTER TABLE ONLY public.repositorys_gitpullers -- --- TOC entry 2300 (class 2606 OID 156062) -- Name: repositorys_gitpullers repositorys_gitpullers_unique; Type: CONSTRAINT; Schema: public; Owner: buildbot -- @@ -1237,7 +1203,6 @@ ALTER TABLE ONLY public.repositorys_gitpullers -- --- TOC entry 2294 (class 2606 OID 156064) -- Name: repositorys repositorys_pkey; Type: CONSTRAINT; Schema: public; Owner: buildbot -- @@ -1246,7 +1211,6 @@ ALTER TABLE ONLY public.repositorys -- --- TOC entry 2296 (class 2606 OID 156066) -- Name: repositorys repositorys_unique; Type: CONSTRAINT; Schema: public; Owner: buildbot -- @@ -1255,7 +1219,6 @@ ALTER TABLE ONLY public.repositorys -- --- TOC entry 2302 (class 2606 OID 156068) -- Name: users users_pkey; Type: CONSTRAINT; Schema: public; Owner: buildbot -- @@ -1264,7 +1227,6 @@ ALTER TABLE ONLY public.users -- --- TOC entry 2304 (class 2606 OID 156070) -- Name: users users_unique; Type: CONSTRAINT; Schema: public; Owner: buildbot -- @@ -1273,7 +1235,6 @@ ALTER TABLE ONLY public.users -- --- TOC entry 2310 (class 2606 OID 156072) -- Name: versions_keywords versions_keywords_pkey; Type: CONSTRAINT; Schema: public; Owner: buildbot -- @@ -1282,7 +1243,6 @@ ALTER TABLE ONLY public.versions_keywords -- --- TOC entry 2312 (class 2606 OID 156074) -- Name: versions_keywords versions_keywords_unique; Type: CONSTRAINT; Schema: public; Owner: buildbot -- @@ -1291,7 +1251,6 @@ ALTER TABLE ONLY public.versions_keywords -- --- TOC entry 2318 (class 2606 OID 698703) -- Name: versions_metadata versions_metadata_pkey; Type: CONSTRAINT; Schema: public; Owner: buildbot -- @@ -1300,7 +1259,6 @@ ALTER TABLE ONLY public.versions_metadata -- --- TOC entry 2306 (class 2606 OID 156076) -- Name: versions versions_pkey; Type: CONSTRAINT; Schema: public; Owner: buildbot -- @@ -1309,7 +1267,6 @@ ALTER TABLE ONLY public.versions -- --- TOC entry 2308 (class 2606 OID 156078) -- Name: versions versions_unique; Type: CONSTRAINT; Schema: public; Owner: buildbot -- @@ -1318,7 +1275,38 @@ ALTER TABLE ONLY public.versions -- --- TOC entry 2319 (class 2606 OID 156079) +-- Name: workers_configs workers_configs_pkey; Type: CONSTRAINT; Schema: public; Owner: buildbot +-- + +ALTER TABLE ONLY public.workers_configs + ADD CONSTRAINT workers_configs_pkey PRIMARY KEY (id); + + +-- +-- Name: workers_flavers workers_flavers_pkey; Type: CONSTRAINT; Schema: public; Owner: buildbot +-- + +ALTER TABLE ONLY public.workers_flavers + ADD CONSTRAINT workers_flavers_pkey PRIMARY KEY (id); + + +-- +-- Name: workers_images workers_images_pkey; Type: CONSTRAINT; Schema: public; Owner: buildbot +-- + +ALTER TABLE ONLY public.workers_images + ADD CONSTRAINT workers_images_pkey PRIMARY KEY (id); + + +-- +-- Name: workers workers_pkey; Type: CONSTRAINT; Schema: public; Owner: buildbot +-- + +ALTER TABLE ONLY public.workers + ADD CONSTRAINT workers_pkey PRIMARY KEY (uuid); + + +-- -- Name: packages category_uuid_fk; Type: FK CONSTRAINT; Schema: public; Owner: buildbot -- @@ -1327,7 +1315,6 @@ ALTER TABLE ONLY public.packages -- --- TOC entry 2321 (class 2606 OID 156084) -- Name: projects keywords_fkey; Type: FK CONSTRAINT; Schema: public; Owner: buildbot -- @@ -1336,7 +1323,6 @@ ALTER TABLE ONLY public.projects -- --- TOC entry 2336 (class 2606 OID 156089) -- Name: versions_keywords keywords_fkey; Type: FK CONSTRAINT; Schema: public; Owner: buildbot -- @@ -1345,7 +1331,6 @@ ALTER TABLE ONLY public.versions_keywords -- --- TOC entry 2328 (class 2606 OID 156094) -- Name: projects_portages_env makeconf_fkey; Type: FK CONSTRAINT; Schema: public; Owner: buildbot -- @@ -1354,7 +1339,6 @@ ALTER TABLE ONLY public.projects_portages_env -- --- TOC entry 2330 (class 2606 OID 156099) -- Name: projects_portages_makeconf makeconf_fkey; Type: FK CONSTRAINT; Schema: public; Owner: buildbot -- @@ -1363,7 +1347,6 @@ ALTER TABLE ONLY public.projects_portages_makeconf -- --- TOC entry 2335 (class 2606 OID 156104) -- Name: versions packages_fkey; Type: FK CONSTRAINT; Schema: public; Owner: buildbot -- @@ -1372,7 +1355,6 @@ ALTER TABLE ONLY public.versions -- --- TOC entry 2322 (class 2606 OID 156109) -- Name: projects profile_repositorys_uuid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: buildbot -- @@ -1381,7 +1363,6 @@ ALTER TABLE ONLY public.projects -- --- TOC entry 2338 (class 2606 OID 550234) -- Name: projects_portages_package project_portage_package_pkey; Type: FK CONSTRAINT; Schema: public; Owner: buildbot -- @@ -1390,7 +1371,6 @@ ALTER TABLE ONLY public.projects_portages_package -- --- TOC entry 2323 (class 2606 OID 156114) -- Name: projects_builds projects_fkey; Type: FK CONSTRAINT; Schema: public; Owner: buildbot -- @@ -1399,7 +1379,6 @@ ALTER TABLE ONLY public.projects_builds -- --- TOC entry 2325 (class 2606 OID 156119) -- Name: projects_emerge_options projects_fkey; Type: FK CONSTRAINT; Schema: public; Owner: buildbot -- @@ -1408,7 +1387,6 @@ ALTER TABLE ONLY public.projects_emerge_options -- --- TOC entry 2326 (class 2606 OID 156124) -- Name: projects_pattern projects_fkey; Type: FK CONSTRAINT; Schema: public; Owner: buildbot -- @@ -1417,7 +1395,6 @@ ALTER TABLE ONLY public.projects_pattern -- --- TOC entry 2327 (class 2606 OID 156129) -- Name: projects_portage projects_fkey; Type: FK CONSTRAINT; Schema: public; Owner: buildbot -- @@ -1426,7 +1403,6 @@ ALTER TABLE ONLY public.projects_portage -- --- TOC entry 2329 (class 2606 OID 156134) -- Name: projects_portages_env projects_fkey; Type: FK CONSTRAINT; Schema: public; Owner: buildbot -- @@ -1435,7 +1411,6 @@ ALTER TABLE ONLY public.projects_portages_env -- --- TOC entry 2331 (class 2606 OID 156139) -- Name: projects_portages_makeconf projects_fkey; Type: FK CONSTRAINT; Schema: public; Owner: buildbot -- @@ -1444,7 +1419,6 @@ ALTER TABLE ONLY public.projects_portages_makeconf -- --- TOC entry 2332 (class 2606 OID 156144) -- Name: projects_repositorys projects_fkey; Type: FK CONSTRAINT; Schema: public; Owner: buildbot -- @@ -1453,7 +1427,6 @@ ALTER TABLE ONLY public.projects_repositorys -- --- TOC entry 2333 (class 2606 OID 156149) -- Name: projects_repositorys repositorys_fkey; Type: FK CONSTRAINT; Schema: public; Owner: buildbot -- @@ -1462,7 +1435,6 @@ ALTER TABLE ONLY public.projects_repositorys -- --- TOC entry 2334 (class 2606 OID 156154) -- Name: repositorys_gitpullers repositorys_fkey; Type: FK CONSTRAINT; Schema: public; Owner: buildbot -- @@ -1471,7 +1443,6 @@ ALTER TABLE ONLY public.repositorys_gitpullers -- --- TOC entry 2320 (class 2606 OID 156159) -- Name: packages repositorys_uuid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: buildbot -- @@ -1480,7 +1451,6 @@ ALTER TABLE ONLY public.packages -- --- TOC entry 2324 (class 2606 OID 156164) -- Name: projects_builds versions_fkey; Type: FK CONSTRAINT; Schema: public; Owner: buildbot -- @@ -1489,7 +1459,6 @@ ALTER TABLE ONLY public.projects_builds -- --- TOC entry 2337 (class 2606 OID 156169) -- Name: versions_keywords versions_fkey; Type: FK CONSTRAINT; Schema: public; Owner: buildbot -- @@ -1498,7 +1467,6 @@ ALTER TABLE ONLY public.versions_keywords -- --- TOC entry 2339 (class 2606 OID 698046) -- Name: versions_metadata versions_metadata_version_uuid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: buildbot -- @@ -1507,8 +1475,6 @@ ALTER TABLE ONLY public.versions_metadata -- --- TOC entry 2476 (class 0 OID 0) --- Dependencies: 3 -- Name: SCHEMA public; Type: ACL; Schema: -; Owner: postgres -- @@ -1516,8 +1482,6 @@ REVOKE ALL ON SCHEMA public FROM postgres; GRANT ALL ON SCHEMA public TO buildbot; --- Completed on 2022-08-21 10:37:13 CEST - -- -- PostgreSQL database dump complete -- |