Separated evaluators

This commit is contained in:
Julien Malka 2023-01-28 20:25:59 +01:00
parent 7124a752b5
commit 60f69c99fb
Signed by: Luj
GPG key ID: 6FC74C847011FD83
2 changed files with 15 additions and 7 deletions
modules/buildbot

View file

@ -290,6 +290,7 @@ def nix_update_flake_config(
def nix_eval_config( def nix_eval_config(
worker_names: list[str], worker_names: list[str],
repo: str,
github_token_secret: str, github_token_secret: str,
) -> util.BuilderConfig: ) -> util.BuilderConfig:
""" """
@ -336,10 +337,10 @@ def nix_eval_config(
) )
return util.BuilderConfig( return util.BuilderConfig(
name="nix-eval", name=f"nix-eval-{repo}",
workernames=worker_names, workernames=worker_names,
factory=factory, factory=factory,
properties=dict(virtual_builder_name="nix-eval"), properties=dict(virtual_builder_name=f"nix-eval-{repo}"),
) )

View file

@ -52,7 +52,7 @@ def build_config() -> dict[str, Any]:
filter_fn=lambda c: c.branch filter_fn=lambda c: c.branch
== c.properties.getProperty("github.repository.default_branch"), == c.properties.getProperty("github.repository.default_branch"),
), ),
builderNames=["nix-eval"], builderNames=["nix-eval-nix-config"],
), ),
schedulers.SingleBranchScheduler( schedulers.SingleBranchScheduler(
name="main-linkal", name="main-linkal",
@ -61,7 +61,7 @@ def build_config() -> dict[str, Any]:
filter_fn=lambda c: c.branch filter_fn=lambda c: c.branch
== c.properties.getProperty("github.repository.default_branch"), == c.properties.getProperty("github.repository.default_branch"),
), ),
builderNames=["nix-eval"], builderNames=["nix-eval-linkal"],
), ),
# build all pull requests # build all pull requests
@ -70,7 +70,7 @@ def build_config() -> dict[str, Any]:
change_filter=util.ChangeFilter( change_filter=util.ChangeFilter(
repository=f"https://github.com/{ORG}/{REPO}", category="pull" repository=f"https://github.com/{ORG}/{REPO}", category="pull"
), ),
builderNames=["nix-eval"], builderNames=["nix-eval-nix-config"],
), ),
schedulers.SingleBranchScheduler( schedulers.SingleBranchScheduler(
@ -78,7 +78,7 @@ def build_config() -> dict[str, Any]:
change_filter=util.ChangeFilter( change_filter=util.ChangeFilter(
repository=f"https://github.com/JulienMalka/Linkal", category="pull" repository=f"https://github.com/JulienMalka/Linkal", category="pull"
), ),
builderNames=["nix-eval"], builderNames=["nix-eval-linkal"],
), ),
# this is triggered from `nix-eval` # this is triggered from `nix-eval`
@ -87,7 +87,7 @@ def build_config() -> dict[str, Any]:
builderNames=["nix-build"], builderNames=["nix-build"],
), ),
# allow to manually trigger a nix-build # allow to manually trigger a nix-build
schedulers.ForceScheduler(name="force", builderNames=["nix-eval"]), schedulers.ForceScheduler(name="force", builderNames=["nix-eval-nix-config"]),
# allow to manually update flakes # allow to manually update flakes
schedulers.ForceScheduler( schedulers.ForceScheduler(
name="update-flake-nix-config", name="update-flake-nix-config",
@ -147,8 +147,15 @@ def build_config() -> dict[str, Any]:
# This should prevent exessive memory usage. # This should prevent exessive memory usage.
nix_eval_config( nix_eval_config(
[worker_names[0]], [worker_names[0]],
"nix-config",
github_token_secret="github-token", github_token_secret="github-token",
), ),
nix_eval_config(
[worker_names[0]],
"linkal",
github_token_secret="github-token",
),
nix_build_config(worker_names), nix_build_config(worker_names),
nix_update_flake_config( nix_update_flake_config(
worker_names, worker_names,