Skip to content

Commit

Permalink
Clean-up master.cfg, initial step
Browse files Browse the repository at this point in the history
* Remove star imports
* master-private.cfg always loaded from base directory.
* TODO(cvicentiu) change buildbot.tac to actually deploy properly
  • Loading branch information
cvicentiu committed Jan 8, 2025
1 parent 3d3722a commit 7508f92
Show file tree
Hide file tree
Showing 9 changed files with 44 additions and 30 deletions.
2 changes: 1 addition & 1 deletion master-bintars/master.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ c = BuildmasterConfig = {}
# Load the slave, database passwords and 3rd-party tokens from an external private file, so
# that the rest of the configuration can be public.
config = {"private": {}}
exec(open("../master-private.cfg").read(), config, {})
exec(open("master-private.cfg").read(), config, {})

####### BUILDBOT SERVICES

Expand Down
2 changes: 1 addition & 1 deletion master-docker-nonstandard-2/master.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ c = BuildmasterConfig = {}
# Load the slave, database passwords and 3rd-party tokens from an external private file, so
# that the rest of the configuration can be public.
config = {"private": {}}
exec(open("../master-private.cfg").read(), config, {})
exec(open("master-private.cfg").read(), config, {})

####### BUILDBOT SERVICES

Expand Down
2 changes: 1 addition & 1 deletion master-docker-nonstandard/master.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ c = BuildmasterConfig = {}
# Load the slave, database passwords and 3rd-party tokens from an external private file, so
# that the rest of the configuration can be public.
config = {"private": {}}
exec(open("../master-private.cfg").read(), config, {})
exec(open("master-private.cfg").read(), config, {})

####### BUILDBOT SERVICES

Expand Down
2 changes: 1 addition & 1 deletion master-galera/master.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ c = BuildmasterConfig = {}
# Load the slave, database passwords and 3rd-party tokens from an external private file, so
# that the rest of the configuration can be public.
config = {"private": {}}
exec(open("../master-private.cfg").read(), config, {})
exec(open("master-private.cfg").read(), config, {})

FQDN = os.getenv("BUILDMASTER_WG_IP", default="100.64.100.1")

Expand Down
2 changes: 1 addition & 1 deletion master-nonlatent/master.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ c = BuildmasterConfig = {}
# Load the slave, database passwords and 3rd-party tokens from an external private file, so
# that the rest of the configuration can be public.
config = {"private": {}}
exec(open("../master-private.cfg").read(), config, {})
exec(open("master-private.cfg").read(), config, {})

####### PROJECT IDENTITY

Expand Down
2 changes: 1 addition & 1 deletion master-protected-branches/master.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ c = BuildmasterConfig = {}
# Load the slave, database passwords and 3rd-party tokens from an external private file, so
# that the rest of the configuration can be public.
config = {"private": {}}
exec(open("../master-private.cfg").read(), config, {})
exec(open("master-private.cfg").read(), config, {})

####### BUILDBOT SERVICES

Expand Down
2 changes: 1 addition & 1 deletion master-web/master.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ c = BuildmasterConfig = {}
# Load the slave, database passwords and 3rd-party tokens from an external
# private file, so that the rest of the configuration can be public.
config = {"private": {}}
exec(open("../master-private.cfg").read(), config, {})
exec(open("master-private.cfg").read(), config, {})

####### PROJECT IDENTITY

Expand Down
56 changes: 35 additions & 21 deletions master.cfg
Original file line number Diff line number Diff line change
@@ -1,28 +1,40 @@
# -*- 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

sys.setrecursionlimit(10000)
import yaml

sys.path.insert(0, "/srv/buildbot/master")

from common_factories import *
from constants import *
from locks import *
from buildbot.plugins import reporters, secrets, steps, util
from buildbot.process.properties import Property
from common_factories import (
getQuickBuildFactory,
getRpmAutobakeFactory,
getSourceTarball,
)
from constants import (
BUILDERS_GALERA_MTR,
GITHUB_STATUS_BUILDERS,
SAVED_PACKAGE_BRANCHES,
OS_INFO,
)
from locks import getLocks
from schedulers_definition import SCHEDULERS
from utils import *
from utils import (
canStartBuild,
createDebRepo,
createWorker,
dockerfile,
hasDockerLibrary,
hasFiles,
hasInstall,
hasUpgrade,
ls2string,
nextBuild,
printEnv,
savePackageIfBranchMatch,
uploadDebArtifacts,
)

with open("master-config.yaml", "r") as f:
master_config = yaml.safe_load(f)
Expand All @@ -31,12 +43,14 @@ with open("master-config.yaml", "r") as f:
# a shorter alias to save typing.
c = BuildmasterConfig = {}

# Load the slave, database passwords and 3rd-party tokens from an external private file, so
# that the rest of the configuration can be public.
# Load the slave, database passwords and 3rd-party tokens from an external
# private file, so that the rest of the configuration can be public.
config = {"private": {}}
exec(open("master-private.cfg").read(), config, {})

####### BUILDBOT SERVICES
#######
# 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
Expand Down
4 changes: 2 additions & 2 deletions validate_master_cfg.sh
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,6 @@ for dir in autogen/* \
$RUNC run -i -v "$(pwd):/srv/buildbot/master" \
-w /srv/buildbot/master \
$IMAGE \
bash -c "cd $dir && buildbot checkconfig master.cfg"
bash -c "buildbot checkconfig $dir/master.cfg"
echo -e "done\n"
done
done

0 comments on commit 7508f92

Please sign in to comment.