Earlier  
Posted Nick Remark
#openstack-sdks - 2018-10-25
16:02:26 edleafe No worries
16:02:37 edleafe Will you have time later? I'll be around
16:03:48 peschk_l edleafe: would 18H UTC be ok for you ?
16:04:14 edleafe peschk_l: That would be fine
16:05:00 peschk_l edleafe: perfect :) My questions would mainly be about flask and microversions
16:05:39 mordred kmalloc might be helpful too
16:05:52 mordred he's been working on the flak transition in keystone
16:05:53 kmalloc ohai
16:05:59 kmalloc what can i do for folks?
16:07:01 edleafe kmalloc: peschk_l has some questions, but isn't at a laptop for another two hours. Will you be around then?
16:07:12 kmalloc edleafe: sure!
16:07:38 kmalloc i'll be around for a couple hours. In ~3hrs i need to duck out for a couple hours (Doctor appt)
16:07:38 cdent peschk_l: you might find https://pypi.org/project/microversion_parse/ interesting/useful
16:07:48 kmalloc but will be back when done
16:08:05 kmalloc peschk_l: o/ I'll look for a ping from you a little later today
16:09:01 kmalloc cdent: i.. i ... wow that's a thing? neato
16:09:05 peschk_l kmalloc, edleafe Nice, see you later then
16:09:20 cdent kmalloc: dag nabbit, I only sent tons of mail about it once upon a time :)
16:09:33 kmalloc cdent: well.... i personally greatly dislike microversions
16:09:42 kmalloc so i probably blocked those emails from my brain
16:09:53 kmalloc doesn't change that it's nice to see that packaged up
16:10:00 kmalloc and easily consumable
16:10:07 elmiko hi
16:10:20 elmiko cdent: yes, i did make it back in one piece =)
16:10:22 cdent yeah, that's basically why I did it: this is painful and annoying and a burden so let's make it not
16:10:27 kmalloc ++
16:10:29 cdent elmiko: excellent
16:10:43 kmalloc and that reminds me, i need to re-prioritize my work to do that middleware extraction bit first
16:10:56 kmalloc i was about to dive into SDK / make keystoneclient dead work.
16:11:56 elmiko wow, seems like there is actually some topics today or just folks looking to get more guidance at a future date?
16:12:29 cdent bitrot++
16:12:51 Miouge Can the SDK identity which OpenStack release a given region is running (Pike/Queens/…)? Or is that a “Ask your administrator” type situation?
16:13:20 dtantsur Miouge: the latter. to a great extent because some people mix-and-match versions of different components.
16:13:39 edleafe elmiko: Yeah, peschk_l had a question, but we pushed it until 1800 UTC
16:13:55 elmiko edleafe: cool
16:14:04 dtantsur for the record: ironic-inspector uses flask and microversins (well, some flavor of them)
16:14:13 kmalloc Miouge: keystoneauth (and likewise things consuming it) can provide discovery information to you [max/min api versions in the case of microversions, etc], but you'd need to know what the differing APIs and Versions really mean, realistically, you're asking the administrator
16:14:17 edleafe dtantsur: Microversions cure all your ills!
16:14:22 dtantsur and now I'm writing a proxy for BM API that will use flask and microversions
16:14:30 dtantsur oh yeah, but how many do they add...
16:14:45 kmalloc in general though, it is much easier to just ask "what version"
16:14:48 dtantsur so, I'm writing a proxy. instead of implementing one baremetal API, I need to implement 48 of them
16:14:52 dtantsur what a time to be alive
16:15:03 elmiko yeesh
16:15:11 kmalloc dtantsur: thankfully flask makes things super easy on that front to do fun things...
16:15:21 elmiko ++
16:15:23 kmalloc s/fun/fun for some measure of fun/
16:15:38 kmalloc personally i love the before-request/after-request functions.
16:15:41 kmalloc elmiko: ^
16:15:46 kmalloc vs. full bore middleware
16:16:04 kmalloc also... with app.test_client() <--- best test client thing ever :)
16:16:16 elmiko i just like how dead simple it is to get a basic http server running
16:16:19 dtantsur kmalloc: that's a good point, these hooks may help with micorversioning stuff
16:16:27 kmalloc dtantsur: absolutely.
16:16:55 elmiko i've found the middleware pipeline to be really easy to extend as well
16:16:57 kmalloc way way simpler and you don't need to wrap app.wsgi_app (whatever you do do NOT wrap app directly with middleware)
16:16:58 dtantsur yeah, I got https://github.com/dtantsur/ironic-proxy/blob/master/ironic_proxy/api.py running in a few hours, half of them was fighting with oslo.config and keystoneauth :D
16:17:27 dtantsur kmalloc: mmm, why not? I'm quite sure we do it in a few places..
16:17:30 kmalloc dtantsur: i found out the hard way to wrap app.wsgi_app when i tried to do test_client
16:17:37 dtantsur ah, with tests?
16:17:37 kmalloc basically wsgi_app is the *actual* application
16:17:42 kmalloc yeah
16:17:57 kmalloc so if you wrap app.wsgi_app instead it exposes all the nice flask things on app stil
16:17:58 kmalloc l
16:18:05 kmalloc like test_client() and test_RequesT_context()
16:18:05 kmalloc etc
16:18:12 dtantsur ah, got it. makes sense indeed :)
16:18:36 kmalloc i highly recommend flask-restful
16:18:44 kmalloc over straight flask if you're doing REST APIs
16:19:07 dtantsur I feel like our API are unrestful enough to not use flask-restful
16:19:16 dtantsur don't remember for sure, but something made me not go that way
16:19:29 kmalloc well, what i like about flask restful is it builds resource objects you then just implement http methods on
16:19:33 kmalloc get/put/etc
16:19:34 Miouge dtantsur and kmalloc thanks! I saw the “openstack versions show” but i’m not able to draw conclusions from that output
16:19:50 cdent objectdispatch--
16:19:55 kmalloc Miouge: yeah, it's a lot of apriori knowledge or "go search the interwebs"
16:19:59 dtantsur kmalloc: ah, this is exactly what I don't like :) I guess tastes differt
16:20:01 kmalloc Miouge: i usually just ask.
16:20:25 kmalloc dtantsur: ah, with the complexity of keystone's (sigh... double sigh) API, it made life a lot easier
16:20:35 dtantsur I can imagine
16:20:40 kmalloc though it has some weird edge cases, like the resource object isn't instantiated until the request is processed...
16:20:46 dtantsur Ironic API is not THAT restful, unfortunately
16:21:19 kmalloc the other benefit is flask-restful has nice hooks for swagger and/or openapi doc
16:21:38 kmalloc but i can see ironic's apis being happier with straight flask
16:21:57 kmalloc cdent: i'll have to poke at gabbi then :P
16:21:59 kmalloc cdent: hehe
16:31:48 Miouge kmalloc: in my situation asking is not really an option, maybe I can infer stuff based on the nova doc then? https://docs.openstack.org/nova/latest/reference/api-microversion-history.html
16:43:51 kmalloc that is the idea
16:43:56 kmalloc you should be able to infer things
16:44:06 kmalloc it's just much easier if you know what to expect :)
16:50:56 kmalloc cdent: ah, gabbi is cool, i think i can couple it with the test_client context manager for great success
16:51:12 cdent huzzah!
16:51:36 kmalloc cdent: the test_client context manager in flask is super useful becasue it holds the context around so i can inspect lots of flask data and ensure everything is right, but the programatic stuff of gabbi will mkae some of the steps super easy
16:52:00 kmalloc so super good stuff, thnx!
16:53:07 cdent kmalloc: a thing you might want to keep in mind with gabbi is that it is oriented so that you're only thinking about the http api, not about the internals of the implementation. It doesn't want you to care about "lots of flask data", just whether the api is doing the right thing
16:53:32 kmalloc right, for cases we do those things it's going to be perfect
16:53:33 cdent so in that sense, I probably should have hassled you about gabbi and keystone before you did the switch the flask, so you could test both sides of the change with the same gabbit tests
16:53:45 kmalloc a lot of our tests are "do X and check response"
16:54:05 kmalloc nah, we didn't change any of our tests (ok not many) when moving to flask
16:54:41 kmalloc that was part of the requirements, so moving to gabbi is totally doable and wont be undoing/redoing much of any work I already did

Earlier   Later