From 67d005c0c973b56d30e93d229f48af654c6c1dcd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vicen=C8=9Biu=20Ciorbaru?= Date: Fri, 6 Dec 2024 08:47:44 +0200 Subject: [PATCH] Move master-bintars to use master common class --- master-bintars/master.cfg | 110 ++++---------------------------------- 1 file changed, 11 insertions(+), 99 deletions(-) diff --git a/master-bintars/master.cfg b/master-bintars/master.cfg index 54ff01c7..62bafa62 100644 --- a/master-bintars/master.cfg +++ b/master-bintars/master.cfg @@ -1,31 +1,15 @@ # -*- python -*- # ex: set filetype=python: -from buildbot.plugins import * -from buildbot.process.properties import Property, Properties -from buildbot.steps.shell import ShellCommand, Compile, Test, SetPropertyFromCommand -from buildbot.steps.mtrlogobserver import MTR, MtrLogObserver -from buildbot.steps.source.github import GitHub -from buildbot.process.remotecommand import RemoteCommand -from datetime import timedelta -from twisted.internet import defer - -import docker import os -import sys import json -import yaml -sys.path.insert(0, "/srv/buildbot/master") -sys.setrecursionlimit(10000) +from buildbot.plugins import util, worker, steps -from common_factories import * -from constants import * -from locks import * -from schedulers_definition import SCHEDULERS -from utils import * -FQDN = os.environ["BUILDMASTER_WG_IP"] +from constants import SAVED_PACKAGE_BRANCHES +from utils import getSourceTarball, read_template, savePackageIfBranchMatch +from master_common import base_master_config cfg_dir = os.path.abspath(os.path.dirname(__file__)) @@ -44,62 +28,12 @@ config = {"private": {}} with open(os.path.join(base_dir, "master-private.cfg"), "r") as file: exec(file.read(), config, {}) + # This is the dictionary that the buildmaster pays attention to. We also use # a shorter alias to save typing. -c = BuildmasterConfig = {} - - -####### BUILDBOT SERVICES - -# 'services' is a list of BuildbotService items like reporter targets. The -# status of each build will be pushed to these targets. buildbot/reporters/*.py -# has a variety to choose from, like IRC bots. - - -c["services"] = [] -context = util.Interpolate("buildbot/%(prop:buildername)s") -gs = reporters.GitHubStatusPush( - token=config["private"]["gh_mdbci"]["access_token"], - context=context, - startDescription="Build started.", - endDescription="Build done.", - verbose=True, - builders=GITHUB_STATUS_BUILDERS, -) -c["services"].append(gs) -c["secretsProviders"] = [ - secrets.SecretInAFile( - dirname=os.environ["MASTER_CREDENTIALS_DIR"] - ) -] - -####### PROJECT IDENTITY - -# the 'title' string will appear at the top of this buildbot installation's -# home pages (linked to the 'titleURL'). -c["title"] = os.environ["TITLE"] -c["titleURL"] = os.environ["TITLE_URL"] - -# 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 -# the 'www' entry below, but with an externally-visible host name which the -# buildbot cannot figure out without some help. -c["buildbotURL"] = os.environ["BUILDMASTER_URL"] - -# 'protocols' contains information about protocols which master will use for -# communicating with workers. You must define at least 'port' option that workers -# could connect to your master with this protocol. -# 'port' must match the value configured into the workers (with their -# --master option) -port = int(os.environ["MASTER_NONLATENT_BINTARS_WORKER_PORT"]) -c["protocols"] = {"pb": {"port": port}} - -####### DB URL - -c["db"] = { - # This specifies what database buildbot uses to store its state. - "db_url": config["private"]["db_url"] -} +c = BuildmasterConfig = base_master_config( + config, + master_port=os.environ["MASTER_NONLATENT_BINTARS_WORKER_PORT"]) mtrDbPool = util.EqConnectionPool( "MySQLdb", @@ -109,17 +43,10 @@ mtrDbPool = util.EqConnectionPool( config["private"]["db_mtr_db"], ) -####### Disable net usage reports from being sent to buildbot.net -c["buildbotNetUsageData"] = None - -####### SCHEDULERS - -# Configure the Schedulers, which decide how to react to incoming changes. -c["schedulers"] = SCHEDULERS - -####### WORKERS - +####### +# WORKERS +####### def mkWorker(name, **kwargs): return worker.Worker(name, config["private"]["worker_pass"][name], **kwargs) @@ -196,8 +123,6 @@ def getBintarFactory( kvm_image_test = kvm_image.replace("vm-centos5", "vm-centos6") - arch = "x86_64" if "amd64" in name else "i686" - # Step 1: Cleaning build directory bin_fact.addStep( steps.ShellCommand( @@ -345,7 +270,6 @@ def getBintarFactory( ####### BUILDERS LIST - c["builders"] = [] builder_definitions = { @@ -378,15 +302,3 @@ for b in builder_definitions: factory=f, ) ) - -c["logEncoding"] = "utf-8" - -c["multiMaster"] = True - -c["mq"] = { # Need to enable multimaster aware mq. Wamp is the only option for now. - "type": "wamp", - "router_url": os.environ["MQ_ROUTER_URL"], - "realm": "realm1", - # valid are: none, critical, error, warn, info, debug, trace - "wamp_debug_level": "info", -}