Monday, 2021-08-02

*** frickler_pto is now known as frickler07:14
digitalsimbojahello @johnsom12:38
digitalsimbojaCould you assist to point me to an implementation where I can call LoadBalancerClient?12:38
digitalsimbojaI am working on Kuryr-kubernetes and writing a tempest test12:39
digitalsimbojaI need a way of fetching the loadbalancers on Octavia.12:39
digitalsimbojaI have checked the following:12:39
digitalsimbojahttps://github.com/openstack/octavia-tempest-plugin/blob/master/octavia_tempest_plugin/services/load_balancer/v2/loadbalancer_client.py12:40
digitalsimbojaand this12:40
digitalsimbojahttps://github.com/openstack/octavia-tempest-plugin/blob/master/octavia_tempest_plugin/services/load_balancer/v2/base_client.py#L20712:40
digitalsimbojaamong others yet unable to fetch loadbalancers?12:41
digitalsimbojaexactly what I am trying to achieve12:41
digitalsimbojahttps://paste.opendev.org/show/807842/12:41
johnsomdigitalsimboja Hi. Do you have a proposed patch posted in gerrit?14:50
digitalsimbojanot yet14:51
johnsomOk. Let me point you to a few things that may help.14:51
digitalsimbojaokay14:52
johnsomHere is a load balancer list test in our suite. Once you have the plugin loaded in tempest, you can call it the same way as this test: https://github.com/openstack/octavia-tempest-plugin/blob/master/octavia_tempest_plugin/tests/api/v2/test_load_balancer.py#L28614:53
johnsomOne thing to note about Octavia is that it uses Advanced RBAC, but kuryr gates may already be turning that off, I'm not sure. That will dictate how you setup a user credential to access the load balancer list. I guess I would recommend just setting one up with the full admin role as you are not testing Octavia really, so full admin should cover your needs. One second, I will point out how to create that credential.14:55
johnsomIn your [credentials] list, add ['lb_admin', 'load-balancer_admin'], then create a client instance:         cls.admin_lb_client = (14:58
johnsom            cls.os_roles_lb_admin.load_balancer_v2.LoadbalancerClient()), then you would call it like: lbs = self.admin_lb_client.list_loadbalancers()14:58
digitalsimbojafollowing..14:58
johnsomYou may be able to use your admin credential, but again, that depends what RBAC mode Octavia is configured for in your gate job.14:59
johnsomIf you have a link to your tempest gerrit I can take a look for you.14:59
digitalsimbojaLet me implement your recommendations then push to gerrit so you can advise further15:00
digitalsimbojagive me one moment please15:00
johnsomOk, yeah, let me know if you would like me to propose fix patches on it, or if you would just like to chat through it.15:00
digitalsimbojafirst step is to set up the credentials15:01
johnsomOur code is here: https://github.com/openstack/octavia-tempest-plugin/blob/master/octavia_tempest_plugin/tests/test_base.py#L4815:01
johnsomIt's a lot more complicated than you need as we are testing all of the RBAC modes, etc.15:02
digitalsimbojaJust a quick one , Kuryr relies on tempest for the clients setup and not on the kuryr itself, so how do I pass/set up the credentials directly on Kuryr?15:20
johnsomdigitalsimboja Maybe I am confused on what you want to do. I thought you wanted to list load balancers inside a tempest test. If you want to do that from kuryr instead, you probably want to use the OpenStack SDK instead of the tempest plugin.15:27
johnsomIf it is inside a tempest test, tempest will setup the client automatically once it is installed.15:28
johnsomThe steps above were to configure tempest to setup a credential to use with the client.15:29
digitalsimbojaI want to list loadbalancers inside here https://github.com/openstack/kuryr-tempest-plugin/blob/master/kuryr_tempest_plugin/tests/scenario/test_service.py15:30
johnsomYeah, ok, so the hints I provided you earlier apply, you will let tempest create a credential and setup the client for you.15:32
digitalsimbojaadd the credentials setup on tempest, you mean?15:34
johnsomYeah, in your plugin. Let me pull that down and find where the credentials are setup in the kuryr plugin. It may be that they are only using the defaults, so there isn't an explicit credential setup in there already. One minute.15:36
digitalsimbojaThanks and expecting...15:37
johnsomYeah, so the kuryr plugin is not explicitly declaring credentials, it's been relying on the defaults. One more minute.15:38
digitalsimbojaokay..15:41
johnsomYeah, ok. And the kuryr gates setup Octavia with the default advanced RBAC. So, you want to add something like this to your test class:15:41
johnsomhttps://github.com/openstack/designate-tempest-plugin/blob/master/designate_tempest_plugin/tests/api/v2/test_pool.py#L3715:42
johnsomYou will probably want "admin" and "primary" there (the tempest defaults), then add the  ['lb_admin', 'load-balancer_admin'] to that list as I mentioned above.15:42
johnsomIt is documented here: https://docs.openstack.org/tempest/latest/write_tests.html#allocating-credentials15:44
johnsomThough that page takes a few minuted to understand. lol15:44
digitalsimbojataking a look...15:50
digitalsimbojaOkay let me clarify, On my test_service.py, I create a list of credentials, then I add the 'lb_admin', and 'load-balancer_admin' to the credentials list?15:52
digitalsimbojathen create an instance of the tempest clients?15:53
johnsomYes. Then in your test case, you will use self.admin_lb_client.list_loadbalancers() to access the load balancer list API using the lb_admin credential tempest setup for you.15:53
johnsomyes15:54
johnsomI fully acknowledge the tempest "magic" that goes on behind the scenes in tempest takes some time to get used to....  At least I was puzzled for a while when I was learning tempest.15:56
digitalsimbojastill puzzling me :)15:57
johnsomGive it a try, post a patch, I will help with adjustments to get you started.15:59
digitalsimbojadoing that .... one moment please15:59
digitalsimbojaJohnsom: Please take a look18:11
digitalsimbojahttps://review.opendev.org/c/openstack/kuryr-tempest-plugin/+/80324418:11
digitalsimbojaThough I am getting an error on https://paste.opendev.org/show/807851/18:16
digitalsimbojaI feel you can review directly on gerrit so I can work on it?18:16
digitalsimbojaI see a patchset that can be very useful as well18:23
digitalsimbojahttps://review.opendev.org/c/openstack/kuryr-tempest-plugin/+/61389918:23
digitalsimbojaI am taking a look18:23
johnsomOk, I will comment on the patch.18:30
johnsomdigitalsimboja Posted some comments18:45
digitalsimbojataking a look..18:54
digitalsimbojagot it! I got something! Sending asap for review19:57
digitalsimbojaJohnsom I uploaded a new patchset, please take a look. Thanks20:13
digitalsimbojaAnd Thanks for all the wonderful helps 20:13
johnsomSure, NP, I will take a look here in an hour or two20:51
johnsomdigitalsimboja I am looking into the requirements-check issue, so ignore that for now.21:16
johnsomOtherwise that looks pretty good. Let's see what the test run comes back with.21:18
digitalsimbojaI have added some few lines, see21:27
digitalsimbojahttps://paste.opendev.org/show/807853/21:27
johnsomThat that is pretty close to what I would expect should run21:27
johnsomHmm, I'm not sure why the stable branches are giving that manager error. I may have to phone a friend on that one.21:29
digitalsimbojahttps://paste.opendev.org/show/807854/21:30
johnsomAh! That is a good result! Yeah, if it's already in PENDING_DELETE you can't call DELETE on it. PENDING_* states mean the object is immutable (locked) pending the change completing.21:31
johnsomBut, that proves that you have access to the service client with the correct credentials21:31
digitalsimbojasure yeah21:34
digitalsimbojaThank you very much21:35
johnsomSure, I will get back to you on what we need to do about the requirements issue. There were a few proposals and I'm not sure which was the final plan.21:35
digitalsimbojacool21:35
digitalsimbojai will be on the lookout21:36
johnsomHmm, they are all failing with this manager issue.... odd21:36
johnsomOh, kuryr doesn't have any service clients, so they are not getting init.21:38
johnsomdigitalsimboja Ok, the manager thing is our issue. The last tagged patch on pypi had a typo. I will get a tag release going now, probably be released tomorrow.21:51
johnsomIt's related to the other issue about requirements.21:53

Generated by irclog2html.py 2.17.2 by Marius Gedminas - find it at https://mg.pov.lt/irclog2html/!