Move all mutable actions to top-level recipe |
|||
Issue descriptionWe would like to have all mutations to any persistent infrastructure (at least all non-idempotent actions) done from the top-level recipe rather than the modules themselves. This keeps things cleaner and reduces the risk of things like a missing `--dryrun` flag (resulting in slightly damp run that could cause problems). That is not to say that the recipe module itself will not perform that action, only that there is a signal in the top-level recipe that shows something is about to be mutated.
,
Dec 18
Stepping back from the problem for a bit, what do you guys think about this (conceptually) for infra: - The outer most layer does nothing more than invoke idempotent/non-persistent actions. Any persistence between actions is handled at this level (you can think of it as the 'wiring' if you like. For example, manifest-versions lives at this layer as it's a 'wiring' detail between steps. - Next layer down is the stable API boundary for these actions. It is a bridge between (for example) a stable proto3 'build these packages' API and the next layer down. - The branched infra, aka build scripts, Portage and so on. Here be dragons. I like this layering because it strongly isolates the infrastructure we run on with the task we are trying to accomplish. The only layer specific to our underlying infra is the first (the wiring). In concrete terms, I like this layering because it would make moving over to a Kubernetes based build system much easier (ex, instead of manifest-versions would would use Docker images for snapshots). So let's define mutable actions as anything that 'should' live in the first layer there. Unfortunately we have smashed the first two layers together in Recipe/Chromite scripts, but this is an effort to try and keep at least some of that organization. I'm open to counter arguments though. Also this 'new' bug looks a lot like crbug.com/914988
,
Dec 18
Lets do design discussion in the doc: https://docs.google.com/document/d/1uRC5iP_bKkfGRpoTwYxyFOjDHBkrYV58BTzjpt73zAo/edit#heading=h.xwmvhrkcqt47
,
Dec 18
> Also this 'new' bug looks a lot like crbug.com/914988 Well dangit why didn't you use that for the TODO link?
,
Dec 18
> > Also this 'new' bug looks a lot like crbug.com/914988 > Well dangit why didn't you use that for the TODO link? Because this bug was something else before you changed it ;p
,
Dec 18
> Stepping back from the problem for a bit I think this fits in with the overall "Build vs CI" boundary, just looking at it from a different perspective.
,
Dec 18
> Because this bug was something else before you changed it ;p I didn't change it what are you talking about. Ignore those deleted comments.
,
Dec 18
Can I get concrete examples of what is / is not "persistent infrastructure"?
,
Dec 18
Maybe. How many peer bonuses are you offering? Mutable actions to persistent infra: - Pushing to a manifest repo, including annealing and LKGM - Pushing portage package uprevs - Pretty much any `git push` actually - Writing to CIDB/Buildbucket from a build - Publishing artifacts to Cloud Storage - And so on The way I think of it is, anything that could be run multiple times and in parallel with safety (modulo quota limits) is non-mutable. Anywhere that has a chance of collision when run in parallel is mutable. Checking out to ToT, building, running VM tests and so on is non-mutable, as is a human-triggered build started in Swarming (assuming the build itself doesn't mutate things). No idea if that makes any sense, it's just what I'm thinking :p
,
Dec 18
Oh you mean "recipe modules". I'm not sure it makes sense to make that distinction there. Recipe modules represent reusable, coherent chunks of code that can be composed in a recipe. I think of it more as recipes being the "main" function and recipe modules being libraries. I do want to make this distinction at the recipes/chromite boundary; that is, (ideally) CI calls into chromite won't expose side effects outside of that build.
,
Dec 18
Think of it this way: we want each recipe to correspond to a builder "kind": CQ, annealing, post-submit, and in the future release, firmware, factory, etc. Recipe modules (and possibly "sub-recipes", depending on how parallel recipes work out) are the reusable parts that are composed into these builders.
,
Dec 18
,
Dec 18
,
Dec 18
If we really want to do this we could get rid of the dev.dryrun state and just do `module.step(dryrun=recipe_dryrun)` for each mutating step.
,
Dec 18
Sorry I have confused things. I'm talking about two different things. There is - This bug, which is overall how recipe is structured, I would like any action that mutates infra to be signaled from the top-level recipe, rather than buried down in some module somewhere. - A discussion on the overall design philosophy of our infrastructure (that is unrelated to how recipes work, apart from the note that we have kind of collapsed the first two layers down into recipe/chromite at this point. I updated the bug description to maybe be a bit more clear.
,
Dec 18
Re#13: You many anything "off builder". Okay, thanks, got it. |
|||
►
Sign in to add a comment |
|||
Comment 1 by dgarr...@chromium.org
, Dec 18