diff --git a/.gitignore b/.gitignore index 9c34568b..a9ddea49 100644 --- a/.gitignore +++ b/.gitignore @@ -14,3 +14,4 @@ master-private.cfg prof* venv workers +.devcontainer/* diff --git a/schedulers_definition.py b/schedulers_definition.py index be99592b..17219f62 100644 --- a/schedulers_definition.py +++ b/schedulers_definition.py @@ -1,6 +1,95 @@ -from buildbot.plugins import * +from buildbot.plugins import schedulers, util +from constants import * + + +####### SCHEDULER HELPER FUNCTIONS +@util.renderer +def getBranchBuilderNames(props): + mBranch = props.getProperty("master_branch") + + builders = list( + filter(lambda x: x not in github_status_builders, supportedPlatforms[mBranch]) + ) + + return builders + + +@util.renderer +def getProtectedBuilderNames(props): + mBranch = props.getProperty("master_branch") + + builders = list( + filter(lambda x: x in supportedPlatforms[mBranch], github_status_builders) + ) + + return builders + + +@util.renderer +def getAutobakeBuilderNames(props): + builderName = props.getProperty("parentbuildername") + for b in builders_autobake: + if builderName in b: + return [b] + return [] + + +@util.renderer +def getBigtestBuilderNames(props): + builderName = str(props.getProperty("parentbuildername")) + + for b in builders_big: + if builderName in b: + return [b] + return [] + + +@util.renderer +def getInstallBuilderNames(props): + builderName = str(props.getProperty("parentbuildername")) + + for b in builders_install: + if builderName in b: + builders = [b] + if "rhel" in builderName: + builders.append(b.replace("rhel", "almalinux")) + return builders + return [] + + +@util.renderer +def getUpgradeBuilderNames(props): + builderName = str(props.getProperty("parentbuildername")) + + builds = [] + for b in builders_upgrade: + if builderName in b: + if "rhel" in builderName: + builds.append(b.replace("rhel", "almalinux")) + builds.append(b) + return builds + + +@util.renderer +def getEcoBuilderNames(props): + builderName = str(props.getProperty("parentbuildername")) + + builds = [] + for b in builders_eco: + if builderName in b: + builds.append(b) + return builds + + +@util.renderer +def getDockerLibraryNames(props): + return builders_dockerlibrary[0] + + +@util.renderer +def getWordpressNames(props): + return builders_wordpress[0] -from utils import * def getSchedulers(): l = [] diff --git a/utils.py b/utils.py index f07fe06d..30cac027 100644 --- a/utils.py +++ b/utils.py @@ -469,16 +469,6 @@ def hasCompat(step): return True -@util.renderer -def getDockerLibraryNames(props): - return builders_dockerlibrary[0] - - -@util.renderer -def getWordpressNames(props): - return builders_wordpress[0] - - def hasDockerLibrary(step): # Can only build with a saved package if not savePackage(step): @@ -572,86 +562,6 @@ def getArch(props): buildername = props.getProperty("buildername") return buildername.split("-")[0] - -####### SCHEDULER HELPER FUNCTIONS -@util.renderer -def getBranchBuilderNames(props): - mBranch = props.getProperty("master_branch") - - builders = list( - filter(lambda x: x not in github_status_builders, supportedPlatforms[mBranch]) - ) - - return builders - - -@util.renderer -def getProtectedBuilderNames(props): - mBranch = props.getProperty("master_branch") - - builders = list( - filter(lambda x: x in supportedPlatforms[mBranch], github_status_builders) - ) - - return builders - - -@util.renderer -def getAutobakeBuilderNames(props): - builderName = props.getProperty("parentbuildername") - for b in builders_autobake: - if builderName in b: - return [b] - return [] - - -@util.renderer -def getBigtestBuilderNames(props): - builderName = str(props.getProperty("parentbuildername")) - - for b in builders_big: - if builderName in b: - return [b] - return [] - - -@util.renderer -def getInstallBuilderNames(props): - builderName = str(props.getProperty("parentbuildername")) - - for b in builders_install: - if builderName in b: - builders = [b] - if "rhel" in builderName: - builders.append(b.replace("rhel", "almalinux")) - return builders - return [] - - -@util.renderer -def getUpgradeBuilderNames(props): - builderName = str(props.getProperty("parentbuildername")) - - builds = [] - for b in builders_upgrade: - if builderName in b: - if "rhel" in builderName: - builds.append(b.replace("rhel", "almalinux")) - builds.append(b) - return builds - - -@util.renderer -def getEcoBuilderNames(props): - builderName = str(props.getProperty("parentbuildername")) - - builds = [] - for b in builders_eco: - if builderName in b: - builds.append(b) - return builds - - ##### Builder priority # Prioritize builders. At this point, only the Windows builders need a higher priority # since the others run on dedicated machines.