/srv/irclogs.ubuntu.com/2012/09/05/#juju-dev.txt

davecheneyPath conflict: cmd/juju/ssh.go.THIS / cmd/juju/ssh.go00:39
davecheneywhy does this keep happening00:39
davecheneythis file isn't even in this branch00:39
rogpeppefwereade_: mornin'06:11
rogpeppeTheMue: hiya06:15
TheMuerogpeppe: morning06:16
TheMuerogpeppe: up so early in the morning?06:16
rogpeppeTheMue: yeah, lying awake, so got up06:16
TheMuerogpeppe: makes sense06:17
rogpeppefwereade_: ping06:17
rogpeppefwereade_: ping07:01
fwereade_rogpeppe, pong07:12
rogpeppefwereade_: i've done a fix for the internal traffic thing, but need to write a test for it, and that requires deploying a charm live, and i'm not quite sure of the best approach07:13
rogpeppefwereade_: the approach i'm thinking of is to use testing/charm and assume that the charms in there are portable07:14
fwereade_rogpeppe, sound like something we have little option but to leave to the FTs if that's so -- presumably you can at least check the security groups though?07:15
rogpeppefwereade_: i.e. copy one of the charms into a local directory under the current series07:15
fwereade_rogpeppe, sorry, what *precisely* are you trying to write a test for?07:15
rogpeppefwereade_: tbh i want to write the test anyway. i don't see why we shouldn't have one.07:15
rogpeppefwereade_: i want to check that a new machine comes up and manages to connect to the state.07:16
rogpeppefwereade_: actually, i *can* do that without deploying a charm.07:16
fwereade_rogpeppe, well, indeed, +1 to testing everything, but -1 to actually touching outside state in unit tests07:16
rogpeppefwereade_: what do you mean by "touching outside state"? we already do, in the ec2 live tests.07:17
rogpeppefwereade_: i think it would be good to have a test that deploys a charm in jujutest/livetests07:18
fwereade_rogpeppe, does that run every time?07:18
rogpeppefwereade_: no|!07:18
fwereade_rogpeppe, +1 to that07:18
fwereade_rogpeppe, sorry, miscommunications clearly07:18
rogpeppefwereade_: you'd know if it did - it takes about 12 minutes to run07:18
rogpeppefwereade_: so...07:18
fwereade_rogpeppe, yeah, I thought so07:18
fwereade_rogpeppe, which is why I don't consider it to be amongst the "unit tests"07:19
rogpeppefwereade_: that's why i didn't call it a "unit test" :-)07:19
fwereade_rogpeppe, although I am aware that the various categories of test are somewhat fuzzily defined07:19
fwereade_rogpeppe, "but -1 to actually touching outside state in unit tests"07:19
rogpeppefwereade_: ah yes07:20
fwereade_rogpeppe, aaanyway, good morning :)07:20
rogpeppefwereade_: top of the day to yourself too, sir :-)07:20
TheMuefwereade_: good morning07:21
fwereade_TheMue, heyhey07:21
rogpeppefwereade_: so, do you think we should have a repository of charms, one per series, with charms that are actually intended to run; or do you think we can assume that the charms that we use in testing are portable across series?07:21
fwereade_rogpeppe, I feel like that should be a pretty safe assumption, and pretty easy to rectify if we balls it up07:21
fwereade_rogpeppe, I *would* like to lean up the testing repo though07:22
rogpeppefwereade_: perhaps we could add a "series" argument Repo.ClonedURL07:23
rogpeppes/Repo/to Repo/07:23
fwereaderogpeppe, sorry, I suspect I missed stuff; last I saw was "...t the charms that we use in testing are portable across series?"07:24
rogpeppefwereade: yes, but we need a URL with the correct series in07:24
fwereaderogpeppe, sure, but the series is almost entirely irrelevant to the testing charms -- its structure happens to be a Repo but that's basically coincidental07:25
rogpeppefwereade: (funny really how the "URL" in charm.URL is anything but "universal" - it only finds charms :-])07:25
fwereaderogpeppe, heh, indeed07:25
rogpeppefwereade: yes, but when we put the charm into the state, it needs to be put in with the correct series (i think!) so that the remote machine will use it correctly.07:26
fwereaderogpeppe, the series of the charm determines the series of the machine07:26
fwereaderogpeppe, pick the series you want, construct a URL, and you're done... right?07:27
rogpeppefwereade: the URL has to actually refer to something07:27
fwereaderogpeppe, why?07:27
fwereaderogpeppe, you can make up whatever crap you like07:27
rogpeppefwereade: because it gets pushed to the state07:27
rogpeppefwereade: so you'd need to copy the directory too. it's not hard of course, but perhaps worth a function in testing, no?07:28
fwereaderogpeppe, I do that sort of thing in a couple of places around the tests for Uniter and BundlesDir... perhaps there's something relevant there07:29
rogpeppefwereade: i'd like to use this as an excuse to live-test our standard deploy mechanism.07:29
fwereaderogpeppe, then I don;t see what needs to be put in state that isn't already handled by deploy07:29
rogpeppefwereade: we need to give a charm to deploy, no?07:30
fwereaderogpeppe, right07:30
rogpeppefwereade: which needs to be in a directory named after a valid series07:30
fwereaderogpeppe, I *see*07:30
fwereaderogpeppe, (or just using a faked-up charm store if I want to be pedantic, but yes, that is the best way)07:31
rogpeppefwereade: yeah, we could do that do07:31
rogpeppeto07:31
rogpeppetoo :-)07:31
fwereaderogpeppe, anyway, sorry, my perspective has been skewed looking at this problem from the UA perspective, when I can force the right context on myself everything you say makes sense07:33
rogpeppefwereade: np!07:33
fwereaderogpeppe, and I think it's just fine to assume that testing charms are valid on every series07:33
fwereaderogpeppe, I'm not sure any of them *actually* do anything07:33
rogpeppefwereade: well, we can rectify that in the future...07:33
fwereaderogpeppe, but that shouldn't be a problem for this test, right?07:34
rogpeppefwereade: exactly07:34
fwereaderogpeppe, cool07:34
rogpeppefwereade: i wonder about some prefix for names of charms that are intended for live testing07:34
rogpeppefwereade: "live-basic" for a starter charm, perhaps, that does nothing other than install07:35
rogpeppefwereade: then it's obvious which charms need to be looked at from the point-of-view of "will this actually run?"07:35
fwereaderogpeppe, hmm, maybe... part of me is saying we should put live test charms in the charm store ;p07:36
rogpeppefwereade: that's not a bad idea actually07:36
fwereaderogpeppe, it has aspects of a good idea and aspects of a bad idea ;)07:36
rogpeppefwereade: except that i can't do that now07:37
fwereaderogpeppe, quite so -- for now I would just slap some oneiric, precise, quantal symlinks into the testing repo and call it a day07:37
rogpeppefwereade: ah, now yer talkin'!07:37
fwereade:D07:38
=== TheMue_ is now known as TheMue
rogpeppefwereade: maybe we should give explicit "series" arguments to all the functions in testing.Repo07:39
rogpeppefwereade: that way we can easily asked for a cloned charm in a particular series for example07:40
rogpeppefwereade:07:45
rogpeppe// ClonedURL makes a copy of the charm directory named name07:46
rogpeppe// into the destination directory (creating it if necessary),07:46
rogpeppe// and returns a URL for it. The URL will have the given series.07:46
rogpeppefunc (r *Repo) ClonedURL(dst, series, name string) *charm.URL {07:46
rogpeppefwereade: i think that's all we need.07:46
fwereaderogpeppe, feels like overkill, surely? can't you use a local repo pointing to the dir with the symlinks and leave it at that?07:47
fwereaderogpeppe, I worry I have skewed context again07:48
rogpeppefwereade: i don't think so. all the methods in testing.Repo hard-code the series name "series"07:48
fwereaderogpeppe, yeah, testing.Repo *might* even be meant to be internal really07:48
rogpeppefwereade: yeah, i wondered about that07:48
fwereaderogpeppe, have a vague feeling something used it once, maybe07:49
rogpeppefwereade: it's quite nice as a namespace for all those methods07:49
fwereaderogpeppe, true07:49
fwereaderogpeppe, but its path is also a perfectly good path for JUJU_REPOSITORY, I think07:50
fwereaderogpeppe, does it have a clone-the-whole-thing method?07:50
rogpeppefwereade: that's actually insufficient, i think, as cloned charms can't be under the same path07:50
rogpeppefwereade: it should do.07:50
rogpeppefwereade: or at any rate, any requested charm should be cloned.07:52
rogpeppefwereade: what was the last thing you saw?07:52
rogpeppefwereade: i saw:07:52
rogpeppe[08:50:35] <fwereade> rogpeppe, does it have a clone-the-whole-thing method?07:52
fwereade<fwereade> rogpeppe, or alternatively just clone a charm to where you want it for one specific test, which may well be in a newly-hacked-up repo with the perfect series alredy07:53
fwereaderogpeppe, I saw fwereade: it should do.07:53
rogpeppe[08:52:19] <rogpeppe> fwereade: or at any rate, any requested charm should be cloned.07:53
fwereaderogpeppe, I think it's more just that any dir we tell juju about to should be outside source control07:54
fwereades/to //07:54
rogpeppefwereade: indeed07:54
rogpeppefwereade: maybe it should be a fixture07:55
rogpeppeCharmSuite07:55
rogpeppefwereade: then we can have JujuConnSuite use it and most other things get it for free07:56
fwereaderogpeppe, I'm not sure that's justified -- lots of tests already get by just cloning the one or two they need, and that's a lot of cloning that might otherwise be unnecessary07:56
rogpeppefwereade: i'd make it so that it only clones on request07:56
rogpeppefwereade: if you ask for a charm, it ensures it's cloned, then gives you a reference to it07:57
fwereaderogpeppe, fair enough then07:57
rogpeppefwereade: the advantage of making it a fixture is that it's clear who has responsibility for cleaning up the clones07:57
rogpeppefwereade: as it is, clients have that responsibility, and that means you can't use a single global JUJU_REPOSITORY07:58
fwereaderogpeppe, yeah, sounds sensible07:58
rogpeppefwereade: actually, i don't think you *can* use a single global JUJU_REPOSITORY07:59
rogpeppefwereade: because you might have more than one active CharmSuite08:00
fwereaderogpeppe, ha, yes08:00
rogpeppefwereade: but i don't wanna use the env var anyway; we'll just have CharmSuite.Path or something08:00
rogpeppeRepoPath probably08:00
fwereaderogpeppe, yep, sgtm08:00
rogpeppefwereade: ok, seems like a plan08:01
rogpeppefwereade: funny how fixing something fairly trivial (internal traffic enabling) leads on to a seemingly totally unrelated code change.08:01
fwereaderogpeppe, yeah, one takes some strange paths on occasion :)08:02
rogpeppefwereade: oh, that's *much* nicer now08:24
fwereaderogpeppe, cool :D08:24
rogpeppefwereade: 16 lines less and more general08:26
fwereaderogpeppe, awesome08:27
Arammoin.08:30
fwereadeAram, heyhey08:30
TheMueAram: moin moin08:32
rogpeppeAram: hiya08:44
fwereadeevening davecheney09:17
fwereaderogpeppe, you recall that jujud-not-on-PATH thing I pasted last night?11:16
rogpeppefwereade: yes11:16
rogpeppefwereade: i have a feeling that our cloud-init doesn't set up PATH, though i haven't checked11:17
fwereaderogpeppe, ah ok -- isn't the path the the executable predictable based on tools, though?11:17
fwereaderogpeppe, maybe we should be using an absolute path11:17
rogpeppehmm. the path should be based on agent name11:18
rogpeppefwereade: /var/lib/juju/tools/$agent/jujud i think11:18
fwereaderogpeppe, and we know what agent we're trying to run :)11:18
fwereaderogpeppe, and that's all somewhere in container?11:18
rogpeppefwereade: yeah, although perhaps it might seem better for the agent Main to set up the PATH11:19
rogpeppefwereade: no, not in container11:19
rogpeppefwereade: container just does a path search11:19
fwereade<fwereade> rogpeppe, ah, I thought that was what actually installed the unit11:20
rogpeppefwereade: last thing i saw:11:20
rogpeppe[12:18:59] <fwereade> rogpeppe, and that's all somewhere in container?11:20
rogpeppe[12:19:23] <rogpeppe> fwereade: yeah, although perhaps it might seem better for the agent Main to set up the PATH11:21
rogpeppe[12:19:38] <rogpeppe> fwereade: no, not in container11:21
rogpeppe[12:19:48] <rogpeppe> fwereade: container just does a path search11:21
rogpeppe[11:21
fwereaderogpeppe, you are probably right that they should just be on PATH11:22
fwereaderogpeppe, but well hmm11:22
fwereaderogpeppe, multiple versions11:22
rogpeppefwereade: that's fine11:22
fwereaderogpeppe, how so?11:22
rogpeppefwereade: the agent dir is a symlink to the right version11:22
rogpeppefwereade: that's how we upgrade11:23
fwereaderogpeppe, ok, sorry, so what exactly goes on PATH?11:23
rogpeppefwereade: i'll just check11:23
fwereaderogpeppe, ahhhh sorry the agent Main11:23
davechen1yfwereade: i think you should always try to call the binary with an abosolute path11:23
rogpeppefwereade: yeah11:23
rogpeppedavechen1y: why so?11:23
davechen1ythe cloudinit or initd environment is very sparce11:23
fwereadedavechen1y, +111:24
fwereaderogpeppe, yeah, I maybe misunderstood again11:24
rogpeppedavechen1y: we do always call the binary with an absolute path11:24
fwereaderogpeppe, which agent main sets up what path?11:24
davechen1yrogpeppe: i thought so, I remember that from cloudinit11:24
rogpeppedavechen1y: but we want the agents to set up PATH so that anything doing FindPath("jujud") will get the right thing11:25
davechen1yrogpeppe: i would try to avoid that11:25
davechen1yPATH is a shell thing11:25
davechen1yand we're not an interactive process11:25
davechen1yI think you'll find it more reliable if you manage that without PATH11:26
fwereaderogpeppe, I'm inclined to just make sure AgentToolsDir is on the PATH when we're calling hooks11:26
* Aram agrees11:26
Aramwith davechen1y that is11:26
rogpeppefwereade: definitely11:26
rogpeppedavechen1y: the PATH isn't just for our internal consumption11:26
rogpeppedavechen1y: it's also for commands running inside hooks11:26
davechen1yrogpeppe: that is an important, but seperate issue11:27
fwereaderogpeppe, but that's unit-agent-specific at the moment11:27
rogpeppedavechen1y: if we don't use PATH, then we have to have a separate place to store the current agent name11:27
rogpeppedavechen1y: because the path to the executable depends on the currently running agent11:27
rogpeppefwereade: hmm, which piece of code was failing?11:28
rogpeppedavechen1y: have you changed the ssh code in state recently?11:28
rogpeppedavechen1y: i just saw a transient error in TestSSHConnect11:29
rogpeppedavechen1y: http://paste.ubuntu.com/1187088/11:29
davechen1yrogpeppe: never seen that before11:30
davechen1ymaybe you are racing with the mock sshd starting11:30
rogpeppedavechen1y: neither me. let's hope it never happens again.11:30
fwereaderogpeppe, I am wondering how we're going to manage juju-run though, given that there could be multiple unit agents in a container11:30
rogpeppefwereade: that's fine11:30
rogpeppefwereade: each agent has its own name11:30
rogpeppefwereade: the unit agent name should contain the unit name11:31
fwereaderogpeppe, so juju-run picks the right jujuc to call based on unit name... I guess11:31
rogpeppefwereade: interesting11:31
rogpeppefwereade: i think it should look at the context.11:32
rogpeppefwereade: which might contain the unit name, yeah11:32
fwereaderogpeppe, what happens when we want to upgrade juju-run, I wonder ;p11:32
fwereaderogpeppe, I don;t think there's any way to know that11:32
rogpeppefwereade: what's juju-run again?11:32
fwereaderogpeppe, the idea of juju-run is it's called from anywhere11:32
fwereaderogpeppe, run this script as if it were a hook please11:32
fwereaderogpeppe, I think the plans are pretty firm, just not urgent11:33
rogpeppefwereade: wouldn't it be reasonable to say that it must be run by a process that descends from a hook?11:33
fwereaderogpeppe, totally unreasonable, wouldn't it?11:33
rogpeppefwereade: really?11:33
fwereaderogpeppe, calling juju-run from within a hook will deadlock, surely?11:33
rogpeppefwereade: yes. but calling juju-run from within a background process started by a hook should be fine11:34
fwereaderogpeppe, and how do you make a cron job run in a process descended from a hook?11:34
rogpeppefwereade: i was wondering about that11:34
rogpeppefwereade: how does that juju-run know how to talk to the right jujud anyway?11:35
fwereaderogpeppe, I think juju-run has to take a unit name... or *maybe* infer it from context where possible... but I think I'd rather be explicit11:35
rogpeppefwereade: i'm not sure i'm happy with executables being called with no control at all. need to think on it.11:37
fwereaderogpeppe, sorry, which executables?11:37
rogpeppefwereade: juju-run in particular. but also the executables that are called by the script invoked by juju-run11:38
fwereaderogpeppe, the idea of juju-run is that it will wait for no other hook to be running and then execute the supplied script within a normal context11:38
rogpeppefwereade: it scuppers my idea of how to do major-version upgrades, i think11:39
fwereaderogpeppe, just like any other hook, neatly serialized with all the other hook executions11:39
fwereaderogpeppe, heh :(11:39
fwereaderogpeppe, anyway, we can worry about this later and figure out some way to make it work with the upgrades that will already be in place11:42
* fwereade pops a couple of levels11:42
fwereaderogpeppe, now, the stuff that was failing was:11:43
fwereade 2012/09/04 15:49:43 JUJU deploying unit etherpad-lite/011:43
fwereadegah11:43
rogpeppefwereade: ah, of course. that's fine.11:43
rogpeppefwereade: that would be fixed by setting up $PATH11:43
fwereade 2012/09/04 15:49:43 JUJU cannot deploy unit etherpad-lite/0: cannot find executable: exec: "jujud": executable file not found in $PATH11:43
rogpeppefwereade: which, despite mr cheney's objections, i think is probably the right approach11:44
fwereaderogpeppe, I guess I need to read the code some more, I'm not clear on what exactly is happening here11:45
rogpeppefwereade: it's quite simple11:45
fwereaderogpeppe, I think I'm convinced that PATH is not something we should be depending on, though11:45
rogpeppefwereade: container does a path search for the jujud exe11:45
rogpeppefwereade: then puts that in the cloudinit executable11:45
fwereaderogpeppe, I don't think it's any of our business what PATH upstart happens to run with11:45
rogpeppefwereade: we don't use any PATH stuff inside the upstart script11:46
fwereaderogpeppe, I'll shut up, you were saying useful things11:46
rogpeppefwereade: the container package itself does the path search11:46
rogpeppefwereade: if we don't have PATH, we need some global place to store the executable dir11:46
rogpeppefwereade: i.e. some global place to store the current agent name11:47
rogpeppefwereade: i think that PATH is actually a reasonable way to encode that. it's all we care about. and everything just falls out from that imo11:47
fwereaderogpeppe, sorry, what are we using the executable dir for?11:48
rogpeppefwereade: all it takes is that each agent does os.Setenv("PATH", environs.AgentToolsDir(agentName) + ":" + os.Getenv("PATH"))11:48
rogpeppefwereade: the executable dir is agent-specific11:48
rogpeppefwereade: which means each agent can upgrade in its own sweet time11:49
fwereaderogpeppe, I understand that bit11:49
rogpeppefwereade: ha! i've just realised that the cloudinit heuristic is wrong, wrong, wrong!11:50
fwereaderogpeppe, well, I shall feel pleased with myself in a non-sepcific and slightly bewildered way :)11:50
rogpeppefwereade: we don't need the path at all11:51
fwereaderogpeppe, I was wondering what it was for11:51
rogpeppefwereade: because the cloudinit script should not run the jujud from the agent that's creating the script11:51
rogpeppefwereade: so there needs to be a little more logic in container to create the agent tools dir symlink11:51
rogpeppefwereade: for the agent it's about to start11:52
rogpeppefwereade: it might be good if it set PATH in the cloudinit script too11:52
rogpeppefwereade: that way jujud doesn't have to muck about with PATH at all11:52
fwereaderogpeppe, excellent, our thoughts are in alignment then... but maybe not on that last bit11:52
rogpeppefwereade: well, that's only a half-baked thought tbh11:53
fwereaderogpeppe, I feel that creating PATH for the hooks is very specific to hook-running, and not something that should be dealt with by all agents just for this one case11:53
fwereaderogpeppe, anyway, I might take a look at that briefly, unless you are underemployed11:54
rogpeppefwereade: please do11:55
fwereaderogpeppe, although if I get unblocked on uniter implementation that will take precedence ;)11:55
fwereaderogpeppe, cheers11:55
fwereaderogpeppe, that might be an after-lunch thing though :)11:55
niemeyerHullah!12:33
niemeyerI'll just announce a mgo release before kicking fully in12:34
fwereadeniemeyer, heyhey12:38
rogpeppeniemeyer: yo!12:41
niemeyerfwereade, rogpeppe: Heya!12:43
fwereadeniemeyer, I have a hideous pile of reviews for you today, but it should be better than one hideous review :)12:44
niemeyerfwereade: LOL12:46
niemeyerfwereade: Thanks a lot for splitting them up12:46
* rogpeppe wishes he saw all the launchpad emails.12:46
fwereadeniemeyer, np, it turned out to be very helpful to do so, the code is better thanks to it12:46
fwereadeniemeyer, there's still one big one but an awful lot of the lines are moves/deletes/trivials, so hopefully it won;t hurt too bad12:46
niemeyerfwereade: Sweet12:49
niemeyerOkaaay13:01
* niemeyer jumps onto a pleasant review queue13:01
rogpeppefwereade: here's the upshot of our earlier conversation. i *think* it's nicer, but i'm biased. what do you think? https://codereview.appspot.com/6495086/13:15
* fwereade looks13:17
niemeyerrogpeppe: What's the motivation behind the change?13:18
rogpeppeniemeyer: the initial motivation was that i wanted to deploy a charm in jujutest.LiveTests13:18
rogpeppeniemeyer: that meant that i needed to create my own charm repository and manually populate it with a charm of the right series.13:19
niemeyerrogpeppe: The first changed file already shows something that is slightly less ideal13:19
niemeyerrogpeppe: It's now bundling a new charm for every test, rather than for the suite13:19
rogpeppeniemeyer: the time impact is minimal13:19
niemeyerrogpeppe: We can't care both about having a fast suite and then disregard that kind of change13:20
rogpeppeniemeyer: 0.05seconds of penalty on that package13:21
rogpeppeniemeyer: i don't think we mind too much about 50ms13:21
niemeyerrogpeppe: Okay, that is irrelevant indeed13:21
rogpeppeniemeyer: though i would indeed like it if we could choose whether to use test fixtures for the duration of a test or a suite13:22
niemeyerrogpeppe: That doesn't make sense to me.. the test fixture can do whatever it pleases, and we can organize the tests in whatever way we like13:23
niemeyerrogpeppe: If you want a suite for the duration of a test, have a suite with a test (!)13:23
rogpeppeniemeyer: what if you want a suite which sets up everything for each test, but you want it to work for a whole suite?13:24
fwereaderogpeppe, +1 to that, +-0 to the change itself purely from an API point of view... much of the time "series" is irrelevant, and it seems tedious to type it out each time13:24
niemeyerrogpeppe: That's exactly what suites do?13:24
rogpeppeniemeyer: it seems wrong to call SetUpTest inside a SetUpSuite13:24
niemeyerrogpeppe: Sorry, that makes even less sense13:25
niemeyerrogpeppe: SetUpTest runs for each test.. SetUpSuite runs for each suite.. we can do whatever with those13:25
rogpeppeniemeyer: yes, but that means the fixture itself decides whether the context it sets up is appropriate for a test or a suite13:25
rogpeppeniemeyer: but i *think* that it doesn't matter - what matters is the context that it sets up, not where it's used13:26
niemeyerrogpeppe: The fixture itself should only be used when it makes sense13:26
niemeyerrogpeppe: If it's not appropriate to have a test in a fixture, don't put it13:26
niemeyerrogpeppe: We can have as many suites as we please13:27
niemeyerrogpeppe: With whatever organization we do13:27
rogpeppeniemeyer: i'm not sure what you mean by "in" a fixture. AFAICS a test suite *uses* a fixture. and perhaps that's the difficulty i'm having.13:27
niemeyerrogpeppe: Nope, a test suite *is* the fixture13:28
rogpeppeniemeyer: i think that's a hangover from inheritance days13:28
rogpeppeniemeyer: it doesn't seem a good fit for the go way of composing things.13:28
niemeyerrogpeppe: Well, we can debate about that, but that's a separate problem from not being able to do things13:29
rogpeppeniemeyer: sure. anyway, i suppose that your concern about doing the bundle in every test comes out of this issue. if this fixture was *solely* concerned with setting and tearing down a charm repo (in whatever context), then we could call SetUp inside SetUpSuite as easily as SetUpTest13:30
niemeyerrogpeppe: There's absolutely nothing preventing a type from doing *solely* whatever it wants to do and being called *solely* wherever we want to13:32
rogpeppeniemeyer: i've idly thought quite a few times that all the current fixture "suites" could be factored into types that conform to this interface: http://paste.ubuntu.com/1187225/13:32
fwereadeniemeyer, rogpeppe: do we have any easy way to get a state.Info out of a state.State?13:33
fwereadeniemeyer, rogpeppe: feels kinda evil so I imagine not13:33
rogpeppefwereade: i don't think so.13:33
rogpeppefwereade: why?13:33
fwereaderogpeppe, I need it to fill in --zookeeper-servers for the unit agent13:34
rogpeppefwereade: haven't you got an Environ?13:34
niemeyerrogpeppe: Yeah, we may eventually have something like that supported by stock gocheck13:34
niemeyerrogpeppe: Meanwhile, there's nothing preventing it from existing, except for the convenience of having  a suite embedded onto another type and having it just work13:35
fwereaderogpeppe, I'm in simpleContainer.Deploy; should I?13:35
fwereaderogpeppe, and I'm called by Machiner, which just has a *state.Machine13:35
fwereaderogpeppe, I'll also want it for Uniter when that comes to deploy subordinates13:36
rogpeppeniemeyer: actually, you can do that too: http://paste.ubuntu.com/1187233/13:36
rogpeppeniemeyer: then embed gocheck.TestFixture(something) or gocheck.SuiteFixture(something) and it'll all be done for you13:36
* rogpeppe thinks that's quite neat actually13:37
niemeyerrogpeppe: I think it's more code without a clear win13:37
rogpeppeniemeyer: you could even have fixture composition operators13:37
niemeyerrogpeppe: The point was to not embed.. if I have to embed and manage it all by hand, there's no reason to do it13:38
rogpeppeniemeyer: if i include 2 fixtures currently, i have to write about 20 lines of code that are entirely mechanical.13:39
niemeyerrogpeppe: You're not improving that situation by having a different mechanism to create a type that does the same thing we have today13:39
niemeyerrogpeppe: You are adding a step to *create a suite*. Everything involved in *using a suite* is contained in *create suite* + *use suite*13:40
rogpeppeniemeyer: maybe so. would you get rid of the SetUpTest etc methods entirely?13:40
niemeyerrogpeppe: I'd make it so that they are not necessary13:41
rogpeppeniemeyer: interesting. i don't quite see how it would work though.13:41
niemeyerrogpeppe: I'll get there eventually13:43
fwereadeniemeyer, rogpeppe: ISTM that we are going to end up with noticeable duplication across Uniter and Machiner, if both are to be responsible for deploying units13:43
fwereadeniemeyer, rogpeppe: it feels like we're missing some abstraction somewhere13:44
fwereadeniemeyer, rogpeppe: does this resonate with either of you?13:44
rogpeppeniemeyer: ah, you could do it by having a test methods which took a fixture as an arg13:44
rogpeppefwereade: container is supposed to be the shared abstraction13:44
niemeyerfwereade: Not really13:44
rogpeppefwereade: what else will be duplicated?13:45
niemeyerfwereade: Deploying another unit from within a set up container should be as complex as putting a upstart script in place and running it, right?13:45
fwereadeniemeyer, true13:45
fwereadeniemeyer, I guess it's just a matter of a... UnitSubordinateWatcher?13:46
fwereadeniemeyer, I guess the client code does end up reasonably different13:48
fwereadeTheMue, we don't have any way to watch a unit's subordinates, do we?13:49
TheMuefwereade: today? afaik no.13:49
fwereadeTheMue, np, we'll do it when we need it :)13:50
rogpeppefwereade: you can watch units assigned to the current machine and ignore all but the subordinates13:55
fwereaderogpeppe, yeah, easy enough, cheers13:55
niemeyerrogpeppe: Reviewed it14:06
niemeyerfwereade: How do you mean (different)?14:07
fwereadeniemeyer, not in any major way -- just stuff like what containers they actually deploy to -- ie it doesn't feel like it will really be so unbearably similar as to demand a single implementation14:08
rogpeppeniemeyer: thanks. it was WIP though, and i'm currently thinking this is a better direction, based on the above discussion and fwereade's reaction: http://paste.ubuntu.com/1187296/14:08
niemeyerrogpeppe: Heh14:08
niemeyerrogpeppe: I think it was mostly ok, despite a few issues14:08
niemeyerrogpeppe: I'll wait until you *actually* want a review, though14:09
rogpeppeniemeyer: the essence is the same except that the original Repo type name is retained and everyone operates on that.14:10
rogpeppeniemeyer: rather than creating a fixture.14:10
rogpeppeniemeyer: very sorry to have wasted your time.14:12
rogpeppeniemeyer: most of your comments are still accurate BTW14:14
niemeyerrogpeppe: No problem, will be glad to review whatever you think makes sense as an improvement14:15
fwereadeniemeyer, rogpeppe, TheMue, Aram, mramm2: could be better, but -- and forgive the spam:14:21
fwereadewilliam@diz:~/code/go/src/launchpad.net/juju-core$ juju status14:21
fwereademachines:14:21
fwereade  0:14:21
fwereade    dns-name: ec2-50-16-72-153.compute-1.amazonaws.com14:21
fwereade    instance-id: i-1478c96e14:21
fwereade    proposed-agent-version: 0.0.014:21
fwereade    agent-version: 0.0.114:21
fwereade  1:14:21
fwereade    agent-version: 0.0.114:21
fwereade    dns-name: ec2-23-20-216-107.compute-1.amazonaws.com14:21
fwereade    instance-id: i-f66adb8c14:21
fwereade    proposed-agent-version: 0.0.014:21
fwereadeservices:14:21
fwereade  etherpad-lite:14:21
fwereade    charm: etherpad-lite14:21
fwereade    units:14:21
fwereade      etherpad-lite/0:14:22
fwereade        proposed-agent-version: 0.0.014:22
fwereade        status: error14:22
fwereade        status-info: 'hook failed: "install"'14:22
fwereade        agent-version: 0.0.014:22
fwereade        machine: 114:22
fwereade    exposed: true14:22
rogpeppefwereade: yay!14:22
niemeyerfwereade: Holy crap!!14:24
niemeyerHOLY CRAP!14:24
TheMueYiiiieha!14:24
* niemeyer does the funky chicken around the chair14:25
fwereade:DD14:25
TheMuefwereade: grats, guy, this looks damn good14:25
TheMuefwereade: and is definitely no spam, it good beef14:26
fwereadehaha14:26
TheMues/it/it's/14:26
mramm2fwereade: So very awesome!14:59
niemeyermramm2: Well, s/fwereade/team/, really..15:03
niemeyerThis is the peak of several months of everybody's hard work.. remarkable really15:04
TheMuedinnertime (instead of lunch today)15:06
niemeyerTheMue: :-)15:09
niemeyerTheMue: Enjoy15:09
rogpeppeniemeyer, fwereade: i think this is nicer (and it's ready for review :-]) https://codereview.appspot.com/649508615:12
niemeyerrogpeppe: You've got a review on https://codereview.appspot.com/6498085/15:13
rogpeppeniemeyer: yeah, i've occasionally wondered about version.IsValid. will do.15:14
rogpeppeniemeyer: thanks a lot for the review BTW!15:14
rogpeppeniemeyer: we need to have a chat about those tests in that earlier CL15:15
rogpeppeniemeyer: i wondered what you'd think of my version bumping scheme :-)15:16
rogpeppeniemeyer: IMO *any* version bumping screws up our versioning.15:17
rogpeppeniemeyer: so we might was well screw it up in an obvious way15:17
niemeyerrogpeppe: Not really, there are ways we can fix this15:18
* rogpeppe listens15:18
niemeyerrogpeppe: Well, let's do it in parts..15:19
rogpeppeniemeyer: sure, i'll remove it for the time being15:19
niemeyerrogpeppe: For that branch, can we please drop the bumping?15:19
niemeyerrogpeppe: It's mostly ready otherwise, except for those trivials15:19
rogpeppeniemeyer: still gotta get the prereqs through... but thanks, i'm happy15:19
niemeyerrogpeppe: Super, me too, thanks a lot for the functionality15:20
niemeyerrogpeppe: So, the tests..15:20
niemeyerrogpeppe: Which one do you wanna talk about first?15:20
rogpeppeniemeyer: the "does nothing" tests15:20
niemeyerrogpeppe: Okay,15:20
niemeyerrogpeppe: This is indeed boring to test, no doubts15:21
rogpeppeniemeyer: yeah. i'm interested to hear your thoughts.15:21
niemeyerrogpeppe: Let me explain first a vague thought I had, which depends on functionality that is coming in mstate15:22
* rogpeppe is listening15:23
niemeyerrogpeppe: What we're trying to test, vaguely speaking, is that a change in the version was observed15:23
rogpeppeniemeyer: yeah15:23
niemeyerrogpeppe: So that we can be reassured that is is being ignored, rather than updating15:23
rogpeppeniemeyer: yup15:23
niemeyerrogpeppe: The difficulty we have is that we don't have a good mechanism to define "steady state"15:24
niemeyerrogpeppe: So I'm trying to imagine of ways we could fix that15:24
niemeyerrogpeppe: I'm not even sure if mstate can help there, to be honest15:25
rogpeppeniemeyer: ah, are you thinking we can rely on the synchronous delivery of watcher events to all watchers?15:25
niemeyerrogpeppe: Yeah, but that doesn't quite work I think15:25
rogpeppeniemeyer: no, different connections15:25
niemeyerrogpeppe: Because we're precisely trying to make it so that events are not really delivered if the consumer didn't bother to ask, right? That was yesterday's conversation15:26
rogpeppeniemeyer: i await the watcher API with eager anticipation :-)15:26
niemeyerrogpeppe: Well, the API is ready.. we need the implementation :)15:27
rogpeppe:-)15:27
niemeyerrogpeppe: So, let's see..15:27
niemeyerrogpeppe: If we had a mechanism to force all events to at least be made available to consumers if they wish,15:28
niemeyerrogpeppe: it might be simpler to define the concept of "steady state" for a loop15:28
niemeyerrogpeppe: So we could say, for example, upgrader.Sync()15:29
rogpeppeniemeyer: i'm not sure what that means15:29
niemeyerrogpeppe: and know it has dealt with every other event that was available till then, and found nothing else to do15:29
niemeyerrogpeppe: If we do that, we can realize changes in the state, Sync, and test that nothing was done15:30
rogpeppeniemeyer: isn't that almost equivalent to the current approach - just send a value into the inner loop rather than receiving one?15:31
niemeyerrogpeppe: Without assuming things about specific code paths15:31
niemeyerrogpeppe: It's completely unrelated to the current approach, IMO15:31
niemeyerrogpeppe: They just have the same goal15:31
niemeyerrogpeppe: Which, well, is precisely what we're trying to preserve15:31
rogpeppeniemeyer: i'm not sure what Sync means though. we don't have events, we have state.15:31
niemeyerrogpeppe: We have both state and events that are emitted as a consequence of changing state15:32
rogpeppeniemeyer: ah, do you mean State.Sync ?15:32
niemeyerrogpeppe: No, I meant upgrader.Sync() indeed15:33
niemeyerrogpeppe: Because we must verify that the *upgrader* is done processing events15:33
rogpeppeniemeyer: but the events are being delivered by the state, right?15:33
niemeyerrogpeppe: Right15:33
niemeyerrogpeppe: But you're on the right track15:34
rogpeppeniemeyer: so how do we know that the Sync call has arrived before the event we're expecting from the state?15:34
niemeyerrogpeppe: I'm planning to make available state.ForceWatcherRefresh()15:34
niemeyerrogpeppe: That will at least make all events ready for consumption locally15:35
rogpeppeniemeyer: ok. but does it guarantee they've been delivered?15:35
niemeyerrogpeppe: No, because there's an intermediate loop that processes watches15:35
rogpeppeniemeyer: so i still don't see how upgrader.Sync can work reliably15:36
niemeyerrogpeppe: The thing that actually implements the e.g. foo.WatchWhatever() loop15:36
niemeyerrogpeppe: Right, I'm still thinking through to see if there's a better way, but no matter what in the short term there's no fantastic way to assert the all events have been made available15:36
niemeyerrogpeppe: So,15:36
niemeyerrogpeppe: To avoid blocking you further,15:36
rogpeppeniemeyer: AFAICS the only way of telling if an event has been delivered is to ask the thing it's been delivered to15:36
niemeyerrogpeppe: Sure, but that sucks for various reasons15:37
rogpeppeniemeyer: yeah, i see your point. but... the alternative sucks too :-)15:37
niemeyerrogpeppe: Not the least one, it means hardcoding logic for every tiny test we need to do15:37
niemeyerrogpeppe: My proposal is for us to implement a mechanism that is good enough for the moment15:37
niemeyerrogpeppe: and avoids the hackery15:38
* rogpeppe is all ears15:38
niemeyerrogpeppe: By defining a test mode in those cases that enables the Sync method to work15:38
niemeyerrogpeppe: When we call Sync(), the loop initializes a channel that was previously nil to time.After(100 * time.Millisecond)15:39
rogpeppeniemeyer: i still don't see how Sync can ever work properly15:39
niemeyerrogpeppe: and puts it in the main loop15:39
niemeyerrogpeppe: When Sync is acting, the value is reset every time the loop begins15:40
niemeyerrogpeppe: When the timeout happens, Sync returns15:40
niemeyerrogpeppe: With mstate's flush logic I described, this will become quite reliable, and we can probably reduce the timeout to half of this or less15:41
rogpeppeniemeyer: if we're going to do that, we may as well just have a timeout in the test rather than cluttering the code for a feature that may never be possible to implement properly15:41
niemeyerrogpeppe: I believe that eventually we can actually have a Sync() method on all watchers, and turn the mechanism into a deterministic system, and avoid issues completely15:41
rogpeppeniemeyer: even *with* the flush logic, we'll still need a timeout15:42
niemeyerrogpeppe: Not necessarily, no, as I just mentioned15:42
rogpeppeniemeyer: i'm not convinced that's possible, i'm afraid15:42
niemeyerrogpeppe: Wouldn't be the first time. :)15:42
rogpeppeniemeyer: how can any watcher know if it has received all the events that might happen as a result of a change to the db?15:43
niemeyerrogpeppe: It's fine, though.. if you want to put a short timeout in the test for the moment, that works for me.. the test should ensure that nothing happens though, rather than just assuming nothing happens.15:43
niemeyerrogpeppe: I'm not going to solve that problem today15:44
rogpeppeniemeyer: ok, i think i'll go for that as the simple approach for the time being, pending some future mechanism. i'm not very  happy about it though. we can easily check that the event gets delivered... and even if we have Sync, we'd be checking the same thing, i think. anyway, i'll go for the timeout.15:46
niemeyerrogpeppe: Agreed. I'm not very happy either. But I'm even less happy with what's there now.15:47
niemeyerrogpeppe: I'm really concerned about having that as a normal practice, and dirtying up all code with that kind of "address breakpoint" that not only doesn't pay for itself, but makes for brittle tests that are hard to debug and dirty up the logic.15:48
niemeyerrogpeppe: I promise I'll keep your core concern in mind, though, and try to have a more reasonable proposal eventually15:48
niemeyerI'll step out for lunch.. biab15:49
rogpeppeniemeyer: BTW about ChangeEnviroConfig...15:49
rogpeppeniemeyer: ok, enjoy15:49
niemeyerrogpeppe: Oh, ok16:39
niemeyerrogpeppe: Wanna conitnue?16:40
niemeyercontinue16:40
rogpeppeniemeyer: it was only a brief observation: my intention wasn't to do a delta, but to atomically write the whole thing. the delta is defined by the function itself. but maybe that's not possible with mstate actually.16:41
rogpeppeniemeyer: i've fixed the tests to do a timeout BTW; i think the branch may be LGTY now.16:42
niemeyerrogpeppe: There's no way to not do a delta with the sample you provided.16:44
niemeyerrogpeppe: You did attrs := AllAttrs; attrs["foo"] = "bar16:44
niemeyerrogpeppe: So attrs is a whole document, which has the issues I described16:45
rogpeppeniemeyer: and then returned all the attributes, which are bundled into a Config and written in their entirety.16:45
niemeyerrogpeppe: Exactly.. you said you're trying to fix the problem of applying deltas, but that isn't16:45
rogpeppeniemeyer: or can't you write a whole Config at once16:45
niemeyerrogpeppe: We can't, and that's the interface we have today16:45
niemeyerErm16:45
niemeyerrogpeppe: We can, and that's the interface we have today16:45
niemeyerrogpeppe: With the known issues..16:46
niemeyerrogpeppe: If we're not solving the issues, we can just use it16:46
rogpeppeniemeyer: can't we do the equivalent of zk's RetryChange?16:46
niemeyerrogpeppe: I've covered that in the review too16:46
niemeyerrogpeppe: Still presents issues16:46
rogpeppeniemeyer: we can't make an invalid config because we make the Config before writing it. i'm still not seeing it. but anyway, i've removed the function.16:47
fwereadeniemeyer, I have a feeling I'm going to feel very stupid in a moment, but: http://paste.ubuntu.com/1187523/16:49
fwereadebrb16:49
niemeyerrogpeppe: A Config is not necessarily a valid environment configuration..16:49
rogpeppeniemeyer: true16:51
niemeyerfwereade: No perceived stupidity.. it's indeed not immediately obvious16:52
niemeyerfwereade: I've argued quite a bit when the jujucharms stuff was created to avoid that kind of issue, but lost the argument in a miserable way16:54
fwereadeniemeyer, can you explain what is going on in words suitable for the hard of thinking?16:54
niemeyerfwereade: It's actually trivial: the charm store revisions charms monotonically.. anything that is looking at the content through alternative means may report a different reality16:55
fwereadeniemeyer, I thought that ended up meaning we picked the lowest possible rev that was higher than any other possible rev16:57
niemeyerfwereade: and to be honest, I don't see anything out of sync in jujucharms16:57
niemeyerfwereade: It's not reporting the wrong revision, at least in this page16:57
niemeyerfwereade: branch revision != charm revision16:58
niemeyerfwereade: revision numbers in Bazaar (or any DVCS) are wildly unreliable16:58
fwereadeniemeyer, yeah, I've been thinking about the content of revision and/or the legacy revision in metadata.yaml16:59
niemeyerfwereade: Charms obtained from the store should have the proper number there16:59
fwereadeniemeyer, it appears not to16:59
niemeyerfwereade: Example?16:59
fwereadeniemeyer, well, pasted -- the store thinks that 2 is the most recent revision, but there is nothing I can see on jujucharms with rev 2 at all17:00
niemeyerfwereade: Sorry, I don't understand17:00
fwereadeniemeyer, according to the rev files on jujucharms, it should be 22, AFAICT17:01
niemeyerfwereade: Which rev files, and why does it matter?17:01
niemeyerfwereade: jujucharms is not the store17:01
fwereadeniemeyer, well, yes, this is true, but I was expecting them to have roughly similar content17:01
niemeyerfwereade: They have roughly similar content17:01
fwereadeniemeyer, to the point where at least I could figure out some correspondence from one to the other17:02
niemeyerfwereade: This is actually possible17:02
niemeyerfwereade: Not sure if it's exposed, but there's a digest in the store17:02
niemeyerfwereade: Which is the revision digest17:02
fwereadeniemeyer, but, I'm sorry, I have to go eat supper... I'll reread some stuff this evening and see if I can see the light17:02
niemeyerfwereade: The branch revision number is not the way to do that, though..17:03
niemeyerfwereade: Because revision numbers are highly unreliable in Bazaar and in pretty much any DVCS17:03
fwereadeniemeyer, yeah, I only reported the branch revision for the sake of completeness17:03
fwereadeniemeyer, anyway, sorry, must go17:03
niemeyerfwereade: Well, not really17:03
niemeyerfwereade: You were basing your analysis on it I think17:03
niemeyerfwereade: Enjoy17:03
=== mramm2 is now known as mramm
niemeyerrogpeppe: I don't get the "// If a test failed, make sure we see any error from the upgrader.".. if a test failed, we already have a failure.. why are we deferring a second check?17:44
rogpeppeniemeyer: i had this problem when development - if an assert fails because some event was not received, it's quite possible the upgrader has died with an error which we want to see17:45
niemeyerrogpeppe: Let's drop the assert then, and use a check + wait?17:46
niemeyerrogpeppe: It feels like we're fighting our own test in a way17:46
rogpeppeniemeyer: waitDeath, yes?17:46
niemeyerrogpeppe: Yeah, it looks nice, thanks17:47
rogpeppeniemeyer: so you're saying use Check rather than Assert?17:47
rogpeppeniemeyer: sure. they're equivalent in a defer anyway17:47
niemeyerrogpeppe: I'm just wondering about that defer which seems to fight the test itself17:47
rogpeppeniemeyer: if we don't use a defer, we can't use Assert anywhere else17:47
rogpeppeniemeyer: there are lots of tests elsewhere that do defer func() {err := x.Close(); c.Assert(err, IsNil)}17:49
rogpeppeniemeyer: this is the moral equivalent17:49
rogpeppeniemeyer: i've gotta go. very close to reproposing the upgrade-juju branch, but just remembered Version.IsValid which is more than i can do in 2 minutes...17:51
niemeyerrogpeppe: Where is that test running Stop?17:51
rogpeppeniemeyer: it isn't. but it always waits for the upgrader to die, so that should be ok, i think.17:52
rogpeppeniemeyer: (no need to call Stop if Wait has returned, right?)17:52
niemeyerrogpeppe: If it always waits for the upgrader to die, why do we have a defer?17:52
niemeyerrogpeppe: No, that's not true17:53
niemeyerrogpeppe: If the test fails, we have an upgrader running in background17:53
rogpeppeniemeyer: that's true. we should call stop anyway, right? in a defer.17:53
niemeyerrogpeppe: Wait is merely saying "Uh.. didn't see it stop!"17:53
niemeyerrogpeppe: Yeah, c.Assert(Stop(), IsNil)17:53
rogpeppeniemeyer: ok, i'll call Stop17:53
niemeyerrogpeppe: That'd be fine17:53
rogpeppeniemeyer: in a defer?17:54
niemeyerrogpeppe: Yeah, as we generally do for the stop stuff17:54
niemeyerrogpeppe: Sorry for not being clear before.. it had something smelly and I couldn't quite put my finger on it17:54
rogpeppeniemeyer: that's fine. Stop is much better there.17:56
rogpeppeniemeyer: https://codereview.appspot.com/6490067/ is ready for final review i think17:58
niemeyerrogpeppe: I'm reproducing the counter bug now, btw.. I'll have a deeper look and try to fix it once and for all17:58
rogpeppeniemeyer: great. i do see it a *lot*17:58
niemeyerrogpeppe: Sorry about that17:59
rogpeppeniemeyer: like at that exact moment!17:59
niemeyer:-)17:59
rogpeppeniemeyer: gotta go. have fun.17:59
niemeyerrogpeppe: Have fun, and thanks!17:59
rogpeppeTheMue, fwereade, Aram, niemeyer: night all18:00
fwereadegn rg18:00
fwereadegn rogpeppe18:00
niemeyerfwereade: Btw, https://bugs.launchpad.net/charmworld/+bug/104644418:01
niemeyerfwereade: I'll also add the digest information to the returned info18:01
fwereadeniemeyer, ah, cool, tyvm18:01
niemeyerfwereade: np, and thanks for raising the issue18:01
fwereadeniemeyer, always a pleasure to blunder constructively into things :)18:02
niemeyerfwereade: Yeah, appreciated. It is a slighly unclear subject, unfortunately18:03
TheMuerogpeppe: gn18:04
niemeyerHah18:06
niemeyerI think the status counter stuff is an actual bug18:06
niemeyermthaddon: ping18:06
niemeyerAnd so it is..18:14
fwereade-on-jujuniemeyer: would you believe how I'm posting this?18:34
fwereade-on-jujuniemeyer: http://ec2-50-19-8-166.compute-1.amazonaws.com:3000/18:34
niemeyerfwereade-on-juju: OMG18:34
TheMueniemeyer: i have to leave. do you see any chance to review the two agent alive branches till tomorrow? tomorrow my vacancies start, but i can do some stuff till friday in the evening hours.18:35
OMG-IT-WORKSWOOHOO18:35
TheMuefwereade-on-juju: FANTASTIC18:36
OMG-IT-WORKSTheMue: Definitely, I'll make sure to have it ready by your morning18:36
fwereade-on-jujuand the unit agent log looks sane as well, barring presence spam that I've absent-mindedly fixed in about 3 branches that never made it to trunk18:36
fwereade-on-jujuhttp://paste.ubuntu.com/1187643/18:36
OMG-IT-WORKSfwereade-on-juju: Oops, sorry about that18:36
TheMueOMG-IT-WORKS: great, thx. i want to have it in befor we leave.18:36
* fwereade-on-juju dances, whoops, backflips18:37
fwereade-on-jujuOMG-IT-WORKS: nah, I suspect they've always been working branches that get taken apart and proposed piece by piece18:37
TheMuefwereade-on-juju: hehe, my claps his hands to your dance18:37
OMG-IT-WORKSTheMue: Thanks a lot, that's appreciated, although I feel a bit bad that you're looking at it over your holidays18:38
TheMueOMG-IT-WORKS: don't worry, our current progress is too fantastic to not participate :D18:39
OMG-IT-WORKSWhat *doesn't* seem to work so well is Subway, though :-)18:39
OMG-IT-WORKSSome messages just don't show up18:40
fwereadeOMG-IT-WORKS, yeah, seems so18:40
fwereadeOMG-IT-WORKS, ah well18:40
OMG-IT-WORKSNOT OUR PROBLEM18:41
OMG-IT-WORKS-)18:41
fwereade:D18:41
OMG-IT-WORKS(for once!)18:41
fwereadehaha18:41
fwereaderight, I think I really am done for the night, unless la famille falls asleep early again18:44
fwereadegn all, take care, and wave a tearful goodbye to the first ever working go-juju service deployment :)18:45
fwereade_rogpeppe, btw, is there something specific that demands that unit agent names be "unit-foo-123" rather than just "foo-123"?20:04
fwereade_rogpeppe, I'm feeling weird tacking "unit-" in front of everything20:05
niemeyerfwereade_: +120:06
niemeyerfwereade_: Although I don't know the context20:06
fwereade_niemeyer, I don't think it introduces any ambiguities20:06
fwereade_niemeyer, just for AgentToolsDir20:07
niemeyerfwereade_: Ah, the reasoning is that we'll have other agents there I think20:18
niemeyerfwereade_: machine-N, provisioning-N, etc20:19
niemeyerfwereade_: So unit-NAME is just making it even20:19
fwereade_niemeyer, I'd be just as happy with prefixes everywhere20:19
niemeyerfwereade_: I think we do have them, don't we?20:19
fwereade_niemeyer, at the moment I think htere's an unstated assumption that there will be <=1 of each of those, so they;re not N'd20:19
niemeyerfwereade_: Hmm20:20
niemeyerfwereade_: I see.. we'll probably not have more than a single one, but I do think we should have the suffix20:20
fwereade_niemeyer, yeah... only question is where the provisioner ID comes from for now :)20:21
fwereade_niemeyer, just copy the machine ID?20:21
niemeyerfwereade_: I'd be fine with that.. rogpeppe will be fixing it soon anyway, as we'll need a real entity for the provisioner as part of the upgrading work20:22
niemeyer(which sounds like a sensible thing, no matter what)20:22
fwereade_niemeyer, +120:22
fwereade_niemeyer, I guess it becomes AgentToolsDir(kind, name string)20:23
niemeyerfwereade_: I wonder if we might have something more straightforward20:24
fwereade_niemeyer, I wouldn't say no to that -- you have a suggestion?20:24
niemeyerfwereade_: func AgentToolsDir(agent interface{}) { switch agent.(type) { ... } )20:25
niemeyerfwereade_: Where do we use this function ATM?20:25
* niemeyer looks20:25
fwereade_niemeyer, not clear what agent is actually expected to be20:25
niemeyerfwereade_: Okay, we use it in a number of different places.. so, better idea:20:27
niemeyerfunc (u *Unit) PathKey() string { return "unit-" + u.Name() }20:27
niemeyerfunc AgentToolsDir(agent interface{ PathKey() string }) { return filepath.Join(prefix, agent.PathKey()) }20:28
niemeyerEOM :)20:29
fwereade_niemeyer, with /-replacement, ok; similar for machine; and just hack something up for provisioner?20:29
fwereade_niemeyer, (man, I really want to just auto-deploy a juju-provisioner charm :))20:30
niemeyerfwereade_: Yeah, for the moment we can have a locally-built value for provisioner20:30
niemeyerfwereade_: That's feeling unlikely at the moment.. it's actually less convenient due ot upgrading/versionoing/etc20:30
niemeyerfwereade_: This PathKey() sounds useful for other places too, btw20:31
niemeyerfwereade_: (like, building the /var/lib dir for the unit)20:31
fwereade_niemeyer, yes indeed20:32
fwereade_niemeyer, (but I bet we could still do a juju-provisioner charm that works with upgrades... not now though :))20:34
niemeyerfwereade_: Hmm.. that'd be interesting, but I think we'd have to bridge two different worlds for that (charm upgrades and agent upgrades)20:34
fwereade_niemeyer, I *think* they're independent... I don't see the charm as needing many upgrades, and all we'd need is to bounce the upstart job whenever we saw a config-changed20:36
fwereade_niemeyer, so long as the upstart job is written in terms of the unit's AgentToolsDir, anyway :)20:37
fwereade_niemeyer, it *is* a bit hackish, I agree :)20:37
niemeyerfwereade_: Yeah :)20:50
niemeyerBug fixed!20:50
fwereade_niemeyer, yay! (what bug?)20:51
niemeyerLOL20:51
niemeyerfwereade_: The one in juju-core/store you likely see every other time you run "go test" (/me hides)20:51
fwereade_niemeyer, YAY!20:51
niemeyerfwereade_: and interestingly, it was a *real* bug20:52
fwereade_niemeyer, ha, hiding in plain sight20:52
niemeyerYeah20:52
niemeyerWill need to ping mthaddon to see if the counter data in production needs fixing20:52
niemeyerand it's up: https://codereview.appspot.com/649008320:59
niemeyerfwereade_: and this one has the digest support: https://codereview.appspot.com/650008321:10
* niemeyer opens a bug on charmworld to use it21:10
niemeyerfwereade_: ping by any chance?22:03
niemeyerOkay, that was a long and nice day22:53
niemeyerdavecheney: Morning!22:53
niemeyerI'm stepping out for dinner+rest22:53

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