From d77727ff258ca40e195c685f371160f546bc8615 Mon Sep 17 00:00:00 2001 From: Alexander von Gluck Date: Fri, 30 Aug 2024 11:28:25 -0500 Subject: [PATCH] buildmaster/builders: Some basic cleanups and repairs --- HaikuPorter/BuildMaster.py | 4 ++++ HaikuPorter/Builders/LocalBuilder.py | 11 +++++++++++ HaikuPorter/Builders/MockBuilder.py | 1 + HaikuPorter/Builders/RemoteBuilderSSH.py | 1 + 4 files changed, 17 insertions(+) diff --git a/HaikuPorter/BuildMaster.py b/HaikuPorter/BuildMaster.py index d07a21c0..837b4ba1 100644 --- a/HaikuPorter/BuildMaster.py +++ b/HaikuPorter/BuildMaster.py @@ -256,6 +256,10 @@ def __init__(self, portsTreePath, packageRepository, options): self.activeBuilders.append(builder) + print('Active builder count: ' + str(len(self.activeBuilders))) + for i in self.activeBuilders: + print(' builder: ' + str(i.name) + ' (' + str(i.type) + ')') + if len(self.activeBuilders) == 0: sysExit('no builders available') diff --git a/HaikuPorter/Builders/LocalBuilder.py b/HaikuPorter/Builders/LocalBuilder.py index a2b23d67..dc653742 100644 --- a/HaikuPorter/Builders/LocalBuilder.py +++ b/HaikuPorter/Builders/LocalBuilder.py @@ -15,6 +15,7 @@ class LocalBuilder(object): def __init__(self, name, packageRepository, outputBaseDir, options): + self.type = "LocalBuilder" self.options = options self.name = name self.buildCount = 0 @@ -52,6 +53,16 @@ def setBuild(self, scheduledBuild, buildNumber): } filter.setBuild(self.currentBuild) + @property + def status(self): + return { + 'name': self.name, + 'state': self.state, + 'currentBuild': { + 'build': self.currentBuild['status'], + 'number': self.currentBuild['number'] + } if self.currentBuild else None + } def unsetBuild(self): self.buildLogger.removeHandler(self.currentBuild['logHandler']) diff --git a/HaikuPorter/Builders/MockBuilder.py b/HaikuPorter/Builders/MockBuilder.py index 51853ee5..be70c623 100644 --- a/HaikuPorter/Builders/MockBuilder.py +++ b/HaikuPorter/Builders/MockBuilder.py @@ -10,6 +10,7 @@ class MockBuilder(object): def __init__(self, name, buildFailInterval, builderFailInterval, lostAfter): + self.type = "MockBuilder" self.name = name self.buildCount = 0 self.failedBuilds = 0 diff --git a/HaikuPorter/Builders/RemoteBuilderSSH.py b/HaikuPorter/Builders/RemoteBuilderSSH.py index 1d32de9b..e5e87f93 100644 --- a/HaikuPorter/Builders/RemoteBuilderSSH.py +++ b/HaikuPorter/Builders/RemoteBuilderSSH.py @@ -27,6 +27,7 @@ class RemoteBuilderSSH(object): def __init__(self, configFilePath, packageRepository, outputBaseDir, portsTreeOriginURL, portsTreeHead): self._loadConfig(configFilePath) + self.type = "RemoteBuilderSSH" self.availablePackages = [] self.visiblePackages = [] self.portsTreeOriginURL = portsTreeOriginURL