Tuesday, 2018-04-10

*** logan- has quit IRC00:02
*** logan- has joined #ara00:02
openstackgerritDavid Moreau Simard proposed openstack/ara master: Add support for configuring sqlalchemy pool size, timeout and recycle  https://review.openstack.org/52442702:59
openstackgerritDavid Moreau Simard proposed openstack/ara master: Improve memory usage when dealing with large amount of data  https://review.openstack.org/55984002:59
*** harlowja has quit IRC03:16
*** bcoca has quit IRC03:45
*** harlowja has joined #ara03:57
*** gvincent has joined #ara05:22
*** harlowja has quit IRC06:40
*** gvincent has quit IRC07:49
*** gvincent has joined #ara07:50
*** gvincent has quit IRC07:52
*** gvincent has joined #ara07:52
*** DrWaluigi has quit IRC08:45
*** mihai_ansible has joined #ara10:24
mihai_ansiblehi, I just read about your project and used the anisble role to install ara and the apache server10:24
mihai_ansiblenow I would like to run ansible plabooks for  a mac laptop, and record the output to the server mentioned before10:25
mihai_ansibleI seem just not to find how to exactly do that10:25
mihai_ansibleis it required that I install ara on the mac? or is enough to install the callback and modules?10:25
mihai_ansibleI would not like to install too many packages10:25
mihai_ansiblethanks!10:25
mihai_ansibleaand made a pull request for a small typo atb the handler name10:29
*** rvgate has quit IRC10:40
*** rvgate has joined #ara10:40
*** sshnaidm is now known as sshnaidm|bbl10:47
*** sshnaidm|bbl has quit IRC10:47
*** rvgate has quit IRC11:12
*** sshnaidm|bbl has joined #ara11:27
mihai_ansibleis this project abandoned?11:30
dmsimardmihai_ansible: it's not at all. I was just sleeping :)11:40
mihai_ansible:) Hi11:40
mihai_ansibleglad you woke up11:40
mihai_ansibleI was about to abandon it11:40
mihai_ansibledmsimard: I had installed the default on a cent virtual machine, managed to see the interface11:41
mihai_ansibledmsimard: now I wanted to run an ansible playbook from my mac laptop11:41
mihai_ansibledmsimard: and I am stuck,11:42
mihai_ansibledmsimard: don't have time to understand the data base configurations and all, but I assume it just uses the sqlite in the centos11:42
dmsimardmihai_ansible: the callback is what records the data in a database. It needs to be installed wherever Ansible is running. The web interface reads from that database.11:43
mihai_ansibledmsimard: what is needed to do to use it ansible playbook from laptop, ara on its own server?11:43
mihai_ansibleI can also update the role afterwards11:44
mihai_ansibledmsimard: even though the pull requests are denied ....11:44
dmsimardSure, I'd love to get some help on the role11:44
mihai_ansibledmsimard: thanks!11:44
dmsimardThere are docs on how to contribute: https://github.com/openstack/ara/blob/master/README.rst#contributing-testing-issues-and-bugs11:45
dmsimardWe just don't use GitHub for code contribution, it's used for mirroring11:45
mihai_ansibledmsimard: ouch ... everything is overly complicated these days :)11:47
mihai_ansibledmsimard: even that with tools like ansible we have the means to just provide a command11:47
mihai_ansibledmsimard: it would of been great if I could of set it up today,11:48
dmsimardIt's pretty simple when you get used to it, I prefer it to the GitHub workflow by far :D11:48
dmsimardI'd be happy to help you get started but I need to properly wake up first lol11:48
mihai_ansibledmsimard: ok. get your uppers see u later11:49
mihai_ansibledmsimard: just ping me pls11:49
dmsimardIn the meantime, maybe this FAQ can help you understand: http://ara.readthedocs.io/en/latest/faq.html#can-ansible-with-ara-run-on-a-different-server-than-the-web-application11:49
dmsimardIf you're installing ARA on your laptop (or even just Ansible) I highly recommend using virtual environments11:50
dmsimardI'll be back in an hour or so.11:51
*** sshnaidm|bbl is now known as sshnaidm11:53
*** weshay_pto is now known as weshay12:03
*** openstackgerrit has quit IRC12:04
*** bcoca has joined #ara12:50
*** bcoca has joined #ara12:50
ara-slack<dmsimard> @logan.attwood this patch limits the memory usage down to more reasonable levels: https://review.openstack.org/#/c/559840/12:50
ara-slack<dmsimard> It's still a bit spiky but I'll iterate on it12:51
ara-slack<dmsimard> You can install it this way: http://paste.openstack.org/raw/718815/12:51
dmsimardmihai_ansible: ok so what have you tried and what doesn't work ?12:52
*** logan- has quit IRC12:55
*** logan- has joined #ara12:56
*** mihai_ansible has quit IRC13:15
ara-slack<logan.attwood> <313:50
ara-slack<dmsimard> @logan.attwood no love until you've confirmed it works :P13:51
ara-slack<logan.attwood> any idea how i get something i can apply with patch?13:51
ara-slack<logan.attwood> ah. nm13:52
ara-slack<logan.attwood> now i'm worried about load balancer timeouts :,)13:58
ara-slack<dmsimard> I gave you the command to run in that paste if you hadn't seen it13:59
ara-slack<dmsimard> (I try not to use the slack paste thing, people on IRC can't see those)13:59
ara-slack<logan.attwood> yeah i used that14:00
ara-slack<logan.attwood> oh14:00
ara-slack<logan.attwood> memory is still spiking :S14:00
ara-slack<logan.attwood> 5GB14:00
ara-slack<logan.attwood> I was trying to setup a wsgi memory profiler middleware but no luck14:01
ara-slack<logan.attwood> spiked, crashed :(14:02
*** tbielawa has joined #ara14:02
ara-slack<logan.attwood> it's14:04
ara-slack<dmsimard> ok so14:04
ara-slack<logan.attwood> reports/ajax/plays14:04
ara-slack<dmsimard> sec14:04
ara-slack<dmsimard> In that patch, there's a constant here at the top: https://review.openstack.org/#/c/559840/2/ara/views/reports.py14:04
ara-slack<dmsimard> Can you put 50 or something and see if it spikes less ?14:04
ara-slack<logan.attwood> sure14:07
ara-slack<logan.attwood> dumb python question14:07
ara-slack<logan.attwood> File uploaded https://ara-community.slack.com/files/UA2H3AQ1Z/FA4BGHT9T/image.png / https://slack-files.com/T6VAB05L7-FA4BGHT9T-dfeab5f18014:07
ara-slack<logan.attwood> how do I log the size of `results`14:07
ara-slack<logan.attwood> no hits for "log" in that file14:07
ara-slack<dmsimard> @logan.attwood I can add some verbosity for profiling real quick, hang on14:11
ara-slack<logan.attwood> what i wanted to get working was this but i had no idea how to: https://github.com/mgedmin/dozer14:12
ara-slack<logan.attwood> I'd get it working but the `_dozer/index` url didn't work14:13
ara-slack<logan.attwood> just did this instead14:14
ara-slack<logan.attwood> (sorry irc folks)14:14
ara-slack<logan.attwood> File uploaded https://ara-community.slack.com/files/UA2H3AQ1Z/FA44NQ8BD/image.png / https://slack-files.com/T6VAB05L7-FA44NQ8BD-be5968c91714:14
*** zxiiro has quit IRC14:14
*** zxiiro has joined #ara14:14
ara-slack<logan.attwood> what i'm hoping14:15
ara-slack<logan.attwood> is that it will OOM and print out the size it OOM'd at14:15
ara-slack<logan.attwood> unless it's OOMing inside `jsonify`14:15
ara-slack<logan.attwood> then all hope is lost14:15
*** mnaser has quit IRC14:15
*** mnaser has joined #ara14:16
ara-slack<logan.attwood> well14:23
ara-slack<logan.attwood> stats load now14:23
ara-slack<logan.attwood> halfa  meg of json :,)14:23
ara-slack<dmsimard> with YIELD_PER at 50 ?14:27
ara-slack<logan.attwood> yeah14:27
ara-slack<logan.attwood> timeout reading headers this time14:28
ara-slack<logan.attwood> I think I may have found the problem14:28
ara-slack<logan.attwood> I think sqlalchemy is eagerly loading the relationships?14:29
ara-slack<dmsimard> I've read something along those lines when I found about yield_per14:29
ara-slack<dmsimard> I can't pretend to know too much about how it works14:29
ara-slack<logan.attwood> trying this14:30
ara-slack<logan.attwood> File uploaded https://ara-community.slack.com/files/UA2H3AQ1Z/FA4C14X7X/image.png / https://slack-files.com/T6VAB05L7-FA4C14X7X-922b2fc07c14:30
ara-slack<logan.attwood> well the ones that succeeded loaded hella quick14:31
ara-slack<dmsimard> hmm, I'll definitely check it out14:32
ara-slack<dmsimard> got rabbitholed by adding debug logs14:32
ara-slack<logan.attwood> yeah i think it's going to timeout again :S14:32
ara-slack<dmsimard> @logan.attwood you likely need to add that to the other queries as well14:34
ara-slack<logan.attwood> getting up into `results 7500` before crash14:50
ara-slack<dmsimard> I found something interesting while fixing the logging things14:57
dmsimardrunning this on my laptop is killing it lol15:13
dmsimardyou can hear the fans spinning15:13
ara-slack<logan.attwood> so it eventually succeeds15:16
ara-slack<logan.attwood> after nearly 30 minutes15:16
ara-slack<logan.attwood> i think pagination might be the solution :(15:16
ara-slack<dmsimard> but hey, it didn't go OOM :)15:18
ara-slack<dmsimard> so that's something15:19
ara-slack<dmsimard> you managed to not go OOM only with eagerloads(false) ?15:19
ara-slack<logan.attwood> i never let it run w/o eagerloads(false), got impatient15:21
ara-slack<logan.attwood> (being honest)15:21
ara-slack<dmsimard> that's totally fair15:23
ara-slack<dmsimard> still looking at this, improving logging will help us look in the right direction15:24
ara-slack<logan.attwood> trying with YIELD_PER set to 200015:24
ara-slack<logan.attwood> man it's a *lot* faster with eager load false15:24
dmsimard"The loading of relationships falls into three categories; lazy loading, eager loading, and no loading. Lazy loading refers to objects are returned from a query without the related objects loaded at first. When the given collection or reference is first accessed on a particular object, an additional SELECT statement is emitted such that the requested collection is loaded."15:25
dmsimard"Eager loading refers to objects returned from a query with the related collection or scalar reference already loaded up front. The Query achieves this either by augmenting the SELECT statement it would normally emit with a JOIN to load in related rows simultaneously, or by emitting additional SELECT statements after the primary one to load collections or scalar references at once."15:25
ara-slack<logan.attwood> what sent me down that direction was connecting to postgres and seeing the queries issued by ara constantly change15:26
ara-slack<logan.attwood> 2k OOMs15:26
ara-slack<logan.attwood> :(15:26
dmsimardyeah yield_per limits the size of the buffer between each flush15:27
dmsimardif you're setting that number higher, the buffer (and memory usage) is higher15:27
ara-slack<logan.attwood> still though- should be able to get 2k rows into memory15:27
ara-slack<dmsimard> @harlowja do you have an opinion on lazy and eager loading ?15:27
ara-slack<dmsimard> @logan.attwood right, it shouldn't be that big of a deal, I agree15:28
ara-slack<logan.attwood> even 500 OOMs :(15:45
ara-slack<logan.attwood> i'm calling `sys.getsizeof` on the results list, will be curious to see where it ends up15:53
dmsimardalmost finished fixing logging..15:54
dmsimardthere's a lot of these queries: http://paste.openstack.org/raw/718850/16:00
dmsimard(with different UUIDs)16:00
ara-slack<logan.attwood> looks like loading that makes me sad :(16:05
ara-slack<logan.attwood> probably makes more sense (dunno if sqlalchemy supports this, i know doctrine on php does)16:05
ara-slack<logan.attwood> to write a custom query and have sqlalchemy hydrate it16:05
ara-slack<logan.attwood> eager loads might actually help <_<16:06
*** openstackgerrit has joined #ara16:08
openstackgerritDavid Moreau Simard proposed openstack/ara master: WIP: Fix logging  https://review.openstack.org/56006916:08
ara-slack<dmsimard> @logan.attwood ^ you can use that as a basis for printing things to log if you'd like.. need to flush ~/.ara/logging.yml (if it exists, the defaults were updated)16:08
ara-slack<dmsimard> and then logs are available in ~/.ara/ara.log16:08
ara-slack<logan.attwood> i uh, kinda prefer them to come to stdout on apache :slightly_smiling_face:16:09
dmsimardYeah that's okay, I'm using that to help me find the issue16:10
ara-slack<logan.attwood> I think the solution is going to be "don't use an ORM when fetching 50k rows"16:12
dmsimardlol16:13
dmsimardgive me a chance to take a stab at it, ironing this out would be great16:14
ara-slack<harlowja> @dmsimard no opinion; i personally don't like ORMs though, haha16:24
ara-slack<dmsimard> Didn't you write oslo.db ? T_T16:24
ara-slack<harlowja> nope, lol16:24
ara-slack<harlowja> oslo.db is just like a helper over sqlalchemy though (imho most of it's code should just be in sqlalchemy itself as like a helper module)16:25
ara-slack<harlowja> sqlachemy-core i think is ok, though idk, i haven't used it in a while16:26
ara-slack<harlowja> http://docs.sqlalchemy.org/en/latest/core/16:26
ara-slack<harlowja> i also just like regular SQL but ya, nice things can't always be had, lol16:28
ara-slack<harlowja> i just always have these weird nightmares about ORMs where u get a 33MB database that takes 6+GB ram :P16:40
ara-slack<harlowja> *alwayyyyys* lol16:40
ara-slack<harlowja> which in no world imho should take more than like 33MB * 10, lol16:41
ara-slack<harlowja> (cause the whole DB could just be in memory, lol)16:41
dmsimardyeah :/16:41
*** DrWaluigi has joined #ara16:51
*** tbielawa is now known as tbielawa|lunch17:07
ara-slack<harlowja> but it's ok, u live u learn :P17:17
*** mihai_ansible has joined #ara17:20
mihai_ansibledmsimard: hi, back for some minutes17:20
mihai_ansibledmsimard: as I was saying, not very good with virtuaenv17:20
mihai_ansibledmsimard: what I did, ran the ansible ara role against a centos 7.4 machine with the apache and the module enabled17:21
mihai_ansibledmsimard: have ansible on my mac laptop and I would like to send the playbook to the centos7 server17:21
mihai_ansibledmsimard: is not very clear what and how  do I need to configure n the laptop17:21
mihai_ansibledmsimard: tried pip install ara and succeded but the rest of the python instructions complain about missing setup module17:23
mihai_ansibledmsimard: maybe there is a simpler way?17:23
*** mihai_ansible has quit IRC17:27
*** sshnaidm is now known as sshnaidm|bbl17:27
*** openstackgerrit has quit IRC17:34
*** tbielawa|lunch is now known as tbielawa|appt17:43
*** gvincent has quit IRC17:51
ara-slack<harlowja> @dmsimard so what patches should i be trying?18:25
ara-slack<harlowja> i've got some time to try some stuff18:25
ara-slack<harlowja> in between other things :P18:25
*** harlowja has joined #ara18:25
ara-slack<dmsimard> Nothing for now, @logan.attwood tried it and it still needs some work. I'm trying something and I'll report back if it works.18:29
ara-slack<logan.attwood> i'm thinking you need eager loading, which means not using `yield_per`18:34
ara-slack<logan.attwood> which means server side pagination18:34
dmsimardyeah that's what I'm working on18:41
dmsimardjust need to get the javascript datatable madness to work with it18:41
ara-slack<logan.attwood> <318:42
ara-slack<logan.attwood> oh damn. thanks to some ansible failures I got some smaller result runs18:42
dmsimardjavascript sucks18:42
ara-slack<logan.attwood> 8k tasks is 3.8MB of json :,)18:42
ara-slack<logan.attwood> so extrapolating 8k to 50k18:42
ara-slack<logan.attwood> almost a 24MB blob18:43
ara-slack<logan.attwood> ahaha18:43
*** sshnaidm|bbl is now known as sshnaidm18:48
*** gvincent has joined #ara18:49
dmsimardhmmm19:01
dmsimardcome to think of it19:01
dmsimardthis is more complicated than I thought19:02
dmsimardbecause the search field is executed and rendered client side, if we don't push all the data it won't be able to search19:02
dmsimardbleh19:02
*** tbielawa|appt is now known as tbielawa19:15
dmsimardthe fact that there's entire python modules dedicated to doing what I'm trying to do is kind of depressing19:29
ara-slack<logan.attwood> seems pretty simple https://stackoverflow.com/a/4310486819:54
ara-slackAction: logan.attwood ducks19:54
ara-slack<logan.attwood> the search does get tricky though19:54
dmsimardWe already have pagination like that19:56
dmsimardIt's not a fancy dynamic javascript thing though19:56
dmsimardhttps://github.com/openstack/ara/blob/master/ara/views/reports.py#L54-L5919:57
dmsimardhttps://github.com/openstack/ara/blob/master/ara/templates/report_list.html#L22-L4619:57
dmsimardDoing a pagination like that would not allow for things like client-side searching, filtering and sorting19:57
dmsimardThere are plenty of fancy javascript things I'm sure we'd be able to do to get datatables to poke a paginated endpoint but I am not a javascript person :(19:58
dmsimardLooked at different options but none of them appear to be appropriate, maintained or actually work19:58
dmsimardi.e, https://pypi.python.org/pypi/sqlalchemy-datatables/19:59
dmsimardor https://datatables.net/examples/server_side/pipeline.html19:59
dmsimardIf you search about datatables and server-side pagination, it's a seemingly endless void of stackoverflow and datatables forums questions20:00
*** tbielawa is now known as tbielawa|brb20:00
*** gvincent has quit IRC20:21
*** gvincent has joined #ara20:29
*** gvincent has quit IRC20:53
*** tbielawa|brb is now known as tbielawa21:03
*** jrist has quit IRC21:14
*** jrist has joined #ara21:41
ara-slack<dmsimard> @logan.attwood, @harlowja I tried a bunch of different things today and I know what the problem is but I can't find a reasonable solution that is not 1.0 (or 2.0)21:53
harlowjait's al good21:53
ara-slack<dmsimard> The best I can do for the time being is the yield_per patch which at least limits the RAM spikes but has a performance impact for larger runs21:53
ara-slack<dmsimard> I've learned a lot from this though and we'll definitely put this into application in 1.0/2.0 where we're allowed to break backwards compat21:54
ara-slack<logan.attwood> :( thanks for digging in21:55
ara-slack<dmsimard> If you folks know anyone who would like to dig into this further, I'd be happy to look at a patch that doesn't involve refactoring everything (because that's what we're already doing in the future release with the API and etc)21:57
ara-slack<dmsimard> For the time being this admittedly exceeds my skills, I'm more of a sysadmin than a dev :S21:57
dmsimardI'll chat with gvincent (who's actually good) tomorrow to make sure we get this right, he's helping with 2.021:58
ara-slack<harlowja> wfm22:01
*** openstackgerrit has joined #ara22:03
openstackgerritDavid Moreau Simard proposed openstack/ara master: Do not merge: profiler implementation  https://review.openstack.org/56016622:03
dmsimard^ Just an example memory profiler implementation which provides an output like this: paste.openstack.org/show/718864/22:04
dmsimardhttp://paste.openstack.org/show/718864/ *22:04
*** spiette has quit IRC22:57

Generated by irclog2html.py 2.15.3 by Marius Gedminas - find it at mg.pov.lt!