/srv/irclogs.ubuntu.com/2016/09/09/#juju.txt

=== alexisb is now known as alexisb-afk
=== karlthane_ is now known as karlthane
=== natefinch-afk is now known as natefinch
magicaltroutanyone around who can provide some interface writing support07:43
magicaltroutor are you all in Pasadena?07:43
magicaltroutbabbageclunk: fancy explaining some interface stuff that is clearly very simple but my brain can't process?09:08
babbageclunkum, I'll have a go! Not very familiar with those bits myself yet.09:09
magicaltroutlol09:09
magicaltroutwell you're my only hope... no pressure09:09
* babbageclunk girds loins09:09
magicaltroutanyway my idea is pretty simple... I want to create a generic JDBC interface because a bunch of services provide JDBC connections and apps like Saiku can consume JDBC connection info09:10
babbageclunkok09:10
magicaltroutand all jdbc connections are basically the same, username, password, class and url09:10
babbageclunksure09:10
magicaltroutso...09:10
magicaltrouthttp://pastebin.com/Ewpg03nM ignore the fact this is mid munging from another interface I wrote09:11
magicaltroutI want to write the provides side of the interface09:11
magicaltroutand my idea is the charm, be it, mysql, drill, postgres etc would provide a connection string and other metadata09:11
magicaltroutbut where I'm struggling is in my understanding of charms <-> interfaces09:11
magicaltrouthow do I tell my interface to look up a variable from my providing charm?09:12
magicaltroutthe only interface stuff I've done so far has been to get unit info etc09:12
babbageclunkSorry, this is all new to me. So you'd subclass this to make a relation?09:14
magicaltrouthehe, well my idea was (I don't know if this is possible which I guess is half the issue), charm x provides jdbc url, password, username etc09:14
magicaltroutgeneric jdbc layer can look up those standard variables09:14
magicaltroutsorry s/layer/interface09:14
magicaltroutand pas them to implementing app to inject into a jdbc connection09:15
magicaltroutthat way, for a bunch of jdbc providing charms there could be one standard jdbc interface that all apps could consume without hacking around the data provided over the wire in the implementing charm itself09:15
babbageclunkBut is there a lifecycle step where an interface can get customised, or is it just looked up directly from some registry?09:16
magicaltroutI don't think (feel free to prove me wrong) it needs much customisation.09:17
magicaltroutso it would just look up stuff from the providing charm09:17
magicaltrouti shall draw a picture! :)09:17
* magicaltrout cracks out google drawings09:17
* babbageclunk reads some docs - this is probably a good time to learn about interfaces.09:21
magicaltrouthere you go babbageclunk09:21
magicaltrouthttps://ibin.co/2uSum2mXgYHo.png09:21
magicaltroutcurrently most interfaces are specific to an app... interface:mysql etc09:21
magicaltroutbut why not make a generic one that passes over specific variables from the providing charm?09:21
magicaltroutthat way requiring charm developers don't need to look up loads of metadata or hop through chopping up unit information09:22
magicaltroutbecause the providing charm (the folks that know what the jdbc stuff should look like) have done it for them09:22
magicaltroutthen "any jdbc compatible application" can then grok the incoming charm connection and use the metadata over the wire09:23
babbageclunkThat makes sense to me. How do the app-specific interfaces get the username/password/etc info they need to convey to the requires-side of the relation?09:23
babbageclunkWouldn't yours work in the same way?09:24
magicaltrouthold on I'll show you what I currently do09:24
magicaltrouthttps://gist.github.com/buggtb/7e04a90922673312ebc6ca62f57fe46409:25
magicaltroutso thats on the jdbc application side09:26
magicaltroutbut this is basically where my knowledge falls down because in the mysql layer for example: https://github.com/johnsca/juju-relation-mysql/blob/master/requires.py09:27
magicaltroutself.host() etc09:27
magicaltrouthttps://github.com/johnsca/juju-relation-mysql/blob/master/provides.py on the provides side coming from mysql09:27
magicaltroutI dont' see how the host, port etc get set09:27
magicaltroutwhich confuses the hell out of me :)09:28
babbageclunkReading...09:28
babbageclunkSo they get passed into provide_database - where does that get called?09:29
magicaltroutexactly! :)09:29
babbageclunkD'oh09:29
magicaltroutwell09:31
babbageclunkStarting simply, it's easy to see how you could make one charm that could require all of mysql, psql, drill, etc.09:31
babbageclunkAnd then provide generic jdbc09:31
babbageclunk(Hmm, actually I might be confused about that but it seems possible, right?)09:32
magicaltroutwell my Saiku charm for example, could then require jdbc in metadata.yaml09:33
magicaltroutwhich would then accept connections from jdbc providing charms09:33
magicaltroutso yeah that seems like its possible09:33
magicaltroutand on the consuming/requiring end it should reduce complexity and repetition09:34
magicaltroutand people wonder why i get annoyed with interfaces, cory is like the bloody interface wizard, but it makes it hard for everyone else ;)09:35
babbageclunkRight. Then the question would be could you do that in a layer so that any charm that provides one of them also privides jdbc?09:35
magicaltroutokay to retort, why would I need a layer instead of an interface?09:37
babbageclunkI think I mean an interface layer - is that a thing?09:37
magicaltroutlol09:37
magicaltroutinterface or layer. Layers allow you to reuse existing layered charms09:38
magicaltroutcharm inheritance09:38
magicaltroutinterfaces are the stuff that allow the hooks to fire09:38
babbageclunkRight, but I was reading this: https://jujucharms.com/docs/2.0/developer-layers-interfaces09:38
magicaltroutso the question would be: could you do that in an *interface* so that any charm that provides the interface can support jdbc connections09:39
babbageclunkOr rather, could you make a layer that would provide a generic interface so that the charm just provides a specific one, and includes the interface layer to magically support the generic one.09:40
magicaltroutwell you'd just upgrade the charms to provide interface:jdbc and set some stuff09:41
babbageclunkWhich was the bit you were asking. Sorry!09:41
magicaltroutI write the Drill charm so my plan is to test it there then if it works, submit some PR's to mysql/postgres etc09:41
magicaltroutI think its something to do with self.conversation()09:43
babbageclunkWell, conversation is the bit that pushes the connection details to the requires side.09:44
babbageclunkI think09:44
magicaltrouthttps://github.com/johnsca/interface-mapred-slave/blob/master/provides.py here's another one of cory's09:44
magicaltroutconv.get_local etc09:44
magicaltroutsooo09:46
magicaltrouthow do I set something on the conversation I guess09:49
magicaltroutor how does it magically appear09:49
babbageclunkThat's a weird one though - since it's a map reduce slave even though it's a provides interface it's getting data from the conversation and storing it. I think if you look at the requires side you'll see something equivalent to the provide_database call.09:50
magicaltroutyeah so on the requires side I need a method like09:51
magicaltroutdef get_jdbc():09:51
magicaltroutwhich does conv.get_remote()09:51
magicaltroutor something09:51
babbageclunkHang on, just looking at the other DB relations09:53
magicaltroutand thats part of the annoyance on that charm the only get_remote is getting the private-address09:53
magicaltroutta09:53
babbageclunkHave you got a locally built version of the mysql charm?10:05
magicaltrouti have a zip bundle download10:05
magicaltroutits not reactive so I guess that counts10:05
babbageclunkYou should be able to find the place that calls provide_database in the code?10:06
magicaltroutyou'll like this10:06
magicaltroutbugg@tom-laptop2:/tmp/charm$ grep -R provide_database .10:06
magicaltroutbugg@tom-laptop2:/tmp/charm$10:06
babbageclunktypical10:06
magicaltroutlol10:07
magicaltrouttold you10:07
magicaltroutthis stuff cory writes is more often than not... magic10:07
babbageclunkhttps://github.com/johnsca/juju-relation-mysql/blob/master/docs/source/provides.rst10:07
magicaltroutah10:08
magicaltroutso.....10:08
magicaltrouton the provides side in drill I need to decorate some method10:08
babbageclunkIf something's using that code to provide mysql, somewhere it's calling provide_database (with all the info you need to make the jdbc conn details).10:09
magicaltroutto detect the connection and set the variables in a provides interface method call10:09
babbageclunkYeah10:09
magicaltroutwoop10:09
magicaltroutbabbageclunk: you code grepping genius10:09
babbageclunkSorry, I'm a bit slow today!10:09
magicaltrouthehe, this stuff really messes with my head, then you think you're on to something and find some weird bash script at the other end etc10:10
magicaltroutI don't write python well at the best of times, finding out how charms interact melts my mind10:10
babbageclunkYou're right it's confusing - the config information flow in the relations isn't always from provides to requires. But I think in the case of things like DB connections it will be.10:10
magicaltroutmarvelous... with this mystery half solved i'll try and implement something in drill and see what happens10:11
magicaltrouti reckon an interface with, jdbcurl, username, password, class and a place for "extra stuff" to live10:11
magicaltroutwould offer enough genericisim hopefully the interface setup allows it to work how I imagine :)10:12
babbageclunkThat sounds neat10:12
babbageclunkok, great! Now I need to work out why DHCP is MIA in my MAAS10:13
magicaltroutlol10:13
magicaltroutunlucky10:13
magicaltroutI did see some stuff when I was messing with virtualbox the other day where DHCP just refused to start if you didn't set a dynamic dhcp address pool10:13
magicaltroutthats about the depth of my MAAS knowledge10:13
autonomouseHi, I was hoping for a bit of advice, if anyone is available. I have a reactive charm and an old-style charm, and I'd like to pass some information between them. e.g. url, username and apikey from a django service to something that needs to use that service. With the newer reactive charms, I believe I am supposed to set up an interface to do this. Can anyone tell me if the old-style charm can use this interface, and if11:24
autonomousenot, what the best approach is for handling this please?11:24
mbruzekbdx16:25
kwmonroeadmcleod: beisner:  https://jujucharms.com/hadoop-processing/  it takes 8 machines by default, but you can change num_units on "slave" from 3 to 1 to get it down to 6:  https://api.jujucharms.com/charmstore/v5/hadoop-processing/archive/bundle.yaml17:05
josejcastro: thought of using summit.ubuntu.com for the summit?17:42
marcoceppijose: no17:55
marcoceppithe schedule is small, lightweight, and constantly in flux17:55
josegotcha, was available so thought of you17:59
kwmonroebeisner: admcleod:  http://paste.ubuntu.com/23155869/19:24
admcleodkwmonroe: thanks19:25
beisnerthx kwmonroe19:37
=== scuttle` is now known as scuttle|afk
magicaltroutnearly missed tomorrows flight..... lost passport....20:47
magicaltroutlazyPower: good news.... I have a 2nd talk.... also about docker and juju20:59
magicaltrout@jpl that is20:59
lazyPowernice!21:01
lazyPowermagicaltrout - when is that?21:01
magicaltroutthe week after the summit21:01
lazyPoweroh wow, so soooooon :D21:01
lazyPowerwe'll have to sync up, make sure we're up to snuff on the latest and greatest21:02
magicaltroutyeah well,  i'm in town etc..21:02
lazyPowerabout that, when do you arrive for the summit?21:02
magicaltroutsaturday afternoon21:02
lazyPowernice, i'll be around21:02
lazyPoweri should shoot you my digits21:02
magicaltrouti'll be sat in the bar very jetlagged ;)21:02
magicaltroutooh21:02
magicaltroutthats tomorrow21:02
lazyPowerindeed21:03
magicaltroutokay tomorrow afternoon21:03
magicaltroutvery jetlagged21:03
magicaltrouti left my passport in the hotel i was in last week21:03
lazyPowerso sunday brunch/lunch then depending on when i roll my lazy bones out of bed21:03
magicaltroutcan you believe it?!21:03
lazyPowerdoh21:03
magicaltrout(yes)21:03
magicaltroutneed to pick it up on the way to LHR21:03
lazyPowerthats a nice distraction eh?21:03
magicaltroutspent all afternoon trying to find it:)21:03
magicaltrouti have an interface question if  you have 3  mins?21:04
magicaltroutnot technical,  theoretical21:04
babbageclunkIT'S A TRAP21:18
magicaltrouti saw you lurking21:18
magicaltrouti  was trying to clear up our theory from this morning :P21:18
=== scuttle|afk is now known as scuttle`
admcleodmagicaltrout: took me ~20 hours from BCN. i feel a bit weird.21:36
magicaltroutlike usual then admcleod ?21:41
lazyPowermagicaltrout - sure21:44
lazyPowerfire away21:44
babbageclunkI mean, it's an interesting trap.21:45
babbageclunk:)21:45
magicaltroutsorry for the delay lazyPower21:56
magicaltroutokay i have this idea21:56
* lazyPower listens intently21:56
magicaltroutideally there will be a bunch of apps that can consume JDBC connections21:56
lazyPowerfor the clarification of kwmonroe - JDBC is just the java database adapter right? their pluggable abstraction?21:57
magicaltroutsoooo I had a plan to create a generic JDBC interface, that the providing charm  could populate with the stuff required by the consuming application21:57
magicaltroutyeah, any java data app  speaks jdbc in some form21:57
lazyPoweryep, similar concepts in .net, go on21:57
magicaltroutso all jdbc connections are basically the same just different details, and I'm sick as a consuming app figuring out the various interfaces and stuff you need to know to build 1 per database or data source21:58
magicaltroutso I figured why not have mysql, postgres, drill etc all suppor the the jdbc interface21:58
magicaltroutwhich clearly is doable21:58
magicaltroutfrom a consuming standpoint, is  it possible and acceptable for 1 charm to consume the same interface from  multiple sources with different deets?21:59
jrwrenmagicaltrout: you are going to be talking at JPL?  that is awesome!22:01
magicaltroutmy employers suggested it might be a good idea22:01
magicaltroutnot sure when a hacker speaking to a bunch of PhD's was a good idea22:01
magicaltroutbut we shall see22:01
admcleodmagicaltrout: usual would be usual. weird is different weird.22:02
magicaltroutadmcleod: a bit more like the i've been up for 24 hours, its 3pm so technically to early to drink but in reality i was drinking at 9am so wtf?22:03
magicaltroutdon't worry you can take the piss out of me tomorrow in the same state22:03
magicaltroutafter my drive from  LAX to the Sheraton22:03
admcleodmagicaltrout: yeah, but i didnt really feel jetlagged, had a great sleep, woke up fresh.. but just hit me now22:04
admcleodmagicaltrout: also i would never take the piss.22:04
magicaltroutsleep?22:07
magicaltroutyou slept on the plane?22:07
magicaltroutor post landing?22:07
magicaltroutI once slept from Manchester to Toronto without waking once, the flight crew were pretty impressed22:07
rick_h_magicaltrout: you all there already?22:07
rick_h_magicaltrout: it's called ambien! only way I can sleep on planes22:08
magicaltroutsadly the first homeless guy to talk to me in Tonronto was from Leeds where i'd just left22:08
magicaltrouti fly tomorrow rick_h_22:08
admcleodmagicaltrout: no, landed last night22:08
rick_h_magicaltrout: ah ok22:08
* rick_h_ doesn't leave until sunday22:08
magicaltrouti need a day or so to get over the lag22:08
rick_h_yea, always a good thing22:09
magicaltroutadmcleod: ah, yeah i know that one22:09
jrwreni usually need a week, and then i go home and need another week to adjust.22:09
magicaltroutalthough when i went to vancouver for apachecon the day i landed it smacked me  so hard i left the hotel bar without paying22:09
magicaltrouthad to grovel the next day ;)22:09
jrwrenmagicaltrout: I look forward to meeting you.22:09
magicaltroutjrwren: good job i'm there for 2 weeks then ;)22:09
magicaltroutyeah jrwren it's gonna be a blast meeting more of the US folks and the expanding charmer team22:11
magicaltroutalso, its amazing how much  has changed and moved on since Ghent at the start of the year22:12
magicaltrouti blame jcastro for my continued participation in this mess! ;)22:12
iceydoes anybody know how to install `charms` in addition to `pycharms`, pycharms seems to overwrite charms and trusty won't install charm-tools anymore22:14
rick_h_magicaltrout: we all blame jcastro :P22:14
rick_h_icey: pycharms?22:15
magicaltroutaye22:15
iceyyes (says cholcombe, he's the asker :) )22:15
magicaltroutdon't blame you22:15
rick_h_icey: hmm, pycharm search only finds the editor22:16
iceyrick_h_: that's the one22:16
rick_h_icey: so the charm command interferes with the editor install?22:16
iceyrick_h_: backwards, apparently the editor interferes with the charm install22:17
iceyhe cannot install charm22:17
rick_h_icey: hmm, and he's getting charm on trusty from the stable PPA?22:17
rick_h_icey: or which PPA I guess?22:17
iceyyes22:17
iceyrick_h_:22:17
rick_h_hmm, there's a few python deps like pytest and path.py that are in the PPA to support charm-tools and the like. I wonder if those are interfering22:19
rick_h_icey: my short answer is try to to setup one of them in a lxc container or the like atm, I'm not sure what conflicts without figuring out where he's getting pycharm from (it's not listed in ubuntu) and so guessing there's conflicting PPA/repos stuff there22:19
iceythanks rick_h_22:20
rick_h_sorry22:20
lazyPowermagicaltrout - to circle back to your interface idea22:24
magicaltrouti like the lag22:24
lazyPoweri think thats a fine idea. JDBC as a generic abstraction would be great, what would be even better, is if jdbc knew how to consume the existing relations, then its a one sided update. I'm wondering if you dont make a jdbc layer, that implements the known relations, and surfaces the details appropriately22:25
lazyPowerotherwise, you're facing adding JDBC interface to every [layer|charm] that needs to communicate to jdbc. I'm trying to noodle how i can save you work there22:25
lazyPowerbut i dont think we have considered this as a use case22:25
magicaltroutwell i might upstream mysql and postgresql and hive22:26
magicaltroutits not masses of effort and saves extra layers22:26
lazyPowerwhen you say upstream, you mean just add the - 'interface:jdbc' to those charms right?22:26
lazyPowerand whatever additional bits to utilize it in the layer22:27
magicaltroutyeah and a connection  method call somewhere22:27
lazyPowerright, ok.  upstreaming is such an overloaded term anymore :)22:27
lazyPoweryeah, that works. I'm +1 to this, as its straight forward, and makes a ton of sense22:27
magicaltroutyou know me... trying to stay hip.. ;)22:27
magicaltroutyeah, i started writing a drill interface, but then i realised apart from the values22:28
magicaltroutthe keys are identical to most  other jdbc interfaces22:28
magicaltroutso the lovely babbageclunk helped me unmuddle my brain this morning and i stood up something basic in drill, but I think generic interface for regular connections, as long as in practice they work22:29
magicaltroutwould make life a lot easier for requring chamrer22:29
magicaltroutcharmers22:29
magicaltroutsaiku, pentaho, spago can certainly implement jdbc requires, so could drill and probably zeppelin somewhere22:31
marcoceppimagicaltrout: yeah, but jdbc is a connection string format, and if you have an app that takes a JDBC connection for MySQL but won't work on cassandra, then a jdbc interface doesn't really help?22:40
magicaltroutokay so lets assume some common sense on the end of the user22:41
magicaltroutcassandra isn't a jdbc compliant database22:41
magicaltroutwhilst there are adapters for it22:41
magicaltroutjdbc is a standard and if you can write SQL  you can 95% of the interrogate a database22:41
magicaltroutof course there are exceptions22:42
magicaltroutbut in the scheme of things and also the charms you guys have available, those exceptions don't really count22:42
magicaltroutalso22:44
magicaltroutits  not the law to implement it22:45
magicaltroutyou can still do what the hell you like :)22:45
marcoceppiif you want to implement a jdbc interface and add it to mysql/maria/percona/postgresql (any others?) go for it :)22:45
marcoceppibut I thin kit'd be work discussing next week22:45
magicaltroutsure, i can always rename my test jdbc interface  drillbit and we're back to the same thing22:46
magicaltrouti just think there should be a nice way for people trying to use the stuff provided by the resources instead of trying to find unit names etc because your providing charm requires a list of ZK nodes etc22:47
magicaltrouti happen to be implementing the drill charm as well so it doesn't count as much. but I wouldn't envy someone trying to work out the jdbc url without charmers help22:51
magicaltroutso why not try and genericise it22:51
marcoceppi+123:18

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