/srv/irclogs.ubuntu.com/2013/02/15/#juju-dev.txt

=== _mup__ is now known as _mup_
wallyworld___davecheney: g'day. i want a mutex with a timeout. any pointers? i couldn't see native support in the go libs? is there anything we use already?00:31
davecheneywallyworld___: hmm, might have to use something with a channel00:32
davecheneylet me ponder for a few mins00:32
wallyworld___ok00:32
wallyworld___hard to believe a modern language doesn't have such a construct built in00:33
wallyworld___or at least in the libs i mean00:33
davecheneyi never ran across such a thing in java00:33
davecheneycan you give me an example from another language00:33
davecheneyprobably can do it with a waitgroup and a goroutine00:34
davecheneybut a mutex that unlocks itself sounds dangerous00:34
wallyworld___java has had it for quite a while00:34
wallyworld___not unlocks itself, just a wait to have the acquire not wait forever00:35
wallyworld___so you can say, try and grab this thing, but if not successful after x seconds, return with an error00:35
wallyworld___useful to avoid deadlocks00:35
wallyworld___and also when making network calls00:35
davecheneyoh, right00:36
davecheneyi understand now00:36
davecheneyyou don't want to block on the lock forever00:36
davecheneyunderstood00:36
wallyworld___the java stuff is in java.util.concurrent00:36
wallyworld___yes00:36
davecheneyprobably still going to look like a channel00:37
davecheneyie, you try to send a command to something via a channel00:37
* davecheney searches archives00:37
wallyworld___ok. i may extend the built in mutex to provide a Lock(timeoutms int) method, using a channel or whatever00:38
wallyworld___i can't be the only one who needs this00:39
* davecheney agrees00:43
* davecheney continues to search archive00:43
wallyworld___thank you00:43
wallyworld___i'll look as well00:44
davecheneyif you feel brave you can as on #go-nuts00:44
wallyworld___i'll see what i can find first, my flame retardant suit in at the cleaners00:49
davecheneysmart move, the annoying pedant quotient is quite high in that channel atm00:54
wallyworld___:-)00:57
thumperwallyworld___: chop off your tail dude...01:22
=== wallyworld___ is now known as wallyworld
thumperdavecheney: I'm wondering if I raised the annoying pedant quotient01:22
thumper:)01:22
=== wallyworld is now known as Guest86404
davecheneythumper: not possible01:23
davecheneyi got a bitchslap by @tqbf two days ago01:23
* thumper doesn't know who that is01:24
thumperwallyworld__: you are broken01:24
wallyworld__yep01:24
wallyworld__it's only freenode too01:24
wallyworld__no issue with canonical channels01:25
thumperwallyworld__: how are you connecting to freenode?01:25
wallyworld__using auto identity in quassel01:25
thumperI seem to have lost my menus for quassel01:26
thumperdumb unity01:26
wallyworld__davecheney: i couldn't find anything, so i did this - seems to work http://pastebin.ubuntu.com/1654692/01:27
wallyworld__thumper: you had your chance to solve all of Unity's problems before you let them01:28
wallyworld__left01:28
wallyworld__you failed :-P01:28
thumperwallyworld__: unfortunately I think that code is flawed01:29
wallyworld__:-(01:29
thumperwallyworld__: lets say you Attemt(100) and it fails01:29
davecheneywallyworld__: looking at your sample01:30
thumperbut 50ms later, the lock succeeds01:30
davecheneyi need to think through it some more01:30
thumperwallyworld__: the channel then has a true in it01:30
thumpernext time you attempt01:30
thumperyou pull off the true, but have another attempted lock pending01:30
thumperdavecheney: am I right in that reading?01:30
wallyworld__ah, i want to make the channel locally01:31
wallyworld__not as an attribute of the mutex01:31
wallyworld__then i also can ditch the New()01:31
davecheneythumper: yeah, it's even a little more complicated because the channel is not buffered01:32
thumperright, so the previous go routine is still alive01:32
davecheneyso chan <- true does not succeed unless something else comes along and does <- chan01:32
davecheneyI think there is a possiblity the lock could leak in the locked state01:33
davecheneyand locks are not re-enterent01:33
thumperouch01:33
thumperso broken by design01:33
thumpersorry wally01:33
thumperyou suck :-)01:33
davecheneythat sounds like my cue to go to lunch01:33
wallyworld__http://pastebin.ubuntu.com/1654719/01:33
* thumper is laughing to himself01:33
* thumper feels lucky to know wallyworld__ personally and knowing he can handle the ribbing01:34
* thumper clicks on rev201:34
* wallyworld__ contemplates ending it all, can't take it anymore01:34
thumperwallyworld__: still have the issue of the lock attempting to lock after the method has returned01:35
thumperwallyworld__: perhaps this crazy thing...01:35
thumperoh oh...01:35
* thumper writes some go01:35
wallyworld__ah yes, you are right01:35
wallyworld__i'll see if i can fix that01:35
wallyworld__i just wanted to first ditch the channel from the mutex01:36
* wallyworld__ still doesn't understand why this is so hard in Go :-(01:36
thumperwallyworld__: http://pastebin.ubuntu.com/1654742/01:38
thumpermight have some syntax wrong01:38
wallyworld__or http://pastebin.ubuntu.com/1654745/01:39
thumpernah01:39
thumperthat won't work01:39
thumperas the defer is run when the method ends01:39
thumperwhich may be before the Lock succeeds and the goroutine finishes01:39
thumperI am assuming that the lifetime of the goroutine can outlive the surrounding function01:40
wallyworld__i wonder what happens which the function ends - are the channels cleaned up straight away?01:40
thumperthey are created on the heap (effectively) and killed when no longer reffed01:40
thumperso the channels will no doubt still be around01:40
wallyworld__what happends to the go routines that are running - i guess they keep going01:40
* thumper hinks01:40
thumperI think so01:40
thumperbut I'm really just guessing01:41
wallyworld__i had assumed everything would be cleaned up, hence my original solution01:41
wallyworld__but if that doesn't hold true, then yours looks better for sure01:41
wallyworld__except that with yours the test spews out all osrts of go routine type errors01:44
wallyworld__ah deadlock01:44
wallyworld__in the failure test01:45
* wallyworld__ debugs01:45
thumperheh01:48
thumperI did say it might not be right01:48
thumpermy first go in anger01:48
thumperothers so far have been little test scripts01:49
* thumper pokes the help command01:49
wallyworld__i wasn't criticising :-)01:49
thumperschool run, bbs01:57
* thumper sobs quietly03:30
thumperbut in a happy way as I understand it, just... ugh03:31
* thumper now understands all the command stuff03:33
thumpernow to just write a useful help command03:33
thumper(FSVO all)03:34
thumperdavecheney: we don't do much with internationalization do we?04:30
thumperdavecheney: is there any locale support in go?04:30
davecheneyvirtually none04:34
davecheney^ as in, we do04:34
davecheneylocale support ... nothing that looks like the c tools (iconv isn't it ?)04:36
thumpernot sure04:36
thumperI'm just going to pretend the entire world speaks english04:37
thumper:)04:37
davecheneythat's the spirit04:37
wallyworld__davecheney: thumper: this seems to work ok now, http://pastebin.ubuntu.com/1655490/04:53
thumperdavecheney: what does %q do in fmt.Errorf ?04:53
wallyworld__i could put this into goose but it doesn't belong there. what's our policy for utilis like this?04:53
davecheneythumper: "quotes" things04:53
davecheneybut will also print them 'safely' for some value of safely i can't remember at the top of my head04:54
thumperta04:55
thumperhmm...04:57
thumperI wonder why we write help to stderr instead of stdout04:57
thumperdavecheney: ok, once I've been editing away on some go files05:03
thumperdavecheney: how to I (re)build the juju command??05:03
thumperdavecheney: nm05:08
thumperdavecheney: nah, had that wrong05:09
thumperhow do I rebuild?05:10
thumperwallyworld__: you know?05:10
thumperI just want to get this bit working and I can finish and have a drink05:10
* thumper taps his fingers05:11
thumperno pressure guys05:11
thumperhmm...05:21
thumperfound install05:21
thumperseems to be mostly going now05:21
thumperenough for me to call time and get a drink anyway05:21
thumpercaio05:21
fwereadedavecheney, thanks for reverting the store07:17
davecheneyfwereade: no worries mate07:17
davecheneyi think i'm missing email at the moment07:18
davecheneyor was that just poorly communicated07:18
fwereadedavecheney, I think it was screwed-up communications07:18
davecheneyoh well, it's fixed now07:19
fwereadedavecheney, yeah -- and it's really nice to have the thing I was planning to do first thing already done when I come in :)07:20
fwereadedavecheney, incidentally, re external dependencies... I am becoming entirely dissatisfied by the state of go in this regard, and starting to think that the only way to get anything resembling a consistent build is to copy every damn thing into thirdparty/07:21
fwereadedavecheney, which sucks, obviously, but seems to suck strictly less than every other option07:22
davecheneyfwereade: i understand07:23
davecheneythis is a problem that has occupied my thoughts for some time07:24
davecheneyi do not have anything to add at this point07:25
fwereadedavecheney, even goamz etc -- even if it's stable API-wise, new things are being added and it's only a matter of time before we start getting weird bugs that are eventually tracked down to "oh, you didn't update XXX? silly you"07:25
fwereadedavecheney, (not even new things -- just little fixes, improvements, etc)07:25
fwereadedavecheney, another thought -- the 4th option is for us to publish, ourselves, to a public bucket we control (on *any* openstack, so long as that bucket in configured for unauthenticated access) and make sure the public-bucket-url defaults to that07:27
davecheneyfwereade: yes, part of the problem is API breakage, major version changes07:27
davecheneythe other, much larger half, is behavioural changes, X.1, and X.Y.1 changes07:28
fwereadedavecheney, yeah, exactly07:28
davecheneyfwereade: yes, on the 4th optoin, i need to get a clear indication from the buisiness what these 'network hostile' customers look like07:28
fwereadedavecheney, (btw, we should *also* I think be checking hashes of the tools we use, and I don't think we do that... it's crazy that we have it for charms but not for the actual code that we run)07:29
davecheneyfwereade: i agree, if we have to stay with the tarball approach, then hashs' or maybe even sigs would be the order of the day07:30
davecheneyfwereade: on a scale of annoying to fucking us daily, where would you place the pkg version problem ?07:32
fwereadedavecheney, persistently annoying... the actual *detected* fuckery is relatively rare but I suspect that (1) probably someone is inconvenienced by it every single day and (2) critically, none of us can *tell* when we might be being fucked by it07:35
fwereadedavecheney, it's the uncertainty more than anything else07:35
rogpeppedavecheney, fwereade, mgz: morning!07:35
davecheneyfwereade: understood, seconded07:36
fwereadedavecheney, eg bac produced a very helpful paste yesterday, with juju-core's bzr version and the go version at the bottom07:36
davecheneyi don't like that double checking your own local environment has to be the first step when debugging biuld breakage07:36
fwereadedavecheney, but that isn't actually enough, and I couldn't esily give you a complete list of external packages we depend on07:36
fwereadedavecheney, trashing src/ every time you have a problem is absurd, but it's starting to seem reasonable in my mind07:37
fwereaderogpeppe, heyhey07:37
davecheneyfwereade: for you and me and rog, it is acceptable07:38
davecheneyfor blue, who have branches in goose and juju-reo, it is totally unacceptable07:39
fwereadedavecheney, I cannot ask anyone else to do that without permanently staining my honour07:39
fwereadedavecheney, exactly07:39
rogpeppewallyworld_: ping07:51
wallyworld_hi07:51
rogpeppewallyworld_: http://play.golang.org/p/YXAHy5kBfD07:52
* wallyworld_ looks07:52
rogpeppewallyworld_: that's the classic method07:53
wallyworld_ok. the good thing about my home grown approach is you don't need a New()07:53
wallyworld_in any case, why isn't this part of the std libs i wonder? why is everyone forced to roll their own?07:54
rogpeppewallyworld_: it's not that common a requirement (people usually need to wait for channels to be available or functions to return, not mutexes to be taken), and it's trivial to implement, as you can see.07:55
rogpeppewallyworld_: we could make the above example not need New too07:56
wallyworld_it's very common in any environment i've ever worked in. trivial yes, but still code that has to be written and live somewhere. goose? juju-core? yet another 3rd party lib we create?07:56
wallyworld_i guess i'm saying it should have been included out of the box07:57
rogpeppewallyworld_: i've written go for quite a while now, and although i know that idiom, i've never required it07:57
rogpeppewallyworld_: i think it's probably because mutexes aren't usually used to guard long-lived things07:58
wallyworld_really? ok. forget Go per se. when using mutexes with network  or other resources, you need to timeout to prevent deadlocks etc07:58
wallyworld_i guess compared to java.util.concurrent, i'm finding Go's concurrent support to be a bit primitive07:59
wallyworld_so, thanks for the code btw, it does look nice. but where should we put it?07:59
wallyworld_not Goose, cause then other stuff can't easily use it08:00
rogpeppewallyworld_: honestly, it's trivial - if you need it, just copy and paste it.08:00
wallyworld_or maybe just stick it there for now08:00
wallyworld_aargggh noooo. not copy and paste08:00
TheMueMorning08:01
fwereadeTheMue, wallyworld_, heyhey08:01
wallyworld_hi08:01
TheMueSomewhat flaky connection this morning. :/08:01
TheMuefwereade, wallyworld_ : Hiya08:01
rogpeppewallyworld_: seriously, it's about as trivial as a for loop08:01
TheMuefwereade: I yesterday pushed the last proposal again.08:01
fwereadeTheMue, cool, thanks, I'll take a look as soon as I can08:02
wallyworld_rogpeppe: that's not the point - it's still business logic that can and should be re-used via being packaged08:02
wallyworld_Go is verbose enough already without yet more cut and paste - they all start to add up08:03
rogpeppewallyworld_: out of interest, what are you using the mutex for?08:04
wallyworld_rogpeppe: to guard the Authenticate call in a Goose client (which we are now sharing between all nova, swift etc instances). we can't allow 2 users to attempt to Auth at the same time08:05
wallyworld_but Authenticate() is a network call08:05
wallyworld_so we don't want to block indefinitely08:05
rogpeppewallyworld_: presumably the network call itself will time out eventually?08:05
wallyworld_perhaps. who knows. we can't asume that08:05
wallyworld_even if it does, the timeout might be tool ong08:06
rogpeppewallyworld_: it's easy to make a network call time out if you want08:06
rogpeppewallyworld_: i think i'd go in that direction (having one thing timing out on the operation in question) rather than have lots of things all timing out on the mutex08:06
fwereaderogpeppe, http://thecodelesscode.com/case/7108:06
wallyworld_we are using http.client as the transport - request.Do() and all that - you saying we can make that time out?08:07
rogpeppefwereade: nice. i think i've missed the point though.08:11
rogpeppewallyworld_: yes, in two ways, one much easier than the other08:11
wallyworld_rogpeppe: out of curiousity, how would i get rid of the New() in the implementation using a channel, if the channel needs to be make()ed ?08:11
rogpeppewallyworld_: use a mutex :-)08:11
fwereaderogpeppe, I was alluding to the "it will eventually time out" assertion, probably not in a very constructive way08:11
wallyworld_ah, yes, ok08:13
rogpeppewallyworld_: http://play.golang.org/p/vooGdZw5aa08:14
wallyworld_yes, that seems sensible, thanks08:14
fwereadebbiab08:15
rogpeppewallyworld_: that's actually a useful general technique for making any zero value usable without a New function.08:15
wallyworld_rogpeppe: i'll look at the http request timeout, but it will need a little thought - we only really want to do it for Auth calls, since they are the only ones that need to be serialised. we don't really need to do anything for other send request calls08:15
wallyworld_so having a mutex with a timeout works nicely08:16
rogpeppewallyworld_: if the auth times out, does it matter if the actual authenticate call is still going on the background?08:16
wallyworld_not really - i don't think so, but need to work through that scenario08:17
rogpeppewallyworld_: that is, is the authenticate call idempotent? if it's failed once, do you want everything that wants to use it to fail?08:17
wallyworld_without it succeeding, nothing can really work from that point08:17
wallyworld_since nothing will have a token08:17
wallyworld_nor the endpoint urls08:17
wallyworld_rogpeppe: thanks for the input, i have to head off to soccer. i'll revisit what's been done with the new info next SOD08:19
rogpeppewallyworld_: ok08:20
rogpeppewallyworld_: i have a little example for you when/if you come back this evening08:20
wallyworld_i have a few more minutes before i have to go08:21
rogpeppewallyworld_: http://play.golang.org/p/sd1Cx2Ey-c08:23
rogpeppewallyworld_: where the authenticate function is standing in for your Auth call.08:24
wallyworld_rogpeppe: excellent thanks. it will take me a little time to digest. i'll read it in detail after soccer08:28
rogpeppewallyworld_: look ma, no mutex timeouts! :-)08:29
wallyworld_rogpeppe: yes indeed. i wonder how reusable it is though. eg with a mutex.TryLock() type operation, it can be used trivially as needed08:30
wallyworld_this latest solution *seems* to mix a fair bit of boilerplate with the business logic08:31
wallyworld_but i need to read it fully08:31
wallyworld_whereas with the mutex.TryLock(), there is no boilerplate in the business logic08:31
wallyworld_anyway, gotta run, hopefully back later. thanks again for the code, i'll learn something for sure just reading it08:32
rogpeppewallyworld_: see ya!08:33
rogpeppewallyworld_: have a good footy session08:33
wallyworld_i will hopefully, thanks :-)08:33
rogpeppewallyworld_: for the record, here's some of the boilerplate factored out: http://play.golang.org/p/XHJ_PLO6RR08:37
dimiternfwereade: ping08:59
fwereadedimitern, heyhey08:59
dimiternfwereade: hey :)08:59
dimiternfwereade: about that CL from yesterday08:59
dimiternfwereade: https://codereview.appspot.com/7317045/08:59
fwereadedimitern, rogpeppe: IMO it is worth having a package just for those constants -- is there some cost to a package that I'm not aware of?09:00
dimiternfwereade: how do you feel about moving hook inside charm/, rather than have it in charm/hook/09:00
fwereadedimitern, rogpeppe: I'm probably +1 on chook rather than uhook09:00
rogpeppefwereade: i see the hooks as very closely related to charms, so can't really see that it needs a new package. but i don't mind much. no there's no particular cost to a package.09:01
fwereadedimitern, rogpeppe, I don't have a strong argument tbh, it's just that charm.HookUpgradeCharm feels irritatingly verbose compared to chook.UpgradeCharm09:01
rogpeppefwereade: if the constants were in charm, there would be no need for the awkward charm/hook uniter/hook name clash09:01
rogpeppefwereade: i'd go for charm.HUpgradeCharm, i think09:02
fwereaderogpeppe, eww ;p09:02
dimiternrogpeppe: but we might have to rename a few things to make them unambiguous09:02
dimitern:)09:02
fwereadedimitern, rogpeppe: ha: charm/hooks vs worker/uniter/hook would resolve it09:02
dimitern+109:03
fwereadedimitern, rogpeppe: and read better just about everywhere, I think09:03
dimiternfwereade: so rename it to charm/hooks09:03
fwereadedimitern, I'd like to see what rogpeppe thinks09:04
dimiternrogpeppe: sounds good?09:04
* rogpeppe sucks his teeth09:04
rogpeppefwereade: the singular/plural distinction seems... arbitrary09:05
fwereaderogpeppe, hooks.UpgradeCharm vs hook.Info seems to read pretty well to me09:05
dimiternfwereade, rogpeppe: uniter/hookinfo and use hi.* ?09:05
rogpeppefwereade: haven't you got that the wrong way around?09:06
fwereaderogpeppe, I don't think so... hooks enumerates the available hooks, while hook is the uniter-specific package dealing with info attached to single hook executions09:07
rogpeppefwereade: oh yeah, i'd forgotten that UpgradeCharm is a hook :-)09:07
fwereaderogpeppe, yeah, the actual upgrade code is mostly in uniter/charm, which itself collides with charm :(09:09
rogpeppefwereade: ha ha! http://godoc.org/launchpad.net/juju-core/worker/uniter?view=import-graph09:11
rogpeppefwereade: that's a bit better: http://godoc.org/launchpad.net/juju-core/worker/uniter?view=import-graph&hide=109:11
fwereaderogpeppe, my eyes, my eyes; the goggles, they do nothing09:11
fwereaderogpeppe, yeah, slightly less awful09:12
rogpeppefwereade: why do we need a uniter/hook package again?09:12
fwereaderogpeppe, primarily to avoid the everything-friends-with-everything situation in (eg) state that makes it so hard to tell what uses what in arbitrarily inappropriate ways09:14
dimiterncool graph, i didn't know you can generate these from godoc09:14
rogpeppefwereade: does anything outside of uniter itself use hook.Info?09:14
fwereaderogpeppe, uniter/relation09:14
fwereaderogpeppe, for the relation hook queues09:16
rogpeppefwereade: ah, of course, i thought it was something like that.09:16
rogpeppefwereade: presumably, it *could* be relation.HookInfo ?09:17
dimiternrogpeppe, fwereade: do do we reach a consensus?09:17
fwereaderogpeppe, nope, it's not just for relation hooks09:18
fwereaderogpeppe, and I'm really not keen on just jamming everything into uniter09:18
rogpeppefwereade: i mean theoretically, but yeah09:18
rogpeppefwereade: i don't think you *can* jam it into uniter09:18
rogpeppefwereade: because then there would be a cycle09:18
fwereaderogpeppe, we could if we jammed relation in as well -- I seem to recall yu arguing for that once, but I was not then and am not not convinced that's a good idea09:19
fwereades/not not/not now/09:19
fwereaderogpeppe, can we agree on charm/hooks and uniter/hook on the basis that it leads to clarity and readability at the "cost" of having more smaller packages that do one thing only? ;p09:20
rogpeppefwereade: i think i'd go for uniter/hookinfo, as that's really what it is09:21
fwereaderogpeppe, dimitern: the other possible direction *may* be uniter/state (not that *that* doesn't have aliasing problems...)09:22
rogpeppefwereade: this is a package with one type with a single method, right?09:23
fwereaderogpeppe, yeah, I think so09:23
rogpeppefwereade: in fact... i've just seen the logic for charm/hooks and uniter/hook09:24
dimiternfwereade: move uniter/hook stuff in uniter/state ?09:24
rogpeppefwereade: let's go for that09:24
dimiternfwereade, rogpeppe: ok, so finally :) charm/hooks then?09:25
rogpeppedimitern: naah. we don't need another state package that's just there for hook info :-)09:25
fwereaderogpeppe, cool :)09:25
rogpeppedimitern: yeah. sorry for the swithering.09:25
dimitern:) np09:25
fwereaderogpeppe, dimitern: the suggestion would have been to move uniter.State in there as well, but I'm not sure what that costs usor whether anything blocks it: so, yes, charm/hooks and uniter/hook09:26
* fwereade does the happy dance09:26
rogpeppedimitern: the godoc package graph functionity is cool, isn't it. it's the first time i've used it on juju...09:27
dimiternrogpeppe: it would've been even cooler if you can rearrange the nodes like juju-gui does with machines09:29
rogpeppedimitern: definitely09:29
rogpeppedimitern: i'm sure gary would accept a patch :-)09:29
fwereadeTheMue, I've sent some more thoughts09:53
fwereadeTheMue, this might go better, I think, if you do the following:09:53
fwereadeTheMue, 1) trivial CL dropping the lxc/network files09:54
fwereadeTheMue, 2) CL for just the backend, with tests09:54
fwereadeTheMue, 3) CL with the Storage implementation, with tests (as they are today)09:55
fwereadeTheMue, 4) CLs with things like the config, the provider, the environ, etc, with tests09:56
TheMuefwereade: Thx for the review09:56
TheMuefwereade: Yep, the real CL for the environ etc has already been intended to follow. This has only been a consolidation.09:57
TheMuefwereade: Maybe already done too much, so I'll split it.09:57
fwereadeTheMue, thanks, I'd like that09:58
TheMuefwereade: No problem.09:59
* TheMue still tends to create too large CLs, shit. *sigh*09:59
fwereadeTheMue, I think we definitely need independent tests for the backend though -- and if you're splitting it, it might be a good idea to put it in its own package to prevent the pain of unpicking it later09:59
fwereadeTheMue, I offend on that front myself, I know :(09:59
fwereadeTheMue, when I manage not to everything goes much smoother though ;)10:00
TheMuefwereade: Yep10:01
dimiternso if I have a map[string]bool as an argument to a func, does it have to be *map... to change it in place?10:02
fwereadedimitern, no, don't think so, a map is already a reference10:03
dimiternfwereade: cheers10:03
fwereadedimitern, http://play.golang.org/p/GEEcsp2KPp10:04
dimiternfwereade: yeah, I keep getting mixed up occasionally with the reference/pointer logic for maps/slices still10:06
fwereadedimitern, I know the feeling, it'll bed in soon enough :)10:06
dimiternrogpeppe, fwereade: here it is https://codereview.appspot.com/731704510:09
fwereadedimitern, cheers10:09
dimiterni'll change the description on submit - i couldn't find a way otherwise10:10
fwereadedimitern, you can do lbox propose -edit10:15
fwereadedimitern, looks good though, just a remark or two10:15
fwereadebbiab10:16
dimiternfwereade: ok, 10x10:16
dimiternfwereade: since i'm not aware how to define a const slice, I'll just make a method that returns a copy of the private for both types of hooks10:30
dimiternrogpeppe: ping10:35
rogpeppedimitern: pong10:36
dimiternrogpeppe: you're ok with the CL?10:36
rogpeppedimitern: looking10:36
rogpeppefwereade: i really don't think we need to copy UnitHooks every time it's used10:37
rogpeppefwereade: there are plenty of places where we have globals that are immutable by convention10:37
fwereaderogpeppe, how is "immutable by convention" not just an "invitation for bugs"?10:38
rogpeppefwereade: there are many possible places for bugs. this one is not easy to trip over.10:38
rogpeppefwereade: in my view doing this it would create more garbage for very little gain.10:41
dimiternrogpeppe: i don't see a problem copying a private slice like this10:44
rogpeppedimitern: i think it sets a bad convention. it's really ok for a package to expose tables of data directly.10:45
rogpeppedimitern: see, for example, the unicode package in the standard library10:45
fwereaderogpeppe, if all your friends jumped off a bridge... ;p10:46
rogpeppefwereade: there would be good reason for it... yeah :-)10:46
dimiternfwereade: what do you think can go wrong with slices? somebody changing it silently? we'll catch this is a review10:46
fwereadedimitern, I think your faith in the review process is perhaps a little too solid... bugs can and do make it through review, even obvious ones... but if people really object to this small and cheap nod towards safety/sanity I can't be bothered to fight it :)10:49
dimiterni'm ok either way, I really want to land this, so I can finish my bug fix10:50
fwereadedimitern, then I leave it to your consicience :)10:50
dimiternfwereade: I already did what you suggested10:51
dimiternrogpeppe: is it really that big of a difference?10:52
rogpeppedimitern: i think of it as increasing complexity due to unjustified paranoia about side effects. we use these things in precisely one place, in a range statement. making a copy seems total overkill.10:55
fwereaderogpeppe, that sounds like an assertion that we will only ever use these things in one place...10:56
rogpeppedimitern: if we think it's justified here, then we will never be allowed an exported data table in any package, and i think that's not great10:56
rogpeppefwereade: i think it's easier to guard against undesired mutation than you fear10:57
* dimitern gets a coffee and sits waiting10:57
fwereaderogpeppe, what is it that's difficult about copying them?10:58
rogpeppefwereade: it's more code and more garbage generated for no reason.10:58
rogpeppefwereade: i think a table variable is a very elegant and simple thing. i don't think we should disallow ourselves that.10:59
dimiternrogpeppe: are the std lib packages using some special built-in way to define immutable exported slices?11:00
rogpeppedimitern: nope11:00
rogpeppedimitern: you can change 'em, but that's your own fault if you do.11:01
dimiternrogpeppe: so you can change them and screw up everybody using the package from that time on?11:01
rogpeppedimitern: sure11:01
rogpeppedimitern: you can change os.Stdin too11:01
dimiternfwereade: can you point out your concerns about changing these exported slices in a bad way?11:02
rogpeppedimitern: or image.Black, or os.ErrNotExist11:02
dimiternrogpeppe: the added code is really 6 lines including comments, and since the slices are tiny making a copy doesn't at all sound like an overkill11:03
fwereaderogpeppe, are you arguing that it is *good* to be able to change, say, image.Black? what's the benefit?11:03
rogpeppefwereade: i'm arguing that it's good to be able to expose simple static values as variables11:03
rogpeppefwereade: and that that's not actually error prone - you have to go out of your way to fuck it up.11:04
dimiternwell, if taking go std lib as best applied practices, then it certainly seems to me following the same pattern is clearer and not unexpected behavior11:04
rogpeppefwereade: yes, if we had a language with const, we'd probably use that, but we don't, and it works ok.11:04
rogpeppedimitern: +111:05
dimiternI wish go had const slices11:05
dimiternor a way to mark an exported immutable, but alas..11:06
dimiternhow about a programmatic solution - something like go fix or similar, which is able to detect such things?11:07
fwereadedimitern, like I said, it's between you and your conscience -- I just wish there was a better argument on the other side than "the stdlib does it so it must be ok", with an implied "encapsulation is teh stupids because everybody always considers every ramification of their actions" :(11:07
dimiterngoing through the code and making sure things marked in some way (eg. comments) are not touched11:07
dimiternfwereade: i certainly see your point11:08
dimiternfwereade: and agree encapsulation is great, but why haven't we done that before (copy exported data) - or this is the first case?11:08
dimiternfwereade: I mean *have we done*11:09
fwereadedimitern, I have not gone through and checked everywhere -- but certainly ISTM to be good hygiene to (eg) copy a struct's internal maps when returning it from a method11:09
fwereadedimitern, I feel it's essentially the same case11:10
jamfwereade: "if all of your friends jumped off a bridge": http://xkcd.com/1170/11:10
fwereadejam, indeed :)11:10
jamhas a good point that yeah, if everyone I know seems to think that the most rational thing to do is X, they are probably right11:10
dimiternjam: hey :) i thought of that as well11:10
fwereadeI had it uppermost in my mind as I typed it, believe it or not11:10
jamI probably agree that "immutable by convention" is asking for that one case where someone doesn't know the convention.11:11
jamcopying a *slice* is trivially cheap, because it is just a reference object, but I haven't looked at the code review.11:11
rogpeppejam: hopefully we ourselves *do* know the convention :-)11:11
rogpeppejam: i think we were talking about copying the contents of the slice here.11:12
fwereaderogpeppe, that is a hideously short-sighted attitude IMO11:12
fwereaderogpeppe, if we get this right, people will still be working on the codebase N years in the future11:12
rogpeppefwereade: i think it's reasonable to consider the std lib as best practice.11:12
fwereaderogpeppe, like go get, huh?11:12
rogpeppefwereade: that's not the standard lib, it's a command.11:13
dimiternjam: that's the CL https://codereview.appspot.com/7317045/ if you want to take a look11:13
fwereaderogpeppe, it would still seem to argue that the authors of go can do profoundly short-sighted things11:14
rogpeppefwereade: what you're saying is that we should never be allowed *any* global exported variables from any package.11:14
rogpeppefwereade: and i'm slightly surprised at your attitude, coming from python where you can change *anything* :-)11:15
fwereaderogpeppe, why do you think I'm so happy doing go? this sort of thing is seductive but IME it screws you up in the not-very-long-term11:16
rogpeppefwereade: it's a continuum.11:16
fwereaderogpeppe, and I'm not saying *never* -- but I think there should probably be a good reason *for* doing so, much like using interface{}11:16
dimiternfwereade, rogpeppe: how about a compromise? IsUnitHook(string) bool; IsRelationHook(string) bool (or Kind) ?11:16
dimiternno that won't do actually - i still need to be able to iterate over them..11:17
rogpeppedimitern: yup11:17
rogpeppedimitern: BTW i just posted a couple of comments to the CL11:18
dimiternrogpeppe: cheers11:18
rogpeppefwereade: honestly, we don't lose sleep about people mutating state.ErrUnauthorized. i don't think we should worry about a global UnitHooks either.11:19
fwereadedimitern, rogpeppe: I first said I was not interested in fighting it almost 30 mins ago... I do not think I'm likely to be convinced that "immutable by convention" is ever a good idea, so please stop trying to convince me that it's somehow *better* than "actually immutable"... but I can also accept that there are much bigger deals11:19
dimiternrogpeppe: you're not exactly right about IsRelation being the opposite of IsUnit, because relation hooks are suffices, and unit hooks are exact matches11:20
rogpeppedimitern: it is the opposite in terms of Kind, no?11:20
dimiternok, another thought - a func taking a callback func and iterating over unit/relation hook kinds?11:21
fwereaderogpeppe, the furthest I'll go is "not a bad enough idea to lose sleep over"11:21
dimiternrogpeppe: no, because IsRelation("foo-relation-changed") is false11:21
rogpeppedimitern: isn't it true that for all kinds k defined in charm/hooks, IsRelation(k) == !IsUnit(k) ?11:22
dimiternrogpeppe: in terms of Kind, yes, but with actual strings I have to check for in expand/bundle (file names), it won't work11:22
fwereadedimitern, please just go with whichever you personally prefer11:23
dimiterni'm between the anvil and the hammer here :) I don't want to choose sides of this merely philosophical debate11:24
rogpeppedimitern: you don't seem to call IsUnit anywhere.11:24
dimiternrogpeppe: no, I added it for a slightly different logic, now it's useless, so I agree and will remove IsUnit()11:25
dimiternthere's a fairly long discussion on golang-nuts about immutables: https://groups.google.com/forum/?fromgroups=#!topic/golang-nuts/BnjG3N77Ico11:26
dimiternto satisfy both views, we can have something like func (kind Kind) RelationHooks() []Kind and the sane for unit hooks11:27
dimiterns/sane/same/11:28
rogpeppefwereade: that's no better tbh11:28
rogpeppeoops11:28
rogpeppedimitern: ^11:28
rogpeppedimitern: go with UnitHooks() []Kind if you like. i'll just sigh from a distance :-)11:29
dimiternrogpeppe: but since we already have methods on Kind, it seems like the right place, no?11:29
rogpeppedimitern: it makes it sound like the it's returning a slice that has something to do with the receiving kind.11:29
rogpeppes/the//11:29
dimiternrogpeppe: yeah, and if you don't have a kind, you have to do smth. like Kind("").RelationHooks() .. ugly11:30
rogpeppedimitern: yup11:30
dimiternrogpeppe: so you agree to have UnitHooks() []Kind ?11:30
dimiternalbeit reluctantly i guess..11:31
rogpeppedimitern: *sigh* yes. does that mean i have to make testing.ServerCert into a function now?11:32
dimiternrogpeppe: tyvm; I don't think we're setting a precedent here11:33
rogpeppei really do feel it's a slippery slope actually11:33
dimiternfwereade, rogpeppe: final look? https://codereview.appspot.com/7317045/11:38
rogpeppedimitern: that's worse, sorry. it doesn't fix fwereade's issue, and if a function returns a slice, it *really* looks like it's ok to modify.11:39
dimiternrogpeppe: ok, maybe I didn't get what I was supposed to do?11:40
rogpeppedimitern: i think you need to do. func RelationHooks() []Kind{a := make([]Kind, len(relationHooks); copy(a, relationHooks); return a}11:40
dimiternrogpeppe: ah, ok - it'll not copy it simply by returning it11:40
rogpeppedimitern: indeed - slices are references11:41
dimiternrogpeppe: fixed11:43
dimiternready to submit then?11:45
rogpeppedimitern: LGTM11:46
dimiternrogpeppe: thanks!11:46
dimiternI have this bug fix here - https://codereview.appspot.com/7305096 - anyone care to review?12:39
dimiternfwereade, rogpeppe, jam? ^^12:42
fwereadedimitern, re dummy's install hook12:54
fwereadedimitern, is there anything currently checking its permissions?12:54
dimiternfwereade: no12:54
fwereadedimitern, best to just fix it then, I think :)12:55
dimiternfwereade: but how?12:55
fwereadedimitern, I think you can just chmod it? doesn't bzr see that as a change?12:55
dimiternfwereade: not sure how to set +x on it, tried chmod +x but bzr didn't pick it up12:55
fwereadedimitern, bah, ok... anyone?12:55
dimiternfwereade: ah, you know, that's not the problem12:58
fwereadedimitern, oh yes? something else does check that?12:58
dimiternfwereade: my bad - I'm not checking before setting them and issuing a warning12:58
fwereadedimitern, I've sent a few comments anyway12:58
dimiternfwereade: dummy/hooks/install was already +, that's why bzr didn't pick it up12:59
dimitern+x12:59
dimiternfwereade: cheers12:59
fwereadedimitern, ha! I completely missed that :/12:59
dimiternfwereade: what do you mean about the block obfuscating the test? the for loop?13:00
fwereadedimitern, the checks for the test data being the test data -- what relations are there, what it's called, what its rev is13:00
fwereadedimitern, and as I say at the top I'd like those tests most of all if we had some hooks with problems, some without, and some missing13:01
dimiternfwereade: not sure I get your point13:01
fwereadedimitern, sorry, my first point or my second point?13:02
dimiternfwereade: you mean the asserts before the loop are unnecessary?13:02
fwereadedimitern, I think so, I'm certainly open to argument otherwise13:02
dimiternfwereade: well, I agree they don't bring anything more than validating the all-hooks charm has what we need13:03
dimiternfwereade: removing them does not weaken the test i think13:04
dimiternfwereade: not sure about logging the name of the charm beforehand - this will cause assertions on log fail in other cases13:07
fwereadedimitern, grar13:07
dimiternfwereade: maybe instead, log the hooks as "charm/hooks/name"?13:07
dimiternfwereade: and take charm name from meta.Name13:08
fwereadedimitern, probably better not to put it into an apparent path if it doesn't refer to a real one, I think I preferred the original form13:09
dimiternfwereade: without charm name or with?13:10
fwereadedimitern, can we move that bit down, though, to where we do check setExec?13:10
fwereadedimitern, with is fine13:10
dimiternfwereade: sure, it seems the right place13:10
fwereadedimitern, cool, ty13:10
dimiternfwereade: and i'll add additional assets in dir_test to check perms after checking the logged warnings13:11
fwereadedimitern, cheers13:11
rogpeppeha! i've worked out why i checking for ErrShutdown after server close is inherently racy.13:11
rogpeppeobvious really, doh!13:11
* fwereade cheers at rogpeppe13:29
fwereaderogpeppe, incidentally, https://codereview.appspot.com/7324049/ is back in review13:31
rogpeppefwereade: thanks, i'll try to have a look, although i'm making a concerted effort to move forward with the api today. the race (not a bug, just my own stupidity in not understanding the issue) has set me back a bit.13:33
fwereaderogpeppe, no worries, I basically did everything you suggested -- but I decided that it was too much effort messing around with floatifying, so 100 cpu-power == 1 ECU13:34
rogpeppefwereade: sgtm13:34
fwereaderogpeppe, cheers -- TheMue or dimitern, if you'd like to take a quick look I'd appreciate it13:34
dimiternfwereade, rogpeppe: PTAL https://codereview.appspot.com/7305096/ - suggestions addressed13:36
fwereaderogpeppe, one thing that is starting to bother me, though... I think the implicit one-environ-per-state will be *much* harder to fix after we release (much like the entity id types)13:37
fwereaderogpeppe, I have a horrible feeling that it's not possible to address it in time though13:37
rogpeppefwereade: why do you think it's going to be particularly hard?13:39
rogpeppefwereade: (not that i necessarily disagree)13:39
rogpeppefwereade: you're thinking about cross-environment juju?13:40
fwereaderogpeppe, because I think all the cross-collection keys will need an e#%d# prepended13:40
fwereaderogpeppe, I'm thinking about multitenanting13:40
fwereaderogpeppe, I know that is not a deliverable, so maybe I should put that on the "meh, fix it later" pile, but a lot of my current stress comes from feeling we have been too quick to do that in the past13:41
rogpeppefwereade: i don't think we'd particularly need someone's existing juju environment to upgrade to multitenanting13:41
fwereaderogpeppe, just adding multitenanting should not break an existing one, though13:42
rogpeppefwereade: well, even if we do - it's just a major upgrade, we stop the world, fix the database, upgrade the clients, and carry on13:42
fwereaderogpeppe, we have done no work to enable that13:42
rogpeppefwereade: indeed - major version upgrades need to be done13:42
rogpeppefwereade: but we can upgrade to allow major version upgrades, *then* change to support multi-tenanting13:43
fwereaderogpeppe, I'm not sure that's trivial either... and while we can't do it, we're basically locked to our existing schema, which makes me nervous13:43
rogpeppefwereade: it's not trivial, but one of the main points of major version upgrades is to allow us to change db schemas, no?13:43
fwereaderogpeppe, yeah, but *not* changing our schema is even better :)13:44
rogpeppefwereade: another possibility is keeping one State per environ, but making it possible to have several States in the same mongo; we could use a collection prefix.13:46
fwereaderogpeppe, indeed, that might actually be smarter, hard to tell at this point13:46
rogpeppefwereade: it would certainly give more isolation13:47
fwereaderogpeppe, anyway, I must not distract you from the API, sorry :)13:47
rogpeppefwereade: thanks :-)13:47
* rogpeppe undistracts13:47
* dimitern lunch13:48
TheMue*sigh* Bad net today. *hmpf*13:59
=== wedgwood_away is now known as wedgwood
rogpeppefwereade, dimitern, jam: this should fix at least one of the common errors we're getting in trunk: https://codereview.appspot.com/7310095/14:20
dimiternrogpeppe: i'm on it14:20
rogpeppe i'm a bit worried by this though - i've never seen it; has anyone else other than jam? http://pastebin.ubuntu.com/1654670/14:21
dimiternrogpeppe: I haven't14:22
dimiternrogpeppe: reviewed, care to reciprocate? https://codereview.appspot.com/7305096/14:23
rogpeppedimitern: ok!14:23
rogpeppedimitern: thanks BTW14:25
dimiternrogpeppe: yw14:25
fwereadedimitern, sorry, a couple more comments, looking good though14:31
dimiternfwereade: sure, np14:31
dimiternfwereade: you're right about BundlePath(), I'll fix it14:33
dimiternand the other thing as well, i'll change the logic to handle hooks dir paths better14:34
fwereaderogpeppe, https://plus.google.com/hangouts/_/539f4239bf2fd8f454b789d64cd7307166bc9083#15:01
fwereademramm, rogpeppe, TheMue: sorry, restarting firefox, brb15:05
fwereademramm, rogpeppe, TheMue: ffs... restarting whole machine15:18
rogpeppefwereade: k15:18
fwereaderogpeppe, screw it, updates seem like my only hope :/15:22
rogpeppedimitern: you've got a review. that was a bit of an unequal swap!15:27
* fwereade feels lucky15:27
fwereaderogpeppe, mramm, TheMue: heh, are we done?15:27
dimiternrogpeppe: tyvm15:28
dimiternrogpeppe: sorry :)15:28
mrammfwereade: yea15:28
fwereademramm, did we come to any conclusions?15:29
mrammwe ended with me saying that I thought that a vendor dir was a mostly effective way of handling dependencies back in the early days of svn and python15:29
mrammand given that we are still a bit of a similar bleeding edge state with go15:29
mrammI think it makes sense15:30
mrammand there was general agreement -- with roger picking up the job of creating an experimental branch with everything "vendored in" to bzr15:30
fwereademramm, awesome; rogpeppe, thanks very much15:31
rogpeppefwereade: one problem with the third-party directory possibility: go test ./... takes a lot longer...15:42
fwereaderogpeppe, ha, I bet :/15:42
fwereaderogpeppe, incidentally, re printing log messages... making logging sane on the CLI feels like an awful lot of work for very little payoff at this stage15:44
rogpeppefwereade: yeah, it was just a passing thought15:45
fwereaderogpeppe, I wanted that, but felt that gating this bug fix on "oh, and fix our logging while you're at it" would be unhelpful :)15:45
rogpeppefwereade: yeah, that's why i said "aside" in the comment15:45
rogpeppepwd15:45
fwereaderogpeppe, no worries, I wasn't accusing you of doing the same... maybe slightly hoping you had a cunning plan I hadn't thought of, at most :)15:46
fwereaderogpeppe, how much longer, incidentally?15:49
rogpeppefwereade: i'll tell you in a mo15:49
fwereaderogpeppe, ouch15:49
rogpeppefwereade: no, i haven't started the tests yet15:49
fwereaderogpeppe, ah, phew :)15:49
dimiternfwereade, rogpeppe: I think it should be much better now - https://codereview.appspot.com/7305096/  - I even caught an issue I haven't noticed, once fixing the tests it popped out :)16:14
fwereadedimitern, awesome, I'll take a look -- and would you give https://codereview.appspot.com/7324049/ a once-over please?16:15
dimiternfwereade: sure, i'm on it16:15
dimiternfwereade: reviewed16:30
fwereadedimitern, cheers -- and LGTM for yours :)16:34
dimiternfwereade: tyvm16:34
dimiternrogpeppe: I think I addressed all you comments as well16:35
rogpeppefwereade: the thirdparty thing is a time waster. i'm leaving it for now. goyaml tests fail for me against tip :-(16:38
fwereaderogpeppe, heh, that doesn't sound great :(16:39
rogpeppefwereade: (which is worrying, but not what i want to be worrying about right now)16:39
rogpeppefwereade: i suspect unsafe buggery16:39
fwereaderogpeppe, sounds all too plausible16:40
fwereadedimitern, not sure how space-stripping makes things simpler -- as it is I handle both "k1=v1" "k2=v2" and "k1=v1 k2=v2" cleanly (to fit both expected command line forms)16:43
fwereadedimitern, expand?16:43
fwereadedimitern, also seems like it would make "mem=" constraints very tricky to get right16:44
dimiternfwereade: that was just a thought really16:44
fwereadedimitern, no worries16:44
dimiternfwereade: think of handling extra spaces though16:45
dimiternfwereade: like "   k1=v1   " ?16:45
dimiternfwereade: Split(" ") will give you empty entries in that case?16:46
fwereadedimitern, hmm, yeah, maybe I should trim external spaces and ignore empties when split16:46
fwereadedimitern, thanks16:46
dimiternfwereade: yw16:47
dimiternrogpeppe: when you can, please have a final look https://codereview.appspot.com/7305096/16:50
fwereadegotta dash gents, happy weekends all17:18
dimiternfwereade: happy weekend!17:18
mrammIt looks like atlanta is the confirmed city for the sprint17:24
dimiternmramm: cool, dates as well?17:25
mrammstarting on the 4th17:27
mrammwe are still working on finalizing the hotel details17:27
dimiternmramm: great17:27
dimiternmramm: so we should be getting a mail about what flights to pick?17:28
dimiternrogpeppe:  ping17:36
TheMuefwereade: Enjoy your weekend.17:37
mrammdimitern: fly in on sunday out on friday night or saturday17:38
mrammbook it through the agent and you are all good17:38
dimiternmramm: ok, I'll contact the agent next week17:39
TheMueWill do it on Monday too, in on Sunday, out on Friday evening/night. Found a good connection.17:42
rogpeppedimitern: pong18:06
rogpeppedimitern: (sorry, been in a meeting)18:06
dimiternrogpeppe: sorry, I submitted it already, but if you thing I should've changed something, take a look pls18:07
rogpeppedimitern: that's fine. i've been a bit frantic all day. haven't reviewed as much as i could18:07
dimiternrogpeppe: no worries, it's like that some days :)18:07
dimiternrogpeppe: thanks for all reviews18:08
rogpeppedimitern: i've been frantic *and* made no significant progress, which is the really annoying thing. bug fixing all the way.18:08
dimiternrogpeppe: sorry, if was bugging you too much actually18:10
rogpeppedimitern: np18:11
dimiternbut this thing - I wanted to get over with it already - whole week almost just for one bug fix :|18:11
rogpeppedimitern: yeah i know. sorry about that.18:11
rogpeppedimitern: i'm just trying to avoid being a critical-path-blocker for the juju-gui guys18:11
dimiternrogpeppe: i see, what's up there?18:12
rogpeppedimitern: they're going to start implementing command-line-equivalent functionality in the api server18:12
rogpeppedimitern: essentially copying stuff from cmd/juju and making it available from state/api18:12
dimiternrogpeppe: they're using the api already?18:12
rogpeppedimitern: they've made a connection to it...18:13
rogpeppedimitern: yeah18:13
dimiternso no longer juju status polling18:13
rogpeppedimitern: no watchers yet. that was my main goal for this week, and i've not got there yet dammit18:13
dimiternrogpeppe: sounds good, but I guess it's hard to integrate initially18:13
rogpeppedimitern: we have a bit of a problem too, that i'm just trying to work out the best way to get around18:14
dimiternrogpeppe: i'll follow the development with keen interest, it's coming along nicely so far18:14
rogpeppedimitern: which is that quite a few of the command line commands use a juju.Conn (which is a (State, Environ) pair) but we don't have access to the Environ in the api server18:15
rogpeppedimitern: so the question is: can we make them do without the Environ?18:15
dimiternrogpeppe: that's by design or not ready yet?18:15
rogpeppedimitern: for instance, deploy uses the environment storage to upload the charm18:16
rogpeppedimitern: the plan is to store charms in mongodb, but we don't do that yet18:16
dimiternrogpeppe: blobs? is that sane performancewise?18:16
rogpeppedimitern: i dunno. is there a particular reason it should be bad?18:17
rogpeppedimitern: a charm wouldn't necessarily need to be stored as a single blob18:17
dimiternrogpeppe: well, I don't know about mongo, but doing so in relational dbs is rarely a good idea18:17
rogpeppedimitern: it was part of the reason we moved to mongo, so i hope it won't be too bad.18:18
rogpeppedimitern: this makes it sound like it's ok: http://blog.mongodb.org/post/183689081/storing-large-objects-and-files-in-mongodb18:18
dimiternrogpeppe: cool18:18
dimiternrogpeppe: sounds way better than using blobs in a table18:19
rogpeppedimitern: the mgo package in supports gridfs: http://godoc.org/labix.org/v2/mgo#GridFS18:19
rogpeppes/in/even/18:20
dimiternrogpeppe: and since it's all bson it shouldn't impair performance, and searches will be fast18:20
rogpeppedimitern: yeah18:20
rogpeppedimitern: although we won't be searching inside charms18:20
rogpeppedimitern: so i'm wondering if it might be easier to do the right thing and change our stuff to store charms in mongo than to get a juju.Conn to the api server18:21
dimiternrogpeppe: maybe not now, but who knows18:21
rogpeppedimitern: true18:21
rogpeppedimitern: although we'd probably just index the metadata18:21
dimiternrogpeppe: yeah18:21
rogpeppedimitern: the other place that uses the environ is status18:22
rogpeppedimitern: it uses it to find out DNS names of instances.18:22
dimiternrogpeppe: what's the problem getting the api access the environ?18:22
rogpeppedimitern: we don't really want to give it that power18:23
dimiternrogpeppe: maybe read-only18:23
rogpeppedimitern: and it's awkward because it'll have to watch the environconfig for changes18:23
dimiternrogpeppe: true18:23
dimiternrogpeppe: but then again, there are things in environ, which have to be proxied through the api, i think18:25
rogpeppedimitern: what do you mean?18:25
dimiternDNSName for one18:25
dimiternrogpeppe: I mean things you get out of status, how the gui used to get it18:26
rogpeppedimitern: yeah18:26
dimiternrogpeppe: but if all of these are already in state, then i guess it'll be sufficient18:26
rogpeppedimitern: except they're not18:27
rogpeppedimitern: (perhaps they should be though - but that's more work)18:27
rogpeppedimitern: ha! there's a chicken/egg problem too18:28
dimiternrogpeppe: the amount of work can be estimated by what they need, should be easy enough to judge18:28
dimiternrogpeppe: they have a working prototype and all18:28
rogpeppedimitern: because the environ isn't valid until someone has connected to the state and pushed the secrets18:28
rogpeppedimitern: and that's done by connecting to the api server18:29
dimiternrogpeppe: hmm, how did the gui used to get all that?18:29
rogpeppedimitern: but we're saying that the api server needs an environ18:30
dimiternrogpeppe: yeah, maybe at first without caring about environ changes18:30
dimiternrogpeppe: it's not changing that much anyway, is it?18:30
rogpeppedimitern: yeah, i think if we provided access to the environ, we'd let the api server come up without it, but any requests that need it would fail18:31
dimiternrogpeppe: until? bootstrap?18:31
rogpeppedimitern: until a client connects and pushes the environ secrets18:32
dimiternrogpeppe: but isn't the gui also a client like this?18:32
rogpeppedimitern: at which point it'll see a valid environ and api requests will start working.18:32
rogpeppedimitern: yes - the gui client won't be able to bootstrap18:32
rogpeppedimitern: until at least one non-gui client has connected18:33
dimiternrogpeppe: really? why not?18:33
rogpeppedimitern: because the gui doesn't have access to the environment secrets.18:33
dimiternrogpeppe: so you cannot pass with the gui only18:33
rogpeppedimitern: although... maybe it should18:33
rogpeppedimitern: ah no, it can't bootstrap18:33
dimiternrogpeppe: well, if the gui is designed as a full cli replacement, it should be able to bootstrap as well18:34
rogpeppedimitern: because it has no way of talking to the environment provider directly in order to start the first machine18:34
rogpeppedimitern: unless we provide some sort of proxy that does that18:34
dimiternrogpeppe: i suspect we'll do that, albeit not for 13.04 probably18:34
rogpeppedimitern: (which means that the user would be handing over their credentials to us, which they probably won't want to do)18:34
dimiternrogpeppe: hmm, i see your point18:35
dimiternrogpeppe: but having the same functionality from the gui means, we'll have environments.yaml somewhere in the gui18:36
rogpeppedimitern: yeah, but web browsers can't talk to amazon APIs AFAIK18:37
dimiternrogpeppe: the backend will do that, but the environ can come from the gui18:38
rogpeppedimitern: yeah, but that's the point: do people trust us enough to give their credentials to the backend?18:38
dimiternrogpeppe: and that's not entirely true either - you can have pure js in-browser AWS clients - there're firefox extensions doing that18:39
rogpeppedimitern: in which case, maybe it's a viable option. i don't know. it's a reasonable amount of work.18:40
rogpeppedimitern: and what about other providers?18:40
dimiternrogpeppe: it surely is18:40
dimiternrogpeppe: other providers - probably can use the same way to connect from the browser18:41
dimiternrogpeppe: ofc, all this is possible, but it'll mean reimplementing a lot of client-based code in JS :)18:42
rogpeppedimitern: depends if they provide an API that's sane to access from javascript. tbh if it involves a browser-specific extension, it's probably a no-goer18:42
dimiternrogpeppe: webkit / gecko pretty much rule all that's not IE, so even having extensions is not unheard of18:43
dimiternrogpeppe: for that password manager app I worked in uniblue, we had extensions for chrome, ff and ie, and the ch/ff shared a lot of common code18:44
dimiternbut all that is an entirely different direction for speculation :)18:44
rogpeppedimitern: i think a proxy charm would be a nicer solution (i.e. given one juju environment, you can bootstrap another)18:45
dimiternrogpeppe: that sounds interesting in more ways than just for gui use18:46
rogpeppedimitern: yeah, there are lots of interesting recursive possibilities :-)18:46
dimiternrogpeppe: anyway, interesting times ahead :)18:47
dimiternI'm off then18:47
rogpeppedimitern: oh yes18:47
rogpeppedimitern: have a great w/e!18:47
dimiternhappy weekend all :)18:47
dimiternrogpeppe: 10x, you too18:47
rogpepperight, that's me for the week18:54
rogpeppehave fun all!18:54
=== wedgwood is now known as wedgwood_away
=== wedgwood_away is now known as wedgwood

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