| Posted | Nick | Remark | |
|---|---|---|---|
| #openstack-sdks - 2019-11-01 | |||
| 14:53:21 | cdent | frickler: one of the issues is that the previous PTL of placement (me) thinks people should just write get and put requests to placement as that's the way it was designed to be used, but the newer PTL (tetsuro) feels a bit differently, so there may be changes afoot. efried: meh. meh to that I say | |
| 14:54:03 | cdent | I would assume that mordred would be very sad if modern sdk can't talk to old clouds | |
| 14:54:32 | umbSublime | currently with .36 I can use it on ocata deployment as well | |
| 14:54:37 | efried | frickler: yes, what cdent said, I was getting to that. We will "never" have a python-placementclient. But we may someday add more SDK-ish methods in the SDK. | |
| 14:57:04 | efried | umbSublime: hm, I don't see anything from 0.36.0 to 0.37.0 that should be making a difference for you. It is possible that the hitch is placement being integrated in nova. A generic ksa adapter ought to be able to talk to $service with REST primitives; but depending which incarnation of the service-types-authority you're using... | |
| 14:57:33 | frickler | efried: cdent: o.k., that explains things, thx | |
| 15:03:15 | umbSublime | efried: I'm still new to all this, I'm not sure i get what you mean | |
| 15:04:34 | umbSublime | Like i can generate a ksa adapter and register my endpoint to it and just use REST methods on it ? | |
| 15:04:34 | efried | sorry, I didn't mean to leave that hanging umbSublime | |
| 15:04:47 | efried | yes, you should be able to do that. | |
| 15:05:28 | umbSublime | And would i be able to register that to my connection object ? | |
| 15:05:32 | efried | If you're paying attention to requirements files, the fact that you have sdk 0.36.0 probably means you have os-service-types at a train-ish level, and that ost thinks that placement is no longer part of nova. | |
| 15:06:09 | umbSublime | Ok that makes sense, and would explain why conn.placement doesn't work corrctly | |
| 15:06:42 | umbSublime | err it works correctly just not for my deployment | |
| 15:07:22 | efried | umbSublime: I want to help you debug this, trying to think how best to do it. | |
| 15:07:46 | efried | Do you have the ability to set up an oslo.config style .conf file with ksa opts to talk to your placement service? | |
| 15:08:32 | umbSublime | is that the older 'export OS_VAR_NAME=bleh' conf format ? | |
| 15:09:25 | umbSublime | really though I'm able to talk to the placement API without issues as it is using requests module | |
| 15:11:31 | efried | cool, ksa is a wrapper around requests that handles the auth and service catalog pieces. And sdk is a wrapper around ksa that lets you use a yaml file for config. | |
| 15:12:04 | efried | (sdk does much more than that obviously for other services, but not yet for placement) | |
| 15:12:38 | umbSublime | Ohhh I see now, so I could just use ksa and at least get the same interface as conn.compute.<HTTP METHOD> instead of re-implementing it ! | |
| 15:13:41 | efried | instead of re-implementing the auth and service catalog pieces, yes | |
| 15:13:59 | efried | umbSublime: Here's an example of oslo.config style setup to talk to placement: https://zuul.opendev.org/t/openstack/build/8d219a6777234f349caf02883b9e0a4d/log/logs/etc/nova/nova.conf.txt.gz#104-112 | |
| 15:14:14 | efried | (from a random CI run on a random recent nova patch) | |
| 15:17:02 | efried | umbSublime: So if you wanted to go that route, you could | |
| 15:17:02 | efried | - steal nova's get_ksa_adapter https://opendev.org/openstack/nova/src/branch/master/nova/utils.py#L969 | |
| 15:17:02 | efried | - register those conf opts like this https://opendev.org/openstack/nova/src/branch/master/nova/conf/placement.py#L19-L30 | |
| 15:17:02 | efried | - set up a .conf file like that one | |
| 15:17:02 | efried | and then you should be able to do: | |
| 15:17:02 | efried | adap = get_ksa_adapter('placement') | |
| 15:17:02 | efried | adap.get(...) etc. | |
| 15:19:29 | efried | I would be interested to know more about how the sdk is failing though. I'm not sure "Skipping over invalid version data. No stability status in version." should actually be preventing sdk from creating a proxy for you... | |
| 15:20:31 | efried | However, that ^ probably means that queens placement wasn't producing a good version document. cdent can you corroborate? | |
| 15:20:52 | umbSublime | I can paste the full stacktrace. It's something about parsing the endpoint | |
| 15:21:13 | cdent | efried, umbSublime : it's likely it was not, at that time | |
| 15:21:36 | cdent | because there was never any plan to have other versions, so for a while it was not a list, if I remember right | |
| 15:21:38 | umbSublime | https://hastebin.com/qezivuxivu.sql | |
| 15:21:49 | cdent | yeah, that | |
| 15:22:21 | umbSublime | Is there a version of the SDK where this would work though ? (prior to train release maybe?) | |
| 15:22:33 | cdent | umbSublime: can we wind this back a bit more: what's your end goal? | |
| 15:22:52 | umbSublime | We have some issues with allocations that don't exist | |
| 15:23:05 | umbSublime | I'm just making a little tool to help show and clean them | |
| 15:23:37 | cdent | ah, okay, yeah, that's a common thing, enough that in newer versions nova has some tooling for it | |
| 15:23:45 | umbSublime | I have all my code working right now, and the tool works. I'm just trying to make it more "standard" I guess | |
| 15:24:24 | cdent | a good inclination but I'd say probably not worth it in this case | |
| 15:24:41 | cdent | no "standard" was set with regard to placement around queens time | |
| 15:24:53 | umbSublime | agreed, it was also a bit of an exercise to get more familiar with the SDK | |
| 15:25:11 | efried | unfortunate that you tried with this particular combination :( | |
| 15:25:30 | efried | We didn't have sdk talking to placement until mid-train, and iirc we had to make some tweaks to sdk to make that happen more smoothly. | |
| 15:25:38 | umbSublime | I appreciate all your help though. efried I think I'll give that technique you shared a try | |
| 15:26:02 | cdent | umbSublime: you can run placement standalone, if you want something to talk to using modern techniques, for educational purposes | |
| 15:26:40 | umbSublime | Ohh you mean on a devstack or something ? | |
| 15:27:01 | cdent | no, much more standalone, let me find you a ref | |
| 15:27:41 | cdent | https://docs.openstack.org/placement/latest/contributor/quick-dev.html as well as https://github.com/cdent/placedock | |
| 15:27:50 | umbSublime | One day I'll try and get more involved into dev in openstack currently I'm just an operator trying to make my life easier :) | |
| 15:28:19 | cdent | that would be great, openstack badly needs more people with field experience working on it to make it easier to manage | |
| 15:29:56 | umbSublime | to be honest I was wondering is there is some type of portal where openstack operators (which don't necesseraly have all the dev experience) could share and discuss some future features/bugs etc. | |
| 15:31:56 | cdent | the openstack-discuss mailing list is supposed to be, in part, for that | |
| 15:34:39 | umbSublime | What is the actual goal the SDK is trying to fill (not historically, but nowadays) ? Is it meant to be a one stop shop for os services needing to talk to another ? Or is it more dev/ops oriented to standardize talking to all the different APIs | |
| 15:35:46 | mriedem | umbSublime: #openstack-operators channel | |
| 15:35:52 | mriedem | though it's generally quiet | |
| 15:35:58 | efried | umbSublime: That's really a mordred (sitting shirtless on a mountain with supplicants bringing him burnt offerings) question. | |
| 15:36:11 | efried | but I'll give it a shot... | |
| 15:36:25 | mriedem | umbSublime: if you send to the ML, tag ops stuff with [ops] to filter properly in people's mailbox | |
| 15:37:01 | efried | Yes, one stop shop. Originally I think for cloud operators writing tooling that talks to their cloud. Yes standardize how we talk to the different APIs. | |
| 15:37:25 | efried | Only more recently have we started to want to use it as a way for one service to talk to another. | |
| 15:37:34 | umbSublime | hence the merge of shade into the sdk in the bigining | |
| 15:38:12 | efried | We made some inroads on that in nova in train: we're most of the way through replacing nova's use of python-ironicclient with sdk; and we already swapped out placement (which had been using ksa directly) as you saw. | |
| 15:54:30 | umbSublime | efried: One last question concerning using get_ksa_adapter. Here https://opendev.org/openstack/nova/src/branch/master/nova/conf/placement.py#L28 what is conf ? I know it's what you showed with the .ini style config. But what type of object do I use to generate it ? | |
| 15:59:24 | efried | umbSublime: it's something like: | |
| 15:59:25 | efried | from oslo_config import cfg | |
| 15:59:25 | efried | register_ksa_options(..) # This should register the opts onto cfg.CONF | |
| 15:59:25 | efried | cfg.CONF(args=['--conf-file', '/path/to/your.conf']) # This loads up your config file into cfg.CONF | |
| 15:59:25 | efried | get_ksa_adapter... | |
| 15:59:36 | efried | gotta run to a meeting, that ^ is a bit rough but hopefully gets you pointed in the right direction. | |
| 16:00:19 | umbSublime | efried: thanks that's exactly what I need :) | |
| 16:16:40 | openstackgerrit | Pedro Henrique Pereira Martins proposed openstack/keystoneauth master: Fixes OIDC authentication with multiple IdPs https://review.opendev.org/692140 | |
| 17:25:57 | openstackgerrit | Merged openstack/python-openstackclient master: versions: Fix 'versions show' help message https://review.opendev.org/686408 | |
| 17:29:13 | umbSublime | I must be missing something https://hastebin.com/utuhuyinur.python I don't see what could be a duplicate. I'm trying to dig in the code, but i'm a bit lost | |
| 17:35:27 | efried | umbSublime: You're just running this code in isolation? | |
| 17:38:09 | openstackgerrit | Pierre Prinetti proposed openstack/python-openstackclient master: Fix 'versions show' helps & docs https://review.opendev.org/691989 | |
| 17:38:15 | efried | umbSublime: It looks right to me, but I was able to repro locally. Investigating... | |
| 17:40:37 | umbSublime | efried: yes, only the code in hastebin in a venv | |
| 17:43:26 | efried | umbSublime: oh, I see what's happening. I didn't notice you were importing from nova. That import is already registering the conf opts via nova.conf.__init__. | |
| 17:43:58 | efried | If you want to be able to use this cleanly, I suggest just copying in the guts of register_ksa_options | |
| 17:44:08 | efried | ...so you don't need to rely on nova existing at all. | |
| 17:44:17 | umbSublime | Ohh I see what you mean. | |
| 17:45:08 | efried | umbSublime: Um, except you can simplify a lot further | |
| 17:45:21 | efried | you don't need to remove and re-add the _ADAPTER_VERSION_OPTS for your purposes. | |
| 17:45:38 | efried | though I guess you can, shrug. | |
| 17:46:05 | umbSublime | same for get_ksa_adapter (I just use the guts of the function) ? | |
| 17:48:40 | openstackgerrit | Pierre Prinetti proposed openstack/python-openstackclient master: Fix 'versions show' helps & docs https://review.opendev.org/691989 | |
| 17:50:14 | openstackgerrit | Pierre Prinetti proposed openstack/python-openstackclient master: Fix 'versions show' helps & docs https://review.opendev.org/691989 | |
| 18:04:15 | umbSublime | got it working. Thanks again efried ! | |
| 18:04:24 | efried | \o/ | |
| 18:13:47 | umbSublime | Here is what I end up with https://hastebin.com/huhajekiso.py | |
| 18:15:48 | efried | umbSublime: Some of that stuff is nova-specific and/or legacy gorp you're dragging along. If this is for more than just playing around, I would suggest simplifying. | |
| 18:16:59 | umbSublime | efried: yup. I'm doing that right now :) but being unfamiliar with the codebase i'm taking my time :) | |
| 18:17:01 | efried | but yeah, this looks good. | |
| 18:17:12 | efried | umbSublime: okay, let me know if you need help | |