#juju-dev 2012-10-01 <Guest7958> fwereade: mornin' <fwereade> hi rog(?) ;p <rogpeppe> fwereade: not sure why it does that. surely noone else is using "rogpeppe"... <fwereade> rogpeppe, I *think* I saw your name change spontaneously at some point yesterday <fwereade> rogpeppe, I have a couple of CLs up, and I would appreciate your thoughts <rogpeppe> fwereade: i'm having a look right now <fwereade> rogpeppe, sweet, tyvm <rogpeppe> fwereade: i saw this: <rogpeppe> [17:25:19] [Notice] -NickServ- djennings@example.org has released your nickname. <rogpeppe> [17:25:20] *** You are now known as Guest7958. <fwereade> rogpeppe, omg, it's that nickserv dude again! he's almost as bad as peer! <fwereade> (sorry) <TheMue> morning <fwereade> heya TheMue <TheMue> hey, hey, fwereade <TheMue> ;) <rogpeppe> TheMue: hiya <TheMue> hi roger <rogpeppe> fwereade: ping <fwereade> rogpeppe, pong <rogpeppe> fwereade: i'm looking at the filter code, and had a little question <fwereade> rogpeppe, go for it <rogpeppe> fwereade: why only receive on the want* channels when there's an event to send? <rogpeppe> fwereade: would it be a problem to always wait on those channels? <fwereade> rogpeppe, because receiving on the want channels will unblock the sending channel and we don't want them to send nils <fwereade> rogpeppe, and we can't guarantee they won't until we've received a change <rogpeppe> fwereade: but aren't the sending channels themselves nil until an event arrives? <fwereade> rogpeppe, happily, all the watchers guarantee us initial events, so it can't be blocked for a long time <fwereade> rogpeppe, the action of a receive on a want channel is to un-nil the sending channel <rogpeppe> fwereade: is that necessary? <rogpeppe> fwereade: erm, yes, i see <fwereade> rogpeppe, in the context of that code, the condition of wanting to send on an out chan is defined by it being non-nil <fwereade> rogpeppe, it means that want* calls can all block for a short time until the filter is ready to deal with them, but the filter should be guaranteed to either become ready or fail, assuming the watchers themselves work as advertised <fwereade> rogpeppe, and the failing will itself unblock the want calls <fwereade> rogpeppe, and hence, all is sunshine and puppies, I think <rogpeppe> fwereade: i'm definitely starting to see puppies in the sun * fwereade feels cheered <rogpeppe> fwereade: one other thing: i'm wondering if it's possible to make the dying status propagate without another step through the watcher <fwereade> rogpeppe, I thought about that and decided that having One True Path for the information was the clearest thing I could do <fwereade> rogpeppe, it would not be a problem to check-and-set the local life var, and close the channel immediately though <rogpeppe> fwereade: yeah, i was wondering if there was an elegant way to do that <fwereade> rogpeppe, it just feels more complex and prone to embarrassing screwup ;) <rogpeppe> fwereade: i do know what you mean <rogpeppe> fwereade: i guess it's just my premature-optimisation head saying "5 more seconds! 5 more seconds!" <fwereade> rogpeppe, well, life could actually be a filter field and we could have a separate hey-the-unit-is-dying method <fwereade> rogpeppe, it's a reasonable concern, any number of crazy operations could be kicked off in 5 seconds <rogpeppe> fwereade: i was mainly thinking about responsiveness, but that too, yeah <fwereade> rogpeppe, if the life-field-plus-method SGTY I can do that, it does feel more ruthlessly efficient in a pleasant sort of way <fwereade> rogpeppe, but then... I dunno <fwereade> rogpeppe, in terms of sheer simplicity of implementation it's a mere Sync away... <rogpeppe> fwereade: true. i seem to remember it being considered bad practice to call Sync in a watcher though. <rogpeppe> fwereade: but i definitely see the attraction <fwereade> rogpeppe, leave some sort of comment for discussion, I imagine niemeyer will have input too ;) <rogpeppe> fwereade: i'm sure of it :-) <fwereade> rogpeppe, crack-check on another idea <fwereade> rogpeppe, move most of cmd/jujuc/server -- ie the commands, HookContext, and associated types -- into worker/uniter/hook <rogpeppe> fwereade: +1 <rogpeppe> fwereade: it's part of the worker after all, right? <fwereade> rogpeppe, I'm quite certain I will do more with the idea but I feel I can't start until I've moved them and absoerbed the impact <fwereade> rogpeppe, I have an intuition the the commands themselves may want to move somewhere else <fwereade> rogpeppe, but yeah <rogpeppe> fwereade: let me just have a quick look at cmd/jujuc/server again <rogpeppe> fwereade: this is where i come up against the "what things are actually intended to be exported?" thing <rogpeppe> fwereade: looking at http://go.pkgdoc.org/launchpad.net/juju-core/cmd/jujuc/server - which functions are actually part of the package API and which are just there for testing purposes? <fwereade> rogpeppe, some of RelationContext's methods may not technically need to be exported <fwereade> rogpeppe, and if you want to get technical about it we *could* make all the commands internal-only, but I think that actually ossifies the package <rogpeppe> fwereade: yeah, i was wondering about NewClosePortCommand and friends <rogpeppe> fwereade: i was trying to work out when we'd need them <fwereade> rogpeppe, ATM the only client is NewCommand or whatever it is <rogpeppe> fwereade: i'm not sure what you mean by "ossifies" actually <fwereade> rogpeppe, adds to the burden of moving parts of it as it becomes more apparent that they're different packages <rogpeppe> fwereade: ok, so everything else other than NewCommand could be private? <fwereade> rogpeppe, and HookContext and most if not all its methods <rogpeppe> fwereade: i don't think that's a substantial problem - renaming is easy <fwereade> rogpeppe, and RelationContext and several of its methods <rogpeppe> fwereade: this is why i think we should have a more rigorous approach to private/public naming. the important parts of the API are obscured by all the bits that could be private. <rogpeppe> fwereade: but regardless of that, i think it would sit well under worker/uniter <Aram> moin. <fwereade> rogpeppe, sorry, got a phone call <rogpeppe> fwereade: np <rogpeppe> fwereade: you've got a filter review <fwereade> rogpeppe, tyvm <rogpeppe> fwereade: what does it mean for a relation to be "broken" rather than "departed" (looking at the comment "TODO don't stop until all relations broken.") <rogpeppe> ? <fwereade> rogpeppe, has executed the -broken hook (and left the scope) <fwereade> rogpeppe, ie when that relation will never again be touched by that unit <rogpeppe> fwereade: ah, so "broken" for a relation is a kinda edge-triggered thing, rather than a steady-state broken like the unit broken thing? <fwereade> rogpeppe, yeah, it's an awful name <rogpeppe> fwereade: it certainly confused me :-) <fwereade> rogpeppe, I'm not sure there's anyone it doesn't <rogpeppe> fwereade: so the "broken" in this context is like a connection breaking - it doesn't imply anything going wrong at all? <fwereade> rogpeppe, yeah, exactly <rogpeppe> jeeze <rogpeppe> fwereade: that's something the docs are going to need to be very careful about... <rogpeppe> fwereade: just looking at modeContext - is there ever a mode that would *not* want to use modeContext? <rogpeppe> davecheney: hiya <fwereade> rogpeppe, basicaly no <rogpeppe> fwereade: why not factor it out into the loop that's calling the modes then? <davecheney> rogpeppe: hey <fwereade> rogpeppe, because the bits that need to know the name (which include the error annotation) can't be used there, because you can't turn a Mode into a name <rogpeppe> fwereade: hmm, the mode name might be a problem <rogpeppe> fwereade: you could always do something like this, i suppose: http://paste.ubuntu.com/1253570/ <rogpeppe> fwereade: i do feel that modeContext feels a bit like a hack in the midst of nice clean code. <fwereade> rogpeppe, I feel that modeContext enables a fair amount of that code's cleanliness <rogpeppe> fwereade: if you could get the name from a mode, then you could still have that cleanliness without modeContext AFAICS <fwereade> rogpeppe, although, hmm, actually the non-name bits would probably be better if they were stuck in the main loop <rogpeppe> fwereade: i think so <fwereade> rogpeppe, sgtm <rogpeppe> woo hoo, just got a 50 pound royalty payment. <fwereade> rogpeppe, nice! <fwereade> rogpeppe, what for? <rogpeppe> fwereade: a tune i wrote some time ago <rogpeppe> fwereade: someone put it on their album <fwereade> rogpeppe, awesome :D <TheMue> rogpeppe: +1 <rogpeppe> fwereade: it'll at least pay for my next bow re-hair... <rogpeppe> fwereade: (which is long overdue as it happens) <fwereade> rogpeppe, excellent :) <TheMue> rogpeppe: where can we d/l your first album? ;) <rogpeppe> TheMue: when i record it. that's predicted to be in NaN years. <TheMue> rogpeppe: ok, i plan to get old, but not so old.:( <TheMue> rogpeppe: different topic. anything special to know when doing ec2 tests (beside setting the environment with the keys)? <rogpeppe> TheMue: you should set the test timeout, because it takes a while <rogpeppe> TheMue: here's the script i use (i call it "livetest"): <rogpeppe> go test -amazon -test.timeout 2h -gocheck.vv $* >[2=1] | timestamp <rogpeppe> for bash, it would be: <rogpeppe> go test -amazon -test.timeout 2h -gocheck.vv "$@" 2>&1 | timestamp <TheMue> rogpeppe: great, thx <rogpeppe> i find the timestamp bit very useful, as i can glance over at the running test and see if it's hanging up unreasonably or progressing normally <TheMue> rogpeppe: if i do a "go test" in environ/ec2 and get an error that "juju-sample" is not found, what did i wrong? <rogpeppe> TheMue: hmm, good question, i'll have a look <rogpeppe> TheMue: could you paste the output of go test -gocheck.vv ? <TheMue> rogpeppe: sure, one moment <TheMue> rogpeppe: http://paste.ubuntu.com/1253687/ <rogpeppe> TheMue: is this running live tests? on trunk? <TheMue> rogpeppe: it's a fresh branch of trunk, just to get sure it's non of my changes <rogpeppe> TheMue: this happen even with you're not running with the -amazon flag? <rogpeppe> s/happen/happens/ <rogpeppe> s/with/when/ :-) <TheMue> rogpeppe: yes, just a play go test <TheMue> rogpeppe: ah, tried it now with -amazon, looks different <rogpeppe> TheMue: i'm wondering if you've got an old copy of the goamz package <TheMue> rogpeppe: i'll force an update, to get sure <rogpeppe> TheMue: my version of goamz is on revision 13 <rogpeppe> TheMue: and trunk environs/ec2 passes all tests for me <rogpeppe> TheMue: (N.B. go get -u doesn't work with bzr repositories) <TheMue> rogpeppe: uuh, i've got the rev 11 <TheMue> rogpeppe: thx, i'll update now and test again <rogpeppe> TheMue: that should fix your problem <Aram> rogpeppe: what GUI tool do you use for diff? <rogpeppe> Aram: qbzr <rogpeppe> Aram: it's not as good as codereview, but much more immediate :-) <Aram> can it help with merges? <rogpeppe> Aram: good morning, BTW! <Aram> (as in, is it a three way diff tool?) <Aram> moin. <rogpeppe> Aram: no. there is a tool around that does, but i can never remember its name <Aram> I'm fine with raw diffs when I need a diff, but merge conflicts really confuse me. <Aram> so I'm searching for a better tool. <TheMue> rogpeppe: thx a lot, you've been right, now the rev 13 runs fine <rogpeppe> TheMue: cool <TheMue> Aram: moin from here too <Aram> hi. <rogpeppe> fwereade: stupid bzr question: if i've got a full revision id, how can i make a branch from it? <fwereade> rogpeppe, sorry, i have no idea <rogpeppe> fwereade: thanks <rogpeppe> ah! done it! <rogpeppe> mramm: morning! <mramm> morning <mramm> How goes? <TheMue> mramm: hiya <Aram> hi. <rogpeppe> mramm: pretty good, just about to propose the final piece of the upgrade logic (the --bump-version flag on upgrade-juju) <mramm> awesome <Aram> meh, I'm using p4merge, all these open alternatives suck. <rogpeppe> Aram: i usually find that apart from very occasional cases, doing it inline is fine <rogpeppe> fwereade: relatively trivial: https://codereview.appspot.com/6593053 <Aram> rogpeppe: my brain is simply not adapted for such a task. <Aram> so I have to do it three times before it's right. <fwereade> rogpeppe, sorry, just having lunch, I'll do it when I come back <rogpeppe> Aram: i found it hard to start with, but then worked out a technique that seems to work <rogpeppe> Aram: i edit the "this" parts by copying and pasting from the "source" parts. <rogpeppe> Aram: then i delete the source parts <rogpeppe> fwereade: np, enjoy! <niemeyer> Good morning juju masters! <TheMue> niemeyer: heya <niemeyer> Hmmm.. why am I getting a BADSIG on us.achive <niemeyer> archive <TheMue> niemeyer: time for a short question? <niemeyer> TheMue: Sure <TheMue> niemeyer: fine, thx <TheMue> niemeyer: when set-up a new machine we set the juju-group and a machine-individual group <TheMue> niemeyer: in ec2 <niemeyer> TheMue: Hmm.. do we? <TheMue> niemeyer: i hope i describe it right, try to make it better understandable <TheMue> niemeyer: there's a setUpGroup() for a machine-id. and there a group with the group name ("juju-xyz") and a machine group ("juju-xyz-(machineid)") is set-up <TheMue> niemeyer: now i removed the machine group, so all machines share only one group and the ports are opened/closed on it per instance <niemeyer> TheMue: Ah, okay, you're talking about *security* groups in EC2.. <TheMue> niemeyer: sorry, yes, missed to tell more about the context <niemeyer> TheMue: Ok <TheMue> niemeyer: so now the question: shell the IP permissions for the juju-group stay the same (ssh for all plus all ports inside the group)? <TheMue> shall <niemeyer> TheMue: Yeah, sounds ok <niemeyer> TheMue: Btw, <TheMue> niemeyer: ok <TheMue> niemeyer: yes? <niemeyer> TheMue: I'm wondering if we should have that as an option rather than the default behavior <niemeyer> TheMue: If we keep the firewaller behaving as-is, would it be feasible to have this behavior switchable within the env only? <TheMue> niemeyer: would be fine to me as i prefer to start with as few open ports as possible <TheMue> niemeyer: let's make it in two CLs. i start with the current default behavior for the juju-group and then, after your lgtm, look how we can make this switchable. ok? <niemeyer> TheMue: Hmmm.. you mean breaking what's working so that we can then see how to fix it? <TheMue> niemeyer: it seems i did not get your idea right. <TheMue> niemeyer: could you please tell me what you mean by "switchable"? <niemeyer> TheMue: I mean being able to select between current behavior and a new behavior <TheMue> niemeyer: oh, understand (hopefully). <TheMue> niemeyer: i reduced it to the default ports, but you talk about the groups, don't you? <niemeyer> TheMue: I'm not sure about what "reducing to the default ports" means <niemeyer> TheMue: And yes, I think we've both been talking about security groups <TheMue> niemeyer: I thought about which ports to be open by default. <niemeyer> TheMue: I don't think we want to change that <niemeyer> TheMue: Do we? <TheMue> niemeyer: no, but after your first sentence "i'm wondering â¦" i thought so. <niemeyer> TheMue: Ah, ok.. no, I'm talking about the whole change <TheMue> niemeyer: yes, now i got it. sorry i got it wrong the first place. <niemeyer> TheMue: It's all good <TheMue> niemeyer: the firewaller relies on the interface for opening and closing ports. so the change imho can be done without changing the firewaller. <TheMue> niemeyer: but the current implementation opens and closes on the machine group <TheMue> niemeyer: and in future on the juju group <TheMue> niemeyer: so i think this can be done configurable <niemeyer> TheMue: Right.. so the first CL would be adding such a setting, without any further changes <TheMue> niemeyer: ok, and i keep my current branch as a reference for the follow-up ;) <TheMue> niemeyer: another question about security groups <niemeyer> TheMue: Yeah, nothing is lost probably <TheMue> niemeyer: if i change a ip permission for the juju group, this does not effect all instances, doesn't it? <niemeyer> TheMue: If you change a security group, it affects all instances to which the security group is attached <TheMue> niemeyer: oh, so instead of a machine security group a service based security group could make more sense, or do i get it wrong? <niemeyer> TheMue: Security groups can only be attached to a machine when the machine is created <TheMue_> Shâ¦, disconnected <niemeyer> TheMue: Security groups can only be attached to a machine when the machine is created <TheMue> niemeyer: Thx, that has been the missing link to the chosen model. Just reading a lot about it to get a better understanding. <niemeyer> TheMue: np <rogpeppe> TheMue, niemeyer: do you think it still makes sense to have two security groups? i'm thinking that we can make do with only one now. <rogpeppe> niemeyer: --bump-version is back, BTW: https://codereview.appspot.com/6593053/ <niemeyer> rogpeppe: It depends a bit on the implementation <niemeyer> rogpeppe: Would be best to have one, but given that it is switchable, I don't know what will end up being easiest <niemeyer> TheMue: ^ <niemeyer> rogpeppe: Cheers <rogpeppe> niemeyer: ah, i see. <rogpeppe> niemeyer: yeah, it depends. if you want it switchable at runtime, there's no other option. <TheMue> rogpeppe: they need something like gosecuritygroups, more lightweighted than real groups. ;) <rogpeppe> TheMue: all they need is to be able to add security groups after launch <rogpeppe> s/add sec/modify sec/ <TheMue> rogpeppe: yes, that would help a lot <niemeyer> rogpeppe: I'm not considering much runtime at this point <niemeyer> rogpeppe, TheMue: I'm hoping we can keep the core issue in mind and have that as a trivial yet nice addition soon <rogpeppe> niemeyer: it's interesting actually - we'd need to store the current mode in the environment somewhere - something we don't do anywhere. maybe an additional field in the bucket. <niemeyer> rogpeppe: We don't need to do anything we're not doing currently. Just a trivial setting that defines the intended behavior <rogpeppe> niemeyer: i mean, we'd need to do that regardless of switching at environment-creation-time or run-time. <rogpeppe> niemeyer: StartInstance needs to know whether it needs to create a new security group or not. <niemeyer> rogpeppe: StartInstance is in the environment, that has the setting to define its behavior <rogpeppe> niemeyer: yes, assuming noone calls StartInstance from the client side, where the setting might be different from the one that the environment was bootstrapped with. <niemeyer> rogpeppe: If we randomly use different settings client side and server side, we surely will have many issues <rogpeppe> niemeyer: ok. i actually thought it would work pretty well currently with just the bare minimum of settings on client's side (after bootstrap of course) <niemeyer> rogpeppe: default-series? <rogpeppe> niemeyer: interesting. tbh i have to say i'm not entirely clear on where and how default-series is used. <niemeyer> rogpeppe: Okay, so before we dive away, TheMue issue is trivial one as it stands. We must consistently use the environment settings stored in the environment no matter what. <rogpeppe> niemeyer: +1 <TheMue> niemeyer: +1 <TheMue> lunchtime <rogpeppe> niemeyer: FWIW in the only occurrence of default series being used that i can find, it's taken from the state env config, not the local config. i imagine there are other places where it will come in though. <niemeyer> TheMue: Enjoy! <niemeyer> rogpeppe: That seems to agree with what was just stated above <rogpeppe> niemeyer: i probably misunderstood you, sorry. i thought you were saying that things could be mucked up by a client using different env config settings from what we bootstrapped with. i don't *think* we can, currently. <niemeyer> rogpeppe: They cannot because we're doing exactly what I suggested, which is consistently using the environment settings stored in the environment. <niemeyer> rogpeppe: This is not a coincidence. <rogpeppe> niemeyer: ah, i see. someone *could* still muck things up by calling StartInstance directly, but none of our stuff will do that. <niemeyer> rogpeppe: Of course, someone can screw up things arbitrarily by doing arbitrary things.. <niemeyer> rogpeppe: We give people all the tools to pull an environment configuration from a mailing list and running wild.. <niemeyer> rogpeppe: Just sent a question to the CL <rogpeppe> niemeyer: i'm not sure what "interacting properly with the --version option" would be <rogpeppe> niemeyer: currently the --version flag does not influence which version is uploaded <rogpeppe> niemeyer: it seems like you might be suggesting that it should <rogpeppe> niemeyer: tbh, i'm thinking that the tool upload functionality might be best off as an entirely separate subcommand <niemeyer> rogpeppe: Hmm <niemeyer> rogpeppe: Yeah, you're right <niemeyer> rogpeppe: --version is about selecting which version to pick <niemeyer> and if we're uploading we don't really have a choice <niemeyer> rogpeppe: We should conflict these options explicitly then, I suppose? <rogpeppe> niemeyer: we could do. <rogpeppe> niemeyer: though i don't mind override semantics either <niemeyer> rogpeppe: It's bogus I think.. it will pretend to be a different version than it actually is <rogpeppe> niemeyer: i'm not sure that will happen. <rogpeppe> niemeyer: s/will/can/ <niemeyer> rogpeppe: What does --version 10.11.12 --upload-tools --bump-version mean? <rogpeppe> niemeyer: the given version is ignored, the tools are uploaded with a bumped version if necessary <niemeyer> rogpeppe: There you go.. <rogpeppe> niemeyer: i'm not sure what you mean by "pretending to be a different version". <rogpeppe> niemeyer: what's pretending? <niemeyer> rogpeppe: Nothing is pretending, because you've ignored the option entirely <rogpeppe> niemeyer: you can also do: --version 10.11.12 --upload-tools <niemeyer> rogpeppe: Let's just error when the option means nothing <rogpeppe> niemeyer: ok. <niemeyer> rogpeppe: Unrelated to the current CL, though.. LGTM <rogpeppe> niemeyer: thanks <rogpeppe> niemeyer: apart from that last wrinkle (and major-version upgades, of course), that completes upgrading for the time being, i think. <niemeyer> rogpeppe: Woohay! <rogpeppe> niemeyer: i'm now moving on to fixing a few bugs that have been assigned to me (in particular some of the sporadic live test failures). other suggestions welcome. <niemeyer> rogpeppe: We have a pretty high/critical one on the pipeline that could see your attention, actually <niemeyer> rogpeppe: I've originally invited Aram to look at it, but on a second thought you probably have more context to do it quickly <rogpeppe> niemeyer: ok. let me at it! <niemeyer> rogpeppe: We're not game to start kicking out the ssh proxying hackery <niemeyer> s/not/now <rogpeppe> niemeyer: woo. do we think that go.net ssh is up to the task? <niemeyer> rogpeppe: We don't need ssh at all, hopefully <rogpeppe> niemeyer: even better! <niemeyer> rogpeppe: The idea is to connect straight onto mongo <rogpeppe> niemeyer: what shall we use for crypto? <niemeyer> rogpeppe: It'll take a few steps to get there, though <niemeyer> rogpeppe: Mongo can talk SSL <rogpeppe> niemeyer: cool. <niemeyer> rogpeppe: mgo can't right now, but I'll fix that before you get there, I'm hoping <niemeyer> rogpeppe: As a very first step, we have to introduce the idea of a connection password for the agents <rogpeppe> niemeyer: where does the password come from? <niemeyer> rogpeppe: The agent passwords are automatically generated <niemeyer> rogpeppe: For the machine agent, we have to hand the password off during the machine creation, so that the new agent can connect once it comes up <niemeyer> rogpeppe: Unfortunately, we have to do a little trick once the agent comes up the first time, and replace the agent password with a new one that is created locally <niemeyer> rogpeppe: Because the metadata that we send to the machine is visible to anyone within the machine itself <rogpeppe> niemeyer: perhaps we could have a new agent that's responsible for exchanging one-time passwords for persistent passwords <rogpeppe> (thinking aloud) <niemeyer> rogpeppe: It's significantly simpler than that <niemeyer> rogpeppe: It doesn't even have to be a one-time password <niemeyer> rogpeppe: It's just a "Oh, is that the password I got during creation, okay.. here is a new one I want to use from now on." <niemeyer> rogpeppe: As long as we do that before the machiner goes on to create units, it's all good <rogpeppe> niemeyer: how do you get the new one? <niemeyer> rogpeppe: Just create one and change it <rogpeppe> niemeyer: ah, does SSL have provision for changing passwords remotely? <niemeyer> rogpeppe: Huh.. wires crossed there <niemeyer> rogpeppe: Forget SSL for the moment <niemeyer> rogpeppe: This is juju state logic <niemeyer> rogpeppe: and mongo auth <rogpeppe> niemeyer: ok. <rogpeppe> niemeyer: are we planning to store passwords inside the state? <niemeyer> rogpeppe: Nope <rogpeppe> niemeyer: sorry, ignore my bleating. i'll shut up until you've explained :-) <niemeyer> rogpeppe: No, that's it really <niemeyer> rogpeppe: That's the first step <rogpeppe> niemeyer: could you outline the next steps, so i know where we're heading? <niemeyer> rogpeppe: How far? :-) <rogpeppe> niemeyer: until we've got equivalent functionality to today <rogpeppe> niemeyer: but via direct connection to mongo <niemeyer> rogpeppe: We can't drop SSH just yet, but that means we can then introduce SSL more or less easily, and dro pit <niemeyer> rogpeppe: This is the tricky bit for doing so <niemeyer> rogpeppe: After that we need some means to define the admin password <niemeyer> rogpeppe: Which is what that old admin-secret meant <niemeyer> rogpeppe: So that we can connect straight to mongo <rogpeppe> niemeyer: mongo's authorization is password-based, presumably <niemeyer> rogpeppe: and then we just enable SSL <niemeyer> rogpeppe: Yes, user/pass <niemeyer> rogpeppe: In a future universe, we'll then introduce an HTTPS API to which everyone will talk to <niemeyer> rogpeppe: Which maps more or less well to that whole model <rogpeppe> niemeyer: and there's a mongo capability to add users and passwords, i guess <niemeyer> rogpeppe: Yeah, that's already well mapped onto mgo <rogpeppe> niemeyer: so we'd have one user per agent, each with its own password <niemeyer> rogpeppe: Exactly <rogpeppe> niemeyer: out of interest, which part of the API do you use to do that? <rogpeppe> niemeyer: oh, i see <niemeyer> rogpeppe: You mean in mgo? <niemeyer> rogpeppe: http://go.pkgdoc.org/labix.org/v2/mgo#Database * rogpeppe grepped for password, not user <rogpeppe> niemeyer: so can anyone change any user? <niemeyer> rogpeppe: No.. we have to put some thinking on how that will work <rogpeppe> niemeyer: it seems like the model we've got here is something like this: http://paste.ubuntu.com/1254028/ <niemeyer> rogpeppe: As you spotted above, we'd have one user per agent, each with its own password <rogpeppe> niemeyer: i'm not quite sure how the MA would pass the password securely to other agents. maybe we should just put it in a file. <rogpeppe> niemeyer: after all, if you're root you can get the password anyway. <niemeyer> rogpeppe: We probably need it in a file either way, since we must know it after it changes <rogpeppe> niemeyer: good point. <rogpeppe> niemeyer: ok, if the above sketch looks right to you, i'm happy. <niemeyer> rogpeppe: It doesn't because of what I mentioned above <niemeyer> rogpeppe: As you spotted above, we'd have one user per agent, each with its own password <niemeyer> rogpeppe: The sketch makes it feel like the password provided is the machine password <rogpeppe> niemeyer: ok, so the MA creates a new mongo user for each agent it starts <rogpeppe> niemeyer: and so, presumably, does the unit agent when it starts subordinates? <niemeyer> rogpeppe: Yeah, that sounds right <niemeyer> rogpeppe: This is a bit silly right now, if you think about it, because all those users have the same permissions <niemeyer> rogpeppe: But it starts to make more sense if we consider that situation won't be like that soon <rogpeppe> niemeyer: yeah, each agent could potentially delegate permissions. <niemeyer> rogpeppe: Btw, when you say "the MA creates a new mongo user", it's not just a mongo user we're talking about.. these details should be abstracted behind our own API <rogpeppe> niemeyer: yeah, because the MA knows nothing about mongo <niemeyer> Right <rogpeppe> niemeyer: would this be sufficient? state.State.AddUser(user, pass string) error <niemeyer> rogpeppe: No.. <rogpeppe> niemeyer: and an extra field in state.Info <niemeyer> rogpeppe: We have to think through the relationship between user and entity <rogpeppe> niemeyer: a "capability" bitmask or set? <niemeyer> rogpeppe: Sorry, I just meant that we don't want dangling users around without association to an entity, and we don't want to have to manipulate the needs of authentication and the needs of entity creation/etc independently <niemeyer> rogpeppe: It should be clear from the API how these things take palce <niemeyer> place <rogpeppe> niemeyer: ok. by "entity" you mean some type or value in the state? <rogpeppe> niemeyer: or an agent? <niemeyer> rogpeppe: We've been using entity to refer to unit/service/machine <niemeyer> rogpeppe: But in this case it's really the subset of those that have an agent ATM <niemeyer> rogpeppe: So unit/machine <rogpeppe> niemeyer: so the Machine entity is kinda superior to the Unit entity, because an MA can create users for UAs but not vice versa? <niemeyer> rogpeppe: We won't have the low-level restrictions in place today.. we just need a proper API that makes sense in such a context <rogpeppe> niemeyer: that's what i'm trying to imagine <niemeyer> rogpeppe: We don't need to "create users" in general <niemeyer> rogpeppe: We have proper unique keys for the agents <niemeyer> rogpeppe: We shouldn't have to be manipulating users and passwords in our own API externally to the state model <niemeyer> rogpeppe: This would add an implicit API on top of our own API that is probalby not necessary <rogpeppe> niemeyer: what about something like this? http://paste.ubuntu.com/1254071/ <niemeyer> rogpeppe: Yeah, that looks nice <rogpeppe> niemeyer: and then a new "Password" field in state.Info <rogpeppe> niemeyer: (which in actual fact incorporates both the mongodb username and password) <niemeyer> rogpeppe: I think we can be a bit more explicit: // SetPassword returns a new random password the agent responsible for X should use to communicate with the state servers. Previous passwords are invalidated. <rogpeppe> niemeyer: NewPassword? <niemeyer> rogpeppe: NewFoo in general returns a new foo, without further consequences <rogpeppe> niemeyer: yeah <niemeyer> rogpeppe: ReplacePassword maybe <rogpeppe> niemeyer: or ChangePassword <niemeyer> rogpeppe: SOunds good <niemeyer> rogpeppe: ChangePassword() (auth string, err error) <niemeyer> rogpeppe: So we can have Auth in state.Info rather than password, as it may contain the username too <niemeyer> rogpeppe: Although we never expose those details out of the state itself <rogpeppe> niemeyer: sounds good <niemeyer> rogpeppe: Hmm.. there's a small detail here, though.. we may need to split that up a bit into separate methods <rogpeppe> niemeyer: i was wondering about this: http://paste.ubuntu.com/1254085/ <niemeyer> rogpeppe: Ah, no.. we should send the new password.. <niemeyer> rogpeppe: ChangePassword(password) (auth string, err error) <niemeyer> rogpeppe: Otherwise there's a race <niemeyer> rogpeppe: We need to persist the new password before we ask to change, otherwise the agent might be locked out <rogpeppe> niemeyer: ah, interesting, yeah <niemeyer> rogpeppe: Regarding the past, I'd prefer an explicit API instead <niemeyer> rogpeppe: unit.ChangePassword.. machine.ChangePassword <rogpeppe> niemeyer: ok <niemeyer> rogpeppe: No need to guess where it makes sense and where it doesn't <rogpeppe> niemeyer: sounds good <rogpeppe> niemeyer: the nice thing about passing in a password is that the method becomes idempotent. <niemeyer> rogpeppe: Indeed <rogpeppe> niemeyer: i think SetPassword makes better sense now. <niemeyer> rogpeppe: +1 <rogpeppe> // SetPassword sets the password the agent responsible for the machine <rogpeppe> // should use to communicate with the state servers. Previous passwords <rogpeppe> // are invalidated. <rogpeppe> func (m *Machine) ChangePassword() (password string, err error) <niemeyer> func (m *Machine) SetPassword(password string) (auth string, err error) <niemeyer> I suppose <rogpeppe> niemeyer: yeah c&p error <niemeyer> fwereade: I mid-way through the filter review.. the conversation here was good, so I didn't make much progress, but will continue after lunch <fwereade> niemeyer, no worries <niemeyer> rogpeppe: I'll step out for lunch and bbiab <rogpeppe> niemeyer: ok cool <fwereade> niemeyer, I may be off soon but will try to pop back on later <niemeyer> fwereade: Sounds good, thanks for the nice progress * niemeyer => lunch <fwereade> niemeyer, seems to be going ok :) <fwereade> niemeyer, cheers <TheMue> niemeyer: https://codereview.appspot.com/6596051/ as the first step is in <TheMue> cu later <niemeyer> mramm: Do we have a call in 20 mins? <mramm> niemeyer: Yea the Cloud Consistency Call <mramm> niemeyer: we will be going over the certified public cloud initiative, and some server stuff <niemeyer> mramm: 'k <mramm> niemeyer: not sure that your attendance is required, if you want to skip I can ping you if something important comes up <niemeyer> mramm: Sounds good, I'll be around then <rogpeppe> niemeyer: just wondering what's the best thing to do about removing users. i'm thinking that SetPassword("") removes the user for an entity (i can't see that we'll ever want to actually set a blank password) <niemeyer> rogpeppe: Why would we want to remove a user in such a fashion? <rogpeppe> niemeyer: if a unit gets removed, i think it makes sense to remove the unit's mgo user too <niemeyer> rogpeppe: Exactly! :) <rogpeppe> niemeyer: erk <rogpeppe> niemeyer: of course. <niemeyer> rogpeppe: Btw, over lunch I was thinking on our interface.. we'll stumble on problems regarding SetPassword returning auth, for the same reason that we need to pass the password in instead of just using the result <niemeyer> rogpeppe: I suggest this instead: <niemeyer> func (m *Machine) SetPassword(password string) error <niemeyer> struct Info { .....; Principal interface{ SetPassword(string) }; Password string; } <rogpeppe> niemeyer: interesting <rogpeppe> niemeyer: i don't quite see why SetPassword is a problem though, assuming it's deterministic <niemeyer> rogpeppe: The only change is that the auth result was nonsense <rogpeppe> niemeyer: the Info change above is a pretty major thing. <niemeyer> rogpeppe: Because? <rogpeppe> niemeyer: currently it's a very simple set of info. <niemeyer> rogpeppe: Ah, you're right.. we have a chicken and egg <niemeyer> rogpeppe: Well, we'll need to save the principal as a string then <rogpeppe> niemeyer: alternatively we could just have a Principal method on Machine and Unit <niemeyer> rogpeppe: For? <rogpeppe> niemeyer: we need to get the user name and password from somewhere. <niemeyer> rogpeppe: That's not an alternative to the issue above, since we still must tell it what the principal is, and we can't get a password from state <rogpeppe> niemeyer: what about Machine.Auth(password) ? <niemeyer> rogpeppe: Sorry, feels like we're going backwards in our conclusions <rogpeppe> niemeyer: i'm not sure i've concluded anything yet <niemeyer> rogpeppe: We already have machine.SetPassword(password).. Auth(password) is no better <rogpeppe> niemeyer: sorry, i'm thinking *in addition* to SetPassword <niemeyer> rogpeppe: I'm a bit lost <niemeyer> rogpeppe: What problem are you solving? <rogpeppe> niemeyer: so we'd have SetPassword(password) error; and Auth(password) (auth string, err error) <niemeyer> rogpeppe: Why? <rogpeppe> niemeyer: so that we can generate the password, save it to disk, then if we crash we can regenerate the required auth info from the password only. <niemeyer> rogpeppe: All of that seems unrelated to Machine.Auth(password) <rogpeppe> niemeyer: Auth is maybe a bad name. AuthInfo, perhaps. <niemeyer> rogpeppe: Seems like a complex way to do something simple <rogpeppe> niemeyer: what's your suggestion? <niemeyer> rogpeppe: The same.. Principal string <rogpeppe> niemeyer: where does that come from? <niemeyer> rogpeppe: We already have a nice key on PathKey.. we can rename it to something more sensible and reuse <rogpeppe> niemeyer: i was going to suggest that <rogpeppe> niemeyer: i still think that AgentName is a reasonable name for that method. <rogpeppe> niemeyer: BTW there's one thing we haven't talked about <rogpeppe> niemeyer: what does the client do? <rogpeppe> niemeyer: in my implementation so far, i've implemented State.SetPassword <niemeyer> rogpeppe: +1 on AgentName.. I can't come up with anything better right now <rogpeppe> niemeyer: <rogpeppe> // SetPassword sets the password the administrator <rogpeppe> // should use to communicate with the state servers. <rogpeppe> niemeyer: but actually maybe we don't care much about changing the admin password <rogpeppe> niemeyer: and we could hardwire "admin" as a principal name <niemeyer> rogpeppe: The thing I dislike about AgentName is that it blocks adding the same interface to other things we'll want to identify in the same manner <rogpeppe> niemeyer: you mean, if we have principals that don't map directly to state objects? <niemeyer> rogpeppe: No, I mean that the concept of having a unique and intelligible key for entities is very useful <niemeyer> rogpeppe: EntityName perhaps <rogpeppe> niemeyer: i wrote that, then deleted it <rogpeppe> niemeyer: but it's not too bad, despite being a nasty mouthful. <niemeyer> rogpeppe: This means we can have "service-foobar" too <rogpeppe> niemeyer: +1 to EntityName <rogpeppe> niemeyer: or even just Name... <niemeyer> rogpeppe: -1, unless we refactor further <niemeyer> rogpeppe: We already have that in some places <rogpeppe> niemeyer: oh yeah, we already use it <rogpeppe> niemeyer: darn <niemeyer> rogpeppe: It's not a bad idea, though <niemeyer> rogpeppe: We might move to Id() in the other fields <rogpeppe> niemeyer: yeah, Id would work well for how unit.Name etc is used currently. <rogpeppe> niemeyer: and it would fit well with Machine.Id too <niemeyer> rogpeppe: unit.Id(), service.Id(), and then we have Name() with the full-blown name <rogpeppe> niemeyer: + <rogpeppe> 1 <rogpeppe> ! <niemeyer> :-) <rogpeppe> niemeyer: ok, that shouldn't be hard to change. <niemeyer> rogpeppe: We have to do that sooner rather than later, or we'll be stuck with the database schema <rogpeppe> niemeyer: i'll do it now, if you think it's good <niemeyer> rogpeppe: It sounds like a good move <rogpeppe> niemeyer: what do you think about the client-initiated connection? Info.Principal == "admin" ? <niemeyer> rogpeppe: Yeah <niemeyer> rogpeppe: Your idea above regarding "admin" sounds good <rogpeppe> niemeyer: that we have State.SetPassword ? <niemeyer> rogpeppe: No, that we can hardcode the "admin" user for the moment <rogpeppe> niemeyer: ok, sounds good <niemeyer> rogpeppe: and that we can do without changing its password for a while <niemeyer> rogpeppe: I think, but not sure <rogpeppe> niemeyer: then "admin-password" as an environment setting makes total sense <niemeyer> rogpeppe: Either way, SetAdminPassword would be ok <rogpeppe> niemeyer: which would be a nice change :-) <niemeyer> robbiew, mramm: Where is the meeting taking place today? <robbiew> niemeyer: what meeting? cloud consistency? <niemeyer> robbiew: Yeah <robbiew> niemeyer: meh..you can skip it, unless you wanna hear an update on charm collection <niemeyer> robbiew: Yeah, that's what I'm curious about <robbiew> conf id 636-721-3251 <niemeyer> robbiew: Cheers <niemeyer> Holy crap <niemeyer> 17 people.. <rogpeppe> niemeyer: first stage of Name change: https://codereview.appspot.com/6585053/ <niemeyer> rogpeppe: Looking <rogpeppe> niemeyer: i'm off for the evening. see ya tomorrow... <rogpeppe> night all! <niemeyer> rogpeppe: Cool, thanks for the quick turnaround <niemeyer> rogpeppe: Have a good evening <rogpeppe> niemeyer: np <rogpeppe> niemeyer: static typing FTW <niemeyer> rogpeppe: Indeed :) <niemeyer> I'll have a walk outside and come back shortly for more reviews <fwereade> niemeyer, very briefly: my issue with using the uniter's existing unit/service is just that I don't want to share them with the filter goroutine <fwereade> niemeyer, so I rather think I have to pay the cost of a refresh anyway <fwereade> niemeyer, from that perspective, passing a single new watcher into the new goroutine, and leaving it to reconstruct everything it required from there, seemed rather neat <fwereade> niemeyer, will be on and off, if you have a quick answer just dump it in the channel and I'll see it soon enough <niemeyer> fwereade: I half agree <niemeyer> fwereade: If you want to not share the service, that's certainly reasonable <niemeyer> fwereade: But the points in the review still feel valid.. you can easily pick the service up from state when starting the filter <niemeyer> fwereade: and watch it upfront <niemeyer> fwereade: Or do I misunderstand your point? #juju-dev 2012-10-02 <davecheney> https://bugs.launchpad.net/juju-core/+bug/1059921 <davecheney> --format=json :( <SpamapS> davecheney: I've been explicitly using --format=json to avoid formatting incompatibilities between go/python <davecheney> SpamapS: yeah, i'm fixing the command line parser to handle this case <davecheney> lucky(~/src/launchpad.net/juju-core) % juju bootstrap --upload-tools <davecheney> lucky(~/src/launchpad.net/juju-core) % juju deploy mysql <davecheney> error: no reachable servers <davecheney> outstanding ... bootstrap didn't <davecheney> aws said yes <davecheney> but the console says that instance is stillborne <davecheney> https://code.launchpad.net/~dave-cheney/gnuflag/001-parse-more-gnu-args/+merge/127419 <davecheney> ^ gnuflags doesn't have lbox setup <rogpeppe> fwereade, davechen1y: mornin' <davecheney> monring <fwereade> rogpeppe, davecheney, heyhey <davecheney> rogpeppe: i have a non CL patch for you to review <fwereade> rogpeppe, 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 rest <fwereade> rogpeppe, davecheney, *but* ofc I have reviews to respond to first :p <davecheney> fwereade: sgtm - don't forget meeting this aternoon <rogpeppe> fwereade: ok, have fun if so! <fwereade> davecheney, good point, ty <rogpeppe> davecheney: i was about to ask if you had any reviews you wanted me to look at <davecheney> one to gnuflags <davecheney> rogpeppe: https://code.launchpad.net/~dave-cheney/gnuflag/001-parse-more-gnu-args/+merge/127419 <davecheney> needed, basically, because all the charms expect it <rogpeppe> davecheney: no codereview link? <davecheney> rogpeppe: it doesn't make one <davecheney> hang on <rogpeppe> davecheney: what doesn't make one? <davecheney> lbox <davecheney> just found the option <rogpeppe> davecheney: -cr <davecheney> https://codereview.appspot.com/6588060 <davecheney> rogpeppe: why don't i need to do that on juju-core ? <rogpeppe> davecheney: there's a .lbox file in its root <rogpeppe> davecheney: with flags in <davecheney> fairy nuf <rogpeppe> davecheney: i'm on the review BTW <rogpeppe> davecheney: i'm not sure it's as simple as your CL tries to make it (which is why i didn't do it before) <rogpeppe> davecheney: you've got a review <TheMue> good morning <TheMue> hi fwereade <fwereade> TheMue, heyhey, I'm not really here :) <TheMue> oh, where you are? <fwereade> TheMue, swap-daying <fwereade> TheMue, I'm tired and it's my birthday :) <TheMue> fwereade: ah, ic. so what do you do here? ;) <TheMue> oh, happy birthday <fwereade> TheMue, 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 cases <fwereade> TheMue, after that I'll go out for a while, but see you at the meeting <TheMue> fwereade: so it's a half swap-day <fwereade> TheMue, whatever :) <TheMue> fwereade: :D <rogpeppe> fwereade: hippy barday to you! <rogpeppe> fwereade: BTW AgentName isn't happening, but we're renaming PathKey to... something else. <Aram> happy birthday fwereade. <rogpeppe> fwereade: 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. <rogpeppe> fwereade: currently going with an earlier of niemeyer's suggestions: EntityName <rogpeppe> fwereade: but i'm not greatly happy with that either - any suggestions welcome. <Aram> meeting in 1 min or 61 min? <Aram> ow <Aram> now <niemeyer> Morning! <mramm> team meeting hangout invite sent <mramm> https://plus.google.com/hangouts/_/557e6f4f5f9de98be4769ec91fc82db48a75d356?authuser=0&hl=en-GB <niemeyer> mramm: Thanks <rogpeppe> fwereade: meeting... <davecheney> rogpeppe: https://bugs.launchpad.net/mgo/+bug/1045678 <davecheney> ^ may be of interest <davecheney> niemeyer: --format=json <davecheney> gnuargs only supports --format json <davecheney> niemeyer: all: https://bugs.launchpad.net/juju-core/+bug/1059921 <rogpeppe> davecheney: i'm happy to do the gnuflag change if you like <rogpeppe> davecheney: i do bear responsibility for that package, after all <davecheney> rogpeppe: if you want to take a crack over night, i would be most grateful <rogpeppe> davecheney: ok <davecheney> i also tried splitting on the = and pushing the remainder back into f.procArgs, which worked, but the testFlagsetParse tests were not happy <davecheney> and I couldn't figure out why <niemeyer> davecheney, rogpeppe: What's the problem with storing the empty flag in procFlag? <niemeyer> davecheney, rogpeppe: Sorry, I think I meant procArgs <rogpeppe> niemeyer: i'm not sure i understand the question <davecheney> niemeyer: that would probably work, but TestFlagSetParse always failed for reasons I didn't understand <niemeyer> rogpeppe: What's the problem with doing the straightforward and just splitting --foo=bar and storing "bar" as usual? <davecheney> niemeyer: that is what I tried first <davecheney> pushing the remainder back into procArgs <davecheney> but I couldn't make the test pass <rogpeppe> niemeyer: what if bar is empty? <niemeyer> rogpeppe: What's the problem with that/ <niemeyer> ? <niemeyer> rogpeppe: --foo "" is fine <niemeyer> rogpeppe: and so is --foo= <fwereade> dammit -- did I completely miss it? <niemeyer> fwereade: Happy birthday! <fwereade> niemeyer, haha, cheers :) <niemeyer> :-) <davecheney> fwereade: happy annual celebration! <fwereade> niemeyer, went out for a nice casual brunch with cath and then got screwed by the busses on the way back :/ <fwereade> niemeyer, the intent was there though :( <fwereade> davecheney, cheers :) <niemeyer> fwereade: No worries really, it was a nice and quick sync up <fwereade> niemeyer, excellent <rogpeppe> niemeyer: i have to remember the code properly, gimme a few moments <niemeyer> rogpeppe: And btw, given your suggestion in the review, note that "--foo=bar" and "--foo =bar" mean different things <rogpeppe> niemeyer: indeed, but i think that wouldn't be a problem if we did it the way i suggested <rogpeppe> niemeyer: because we wouldn't put the latter argument into procFlag <niemeyer> rogpeppe: Cool <rogpeppe> niemeyer: the main immediate problem with storing an empty procFlag is that i want to be able to do --foo=false for boolean flags. <rogpeppe> niemeyer: while still allowing --foo to mean the same as --foo=true <niemeyer> rogpeppe: Sounds good, although I'm not familiar with the algorithm there to have an opinion <rogpeppe> niemeyer: i'm nearly there. we'll see if the tests work :-) <niemeyer> rogpeppe: Super :) * niemeyer gets some coffee <fwereade> niemeyer, Aram: can we talk a little about relations and their creation, retrieval, and watchery? <Aram> sure <fwereade> Aram, teh relation key is now a string with N service:relation pairs, in sort order, right? <Aram> yes <fwereade> Aram, this is interesting from my POV because we identify relations to hooks in a not-quite-neatly-fitting way <Aram> it's also used in some watchers to identify that the relation belongs to a service. <fwereade> Aram, as I see it we can either have an API that gets a relation by pre-existing ID number, rather than by key <fwereade> Aram, which will be convenient for the hook tools <fwereade> Aram, or we can try to do more interesting things with the key and do everything that way <fwereade> Aram, niemeyer: and I'm rather hoping someone else has some thoughts on this because I can't tell which is better <Aram> so, the hook cares about the id of the relation? <fwereade> niemeyer, eg, do we think that anyone is depending on any way on the format of the JUJU_RELATION env vars? <fwereade> Aram, the hook needs to differentiate between different relations on the same endpoint <fwereade> Aram, there's a JUJU_RELATION which is, say, "db", and a JUJU_RELATION_ID which is, say "db:7" <fwereade> Aram, niemeyer: if we were to specify, instead, a JUJU_RELATION_ID of "db:otherservice:otherrelation" <fwereade> Aram, niemeyer: I think it should be pretty simple to transform back and forth into real relation keys <fwereade> Aram, niemeyer: which would resolve the icky two-Relation-getter-methods-on-State thing <fwereade> niemeyer, Aram: I am then *very* torn on the issue of AddRelation and what params it should take <fwereade> niemeyer, Aram: on the one hand, it's very convenient to be able to make up any old relations we like <fwereade> niemeyer, Aram: and we make wanton use of this ability in the tests <fwereade> niemeyer, Aram: (thought, derail atm: there's some always-on relation we should always be able to handle, right? for subordinates?) <fwereade> niemeyer, 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 upgrade <fwereade> niemeyer, 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 ambiguity <fwereade> niemeyer, Aram: but which mostly wants and expects real keys for normal usage * niemeyer catches up <Aram> hmm? <Aram> how would it resolve the fuzzy naming? <fwereade> niemeyer, Aram: do I sound like I'm on crack, and just making needless work? I *think* there's something important buried in there somewhere <fwereade> Aram, not very fuzzy -- you have to specify the service names, but can leave the :relation bit off if there's no ambiguity <niemeyer> fwereade: No, I think you're on a good track <fwereade> Aram, the point is just that it allows for a single clean API that includes appropriate validation for all uses <niemeyer> fwereade: I dislike a bit the way relations are referred to right now <fwereade> Aram, it's definitely not a polished proposal just a feel that *something* is wrong <fwereade> niemeyer, in what context? <niemeyer> fwereade: In general <fwereade> niemeyer, they're represented too many ways already, I think ;) <niemeyer> fwereade: Oh, sory <niemeyer> sorry <niemeyer> fwereade: I mean the way we refer to them by a string that is a concatenation of the endpoints <niemeyer> fwereade: It ended up as a convenient way, though <fwereade> niemeyer, 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 thing <niemeyer> fwereade: So, let me try to help on a few of your questions above * fwereade sits attentively <niemeyer> fwereade: I don't think we should change the environment variable <niemeyer> fwereade: It's breakage that sounds easy to avoid <fwereade> niemeyer, ok, wholeheartedly accept that argument <niemeyer> fwereade: It sounds fine to have a method that grabs the relation by its numeric id <niemeyer> fwereade: I'm not sure I get the problem you describe referring to AddRelation, though <fwereade> niemeyer, a client of the API is perfectly able to AddRelation(<wordpress:lol>, <mysql:giggle>) <fwereade> niemeyer, and we will consider that a perfectly good relation, and join it, and just not run any hooks <fwereade> niemeyer, 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 start <rogpeppe> davecheney, niemeyer: https://codereview.appspot.com/6598052/ <rogpeppe> now for some lunch <fwereade> niemeyer, so, we should really just not be allowed to create them, just as we don't create services referring to charms that cdon't exist <Aram> fwereade: yeah, we should validate the relation, we didn't do so because we didn't have the emans
{'channel': 'juju-dev', 'month': 10}