Tuesday, 2017-03-28

*** VW has joined #craton03:00
*** Tamayo has quit IRC03:32
openstackgerritMerged openstack/craton master: Adding wrapper functions to tools  https://review.openstack.org/44923004:51
openstackgerritMerged openstack/craton master: Ensure JSON responses result from failure  https://review.openstack.org/44758004:51
jimbakerantonym, read only users, yes. you can see some of the ideation here: https://blueprints.launchpad.net/craton/+spec/craton-rbac-support04:56
jimbakerbut in essence, the basic CRUD ops will be split out as potential roles04:56
jimbakerwith any level of granularity on a given resourfce04:56
*** acabot has quit IRC08:11
*** VW has quit IRC10:54
*** VW has joined #craton10:54
*** openstackgerrit has quit IRC11:33
*** VW has quit IRC12:50
*** VW has joined #craton12:50
*** VW has quit IRC13:08
thomasemo/13:28
suloo/13:30
fsaadmorning guys13:37
*** VW has joined #craton13:39
git-harrysulo: what's going on with those client patches you have in progress? I seem to remember them being mentioned in yesterday's meeting. Do you need any assistance?14:01
thomasemThanks for the feedback on the JSON Path patch, folks. Going to fix that up.14:06
sulogit-harry: ill fix them up sometime this week14:07
thomasemsulo: I was planning to add documentation in a patch following this one. Do you feel strongly that it ought to be in this patch?14:07
sulothomasem: cool, na its good14:07
thomasemSince this is already a good 700+ line change, I was hoping not to bloat the review with docs stuff, too.14:07
thomasemOkay, cool14:07
suloif you already had that in mind, i am fine.14:07
sulodoing it separately14:08
thomasemAwesome. Thanks!14:08
anonymikeo/14:09
thomasemgit-harry: hmmm, it looks like jsonpath-rw is printing an invalid path... $.bar.[*]14:10
*** Tamayo has joined #craton14:10
thomasemtest = jspath.parse('foo.bar[*]')14:10
thomasemWhen it sets the Fields object containing 'foo' to Root(), it winds up causing the array Slice to be sectioned off as a member.14:11
thomasemhttps://gist.github.com/thomasem/42c40d95b9a8f214cf98a9057bf14e9e14:12
thomasemSo, that's going to cause some trouble if it's doing that.14:12
thomasemHeh, it's incorrect to begin with:14:13
thomasemIn [13]: str(test)14:13
thomasemOut[13]: 'foo.bar.[*]'14:13
thomasemtest = jspath.parse('foo.bar[*]')14:13
git-harrythomasem: Are you saying "foo.bar.[*]" != "foo.bar[*]"?14:16
thomasemThat's correct. At least MySQL doesn't like it.14:16
thomasemIt may be the same from a specification perspective (though I'm not wild about the dual meaning), but MySQL definitely doesn't like it.14:17
git-harrythomasem: yeah, the docs say they're equivalent https://github.com/kennknowles/python-jsonpath-rw#jsonpath-syntax14:18
thomasemSo, I think the implementation I already have is going to be the most successful here. Though, I do not like it much either. The alternative being massaging what's produced by jsonpath-rw every time an array is involved to make it into something MySQL likes.14:18
git-harrythomasem: this would also need to be documented because any user's will get an error even though it looks valid14:21
thomasemThat's okay. I'm planning to specify the subset of JSON Path that is supported.14:21
thomasemin the documentation14:21
thomasemSince MySQL only supports https://dev.mysql.com/doc/refman/5.7/en/json-path-syntax.html14:21
thomasemAnd because jsonpath-rw doesn't support the double-asterisk, I have to drop that, too.14:22
thomasemMySQL 5.7, I should say. I can't speak to the latest.14:22
* thomasem sighs14:23
thomasemLeast common denominator here, I'm afraid.14:23
*** VW_ has joined #craton14:30
*** VW_ has quit IRC14:31
*** VW_ has joined #craton14:31
thomasemfwiw, the most common way to specify arrays is to just add the slice/index specification right after the key, and not to add a period. At least that's what I've seen over the past week digging around.14:32
thomasemThat jsonpath-rw is printing it always with a period before it is a bit weird to me.14:33
*** VW has quit IRC14:34
git-harryI suspect there will be lots of fun edge cases causing all sorts of pain from these differences.14:35
thomasemYeah. It makes one wonder if we ought to drop the feature altogether for.. Elasticsearch. :D14:36
thomasemThe subset of support in MySQL coupled with some fun idiosyncracies...14:36
thomasemNot to mention how MySQL actually supports something that it appears jsonpath-rw does not - the double asterisk.14:37
thomasemI'm hoping I covered at least the 80% case, though.14:37
*** openstackgerrit has joined #craton14:38
thomasemPushed an update https://review.openstack.org/#/c/443941/3014:39
thomasemAhhhh, interesting. I guess openstackgerrit was out. I wonder if it logged back in as a result of my patch, but didn't go on to push the notification. Sounds like a bug.14:39
openstackgerritThomas Maddox proposed openstack/craton master: JSON Path-like querying for variables  https://review.openstack.org/44394114:42
thomasemThere it goes14:42
openstackgerritThomas Maddox proposed openstack/craton master: JSON Path-like querying for variables  https://review.openstack.org/44394114:43
thomasemI'm sorry!14:43
jimbakerthomasem, makes sense. when i was first looking at pulling jsonpath-rw into a related bit of work, my biggest concern was the possibility of two separate implementations with slightly different support14:44
jimbakerthis appears to be the case14:45
jimbakermuch like different regex implementations etc14:45
thomasemYep. Everyone's got their own flavor and we're the suckers that have to glue it together.14:47
thomasem:P14:47
anonymikelol :/14:47
jimbakerright, sorry about that. perhaps we are pushing the boundaries of sql + json at this time. certainly *mysql* + json :)14:48
jimbakeranonymike, were you able to make progress on using the python client and the ES bulk api?14:49
jimbakerpython client for craton14:49
jimbakeranonymike, also thanks for the work on the wrappers, glad to see that merged in!14:50
anonymikeNot much, I totally  switched to  working on the fields  bug. I have the docker compose stuff to get craton and two elastic nodes built14:50
anonymikeand a script to pull things down from craton after populating with fake data14:50
anonymikeI was writing the piece to send it to elastic search when we had our meeting yesterday14:51
jimbakeranonymike, cool. we can share in a (throwaway) github repo14:51
anonymikeSounds good14:52
jimbakerbut the fields stuff is the most important of the work that was not in progress on monday, so right prioritization14:52
jimbakerhopefully pretty clear what it looks like in the client14:52
jimbakerre valid json path selectors, i don't know how much we can borrow from thomasem's recent changes to his patch here14:53
anonymikeCool :) I'm trying to get more familiar with everything so these tasks don't take so long lol14:53
anonymikeyeah I was going to hold off on that for a while14:53
jimbakerso basic field selector support, then look at json path selectors support? sounds workable14:54
jimbakercould divide into two patches that way too14:54
anonymikeGreat14:54
jimbakeranonymike, also earlier thomasem and i were thinking about this in terms of regexes14:56
anonymikethe fields path?14:57
*** VW_ has quit IRC14:57
anonymikeer fields filter14:57
jimbakeragainst the keys. it is quite possible that both forms are valid14:57
*** VW has joined #craton14:57
jimbakeranonymike, most of the value of the jsonpath is filtering on values after all14:58
jimbakerso it's a very good reason not to get too caught up in a specific implementation choice14:58
anonymikeright14:59
jimbakeris all i'm pointing out. so breaking this out is highly valid. hopefully no confusion here on the choices we need to look at14:59
jimbakerat the end of the day, that's why the specific data requirements from bjoern are so useful15:00
anonymikeNope, I don't think so. I'll get something out that filters out top level keys in the json response and hold off on nested keys... correct?15:01
jimbakeranonymike, +115:01
thomasemWould appreciate another quick round of reviews when folks have a chance https://review.openstack.org/#/c/443941/3115:08
thomasemoop: https://review.openstack.org/#/c/443941/3215:08
thomasem#32 :)15:08
jimbakerthomasem, plan to do so15:10
thomasemHuzzah15:12
*** VW has quit IRC15:22
*** VW has joined #craton15:23
thomasemfsaad: Are we still using https://etherpad.openstack.org/p/craton-sprint-planning for planning, or are we going elsewhere?15:34
thomasemjimbaker: ^^15:34
fsaadI think we agreed last time on using craton-meetings?15:34
thomasemCool15:34
jimbaker+1. certainly feel free to pull in from that etherpad of course15:35
fsaadon that note, please self drive as I may not make it in time due to a meeting reschedule that will overlap15:35
jimbakerlots of useful info15:35
fsaadI'm going to follow up with y'all right after though.15:35
thomasemI know we had agreed that when we're on StoryBoard we're just going to share that and use it for this.15:35
thomasemInstead of etherpads15:35
thomasemBasically prioritizing a pre-existing backlog15:36
* thomasem can't wait15:36
openstackgerritThomas Maddox proposed openstack/craton master: JSON Path-like querying for variables  https://review.openstack.org/44394115:37
thomasemRebased15:37
*** klindgren_ has joined #craton15:37
*** klindgren has quit IRC15:38
openstackgerritThomas Maddox proposed openstack/craton master: Add documentation for JSON Path-like variable searching  https://review.openstack.org/45086115:39
anonymikeoh yeah, are we still next in line for migration to storyboard?15:42
anonymikethat seems to take a while15:42
jimbakerthomasem, see my comment re something like craton-get v1/devices?vars=bar.baz:4715:43
jimbakerlet's work on this in a separate bug15:43
jimbakerbut i don't like forever bugs15:43
jimbakerconfused phrasing15:44
thomasemWait, did you see something wrong with integer values?15:44
jimbakershould have stated: let's work on this in a separate bug, because i don't like forever bugs15:44
jimbakerno, it's the devices endpoint15:44
jimbakerintegers, etc, work just fine15:44
thomasemOh! Yeah. That's definitely a separate bug. Should be a one-liner.15:45
thomasemWell... more like 2 or 3, but yeah.15:45
jimbakeryeah. plus some testing15:45
thomasemI'm writing up the bug now.15:45
jimbakerso let's just treat separately15:45
thomasemYeah, and I can just add the test class for the other stuff.15:45
thomasemSince it's generic15:45
jimbakerthanks!15:45
thomasemcool15:45
jimbakeranonymike, i did talk with kendall nelson yesterday, and we are in the next batch15:46
jimbakerre storyboard15:46
jimbakerso soonish15:46
anonymike:)15:46
anonymikeso I've since moved on and just started working in the directory, but I cannot get they pythonclient to install system wide15:47
jimbakergiven how the migration works, should be fine. we just need to cut over to the new ui from launchpad when we are ready. so nothing we need to do15:47
anonymikethe*15:47
jimbakerin the meantime15:47
thomasemhttps://bugs.launchpad.net/craton/+bug/167693215:47
openstackLaunchpad bug 1676932 in craton "Devices endpoint does not support filtering by variables" [Undecided,New]15:47
jimbakerthomasem, can you look across the board at what devices does and does not support in that bug?15:48
jimbakeranother reason why i wanted the split to be honest...15:48
jimbakeractually whoever works on that bug should do that. it might be thomasem ...15:48
thomasemjimbaker: updated15:48
thomasem"Also, let's audit what all's missing from /v1/devices compared to /v1/hosts and address here."15:49
thomasemI'd like to get the JSON Path docs out first, personally.15:49
thomasemThen work on that.15:49
thomasemI want to be pretty explicit in docs, including identifying limitations of the feature.15:49
thomasemSo, want to spend some time on it.15:50
git-harryI'd rather see the more general problem addressed that just adding vars support to devices15:50
thomasemWe can, of course, do a separate task from this to simply audit what the differences are and issue bugs for them.15:50
thomasemIf there are any others.15:50
git-harrythomasem: I guess what I'm saying is that shouldn't be necessary. The model should be more all or nothing similar to how the variables endpoint is handled.15:51
thomasemjimbaker: Thinking about it... what do you mean "look across the board"?15:56
thomasemWhat sorts of things are you suspecting aren't supported?15:56
*** VW has quit IRC15:58
jimbakerthomasem, umm, well when something basic is missing like var search, i get worried, that's all15:58
jimbakerand in terms of prioritization, obviously the jsonpath needs to be done. that's why i asked we do this in a separate bug :)15:58
jimbakertime for that meeting15:59
anonymikevidyo crashed :( restarting16:03
*** VW has joined #craton16:04
*** VW_ has joined #craton16:58
*** VW__ has joined #craton17:01
*** VW_ has quit IRC17:01
*** VW has quit IRC17:02
jimbakergit-harry, sulo, anything you want to add to https://review.openstack.org/#/c/443941/ ? i believe thomasem has addressed your concerns and this patch is ready to be added to master17:02
anonymikejimbaker thomasem: why do we want the fields args comma separated instead of space separated like the current implementation18:31
anonymikeI implemented the solution to handle both cases that Ian suggested, but I'm curious why spaces wouldn't work18:32
anonymikehttps://bugs.launchpad.net/python-cratonclient/+bug/1675410  for reference18:32
openstackLaunchpad bug 1675410 in Craton's Python Client "Add fields selector to <resource>-show commands" [Critical,New] - Assigned to Michael Porras (mporras6856)18:32
jimbakeranonymike, i think we should support something like18:35
jimbakercraton host-show --fields=spec1,spec2 --fields=spec318:36
jimbakerbut certainly open to other suggestions18:37
anonymikehmm okay... That'd be just like doing   craton host-show --fields=spec1,spec2,spec3?18:37
jimbakeranonymike, yes18:37
anonymikeokay18:37
anonymikenot a cli wizard but is that standard?  repeating flags in a command?18:38
jimbakeranonymike, yes, fairly typical18:38
anonymikeinteresting18:38
jimbakernot certain for openstack CLIs18:39
anonymikecool I'll do that. thanks for the clarification18:39
jimbakerbut argparse has good support for this18:39
jimbakeranonymike, see the append action - https://docs.python.org/3.5/library/argparse.html#action18:42
jimbakerfor comma separation, we have to do the flattening ourselves, i don't believe argparse has specific support here18:43
anonymikeYeah, I used the link Ian provided18:43
jimbakerthe only liability in fact with comma separation is if the field spec has a comma in it. then it becomes a mess :)18:44
jimbakerin terms of any parsing18:44
anonymikewould that ever be the case? :/18:44
jimbakerwell, we did say key could be any valid unicode...18:46
jimbakervs just a python identifier, which could still use unicode18:46
jimbakerit does come up. basically anytime you think that someone does only X, they actually do a bit more than that18:47
jimbakerand then just standard stuff. such as having names being drawn from other sources than ascii. so a recent bug in monasca because it could not support instances with chinese names18:48
thomasemI think --fields has to be the last option if it's space delimited.18:48
thomasemAlso, spaces in paths or JSON strings could cause some trouble.18:49
jimbakerwell if it's space delimited, usually it's passed in like so18:49
jimbaker--fields "baz bar foo"18:49
jimbakerso the shell can give it to you as one arg18:49
thomasemGotcha18:49
thomasemWell, going with commas is more in-line with what the API supports, too.18:49
thomasemspace separate feels a bit clunky, but maybe that's just me.18:50
thomasemseparated*18:50
jimbakeryeah. as usual, i like to raise questions18:50
thomasemFor example18:50
jimbakercomma separated is so much more convenient. unless it doesn't work18:50
jimbakerthomasem, but i think the better answer is as follows18:50
jimbakerif you have a comma in the field name, you will have to use the alternative json spec version we have talked about18:51
anonymikecan I change it to JUST comma separated and not worry about space18:51
jimbakeranonymike, yeah, i think that's fine18:51
anonymikecool18:51
jimbakerbecause having a space in the name is surely the more common thing to see18:51
anonymikeagreed18:51
thomasemThat may be a bug with the existing implementation, actually in Craton API.18:52
jimbakercorner cases!18:52
jimbakerwhen we will ever get rid of them??? ;)18:52
thomasemhttps://github.com/openstack/craton/blob/12b31e49ac1e9fe135497d59f3f2a67b5c1bcafc/craton/db/sqlalchemy/api.py#L26818:52
thomasemWhen we specify the valid characters? :D18:53
thomasemand validate18:53
jimbakerthomasem, hence my valid python identifiers musing...18:54
thomasemRight18:54
jimbakersomeone already did the specification, and there's even code we can use18:54
jimbakerperhaps a better way to do this is the following18:55
jimbakera valid python identifier can be used without quoting18:55
jimbakerif quoted, any valid unicode key can be used18:56
jimbakerso this is similar to how it's treated in sql18:56
jimbakeras it is, i doubt we really allow arbitrary keys with '=', ':', '.', ',' in them, at least not in every position. i don't know how jsonpath intersects with this in terms of key spec either18:58
jimbakerso another possible cleanup. not super critical, but out there18:59
thomasemHaven't really tried.19:00
*** VW has joined #craton19:01
*** VW has quit IRC19:03
*** VW__ has quit IRC19:04
*** VW has joined #craton19:04
*** VW has quit IRC19:41
*** VW has joined #craton19:42
*** VW_ has joined #craton20:15
*** VW_ has quit IRC20:16
*** VW_ has joined #craton20:16
*** VW has quit IRC20:18
openstackgerritThomas Maddox proposed openstack/craton master: Add documentation for JSON Path-like variable searching  https://review.openstack.org/45086120:49
*** VW has joined #craton20:58
*** VW has quit IRC20:58
*** VW has joined #craton20:59
*** VW_ has quit IRC21:01
anonymikewoo so I think I got --fields working with  host list/show  for both table and json..  Gonna go run, then apply to all the other shells and write some tests21:25
jimbakeranonymike, awesome stuff, thanks!21:27
*** VW_ has joined #craton21:30
*** VW has quit IRC21:30
*** VW_ has quit IRC21:35
*** VW has joined #craton21:35
openstackgerritThomas Maddox proposed openstack/craton master: Add documentation for JSON Path-like variable searching  https://review.openstack.org/45086121:41
openstackgerritThomas Maddox proposed openstack/craton master: Add documentation for JSON Path-like variable searching  https://review.openstack.org/45086121:48
thomasemAlright. Would appreciate feedback on that ^^21:50
thomasemJust some light documentation. We can, of course, go into further detail.21:51
openstackgerritThomas Maddox proposed openstack/craton master: Add documentation for JSON Path-like variable searching  https://review.openstack.org/45086121:51
thomasemAnyway, I'm outta here. Have a lovely evening/day!21:55
*** VW_ has joined #craton23:27
*** VW has quit IRC23:30
*** VW_ has quit IRC23:31

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