Starlark based 'standard maintenance builder' templates |
|
Issue descriptionOnce we have starlark configs in LUCI, we might want to consider having a oneliner LUCI stdlib config function which: * Sets up a recipe autoroller builder* * Sets up a git-cache warmer for whichever service account groups you want * Sets up a recipe bundler (and maybe feeds the result of this as input into the various recipe directives?) * Other maintenance stuff? * Unless we turn recipe autoroller into an honest-to-goodness service, which maybe we should do anyway.
,
Jan 15
Yeah I'm not sure; it's definitely not a fully baked idea, but it would be a nice end-state :) We could potentially also have the lucicfg binary always pull some luci-stdlib stuff from some cipd ref (and allow this to be overridden on the command line, if you wanted to have reproducibility and accept the responsibility for keeping it up to date yourself). Since the produced proto files are the actual source of truth, it would look something like: * Change stdlib .star files * Canary them (by regenerating infra/staging configs). * Promote them to production (and promote old stable to "previous_release" ref) and send PSA "please regenerate configs, pass -luci-stdlib-vers previous_release if you don't want to right now"
,
Jan 15
Seems reasonable.
I also had the following deps/lockfile idea which complimentes your proposal: when generating configs, all external starlark packages are by default fetched from ToT (e.g. 'stable' cipd ref). But at the same time we generate a sort-of "lockfile" which has a concrete version of a cipd package used during this generation run.
This lockfile is just a byproduct of the config generation and it is committed to the repository along with other configs. So the committed state in the repository is sufficient to reproduce what happened EXACTLY (e.g. for debugging).
If for whatever reason 'stable' is not good enough, any other version can be specified in the "deps" file.
This "deps" file can either be a real file in some format, or we can perhaps have:
core.external_package(
name = "lucitools",
cipd_package = "infra/lucicfg/...",
cipd_version = "latest")
load("@lucitools//recipe_roller.star", "recipe_roller")
recipe_roller(...)
,
Jan 15
+1 for lock file.
,
Jan 15
also sgtm :)
,
Jan 15
Though I would like the entrypoint to be just "luci_stuff" (but with a better name) not necessarily 'recipe_roller', etc. So that way we can add other maintenance tasks (or remove them!) as necessary.
,
Jan 15
In my example the "entry point" is '@lucitools' package. From owners points of view, I think this is mostly equivalent:
load("@lucitools//stuff.star", "stuff")
stuff.recipe_roller()
vs
load("@lucitools//recipe_roller.star", "recipe_roller")
recipe_roller()
In both cases to add something, we need to extend some existing namespace (either namespace of files, or the 'stuff' struct), and then ask users to go an pick up this new thing.
This comes down to what feels like more natural. Core Starlark advertises importing end-symbols via "load". But it is also a common pattern (as far as I've seen) to import structs :-/
In any case, the base implementation is identical and each individual external package can choose whatever pattern it prefers. Details like this are not important for 90% of the implementation.
,
Jan 15
Yes, I know, I was just meaning that client .star files should not contain the string `recipe_roller`, but instead `stuff.stuff()` (whose implementation is in lucitools//stuff and does mention recipe_roller). I agree that 0% of this is relevant, considering how much left there is to do :) |
|
►
Sign in to add a comment |
|
Comment 1 by vadimsh@chromium.org
, Jan 15