*** frickler_pto is now known as frickler | 07:14 | |
digitalsimboja | hello @johnsom | 12:38 |
---|---|---|
digitalsimboja | Could you assist to point me to an implementation where I can call LoadBalancerClient? | 12:38 |
digitalsimboja | I am working on Kuryr-kubernetes and writing a tempest test | 12:39 |
digitalsimboja | I need a way of fetching the loadbalancers on Octavia. | 12:39 |
digitalsimboja | I have checked the following: | 12:39 |
digitalsimboja | https://github.com/openstack/octavia-tempest-plugin/blob/master/octavia_tempest_plugin/services/load_balancer/v2/loadbalancer_client.py | 12:40 |
digitalsimboja | and this | 12:40 |
digitalsimboja | https://github.com/openstack/octavia-tempest-plugin/blob/master/octavia_tempest_plugin/services/load_balancer/v2/base_client.py#L207 | 12:40 |
digitalsimboja | among others yet unable to fetch loadbalancers? | 12:41 |
digitalsimboja | exactly what I am trying to achieve | 12:41 |
digitalsimboja | https://paste.opendev.org/show/807842/ | 12:41 |
johnsom | digitalsimboja Hi. Do you have a proposed patch posted in gerrit? | 14:50 |
digitalsimboja | not yet | 14:51 |
johnsom | Ok. Let me point you to a few things that may help. | 14:51 |
digitalsimboja | okay | 14:52 |
johnsom | Here 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#L286 | 14:53 |
johnsom | One 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 |
johnsom | In 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 |
digitalsimboja | following.. | 14:58 |
johnsom | You 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 |
johnsom | If you have a link to your tempest gerrit I can take a look for you. | 14:59 |
digitalsimboja | Let me implement your recommendations then push to gerrit so you can advise further | 15:00 |
digitalsimboja | give me one moment please | 15:00 |
johnsom | Ok, 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 |
digitalsimboja | first step is to set up the credentials | 15:01 |
johnsom | Our code is here: https://github.com/openstack/octavia-tempest-plugin/blob/master/octavia_tempest_plugin/tests/test_base.py#L48 | 15:01 |
johnsom | It's a lot more complicated than you need as we are testing all of the RBAC modes, etc. | 15:02 |
digitalsimboja | Just 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 |
johnsom | digitalsimboja 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 |
johnsom | If it is inside a tempest test, tempest will setup the client automatically once it is installed. | 15:28 |
johnsom | The steps above were to configure tempest to setup a credential to use with the client. | 15:29 |
digitalsimboja | I want to list loadbalancers inside here https://github.com/openstack/kuryr-tempest-plugin/blob/master/kuryr_tempest_plugin/tests/scenario/test_service.py | 15:30 |
johnsom | Yeah, ok, so the hints I provided you earlier apply, you will let tempest create a credential and setup the client for you. | 15:32 |
digitalsimboja | add the credentials setup on tempest, you mean? | 15:34 |
johnsom | Yeah, 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 |
digitalsimboja | Thanks and expecting... | 15:37 |
johnsom | Yeah, so the kuryr plugin is not explicitly declaring credentials, it's been relying on the defaults. One more minute. | 15:38 |
digitalsimboja | okay.. | 15:41 |
johnsom | Yeah, 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 |
johnsom | https://github.com/openstack/designate-tempest-plugin/blob/master/designate_tempest_plugin/tests/api/v2/test_pool.py#L37 | 15:42 |
johnsom | You 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 |
johnsom | It is documented here: https://docs.openstack.org/tempest/latest/write_tests.html#allocating-credentials | 15:44 |
johnsom | Though that page takes a few minuted to understand. lol | 15:44 |
digitalsimboja | taking a look... | 15:50 |
digitalsimboja | Okay 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 |
digitalsimboja | then create an instance of the tempest clients? | 15:53 |
johnsom | Yes. 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 |
johnsom | yes | 15:54 |
johnsom | I 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 |
digitalsimboja | still puzzling me :) | 15:57 |
johnsom | Give it a try, post a patch, I will help with adjustments to get you started. | 15:59 |
digitalsimboja | doing that .... one moment please | 15:59 |
digitalsimboja | Johnsom: Please take a look | 18:11 |
digitalsimboja | https://review.opendev.org/c/openstack/kuryr-tempest-plugin/+/803244 | 18:11 |
digitalsimboja | Though I am getting an error on https://paste.opendev.org/show/807851/ | 18:16 |
digitalsimboja | I feel you can review directly on gerrit so I can work on it? | 18:16 |
digitalsimboja | I see a patchset that can be very useful as well | 18:23 |
digitalsimboja | https://review.opendev.org/c/openstack/kuryr-tempest-plugin/+/613899 | 18:23 |
digitalsimboja | I am taking a look | 18:23 |
johnsom | Ok, I will comment on the patch. | 18:30 |
johnsom | digitalsimboja Posted some comments | 18:45 |
digitalsimboja | taking a look.. | 18:54 |
digitalsimboja | got it! I got something! Sending asap for review | 19:57 |
digitalsimboja | Johnsom I uploaded a new patchset, please take a look. Thanks | 20:13 |
digitalsimboja | And Thanks for all the wonderful helps | 20:13 |
johnsom | Sure, NP, I will take a look here in an hour or two | 20:51 |
johnsom | digitalsimboja I am looking into the requirements-check issue, so ignore that for now. | 21:16 |
johnsom | Otherwise that looks pretty good. Let's see what the test run comes back with. | 21:18 |
digitalsimboja | I have added some few lines, see | 21:27 |
digitalsimboja | https://paste.opendev.org/show/807853/ | 21:27 |
johnsom | That that is pretty close to what I would expect should run | 21:27 |
johnsom | Hmm, 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 |
digitalsimboja | https://paste.opendev.org/show/807854/ | 21:30 |
johnsom | Ah! 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 |
johnsom | But, that proves that you have access to the service client with the correct credentials | 21:31 |
digitalsimboja | sure yeah | 21:34 |
digitalsimboja | Thank you very much | 21:35 |
johnsom | Sure, 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 |
digitalsimboja | cool | 21:35 |
digitalsimboja | i will be on the lookout | 21:36 |
johnsom | Hmm, they are all failing with this manager issue.... odd | 21:36 |
johnsom | Oh, kuryr doesn't have any service clients, so they are not getting init. | 21:38 |
johnsom | digitalsimboja 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 |
johnsom | It'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/!