Skip to content

Commit

Permalink
MDBF-713 - Move scheduler helper functions
Browse files Browse the repository at this point in the history
  • Loading branch information
RazvanLiviuVarzaru committed Jun 19, 2024
1 parent 28b429d commit 8fe4a68
Show file tree
Hide file tree
Showing 3 changed files with 92 additions and 92 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -14,3 +14,4 @@ master-private.cfg
prof*
venv
workers
.devcontainer/*
93 changes: 91 additions & 2 deletions schedulers_definition.py
Original file line number Diff line number Diff line change
@@ -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 = []
Expand Down
90 changes: 0 additions & 90 deletions utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down Expand Up @@ -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.
Expand Down

0 comments on commit 8fe4a68

Please sign in to comment.