/srv/irclogs.ubuntu.com/2012/10/02/#juju-dev.txt

davecheneyhttps://bugs.launchpad.net/juju-core/+bug/105992101:56
davecheney--format=json :(01:56
SpamapSdavecheney: I've been explicitly using --format=json to avoid formatting incompatibilities between go/python05:03
davecheneySpamapS: yeah, i'm fixing the command line parser to handle this case05:07
davecheneylucky(~/src/launchpad.net/juju-core) % juju bootstrap --upload-tools05:11
davecheneylucky(~/src/launchpad.net/juju-core) % juju deploy mysql05:11
davecheneyerror: no reachable servers05:11
davecheneyoutstanding ... bootstrap didn't05:11
davecheneyaws said yes05:11
davecheneybut the console says that instance is stillborne05:11
davecheneyhttps://code.launchpad.net/~dave-cheney/gnuflag/001-parse-more-gnu-args/+merge/12741906:26
davecheney^ gnuflags doesn't have lbox setup06:26
rogpeppefwereade, davechen1y: mornin'06:39
davecheneymonring06:39
fwereaderogpeppe, davecheney, heyhey06:39
davecheneyrogpeppe: i have a non CL patch for you to review06:39
fwereaderogpeppe, davecheney: I'm thinking I might actually take my swap day, I fell asleep really early last night and would prefer not to waste the sudden urge to rest06:40
fwereaderogpeppe, davecheney, *but* ofc I have reviews to respond to first :p06:40
davecheneyfwereade: sgtm - don't forget meeting this aternoon06:40
rogpeppefwereade: ok, have fun if so!06:40
fwereadedavecheney, good point, ty06:40
rogpeppedavecheney: i was about to ask if you had any reviews you wanted me to look at06:40
davecheneyone to gnuflags06:41
davecheneyrogpeppe: https://code.launchpad.net/~dave-cheney/gnuflag/001-parse-more-gnu-args/+merge/12741906:41
davecheneyneeded, basically, because all the charms expect it06:42
rogpeppedavecheney: no codereview link?06:42
davecheneyrogpeppe: it doesn't make one06:43
davecheneyhang on06:43
rogpeppedavecheney: what doesn't make one?06:43
davecheneylbox06:43
davecheneyjust found the option06:43
rogpeppedavecheney: -cr06:43
davecheneyhttps://codereview.appspot.com/658806006:43
davecheneyrogpeppe: why don't i need to do that on juju-core ?06:44
rogpeppedavecheney: there's a .lbox file in its root06:44
rogpeppedavecheney: with flags in06:44
davecheneyfairy nuf06:45
rogpeppedavecheney: i'm on the review BTW06:57
rogpeppedavecheney: i'm not sure it's as simple as your CL tries to make it (which is why i didn't do it before)06:59
rogpeppedavecheney: you've got a review07:10
TheMuegood morning08:30
TheMuehi fwereade08:54
fwereadeTheMue, heyhey, I'm not really here :)09:03
TheMueoh, where you are?09:03
fwereadeTheMue, swap-daying09:05
fwereadeTheMue, I'm tired and it's my birthday :)09:05
TheMuefwereade: ah, ic. so what do you do here? ;)09:05
TheMueoh, happy birthday09:05
fwereadeTheMue, well, the most entertaining thing I can do for the next 10 mins is poke at how we implement relations and try to come up with something cleaner than what we have for the current use cases09:06
fwereadeTheMue, after that I'll go out for a while, but see you at the meeting09:06
TheMuefwereade: so it's a half swap-day09:07
fwereadeTheMue, whatever :)09:09
TheMuefwereade: :D09:09
rogpeppefwereade: hippy barday to you!10:54
rogpeppefwereade: BTW AgentName isn't happening, but we're renaming PathKey to... something else.10:55
Aramhappy birthday fwereade.10:55
rogpeppefwereade: my suggestion was Name, but that doesn't work because Service.Name already has implications. niemeyer suggested Key but that doesn't work because all kinds of things have keys.10:56
rogpeppefwereade: currently going with an earlier of niemeyer's suggestions: EntityName10:56
rogpeppefwereade: but i'm not greatly happy with that either - any suggestions welcome.10:57
Arammeeting in 1 min or 61 min?11:00
Aram ow11:00
Aramnow11:00
niemeyerMorning!11:01
mrammteam meeting hangout invite sent11:01
mrammhttps://plus.google.com/hangouts/_/557e6f4f5f9de98be4769ec91fc82db48a75d356?authuser=0&hl=en-GB11:01
niemeyermramm: Thanks11:02
rogpeppefwereade: meeting...11:03
davecheneyrogpeppe: https://bugs.launchpad.net/mgo/+bug/104567811:17
davecheney^ may be of interest11:17
davecheneyniemeyer: --format=json11:19
davecheneygnuargs only supports --format json11:19
davecheneyniemeyer: all: https://bugs.launchpad.net/juju-core/+bug/105992111:20
rogpeppedavecheney: i'm happy to do the gnuflag change if you like11:36
rogpeppedavecheney: i do bear responsibility for that package, after all11:36
davecheneyrogpeppe: if you want to take a crack over night, i would be most grateful11:36
rogpeppedavecheney: ok11:36
davecheneyi also tried splitting on the = and pushing the remainder back into f.procArgs, which worked, but the testFlagsetParse tests were not happy11:37
davecheneyand I couldn't figure out why11:37
niemeyerdavecheney, rogpeppe: What's the problem with storing the empty flag in procFlag?11:37
niemeyerdavecheney, rogpeppe: Sorry, I think I meant procArgs11:37
rogpeppeniemeyer: i'm not sure i understand the question11:38
davecheneyniemeyer: that would probably work, but TestFlagSetParse always failed for reasons I didn't understand11:38
niemeyerrogpeppe: What's the problem with doing the straightforward and just splitting --foo=bar and storing "bar" as usual?11:38
davecheneyniemeyer: that is what I tried first11:38
davecheneypushing the remainder back into procArgs11:39
davecheneybut I couldn't make the test pass11:39
rogpeppeniemeyer: what if bar is empty?11:39
niemeyerrogpeppe: What's the problem with that/11:39
niemeyer?11:39
niemeyerrogpeppe: --foo "" is fine11:39
niemeyerrogpeppe: and so is --foo=11:39
fwereadedammit -- did I completely miss it?11:39
niemeyerfwereade: Happy birthday!11:39
fwereadeniemeyer, haha, cheers :)11:40
niemeyer:-)11:40
davecheneyfwereade: happy annual celebration!11:40
fwereadeniemeyer, went out for a nice casual brunch with cath and then got screwed by the busses on the way back :/11:40
fwereadeniemeyer, the intent was there though :(11:40
fwereadedavecheney, cheers :)11:40
niemeyerfwereade: No worries really, it was a nice and quick sync up11:41
fwereadeniemeyer, excellent11:41
rogpeppeniemeyer: i have to remember the code properly, gimme a few moments11:41
niemeyerrogpeppe: And btw, given your suggestion in the review, note that "--foo=bar" and "--foo =bar" mean different things11:42
rogpeppeniemeyer: indeed, but i think that wouldn't be a problem if we did it the way i suggested11:43
rogpeppeniemeyer: because we wouldn't put the latter argument into procFlag11:43
niemeyerrogpeppe: Cool11:45
rogpeppeniemeyer: the main immediate problem with storing an empty procFlag is that i want to be able to do --foo=false for boolean flags.11:46
rogpeppeniemeyer: while still allowing --foo to mean the same as --foo=true11:47
niemeyerrogpeppe: Sounds good, although I'm not familiar with the algorithm there to have an opinion11:50
rogpeppeniemeyer: i'm nearly there. we'll see if the tests work :-)11:50
niemeyerrogpeppe: Super :)11:51
* niemeyer gets some coffee11:51
fwereadeniemeyer, Aram: can we talk a little about relations and their creation, retrieval, and watchery?12:00
Aramsure12:00
fwereadeAram, teh relation key is now a string with N service:relation pairs, in sort order, right?12:01
Aramyes12:01
fwereadeAram, this is interesting from my POV because we identify relations to hooks in a not-quite-neatly-fitting way12:03
Aramit's also used in some watchers to identify that the relation belongs to a service.12:04
fwereadeAram, as I see it we can either have an API that gets a relation by pre-existing ID number, rather than by key12:04
fwereadeAram, which will be convenient for the hook tools12:05
fwereadeAram, or we can try to do more interesting things with the key and do everything that way12:05
fwereadeAram, niemeyer: and I'm rather hoping someone else has some thoughts on this because I can't tell which is better12:06
Aramso, the hook cares about the id of the relation?12:06
fwereadeniemeyer, eg, do we think that anyone is depending on any way on the format of the JUJU_RELATION env vars?12:07
fwereadeAram, the hook needs to differentiate between different relations on the same endpoint12:07
fwereadeAram, there's a JUJU_RELATION which is, say, "db", and a JUJU_RELATION_ID which is, say "db:7"12:07
fwereadeAram, niemeyer: if we were to specify, instead, a JUJU_RELATION_ID of "db:otherservice:otherrelation"12:09
fwereadeAram, niemeyer: I think it should be pretty simple to transform back and forth into real relation keys12:09
fwereadeAram, niemeyer: which would resolve the icky two-Relation-getter-methods-on-State thing12:10
fwereadeniemeyer, Aram: I am then *very* torn on the issue of AddRelation and what params it should take12:12
fwereadeniemeyer, Aram: on the one hand, it's very convenient to be able to make up any old relations we like12:12
fwereadeniemeyer, Aram: and we make wanton use of this ability in the tests12:13
fwereadeniemeyer, Aram: (thought, derail atm: there's some always-on relation we should always be able to handle, right? for subordinates?)12:14
fwereadeniemeyer, Aram: on the other, it's pretty clearly a Bad Thing to be able to create any nonsensical relation we like, we ought to be validating them against the charms, just like we should be on upgrade12:15
fwereadeniemeyer, Aram, so my instinct is drawn towards a fuzzy-name interface for both AddRelation and Relation: ie it accepts things like "wordpress mysql" and figures out the right answer without ambiguity12:17
fwereadeniemeyer, Aram: but which mostly wants and expects real keys for normal usage12:17
* niemeyer catches up12:17
Aramhmm?12:17
Aramhow would it resolve the fuzzy naming?12:17
fwereadeniemeyer, Aram: do I sound like I'm on crack, and just making needless work? I *think* there's something important buried in there somewhere12:17
fwereadeAram, not very fuzzy -- you have to specify the service names, but can leave the :relation bit off if there's no ambiguity12:18
niemeyerfwereade: No, I think you're on a good track12:19
fwereadeAram, the point is just that it allows for a single clean API that includes appropriate validation for all uses12:20
niemeyerfwereade: I dislike a bit the way relations are referred to right now12:20
fwereadeAram, it's definitely not a polished proposal just a feel that *something* is wrong12:20
fwereadeniemeyer, in what context?12:20
niemeyerfwereade: In general12:20
fwereadeniemeyer, they're represented too many ways already, I think ;)12:21
niemeyerfwereade: Oh, sory12:21
niemeyersorry12:21
niemeyerfwereade: I mean the way we refer to them by a string that is a concatenation of the endpoints12:21
niemeyerfwereade: It ended up as a convenient way, though12:22
fwereadeniemeyer, ha, I've been coming to rather like that -- if it is (or is trivially transformable to/from) the relation "names" that the user types/sees, I think it is a good thing12:22
niemeyerfwereade: So, let me try to help on a few of your questions above12:22
* fwereade sits attentively12:23
niemeyerfwereade: I don't think we should change the environment variable12:23
niemeyerfwereade: It's breakage that sounds easy to avoid12:23
fwereadeniemeyer, ok, wholeheartedly accept that argument12:23
niemeyerfwereade: It sounds fine to have a method that grabs the relation by its numeric id12:24
niemeyerfwereade: I'm not sure I get the problem you describe referring to AddRelation, though12:25
fwereadeniemeyer, a client of the API is perfectly able to AddRelation(<wordpress:lol>, <mysql:giggle>)12:26
fwereadeniemeyer, and we will consider that a perfectly good relation, and join it, and just not run any hooks12:26
fwereadeniemeyer, IMO this is bad because if that relation *becomes* valid in future charms, to which we upgrade, we'll start running hooks in a weird weird state -- not installed, for a start12:27
rogpeppedavecheney, niemeyer: https://codereview.appspot.com/6598052/12:27
rogpeppenow for some lunch12:27
fwereadeniemeyer, so, we should really just not be allowed to create them, just as we don't create services referring to charms that cdon't exist12:28
Aramfwereade: yeah, we should validate the relation, we didn't do so because we didn't have the emans when I've written that/12:28
Arams/emans/means/12:28
fwereadeAram, did we not? I thought charm.Meta was all we needed?12:29
fwereadeAram, ok, but it's not just a matter of validating the endpoints12:29
niemeyerfwereade: Curious.. :-)12:29
fwereadeAram, it's a matter of specifying them in the first place, in add-relation, which requires that we do the validation12:29
niemeyerfwereade: A bit of history.. https://codereview.appspot.com/6305067/ ;-)12:29
fwereadeniemeyer, ok, that is referring (I think) to a somewhat lower standard of validity12:30
fwereadeniemeyer, I think that in apprehending the charm-upgrade issue, my thoughts on this matter have taken a harder line12:31
niemeyerfwereade: Yeah, your thoughts on it are well appreciated12:32
niemeyerfwereade: So, hmm.. what prevents a relation from being added while an upgrade is in progress?12:32
fwereadeniemeyer, nothing yet12:33
fwereadeniemeyer, things are still changing under my feet enough that I don't have a clear picture of the final shape of the solution12:33
fwereadeniemeyer, I just know it's something that should be borne in mind12:33
niemeyerfwereade: We should certainly validate the relation.. just trying to imagine how to do it properly12:34
fwereadeniemeyer, I don't see any way around getting the charms' Metas12:37
niemeyerfwereade: We can add an assertion against the revision numbers of the involved services, I suppose12:37
fwereadeniemeyer, I think it's easier that that if we are careful with the lifetimes and with what upgrades we allow12:37
fwereadeniemeyer, block upgrades which would change non-Dead relations12:37
niemeyerfwereade: Yeah, this is the basic need.. the next question is which charm12:37
niemeyerfwereade: That's already an agreement I think, although we didn't put it in place yet12:38
fwereadeniemeyer, the current one of the service -- by blocking upgrades until incompatible relations are gone we can always use the service's current charm12:38
niemeyerfwereade: But besides that, we must also prevent adding a relation after the decision that it was ok to upgrade happens12:38
fwereadeniemeyer, it becomes a matter of figuring out what races we have to deal with between client 1 adding relations and client 2 upgrading charms12:40
niemeyerfwereade: Yeah, that's what I was referring to above12:40
niemeyer<niemeyer> fwereade: We can add an assertion against the revision numbers of the involved services, I suppose12:40
fwereadeniemeyer, I am hoping that we will be able to express suitable asserts in the transactions12:40
niemeyerfwereade: To prevent adding a relation to a service that holds an unknown charm12:41
fwereadeniemeyer, yeah, exactly12:41
niemeyerfwereade: Cool, nothing sounds too bad so far12:41
fwereadeniemeyer, as long as we express the changes correctly on the client, we can find some way to keep not-yet-ok charms off to one side until the deployed charm can handle them12:42
fwereadeniemeyer, not really sure how to do that yet12:42
fwereadeniemeyer, doesn't feel likely to be a real dealbreaker12:43
niemeyerfwereade: You mean not-yet-ok relations?12:43
* fwereade slaps self12:43
fwereadeniemeyer, yes, thank you12:43
niemeyerfwereade: Cool, np12:43
niemeyerfwereade: Yeah, agreed.. we have easy access to the current charm from the uniter12:44
fwereadeniemeyer, yeah, it feels quite neat12:44
fwereadeniemeyer, you had doubts about the appropriateness of the current "foo:bar baz:qux" key, though?12:44
fwereadeniemeyer, actually, that's in backward form :p12:45
niemeyerfwereade: I have a tiny dislike for it.. but it's not a big deal I think12:45
fwereadeniemeyer, I *think* that the ease of transformation to/from user-speak is very nice12:46
niemeyerfwereade: The only change I'll likely propose in the short term is to order the keys by role12:46
fwereadeniemeyer, +112:46
niemeyerfwereade: Otherwise we have "wordpress:db mysql:server" and "mysql:server blogger:foo"12:47
niemeyerWhich is not great12:47
fwereadeniemeyer, requirer then provider?12:48
niemeyerfwereade: Yeah,  that sounds sensible12:49
fwereadeok then -- since the ids-in-watchers change, I have no way to progress on relations without working on some of this stuff13:03
fwereadeniemeyer, ^^13:03
fwereadeniemeyer, I really don't think it is sensible for me to get sidetracked by the CLI-related bit when the uniter is still to be done, so I think I will just add a minimal RelationById(int) (*Relation, error) and change Relation() to take a key instead of endpoints13:05
fwereadeAram, how are the watchers looking?13:06
fwereadeAram, specifically ServiceRelationsWatcher :)13:06
Aramnothing done on that front, there's one in review you can look at, it will definetly look very similar.13:06
fwereadeAram, great, I will * try* to check that out this evening13:07
niemeyerfwereade: Hmm13:08
* fwereade listens13:08
niemeyerfwereade: Sorry, still pondering on the scheme you mention there13:09
niemeyerfwereade: Having the relation taking a key instead of endpoints doesn't feel great13:10
niemeyerfwereade: The way we have the current interface pretty consistent on that front feels like a nice win we have13:11
fwereadeniemeyer, hmm; I need to get relations both by key (because I presume that is how the watcher will deliver them) and by id (because that is how I express them to the hooks, which might pass them back to me)13:13
fwereadeniemeyer, getting relations, and watching relations, by key, seems natural to me13:14
* rogpeppe had never realised the subtle difference in Gnu flags between -u=foo and --u=foo13:14
fwereadeniemeyer, the intent is that at some stage we can change over AddRelation to take a string, just as GetRelation does, that does the appropriate inference of unambiguously underspecified endpoints13:15
fwereadeniemeyer, and sorts appropriately, I guess13:15
niemeyerfwereade: :-)13:15
niemeyerfwereade: Effectively manipulating the key onto a different key13:15
fwereadeniemeyer, and thereby as a second step get back a unified API, that is backward-compatible with the stuff I've been doing in the uniter13:16
fwereadeniemeyer, ok, the heart of it is this13:16
fwereadeniemeyer, I need to look them up in 2 different ways, neither of which is the same as the current way to get a relation13:17
niemeyerfwereade: What is the real underlying needs you have?13:17
fwereadeniemeyer, if I just add two trivial RelationByKey and RelationById methods, I'm golden13:17
niemeyerfwereade: -1 on relation by key13:18
niemeyerfwereade: key is internal, and is a compilation of the current endpoint semantics13:18
niemeyerfwereade: I'm pretty sure we'll regret if we change it13:18
fwereadeniemeyer, ah -- I had thought we were loving away from internal keys that differed from external names13:18
fwereadeniemeyer, but, ok, if it's not the thing that we use to look things up by, and to send in watchers, it's not much of a key, is it?13:19
niemeyerfwereade: That's one of the reasons why I dislike the key mechanism. That said, I'm pretty sure exposing it as suggested will lead to many other issues that don't feel great to get into.13:19
niemeyerfwereade: You just mentioned one of them.. we cannot add a relation by its key, because we have to manipulate the key first13:20
niemeyerfwereade: It's a primary key used in the database.. there's no single place in our API that exposes this key13:20
niemeyerfwereade: It's an implementation detail13:20
niemeyerfwereade: To enable the API that we've agreed on so far13:21
niemeyerfwereade: We can kill the idea of using it as a key if we change the API13:21
fwereadeniemeyer, ok, then ID remains the primary way of identifying relations?13:21
niemeyerfwereade: It depends on the way you look at it13:21
niemeyerfwereade: how does our API look like? Are we using id as a primary way to identify relations?13:21
fwereadeniemeyer, ok: SRW will send IDs, and I will call a State method that takes an ID when I want to see what relation it refers to13:21
fwereadeniemeyer, I have assumed ID to be the main way, yes, but little committed code depends on this13:22
niemeyerfwereade: We can make the concept more first class13:23
niemeyerfwereade: For instance, state.Relation(id) sounds fine..13:24
niemeyerfwereade: Feels a lot more sensible than obtaining all the endpoints to grab the relation13:25
niemeyerfwereade: We can then have e.g. state.EndpointsRelation(endpoints ...RelationEndpoint) (*Relation, error)13:26
fwereadeniemeyer, great, +113:27
fwereadeAram, in the absence of other feedback, then, I will probably move on to a SRW that generates IDs at some point tomorrow; please let me know if you suspect collisions13:28
fwereadeAram, I imagine I will implement it along the lines of your proposal13:28
niemeyerfwereade: This kills the inconsistency, I think, and makes state.Relation(relation.Id()) work, as usual for everything else13:28
fwereadeniemeyer, yeah, that is fine by me13:28
Aramfwereade: I don't anticipate any collisions, everythung should be smooth13:29
fwereadeniemeyer, and then we can have a state.InferEndpoints(eps ...string) ([]RelationEndpoint, error), that can be used by the CLI tools13:29
niemeyerfwereade: Yeah, that sounds great13:29
fwereadeniemeyer, and as a bonus we can keep the AddRelation logic as it is for now and do that properly in concert with the upgrady bits13:30
niemeyerfwereade: Cool13:30
niemeyerfwereade: Btw, there's a great benefit of having the DB _id being the key as it is today13:32
niemeyerfwereade: The service relations watcher doesn't have to load the document to tell what service it targets13:32
fwereadeniemeyer, +10013:33
=== TheMue_ is now known as TheMue
fwereadeniemeyer, I *knew* there *was* something really good about it13:33
niemeyerfwereade: Yeah, that was kind of an unanticipated benefit.. the real reason we changed was the transaction mechanism13:34
niemeyerfwereade: Without this, we can't add a unique relation13:35
niemeyerfwereade: Because we don't have anything to assert on13:35
fwereadeniemeyer, very neat :)13:35
niemeyerfwereade: We can't assert on non-existence of something else that contains a given field13:35
niemeyerfwereade: Do you have a moment to talk about https://codereview.appspot.com/6588053/diff/2001/worker/uniter/modes.go#newcode17113:44
niemeyerfwereade: happy to postpone if you're in flow on something else13:44
niemeyer_:(13:47
niemeyer_<niemeyer> fwereade: Do you have a moment to talk about https://codereview.appspot.com/6588053/diff/2001/worker/uniter/modes.go#newcode17113:47
niemeyer_<niemeyer> fwereade: happy to postpone if you're in flow on something else13:47
=== niemeyer_ is now known as niemeyer
TheMuehmm, the current test in environs/ec2 in trunk has one fail and one panic. anybody working on that?14:12
niemeyerTheMue: What's the failure/panic?14:17
niemeyerHmm.. something in the last two revisions broke it14:18
TheMueniemeyer: Fail is NoSuchBucket in TearDownTest14:18
niemeyerAh14:18
niemeyerThat's Dave's change14:18
TheMueniemeyer: Panic is in localServerSuite.TestBootstrapInstanceUserDataAndState14:19
niemeyerLet's see in the previous revision14:19
niemeyerTheMue: Proposing14:26
TheMueniemeyer: Pardon?14:33
niemeyerTheMue: I've fixed it.. CL up in a moment14:36
niemeyerTheMue: https://codereview.appspot.com/659605614:37
TheMueniemeyer: LGTM14:41
rogpeppeniemeyer: PathKey->EntityName https://codereview.appspot.com/6593061/14:41
niemeyerrogpeppe: LGTM14:44
rogpeppeniemeyer: thanks!14:44
fwereadeniemeyer, I think I can for a mo :)14:47
niemeyerrogpeppe: np, and thanks14:47
niemeyerfwereade: Sorry, I just read your mail and didn't realize you were out before14:47
fwereadeniemeyer, nah, I was explicitly doing it because I realised I needed to and, meh, cath was out :)14:48
fwereadeniemeyer, while C&L are distracted together I'm more than happy to talk if it helps us progress14:48
fwereadeniemeyer, it just means I may disappear abruptly for hours at a time :)14:48
niemeyerfwereade: I was just going to mention that the issue there was simpler than it sounded14:48
niemeyerfwereade: I was questioning why we do the wantEvent+waitForConfig dance at all14:49
niemeyerfwereade: Rather than just running the hook directly14:49
fwereadeniemeyer, yeah -- as it turned out I really did have a reason ;)14:49
fwereadeniemeyer, not well expressed in the comments though ;)14:49
fwereadeniemeyer, oh yeah, I meant to ask about the resolved business14:50
niemeyerfwereade: Cool, I'm curious about why that is, but I can wait for the comment easily :)14:51
fwereadeniemeyer, in suggesting that no ResolvedNone event needs to be sent, I imagine that, to go with this, a wantResolved would just do nothing if the state was ResolvedNone14:52
fwereadeniemeyer, which makes "want" not quite right, maybe14:52
fwereadeniemeyer, or maybe "want" is just right :)14:52
fwereadeniemeyer, regardless, it would necessarily I think break the want-always-causes-a-send-as-soon-as-possible feature14:53
fwereadeniemeyer, the immediate consequences are generally good14:53
fwereadeniemeyer, but that property did seem like quite a nice one14:53
niemeyerfwereade: Yeah, a slight change in perspective.. it does send an event immediately, as long as the current state is sensible14:54
fwereadeniemeyer, ha, actually, the way I expressed it above, it *doesn't* break it14:54
fwereadeniemeyer, ok, if you've already considered it from that perspective I'm very happy indeed to do it that way14:54
SpamapSfwereade: aren't you supposed to be doing celebratory chores?14:55
niemeyerfwereade: Yeah, I wish we could do the same for upgrades actually14:55
fwereadeSpamapS, did some, now I can relax again ;p14:55
fwereadeniemeyer, upgrades aren't so simple, the upgradiness of a given service charm differs depending on mode14:56
niemeyerfwereade: You mean force vs. non-force?14:57
fwereadeniemeyer, and what it's to14:59
fwereadeniemeyer, X is not an interesting request when we're already upgrading to X even if it's forced14:59
fwereadenie sorry gtg for a while again14:59
niemeyerfwereade: Please do go :)14:59
* niemeyer => lunch15:32
TheMueniemeyer: a final propose of https://codereview.appspot.com/6596051/ for the error message of illegal firewall modes15:35
=== Aram2 is now known as Aram
rogpeppeniemeyer: any idea why this doesn't work? http://paste.ubuntu.com/1256219/15:59
niemeyerrogpeppe: Because you're authenticating against the wrong database16:00
rogpeppeniemeyer: ah, i wondered if it might be something like that16:00
niemeyerrogpeppe: The "/dbname" at the end of the URL does the trick16:00
niemeyerrogpeppe: That said, I don't think we want to use it like that, FWIW16:00
niemeyerrogpeppe: Login is a lot easier16:00
rogpeppeniemeyer: i don't think so either16:00
rogpeppeniemeyer: but i wanted something to verify that AddUser was actually doing something16:01
rogpeppeniemeyer: and in fact, for non-SSL connections, perhaps we do want to do it this way16:01
rogpeppeniemeyer: Login... hmm, i started doing it that way, then thought this was easier!16:01
rogpeppeniemeyer: SetPassword in state: https://codereview.appspot.com/6587060/16:32
niemeyerrogpeppe: Reviewed17:02
rogpeppeniemeyer: thanks17:02
niemeyerrogpeppe: np17:03
rogpeppeniemeyer: i'm not entirely sure how i can check that the presence database is authenticated. currently there's no difference between an authenticated and an unauthenticated connection AFAIK17:04
niemeyerrogpeppe: Perhaps we should fix that first then?17:05
rogpeppeniemeyer: i'm not sure i can do that without running mongo in auth mode, which comes in the next CL17:05
niemeyerrogpeppe: Perhaps we should do that first?17:05
rogpeppeniemeyer: hmm, yeah, we could do that17:06
niemeyerrogpeppe: As it is the CL has a bug that went unperceived because we had no tests.. feels like a good reason to step back17:06
rogpeppeniemeyer: i'm not entirely sure i understand how the auth mode thing works - the mongodb docs seem pretty sketchy17:06
rogpeppeniemeyer: i don't think the bug comment was published17:07
niemeyerrogpeppe: ?17:07
rogpeppeniemeyer: i don't see any comment in your review that points out a bug17:07
rogpeppeniemeyer: (apart from "Just needs a test to ensure the bug is fixed")17:08
niemeyerrogpeppe: Try to add the test then :-)17:08
rogpeppeniemeyer: ha17:08
rogpeppeniemeyer: i just looked at the comment in context :-)17:08
niemeyerrogpeppe: In terms of --auth, just running with --auth enables secure mode.. it allows connecting locally to the database before a user is added17:09
niemeyerrogpeppe: Which is quite handy for what we want17:09
rogpeppeniemeyer: ok, i'll make another CL that runs the testing mongodb server in auth mode.17:10
rogpeppeniemeyer: once a user is added, does it stop any further unauthenticated local connections?17:10
niemeyerrogpeppe: I think all we'd need is running the test mgo in auth mode, and use SetAdminPassword on it17:10
niemeyerrogpeppe: Right17:10
rogpeppeniemeyer: i don't see a SetAdminPassword method in mgo17:11
niemeyerrogpeppe: That's about juju :-)17:12
rogpeppeniemeyer: but we can add a user in state.Initialize17:12
rogpeppeniemeyer: i'd thought we might add a password argument to state.Initialize17:12
niemeyerrogpeppe: and then how do we connect?17:12
niemeyerrogpeppe: Well, sorry, that's irrelevant17:13
rogpeppeniemeyer: with Open as usual, no?:17:13
niemeyerrogpeppe: Yeah17:13
niemeyerrogpeppe: Either way, Initialize can be made in terms of SetAdminPassword..17:13
rogpeppeniemeyer: seems reasonable17:13
rogpeppeniemeyer: BTW in environs/cloudinit, i'm planning to write the entity name and password to $dataDir/admin/mongodb-auth17:14
rogpeppeniemeyer: then the agents will read that and put the info into the state.Info before connecting17:14
rogpeppeniemeyer: i've gotta go and cook up some wild mushrooms for tea :-)17:15
niemeyerrogpeppe: Sounds fine, except a "/auth" file sounds enough. We need to consider how to handle the multiple agents too. $dataDir is shared, IIRC17:16
rogpeppeniemeyer: ok. i wondered if there might be a problem with people reading the length of the file, given that $dataDir is globally readable.17:17
rogpeppeniemeyer: for multiple agents, i'd thought we'd use agents/$entityname/auth17:18
niemeyerrogpeppe: Not sure.. agents/ was going away, I think.. we'll have containers/ instead IIRC17:19
rogpeppeniemeyer: i think i'll fold in the Initialize changes into the current CL otherwise we've got a small chicken/egg problem .17:19
niemeyerrogpeppe: We must also think about how to avoid having the admin password exposed..17:19
rogpeppeniemeyer: well, the same directory that's used for the agent anyway17:20
niemeyerrogpeppe: I don't see the chicken/egg problem17:20
rogpeppeniemeyer: i think it's got to sit in a file. as long as it's in a 700 file in a 700 directory, i don't think there's a problem17:20
niemeyerrogpeppe: I mean how to get the admin password to be set in a way that doesn't leak it17:21
niemeyerrogpeppe: and at the same time is known by the client17:21
rogpeppeniemeyer: Initialize relies on SetPassword (well SetAdminPassword which is almost exactly the same thing), and that's what's in the current CL17:21
niemeyerrogpeppe: That's how we end up with big unfocused branches17:21
niemeyerrogpeppe: It doesn't really on unit.SetPassword or machine.SetPassword17:22
niemeyerrely17:22
rogpeppeniemeyer: yes, but the testing will be exactly the same (they both share tests)17:22
rogpeppeniemeyer: as will the implementation17:22
rogpeppeniemeyer: and we'll need the changes from the current CL that do the login too17:23
niemeyerrogpeppe: What happens if you login with an invalid user?17:23
rogpeppeniemeyer: you get an "auth failed" error17:23
niemeyerrogpeppe: s.Session.Login("admin", "foo")17:24
niemeyerrogpeppe: This means one can trivially implement SetAdminPassword, and test it17:24
rogpeppeniemeyer: ok, so that's stage 1. the next stage needs to have all the other login stuff in. and that's the bulk of it. SetAdminPassword is about two lines of code.17:25
niemeyerrogpeppe: Without Open, or machine.SetPassword, or unit.SetPassword, or Initialize, etc17:25
niemeyerrogpeppe: No, it doesn't17:26
niemeyerrogpeppe: The next stage can have just the changes to state.Open, I believe17:26
niemeyerrogpeppe: Without anything else again17:26
rogpeppeniemeyer: that's what i meant17:26
niemeyerrogpeppe: No unit.SetPassword, no machine.SetPassword, etc17:26
rogpeppeniemeyer: i didn't mean those as login stuff.17:27
rogpeppeniemeyer: anyway, it's all pretty small. i don't think there's a danger (currently) of the branch getting too unfocused17:27
niemeyerrogpeppe: That's how it starts every time17:27
niemeyerrogpeppe: and that's the direction that it was going again17:28
niemeyerrogpeppe: It's extremely rewarding to have small branches quickly integrated17:28
rogpeppeniemeyer: i will try17:29
rogpeppeniemeyer: BTW your admin password question is salient17:29
rogpeppeniemeyer: i don't know how we can get the admin password to the bootstrap machine without putting it in cloudinit17:29
rogpeppeniemeyer: and hence making it available forever17:29
niemeyerrogpeppe: I think we can use a hash trick on the original password17:30
niemeyerrogpeppe: hash it together with a well known token, and use that as the first password.17:30
rogpeppeniemeyer: yeah, i suppose we could use a hash designed for passwords.17:30
niemeyerrogpeppe: On first connection, replace with the actual password17:30
niemeyerrogpeppe: That's not the issue17:31
niemeyerrogpeppe: If we use a hash designed for passwords as the password, we'd still have the same issue17:31
rogpeppeniemeyer: i realise we have to change the password on first connection17:31
rogpeppeniemeyer: but we also need to use a hash designed for passwords, i think17:32
niemeyerrogpeppe: Not super worried about it, as long as it's a cryptographic hash17:33
rogpeppeniemeyer: otherwise someone can reverse the hash and connect as admin17:33
niemeyerrogpeppe: None of the traditional hashing algorithms are reversible17:33
rogpeppeniemeyer: i think it's important actually, if we're concerned about security from the bootstrap machine17:33
rogpeppeniemeyer: they don't need to be reversible if the password isn't so strong17:34
niemeyerrogpeppe: In fact, hashes are not reversible by definition.. they may have other weaknesses, but not reversibility17:34
rogpeppeniemeyer: i should've said "crack" not "reverse"17:34
niemeyerrogpeppe: It doesn't matter in this context17:35
rogpeppeniemeyer: because they can't make that many connections to mongodb?17:35
niemeyerrogpeppe: Sorry, I don't understand what problem you're trying to solve17:36
rogpeppeniemeyer: i'm imagining someone malicious on the bootstrap machine. they have the hash of the password from cloud-init; now they're trying to log in as admin17:36
niemeyerrogpeppe: Okay.. they have a hash based on the password.. so what?17:37
rogpeppeniemeyer: they can go through a few hundred billion passwords quite easily; when they find one that hashes to the same thing, they have the admin password.17:37
rogpeppeniemeyer: hence we slow down that process by using a hash designed for that purpose.17:38
rogpeppeniemeyer: i really must go; i'll pop my head in a little later.17:39
niemeyerrogpeppe: Enjoy17:39
niemeyerI've got a doc appointment.. back soon18:22
fwereadeniemeyer, ping20:56
niemeyerfwereade: you're probably off by now, but I just sent a question in the review22:45
niemeyerfwereade: Have seen your email too, and pondering.. will reply later22:46
davecheneystate_test.go:250: c.Assert(current, DeepEquals, initial)22:55
davecheney... obtained map[string]interface {} = map[string]interface {}{"firewall-mode":"default", "name":"test", "development":true, "authorized-keys":"i-am-a-key", "default-series":"precise", "type":"test"}22:55
davecheney... expected map[string]interface {} = map[string]interface {}{"type":"test", "name":"test", "development":true, "authorized-keys":"i-am-a-key", "default-series":"precise"}22:55
davecheney^ when was firewall-mode added ?22:55
davecheneyniemeyer: https://bugs.launchpad.net/juju-core/+bug/106050923:04
davecheneycan anyone else reproduce this, i'm getting it on two systems23:04
niemeyerdavecheney: It was added today23:12
niemeyerdavecheney: Well, yesterday from your perspective23:12
niemeyerdavecheney: Frank probably didn't run the full test suite23:13
davecheneyhttps://codereview.appspot.com/6590064 has the fix23:13
niemeyerdavecheney: LGTM23:14
davecheneyta23:14
davecheneywhat happened with rogers gnuflag patch ?23:14
davecheneyok, the mysql charm is failing because falvor doesn't have a valid default23:46
davecheneyniemeyer: it looks like charm setting's defaults are broken23:56

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