Friday, 2017-03-10

*** VW has quit IRC00:02
jimbakerthomasem, ok, sounds good00:03
jimbakerlooking forward to that conversation, and i will take a look at your code as well00:03
jimbakerbut in general the algorithm itself would not care, just need to resolve any leaf issues like this00:03
*** jovon has quit IRC00:22
*** VW has joined #craton01:32
*** valw has joined #craton03:18
*** valw has quit IRC03:40
*** zz_pwnall1337 is now known as pwnall133703:46
*** pwnall1337 is now known as zz_pwnall133705:34
openstackgerritJim Baker proposed openstack/craton master: WIP: Variable search for resources now uses resolved variables.  https://review.openstack.org/44092907:26
*** VW_ has joined #craton08:21
*** VW has quit IRC08:21
sulowhat was this openstack thing that we wanted to use as scrum board ?10:21
git-harrysulo: storyboard?10:24
sulogit-harry: thanks10:24
*** openstackgerrit has quit IRC10:33
*** VW_ has quit IRC13:13
*** VW has joined #craton13:13
*** valw has joined #craton14:18
*** valw has quit IRC14:23
*** valw has joined #craton14:41
*** valw_ has joined #craton14:58
*** valw has quit IRC15:00
thomasemHappy Friday, folks.15:28
*** Syed__ has joined #craton15:32
thomasemjimbaker: I think I figured out the problem I was having yesterday. :)15:40
thomasemI'm doing some manual testing, but would appreciate your thoughts when I throw it up in review.15:40
thomasemEssentially, I had to drop the initial matches dict since kv_pairs doesn't map exactly to the result of (variable.key, variable.value) anymore, since the key could be JSON path. So, instead, I build the matches as I got and ensure that len(set(kv_pairs)) == len(matches.keys()), to ensure there's a match for every one.15:42
thomasemThat way the intersection computation at the end won't just evaluate the matches that were found, but make sure it's an intersection according to all criteria that was passed in.15:43
thomasemAt least, that's how it works in my head. We shall see!15:43
thomasemFor the matches dict, I went with a string representation of the dict, so matches[(variable.key, str(variable.value))]. Thinking through whether that will be lossy in any fashion enough to cause a problem here.15:45
jimbakerthomasem, cool. just something to realize: i fixed up the var searching algorithm in the branch you are depending on15:48
jimbakerlet's discuss further15:48
jimbakeri did move to using "or" clauses, given that sqlite does not support "in" searches with tuples15:49
thomasemoi15:50
thomasemokay15:50
jimbakerbut there should be no performance impact here15:50
thomasemI mean, I did the same thing, because of the JSON column limitation there, too.15:50
jimbakeri understand15:50
jimbakerre the matches dict - it really should not matter what the "key" is15:50
jimbakerthe point is to collect the matches that are required for future intersection15:51
thomasemAs long as it's unique to the kv_pair? Because the goal appears to be ensuring matches for all kv_pairs that are passed in and then doing an intersection computation on the results15:51
jimbakerbut it sounds like the problem is that we cannot do an or clause15:51
thomasemWhere'd you get that from?15:52
jimbakerbecause the matched variables are used to populate the matches15:52
thomasemI'm able to do an or clause just fine15:52
jimbakerno, just thinking about the counting calculation you make. but maybe that works as well15:53
jimbakerthe or clause generation is not the interesting part. the interesting piece is determining the intersection15:54
jimbakerwith respect to resolution15:54
thomasemRight, and that was having snags because variable.value is now a dict15:54
thomasemcorrect15:54
thomasemvariable.value can now be a dict*15:55
thomasemI mean to say15:55
jimbakerbrb, need to transport kid15:55
thomasemk15:55
jimbakerback16:11
*** openstackgerrit has joined #craton16:17
openstackgerritThomas Maddox proposed openstack/craton master: JSON Path-like querying for variables  https://review.openstack.org/44394116:17
openstackgerritThomas Maddox proposed openstack/craton master: Move to MySQL 5.7 and SQLAlchemy>=1.1.0  https://review.openstack.org/44318616:17
jimbakerthomasem, taking a look16:20
thomasemjimbaker: cool, I noted a few shortcomings that I'm ideating around right now.16:21
thomasemlike properly handling 'true' vs. '"true"'16:21
thomasemand other non-string types16:21
thomasemBut, the string case appears to work fine now. :)16:22
thomasemI know it needs bracket support added16:22
jimbakerthomasem, yeah, we need to do it the right way16:22
thomasemLol, what is the right way? :P16:23
thomasem"right"16:23
jimbakersure. i like the CLI quoting that the http command does16:23
jimbakerbut the right way means, no lossiness16:23
jimbakerso "true" is distinguished from true, etc,16:23
thomasemYeah, that's the tricky part. I think I'm going to come up with a list of queries that I'd expect to work.16:23
thomasemRight16:23
jimbakerwe can expand on the right way. a lot16:24
jimbakerbut i think that's a good starting point :)16:24
*** valw_ has quit IRC16:24
thomasemOh, definitely. I just want a simple starting point that gives folks a way to query any type of value we're storing here.16:25
jimbakerthomasem, and one possibility is that true matches true and "true"16:25
thomasemthe leaves of it, at least.16:25
thomasemThat's the problem. One may want to store the literal "true"16:25
thomasemor the boolean true16:25
jimbakerunless stricter is desired16:25
jimbakerin the search16:25
jimbakerof course. it's json16:25
thomasemYep16:26
thomasemNow, to your point, the question may be "who cares?"16:26
thomasemChances are they just want the one that says "true", regardless of whether it's bool or string16:26
thomasemor ones that say*16:27
thomasemAnd trying to distinguish may be adding power that confuses more than helps16:27
thomasemAssuming that's what you were getting at. Don't want to put words in your mouth.16:28
thomasemOr hands, as the case may be.16:28
jimbakeryeah, my words are: let's match both the string and the non-string, if valid. but we have to count properly of course16:29
jimbakerso 3.14159 or "3.14159" etc16:29
thomasemHmmm, okay.16:30
jimbakeralthough maybe that also means using https://www.python.org/dev/peps/pep-0485/ - anyway, we will see if necessary16:31
thomasemAlright, so, then, why store as anything other than a string?16:32
jimbakerwe are not doing calculations, so my understanding is that json presumes a specific IEEE repr for floats16:32
jimbakerthomasem, because it's json16:32
jimbakeri think it's ok. it only comes up in what, a couple of places?16:33
jimbakeri think we are fine16:33
thomasemI mean, why do we do the value conversion if we're only ever going to query it as a string?16:33
thomasemTo me, the answer would be so we're not lossy.16:34
thomasemSo we can eventually move to distinguishing queries, if desired.16:34
thomasemWithout having to migrate the data16:34
openstackgerritMerged openstack/python-cratonclient master: Add testing plan to specifications  https://review.openstack.org/44210216:35
jimbakerok, with these thoughts to ruminate on16:35
jimbakerlet me look at your branch16:35
thomasemmmkay16:35
*** jimbaker has quit IRC16:39
thomasemOne way around this is to essentially make the API expect a JSON value in vars queries16:40
thomasemSo, you'd do like vars=neutron_l2_population:true,nova_console_type:"novnc",glance_default_store:"swift"16:41
thomasemvars=neutron_l2_population:true,nova_console_type:"novnc",glance_default_store:"swift",child-nested.bumbleywump.cucumberpatch:"haha"16:41
*** jimbaker has joined #craton16:42
*** jimbaker is now known as Guest6701016:42
*** Guest67010 is now known as jimbaker16:43
*** jimbaker has joined #craton16:43
*** ChanServ sets mode: +o jimbaker16:43
thomasemjimbaker: did you lose what I said?16:44
jimbakersorry bounced bouncer. will check log16:45
thomasemNo problemo16:45
jimbakerthomasem, so i think this is fine. i was just suggesting with my ref to httpie that we could have a special syntax for a string (or perhaps a non-strict string or non-string match)16:47
jimbakerbut this is more of a CLI problem in any event16:47
jimbakerthe rest api should be reasonably friendy16:47
jimbakerbut it need not be crazy either on our side16:47
jimbakermake sense? we are making it up as we go of course!16:47
jimbaker:)16:48
jimbakerbut i like the dotted notation on the key side, that looks nice16:48
thomasemI mean, I could write the logic to do the approximate equality and json.dumps when necessary, too. Just a matter of the UX we want. :) I'd really like to understand what the customers would want for this.16:50
thomasemDo they ever see themselves caring about the difference between 3 and "3" or true and "true"?16:50
thomasemIf not, we can make the API easier. If so, it's probably better to go the more strict route so they get EXACTLY what they asked for.16:51
thomasemCould also add a strict flag, but... I dunno. Feels like we're overcomplicating the situation at that point.16:52
*** logan_ has joined #craton16:56
*** logan_ is now known as Guest2958916:57
*** logan- has quit IRC16:59
*** Guest29589 is now known as logan-17:03
jimbakerthomasem, gave some thought to this17:12
jimbakerthomasem, gave some thought to this17:15
jimbakerlet's have a simple expression language, which is non strict for strings vs nonstrings, only supports , for conjunction17:15
jimbakerthis is the language we are working out right now. seems to be fine17:15
jimbakerthen we reserve the following for a future query expression language17:15
jimbakervars={....}17:15
jimbakerso curly braces indicates this reserved future expr lang17:15
jimbakerit will allow for full quoting, json paths, the use of & and | for conj and disj17:15
jimbakeretc17:15
jimbakerso someone could say vars={foo->json_path | bar:"foo" & "you-want-a-var-with-hyphens-sure-you-can-do-that": true}17:16
jimbakeror maybe "or" and "and"17:17
jimbakerof course all this would be url quoted, as expected17:17
thomasemAnd what portion of that do you feel falls in scope on this work I'm doing right now?17:18
jimbakervars={foo->json_path or bar:"foo" and "you-want-a-var-with-hyphens-sure-you-can-do-that": true}17:18
jimbakernone of this, except to possibly reserve {...}17:18
jimbaker:)17:18
thomasemOkay, so need a regex filter for our validators17:18
jimbakeri just want to limit scope now by pointing at this exciting new feature we may in the future develop :)17:18
thomasemRight. Yeah, I see nothing wrong with evolving this into something far more powerful.17:19
thomasemrather, I agree that it'd be nice. But, yeah, let's drive that with use-cases17:19
jimbakerthis also lets me off the hook on the vars should resolve or not17:19
jimbakerfor search17:19
thomasemHow do you mean?17:19
jimbakerbecause we can just push that into the future expr language17:19
jimbakerso let's just say, and i'm just making it up right now/brainstorming17:20
jimbakervars={foo=:bar and baz:42}17:21
jimbakerfoo= means do not resolve17:21
jimbakerbaz implies resolution17:22
jimbakeror maybe it is17:22
thomasemWait... why would we not want resolved by default?17:22
jimbakervars={foo:bar and baz^:42}17:22
jimbakerthomasem, my point entirely17:22
jimbakeri want to push out into the future expr lang how to indicate "i don't want it resolved, which should be done on a var usage by var usage basis btw"17:23
thomasemWhat? I'm interpreting what you're saying as: let's abandon https://review.openstack.org/#/c/440929/417:23
jimbakersometimes face to face is more effective :)17:23
jimbakerbut never17:23
jimbakerin terms of abandoning17:23
jimbaker(not never to "face to face" !!!)17:24
thomasemRight17:24
jimbaker(see ambiguity is everywhere. just got to get used to it online!)17:24
thomasemSo, for your patch https://review.openstack.org/#/c/440929/, you were going to add a way to tell it not to resolve?17:24
jimbakeri like not having to do something today that can be done tomorrow17:24
jimbakerthomasem, i was17:24
thomasembut now you're suggesting that part isn't necessary?17:24
jimbakernot anymore17:24
thomasemOkay, I think I gotcha now. Cool.17:25
thomasemOkay, A/C guy's here, so I may disappear unexpectedly.17:25
thomasemHooray for pre-summer maintenance.17:25
jimbakerexactly. it's the "I'll gladly pay you Tuesday for a hamburger today"17:25
jimbakerhopefully my roof guy shows up17:26
jimbakerit's been an excessively windy winter, and spring is almost here. got to get my battered roof fixed. (had roofer cancel multiple times, due to being too windy)17:26
thomasemDon't let the thing come off your house!17:27
thomasemI've seen Twister.17:27
thomasemWhy do I imagine this kludge of bent nails and bungie cords keeping it all together? :P17:27
jimbakerfortunately we are just west of the line where tornadoes can occur in colorado. literally just a few miles in fact17:27
thomasemOh man, that's good.17:28
jimbakerbut the flip side is, we live close enough to the mountains to get battered by winds coming off of them17:28
jimbakerso you win some, you lose some17:28
jimbakeranyway, supposedly i have hurricane resistant shingles, whatever that means. but installation is everything, and the builder just pumped out roofs when they were going through the subdivision dev17:29
jimbakerthat, and 100 mph winds, and stuff flies17:30
jimbakerso my wife, who is wfh today, informed me they have started the roof repair. (obviously not above me yet)17:33
jimbaker(i would hear the hammers)17:33
thomasemLol, I see17:59
thomasemWe never get winds like that hear... that's got to be crazy.17:59
thomasemAlright, implemented some JSON approximation that'll handle these values a bit better. :)18:02
thomasemvars=neutron_l2_population:true,test:"true",nova_console_type:novnc,child-nested.bumbleywump.cucumberpatch:"haha"'18:04
thomasemit'll handle novnc and "haha" the same way, just json.dumps(...) the novnc one.18:04
thomasemSo, basically, if you want the value as a string literal, you can wrap it in quotes. That way you can distinguish "true" from true or 1 from "1"18:05
thomasemfor example.18:05
openstackgerritThomas Maddox proposed openstack/craton master: JSON Path-like querying for variables  https://review.openstack.org/44394118:06
thomasemAlright, time to start messing with brackets18:07
thomasemWow, it appears to "just work"18:14
thomasemOkay, let me make this a bit more complicated18:14
sulohehe18:15
thomasemso root-level arrays bomb. Need to handle those.18:17
thomasemNaturally because of the way the first item in the path is actually the key_ in the data modedl.18:17
thomasemmodel*18:17
jimbakerthomasem, nice18:23
jimbakersulo, so what do you think of my proposal for a future expression language for queries? for now we just reserve vars={...} for it18:23
jimbakeror maybe it can be more like q={...}18:23
jimbakerhmmm, that might be much nicer18:24
jimbakeranother possibility is we have discussed elasticsearch (possibly through searchlight, although i'm not sure exactly what we get with searchlight)18:28
jimbakerthe q={} query might possibly work with elasticsearch, although it's unclear to me how we would teach it about var resolution18:29
jimbakerit does know about json docs however, https://www.elastic.co/guide/en/elasticsearch/reference/1.4/mapping-object-type.html18:29
thomasemYeah, i do have to wonder at what point it's better to offload that sort of concern.18:37
thomasemThere are other solutions with far more powerful query languages, and it'd be cumbersome for us to re-invent them.18:37
jimbakerso the point is, we can put in this escape valve to consider for later18:37
jimbakerhaving faceted, flexible search is a huge win18:37
thomasemYeah, however we wish to get it. I do think this nested query'ing capability will take care of a large portion of that use-case, though. At least the immediate one.18:38
jimbakerand it's easy enough to sync with elasticsearch. the only question is adding extras like resolution, etc, but i suspect we just denormalize as necessary18:38
jimbakerfor sure18:38
thomasemSo... apparently I run my A/C too much during the summer and my motor is probably going in the next 2 years.18:39
thomasemfor my outside unit.18:39
* thomasem sighs18:39
thomasemThe list of lessons learned from buying this house is enormous.18:39
thomasemGut reaction is just build my own, but of course that has its own problems.18:40
tojuvoneEvening deeper level of the continent or how it is described18:45
openstackgerritThomas Maddox proposed openstack/craton master: JSON Path-like querying for variables  https://review.openstack.org/44394119:19
thomasemAlrighty I can now specify paths to any of these values: {"foo": [1,2,true,"true",{"dangling": "doc"}]}19:24
thomasemand get back the hosts that match19:24
thomasemlike vars=foo[*]:1 or vars=foo[2]:true or vars=foo[*].dangling:doc19:25
thomasemOh dear... found a bug19:28
thomasemNeed to be able to support multiples like vars=foo[3]:true,foo[*].dangling:doc19:28
thomasemwhere it returns the same variable to match each.19:28
thomasemThat's where simply counting and comparing lengths won't work.19:29
openstackgerritMerged openstack/craton master: Add http_codes decorator where missing  https://review.openstack.org/44356519:43
openstackgerritMerged openstack/craton master: Validate parent_id is neither id nor a descendant  https://review.openstack.org/44356619:43
jimbakeri have reached out to diablo rojo (kendall nelson), and we should be next in line to move to storyboard, after monasca and refstack. so in a couple of weeks20:02
jimbakerhowever they have the process automated so that it will load up the launchpad bugs/blueprints and put into storyboard. so we just need to cut over at the right time, and it should be good20:02
jimbakernote that storyboard has ubuntu login integration, so it should just transfer over in terms of being able to use existing creds20:05
thomasemOh, there's a line?20:11
thomasemSo, I guess we can't move to it next week, then.20:12
jimbakerthomasem, nope20:13
jimbakerbut it's ok, because we can continue to use LP, and it will transfer over. so that's actually even better - no manual work on our part20:14
jimbakeri'm sure adjustments will need to be made. and more tagging.20:14
thomasemIdeally! Depending on how that all maps. :P20:14
thomasemYep20:14
jimbakeryeah, but raw text is pretty good already20:14
thomasemk20:14
jimbakerand it sounds like that they do better than that20:15
jimbakerwe shall see20:15
thomasemExcellent20:17
thomasemhuzzah, unicode support21:01
thomasemhttp 'http://127.0.0.1:8080/v1/hosts?details=all&vars=schön[*]:schön'21:01
thomasemworks21:01
thomasemBoy time flies when you're ideating a million nuances.21:16
jimbakernice! and yes it does21:21
thomasemjimbaker: I'm about to push a rebased revision of your patch up21:25
jimbakerthomasem, you beat me to it. sounds good, please go ahead21:25
openstackgerritThomas Maddox proposed openstack/craton master: JSON Path-like querying for variables  https://review.openstack.org/44394121:25
openstackgerritThomas Maddox proposed openstack/craton master: Move to MySQL 5.7 and SQLAlchemy>=1.1.0  https://review.openstack.org/44318621:25
openstackgerritThomas Maddox proposed openstack/craton master: WIP: Variable search for resources now uses resolved variables.  https://review.openstack.org/44092921:25
jimbakerit is the most minor rebasing21:25
thomasemYeah, just some displaced tests21:26
thomasem:P21:26
jimbakerneed to get back & add some more in fact21:26
jimbakerok, will do that now21:26
jimbakerbrb21:26
thomasemAgh, sorry Syed__. I lost track of time. :\21:28
thomasemThis needs +2 https://review.openstack.org/#/c/443170/21:53
thomasemand workflow21:53
thomasemCould we get eyes on it so we can move forward with the Alembic changes, too?21:54
thomasemSince that makes some of the Alembic changes unnecessary21:54
thomasemHere's an updated deploy script https://gist.github.com/jimbaker/e74a7b98bc60519033fd455a22163ad2#gistcomment-202397921:56
thomasemif you'd like to pull it down and check it out21:56
thomasemTime for me to run. Have a lovely weekend, everyone!22:08
jimbakerthomasem, i will review22:42
jimbakeralso i'm going to fix up your json path patch22:42
jimbakerhave a good one!22:42

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