| Posted | Nick | Remark | |
|---|---|---|---|
| #openstack-nova - 2020-01-29 | |||
| 15:05:44 | bauzas | honestly, we haven't heard about this since nova exists | |
| 15:05:59 | efried | entrypoints plus python code plus packaging, versus putting a yaml file in a directory? Hell yes. | |
| 15:06:01 | sean-k-mooney | bauzas: there is one complexity with them form a packaging point of view | |
| 15:06:14 | stephenfin | sean-k-mooney: so we'd be using a package to distribute a YAML file? | |
| 15:06:35 | efried | ugh, no, please. | |
| 15:06:38 | bauzas | it's config | |
| 15:06:39 | efried | Can we not boil the ocean? | |
| 15:06:40 | sean-k-mooney | json file and the code to do all the validation which they have laready written as far as i knwo | |
| 15:07:15 | stephenfin | I'd personally rather strip the flavor stuff out of glance | |
| 15:07:24 | stephenfin | Why do they need to care about flavors? They're an image service | |
| 15:07:53 | efried | how did glance get involved here? | |
| 15:07:55 | sean-k-mooney | they care about it becasue we had this problem years ago and decied that they would be used as the catalog of support meatdata itmes | |
| 15:08:05 | bauzas | I thought the spec was simple enough to just re-accept it | |
| 15:08:09 | efried | (rhetorical question; can we stay on topic?) | |
| 15:08:12 | bauzas | given it was accepted beofre | |
| 15:08:29 | bauzas | but now, looks like we rathole around any possible better way to provide config | |
| 15:09:09 | stephenfin | so I really don't want another os-whatever library to maintain. This should be in-tree, with some kind of mechanism to export to glance if we really care | |
| 15:09:28 | stephenfin | Which I'd be surprised if we do, since sean-k-mooney is the only person that's ever heard of this feature in glance | |
| 15:09:30 | bauzas | that's exactly why we chose plugins before | |
| 15:09:38 | bauzas | but... whatever | |
| 15:09:54 | bauzas | looks like we have consensus around YAML | |
| 15:10:14 | bauzas | the glance issue shouldn't be taken care as of now, until we know whether glance needs it as well or not | |
| 15:10:19 | stephenfin | so the question comes down to Python objects or YAML, and whether we need to make the strict behavior opt-in or not | |
| 15:10:19 | sean-k-mooney | well im going to be out voted so i guess yes | |
| 15:10:35 | dansmith | yaml for what? rules of extra spec validation? | |
| 15:10:43 | stephenfin | yup | |
| 15:10:50 | dansmith | and... why? | |
| 15:10:53 | gibi | I think having a simple api microversion to opt in is enough | |
| 15:11:01 | dansmith | because we can share that file between us and glance? | |
| 15:11:05 | efried | no | |
| 15:11:22 | efried | so we can accommodate extra specs nova doesn't own or know about | |
| 15:11:31 | gibi | dansmith: because we need the yaml for deployer defined extra specs anyhow | |
| 15:11:38 | stephenfin | so we don't have two different ways to represent a rule | |
| 15:11:38 | stephenfin | https://review.opendev.org/#/c/704643/2/nova/api/validation/extra_specs/hw.py | |
| 15:11:41 | bauzas | honestly, I was preferring the python approach thru stevedore plugins | |
| 15:11:45 | stephenfin | we want to provide a way for operators to specify their own custom extra specs for out of tree filters, or whatever | |
| 15:11:49 | sean-k-mooney | dansmith: gibi does not like the python class way of doing it and suggeste that if we are going to support yaml anyway just use it for everything. fair summary? | |
| 15:12:00 | stephenfin | sean-k-mooney: yup, that | |
| 15:12:11 | gibi | I don't want to start a format war, I just wanted to avoid implementing two pieces of code when one piece would be enough technically | |
| 15:12:17 | dansmith | so, this brings the policy problem screaming back from hell? | |
| 15:12:38 | stephenfin | oslo.policy? | |
| 15:12:44 | sean-k-mooney | dansmith: no that was brogh back for a different reason | |
| 15:12:48 | dansmith | i.e. we provide a base yaml, they edit it to add their stuff and tweak their prefs and then when they go to upgrade they're sadface? | |
| 15:13:12 | stephenfin | that was another concern of mine, but I figured we'd just load multiple files | |
| 15:13:17 | sean-k-mooney | e.g. if the new microversion enabled validateion and we extend the flavor update again in the future you cant use the new feautre with validation idsabled | |
| 15:13:30 | stephenfin | I'm almost certain someone will go tweak the YAML file we provide though | |
| 15:13:39 | bauzas | yuuuuup | |
| 15:13:46 | dansmith | stephenfin: I would argue that we don't/shouldn't encode our baseline validations into yaml and distribute them that way, as it's just asking for that problem | |
| 15:13:49 | dansmith | right | |
| 15:13:52 | sean-k-mooney | dansmith: so i was suggesting add a &validate query arge to turn off validation in the new microversion | |
| 15:13:53 | efried | If we do in-tree stuff with yaml, we put the nova-owned stuff within the nova package so nobody fs with it. | |
| 15:14:06 | dansmith | efried: riiiight | |
| 15:14:07 | stephenfin | sean-k-mooney: hold up, let's figure the YAML thing out first | |
| 15:14:38 | efried | riiiight they'll still f with it? Let 'em. That's breaking the seal, voiding the warranty, not different than if they go patch the code. | |
| 15:14:46 | sean-k-mooney | efried: distos will modify it every time we backport stuff | |
| 15:14:51 | gibi | we somebody want to tweak what is written in the python DSL for in-tree validation he can do it, it is almos like a yaml file | |
| 15:14:52 | dansmith | surely the yaml to validate something complex like numa whatever is going to be nasty or naive right? | |
| 15:15:12 | sean-k-mooney | it will be an interesting regex | |
| 15:15:23 | gibi | but nothing more than a regex | |
| 15:15:26 | stephenfin | gibi: I don't think it's a DSL, really. It's just an object. I could use dicts if that would be preferable | |
| 15:15:28 | dansmith | an "interesting" regex or some relatively simple python right? | |
| 15:15:42 | bauzas | :) | |
| 15:15:43 | sean-k-mooney | actully its still a regex in stephns code | |
| 15:15:49 | sean-k-mooney | well poc | |
| 15:15:56 | stephenfin | not entirely | |
| 15:15:57 | sean-k-mooney | but it could be simpler | |
| 15:16:11 | stephenfin | I let you specify enums etc. | |
| 15:16:19 | sean-k-mooney | yes | |
| 15:16:37 | stephenfin | granted, all that gets converted into a regex but there's no reason I have to do that for all cases. It's a PoC after all | |
| 15:16:43 | sean-k-mooney | although you convert the enum int an bool filed back to regex form | |
| 15:17:25 | dansmith | so I think my feeling on this is: (a) I'm not sure we need an interface for people to be able to specify their own validators, but (b) if we do, that seems like an obvious use case for entrypoints and a dead simple plugin interface with a super-controlled input and output behavior set | |
| 15:17:51 | efried | gibi: it won't be a lot of duplication, really. The parser will construct the same kind of python objects we have in tree and then feed all of them into the validation engine. | |
| 15:18:04 | stephenfin | gibi: yeah, what efried said | |
| 15:18:19 | gibi | OK, I rest my case then | |
| 15:18:21 | stephenfin | it's just a slightly different representation of the exact same data | |
| 15:18:30 | stephenfin | dansmith: So kill the YAML idea entirely? | |
| 15:19:39 | stephenfin | If so, the main issue I'd see with that is that they'd have to write and install a Python package for the custom stuff | |
| 15:19:49 | dansmith | stephenfin: I don't think our validations should be in yaml, and I don't really see why custom ones should be either.. they'd be a lot harder to test than a single python function you can run with a string you would put in your flavor | |
| 15:20:07 | bauzas | stephenfin: I don't see a problem here, we asked for that since a while | |
| 15:20:25 | efried | If we do that, we can't have strict validation. Writing python code and figuring out stevedore for snowflake extra specs is too high a barrier to entry for that to be the only option. | |
| 15:20:31 | dansmith | stephenfin: I think that would be a pretty simple example thing, they have to do that for scheduler filters, and I expect anyone that feels they need this (honestly I don't see it being that important) will be fine with that standard | |
| 15:20:36 | bauzas | (like, Blazar was having a specific nova-ish package for nova plugins he needed) | |
| 15:21:06 | bauzas | yeah, it's very similar to the scheduler filters case | |
| 15:21:06 | stephenfin | I was about to ask what the story with extra scheduler filters was. Those are a package too so | |
| 15:21:13 | bauzas | yup | |
| 15:21:22 | bauzas | or delivered by other means | |
| 15:21:27 | dansmith | efried: stevedore is on the loader side, they don't have to do anything like that.. entry points are a stock python thing | |
| 15:21:27 | stephenfin | efried: Are snowflake extra specs a real thing people use? | |
| 15:21:50 | stephenfin | Far as I knew, extra specs were for scheduler filters and virt drivers | |
| 15:21:53 | sean-k-mooney | they use custom one for filter | |
| 15:21:57 | efried | f man, even if you managed to miss one of the stock ones | |
| 15:22:00 | dansmith | stephenfin: you can in conjunction with the json filter or yeah a custom scheduler filter | |
| 15:22:19 | dansmith | stephenfin: if you're writing a custom scheduler flter, you're doing a package, so throwing a validator in there makes plenty of sense | |
| 15:22:29 | stephenfin | If it's a custom filter, we're saying they're using a package already so no big deal | |
| 15:22:31 | stephenfin | dansmith: yeah | |
| 15:22:37 | gibi | my employer's downstream product has at least two snowflake extra spec | |
| 15:22:48 | gibi | but sure I can implement a python filter for that | |
| 15:22:49 | sean-k-mooney | same with a thrid party virt dirver | |
| 15:22:50 | dansmith | stephenfin: imagine the fame and fortune if you wrote up a nice blog post on how to do this super cleanly :D | |
| 15:23:00 | dansmith | sean-k-mooney: shut yo' mouth! :D | |