[06:44] morning [06:44] TheMue, heyhey [06:45] fwereade_: heya [06:48] howdy [07:20] fwereade_, TheMue: hiya [07:20] rog, heyhey [07:21] rog: hi [07:21] rog: impl of environ config is - almost - done, i'm currently change the testing. here Config behaves different than ConfigNode [07:22] TheMue: great! thanks for doing it. [07:23] rog: one question here [07:24] rog: is SetEnvironConfig intended to update or to replace the config? [07:24] TheMue: yes, i believe so [07:24] TheMue: for State anyway [07:24] TheMue: it's not intended to replace ConfigNode in general, i think [07:26] rog: no, only this one method. so the passed config replaces an existing one, ok. [07:26] TheMue: oops, sorry i answered the wrong question [07:27] TheMue: i *think* it should replace the config [07:27] TheMue: as it's usually set all at once. but i'm not so sure [07:27] TheMue: interesting question. [07:27] rog: i think so too, otherwise by updating you only can add more values but never remove them [07:29] TheMue: the issue i'm thinking is that if one client updates the environment settings and the other does an upgrade (setting the proposed version), then one or other of the changes may be lost. [07:29] rog: cfg(a, b, c).update(cfg(b, c, d)) => cfg(a, b', c', d) [07:29] rog: oh, yes, would be an issue too [07:30] rog: but the same would be in case of an update by two clients [07:30] TheMue: i'm not sure [07:31] TheMue: what i'm worried about is: c := cfg(a=1); {c.set(a=2)} in parallel with {c.set(b=1)} [07:31] rog: client a thinks b has to be b' and updates, a millisecond later client b thinks b (the old value he remembers) has to be b'' and updates too. the first update is lost. [07:32] TheMue: that's true, but in this case we're dealing with disjoint sets of attributes. [07:33] shit, network agaiin [07:33] rog: ok, as long as keys are different an update mixing the value sets is ok. but updating the same key is still a problem. [07:33] TheMue: the environ config that we set when changing provider attributes doesn't hold the proposed version attribute. [07:34] hello. [07:34] TheMue_: of course, but that's inevitable [07:34] Aram: hiya [07:34] Aram: moin ;) [07:34] TheMue_: it's reasonable that someone might want to do an upgrade at the same time as updating the provider attrinbutes [07:35] TheMue_: i'm becoming less convinced that it's appropriate to lump the proposed version in with the provider attributes [07:36] rog: a kind of txn.exec(func(cfg)) would be nice, so the whole change based on the current config executes in a txn === TheMue_ is now known as TheMue [07:36] TheMue_: actually, we do have that kind of thing. i think we might be ok. let me check. [07:37] rog: i have to leave for some time in a few minutes, so you've time to rethink it [07:37] TheMue: ok [07:39] TheMue: i think it depends on how the API to changing environment settings works [07:42] fwereade: do you know what mechanism the user will use to change provider settings in the state? (i'm presuming that the client is the only thing that will change them - is that right?) [07:42] rog: let's talk about it later [07:42] * TheMue is now afk, bbl [07:42] TheMue: k [08:00] rog, um, I think there's an env-set command planned [08:01] rog, constraints will interact somehow; python already has set-constraints which allows for env-level settings [08:01] fwereade: that's good. i don't think the user would expect attributes they don't provide on the command line to be deleted. [08:01] rog, damn straight :) [08:02] fwereade: but the SetEnvironConfig method kind of implies that [08:02] rog, what's the justification for that method? [08:02] rog, surely all we ever want is some form of update? [08:03] fwereade: i *think* we already have something similar. but maybe not. [08:03] fwereade: i agree. [08:03] rog, what we originally had was just a ConfigNode, but I haven't been following the updates very closely [08:04] fwereade: yeah. [08:04] fwereade: we're going to replace that with a config.Config [08:04] rog, ok, indeed, that's a good thing to get [08:04] fwereade: but there's no way of setting attributes on a config.Config, so the interface will have to be SetEnvironConfig(*config.Config) [08:05] rog, my heart still says we want an UpdateEnvironConfig method [08:05] fwereade: and it seems perhaps a little surprising that if you do that, then no attributes will ever be deleted. [08:05] rog, what attributes might we want to delete? [08:05] fwereade: signature? [08:05] fwereade: i don't think we do [08:06] rog, hold on, a bell is ringing [08:06] rog, maybe SetEnvironConfig *is* ok, if we can trust ourselves to build a provider-valid config before we call it [08:07] fwereade: it's not ok if it does a replace not an update [08:07] rog, ha, concurrent updates [08:07] fwereade: yup [08:08] rog, hm, it could still use a confignode internally and work right [08:08] fwereade: not really. because we don't know what attributes to delete. [08:08] rog, what's the use case for deleting attributes? [08:09] fwereade: i think we should have UpdateEnvironConfig(*config.Config) and document that attributes are never deleted. [08:09] fwereade: 'cos yeah i don't see a use case for deleting attributes. [08:09] rog, sounds sane to me [11:21] fwereade: are you planning to add more methods to UniterSuite? [11:21] fwereade: more Test methods, that is [11:21] rog, no, I think I'll just be adding table entries [11:22] fwereade: currently we've got TestUniter only, but SetUpSuite writes stuff to VarDir. unfortunately JujuConnSuite sets up environs.VarDir on a per-test basis, not a per-suite basis [11:22] fwereade: actually, perhaps i'll just do the tools building in SetUpTest instead of SetUpSuite. [11:23] fwereade: it makes me wish for more flexible fixtures... [11:23] rog, yeah, I know the feeling [11:23] rog, I have a vague recollection of being aware of that and deciding it didn't matter -- I guess it does for what you're doing? [11:24] fwereade: i'm wondering if fixtures should all conform to interface{SetUp(c *gocheck.C); TearDown(c *gocheck.C); Reset(c *gocheck.C)} [11:24] re [11:24] fwereade: JujuConnSuite did not set environs.VarDir before [11:24] rog: i've just read that UpdateEnvironConfig() makes more sense? would be fine for me. [11:24] rog, ah, ok [11:24] TheMue: cool [11:25] rog, I do rather like that potential fixture style, yes [11:25] fwereade: i might run the idea past niemeyer some time [11:44] fwereade: actually, it seems that the above interface would not be sufficient for the use case in UniterSuite. the JujuConnSuite is reset for every test in the table, but that makes a new VarDir; whereas we want to keep the same jujuc executable around for all the tests. [11:44] fwereade: so actually i think that suite really does want to set VarDir itself. [11:45] fwereade: (took me a while to realise what was going on!) [11:57] note for the future: this is not a good idea: c.Logf("testlog: %q", c.GetTestLog()) [11:58] i wondered why i was seeing sequences of 255 backslashes [11:58] 256 presumably [12:01] rog, huh, did I do that? [12:01] fwereade: no, i did, trying to debug a failing UniterSuite test [12:02] rog, ah, good, because I'm pretty sure I felt the temptation to the other day, was wondering if I'd blacked out and checked it in or something ;p [12:02] fwereade: i'm sure the cause is something simple, but currently i can't see the wood for trees [12:11] fwereade: do you have an instant gut feeling for what kind of thing might be causing this failure? http://paste.ubuntu.com/1173708/ [12:11] lsr | grep test | grep -v internal | grep -v confignode | grep -v life | xargs grep '(Update(Id)?)|(Find(Id)?)|(Insert(Id)?)|(Upsert(Id)?)' [12:11] oops [12:11] wrong focus [12:12] fwereade: it's almost certainly to do with something in the environment that hasn't been set up correctly. [12:14] rog: so, implementation and test in state are done, now check for not yet covered dependencies. had to fight with the schema for test ;) [12:26] TheMue: cool. i'm struggling trying to merge trunk into a LGTM'd branch :-( [12:26] rog: *lol* yeah, sometimes hard [12:27] TheMue: the uniter tests are broken somehow, and it's too subtle for me to see yet [12:27] rog: strange. no useful hints? [12:28] TheMue: thanks for the work you did on mstate, I merged all txn stuff and pushed it. [12:28] TheMue: no clue yet. am delving to see what's actually going on in the tests. [12:28] Aram: yeah, took already a look. it's doing great steps into the right direction. [12:53] rog, sorry, I was having lunch [12:53] Gooood morning [12:53] fwereade: np [12:53] niemeyer: hiya [12:53] rog, and, hum, I'd usually expect to see rather more in the logs than just that, looks almost like there's no uniter at all [12:54] niemeyer, heyhey [12:54] man, I think there's a thunderstorm on its way, I'm feeling ridiculously flat [12:54] fwereade: it's failing in startupError, doing waitUnit for hook failed just after createUniter{} [12:55] rog, yeah, I saw that much... and I didn't see any of the uniter logging at all in that paste [12:55] fwereade: i changed the tests so that everything gets run with this function; that way i can see substeps: [12:55] func step(c *C, ctx *context, s stepper) { [12:55] c.Logf("%#v", s) [12:55] s.step(c, ctx) [12:55] } [12:56] rog, ISTM like the uniter is failing before it even hits a mode [12:56] fwereade: hmm, maybe the LoggingSuite isn't being hooked in right [12:56] rog, otherwise I'd expect an "examining charm state..." [12:57] rog, possibly something is up with the tools? [12:57] fwereade: entirely possible [12:57] rog, NewUniter calls esnureFs which calls EnsureTools [12:57] rog, except hmm *that* surely ought to be caught :/ [12:58] rog, yeah, startUniter checks that :/ [12:58] fwereade: the logger seems to be hooked in ok [12:59] fwereade: here's the full test output BTW: http://paste.ubuntu.com/1173763/ [13:00] rog, all I can say is that something is very up, because test 3 at *least* ought to be giving you log output [13:00] fwereade: what log messages should i be seeing? [13:01] * rog has an idea [13:02] ha! [13:02] rog: is there a way to push an invalid value (not matching the schema) into config.Config? [13:02] TheMue: which schema? [13:02] rog: i have to invalidate it for a test [13:03] rog, something more like http://paste.ubuntu.com/1173766/ [13:03] rog: environ config [13:03] fwereade: the log hooking is being disabled after Reset! [13:03] rog, ahhhhh [13:03] rog: i want to set name = 1, the provider test has done it before to see how the provider reacts [13:03] rog, then that would definitely explain it :) [13:04] rog: and the old usage of the config node allowed it to be so mean ;) [13:04] TheMue: you'll have to go behind the scenes, i'm afraid [13:04] rog: *sigh* [13:04] TheMue: kinda the point of config.Config is that it always matches the schema [13:05] rog: expected this answer, but hoped for an easier one :| [13:05] fwereade: all tests pass. phew. thanks for your help. [13:06] rog: need a kind of config.Evil(attrs) *Config, err [13:06] rog, phew indeed :) [13:06] fwereade: i'd let an extra line creep in when merging. [13:06] fwereade: which happened to be LoggingSuite.TearDownTest [13:06] TheMue: Yo [13:06] rog, ouch :) [13:06] TheMue: How's the EnvironConfig stuff? [13:06] niemeyer: implemented in state and tested there, now i'm changing the dependencies [13:07] niemeyer: hi btw [13:07] niemeyer: and for the provider test i have to write an invalid config [13:08] TheMue: Superb [13:09] niemeyer: i think i have to go directly to ZK here *sigh* [13:11] niemeyer: TheMue: I want to get rid completely of mgo in mstate_test. Tests should only rely on the public API and not implementation details. for test that HAVE to peek in the DB, I'd rather move them to a internal_test.go file or something. [13:11] Aram: +1 [13:11] Aram: +1 [13:12] TheMue: FWIW, it's a good thing that you're finding it difficult to write down a broken config ;) [13:12] niemeyer: yeah, indeed *lol* [13:14] niemeyer: the usage of config.Config with coercing a schema makes it hard, and that's a good feature [13:16] fwereade: could you have a glance at the uniter test changes in this CL, please, before i submit: https://codereview.appspot.com/6484051 [13:26] rog, they look fine to me :) [13:26] fwereade: thanks [13:28] rog, I'm feeling rather uncomfortable about writing tests which check git output directly, but I can't think of another way to get, say, the status/log of a git repo [13:28] rog, am I missing something obvious? :/ [13:29] fwereade: i presume that's the only way, but i'm not familiar with git [13:29] fwereade: there may be some API [13:31] rog, hmm, seems that such things exist, but they look like a hassle [13:32] ;) [13:33] Aram: How's the watcher going? [13:33] niemeyer: working on it, have a good model drawn on paper, expecting very good results. [13:34] Aram: Was there any issue with the proposal? [13:34] no. [13:35] at least I haven't found any. [13:35] Aram: Cool, was just wondering if the model on paper was different [13:52] lunch [14:11] niemeyer: can you think of any reason to retain the AgentToolsWatcher? [14:12] rog: No, I think EnvironConfig watcher should cover it [14:12] niemeyer: yeah, i think so. i was wondering if we might have reason to watch the current tools of an agent, but i don't think so. just checking. [14:13] rog: I don't think so as well.. it's mostly informational [14:45] niemeyer, I'm wiped out and need a break; if you have a moment, can I get a really casual pre-review on https://codereview.appspot.com/6488051 please? there's something not quite right about it: [14:46] niemeyer, I'm starting to think I should drop charm.Manager entirely and move its functionality into Uniter itself [14:46] fwereade_: Interesting, what's the motivation that makes you feel that way? [14:46] niemeyer, (also the tests are screwed up, but I'm hoping fresh eyes after a lie down will fix that, so you shouldn't have to worry too much there... [14:48] niemeyer, I can't quite put my finger on it... I'm sort of hoping you'll take one look and say "why are you doing X" and I'll say "er, I don't know", and we'll all live happily ever after [14:48] fwereade_: LOL [14:49] niemeyer, don't spend too much time on it, though [14:50] fwereade_: Cool, will check it out [14:50] niemeyer, cheers [15:21] niemeyer: most stuff for environ config is done, but provisioner (and here especially the tests) are a problem. dave also tested invalid environments. his impl today is relative friendly and retries based on the changes delivered by the watcher. but the new watcher stops on invalid environments, because config.New() thankfully doesn't except them. [15:22] TheMue: There is an important distinction between an invalid config.Config and a config.Config considered invalid by a provider [15:23] TheMue: The logic in the provisioner, and in fact in other workers too, should still consider a broken env and retry [15:23] niemeyer: config.New() checks the schema and returns an error if it is invalid [15:23] TheMue: The firewaller should do that too, for example [15:23] TheMue: There is an important distinction between an invalid config.Config and a config.Config considered invalid by a provider [15:25] niemeyer: what should the watcher return in this case? a struct containing the config and an error, so that the receiver can check? would be easy, but leads to more changes in other places. [15:25] TheMue: If the watcher receives an invalid *config.Config*, it can drop it, and wait for the next change [15:26] TheMue: That said, the firewaller and the provisioner must still check for a config.Config considered invalid by the provider [15:26] niemeyer: ah, good idea [15:26] TheMue: Because a valid config.Config is not necessarily a valid configuration for a specific provider [15:26] niemeyer: yeah, i don't change that check [15:36] so, it seems there's only one failing assert left. have to check why [15:48] ah, landed, only one well known fail due to my locale (compared bzr message of store is wrong) [15:50] dinnertime [15:57] fwereade_: I think I spotted some of your dislike there [15:57] TheMue: Enjoy! [16:03] niemeyer, oh yes? [16:05] fwereade_: Yeah, I've sent a review [16:05] niemeyer, sweet, tyvm [16:06] fwereade_: np! [16:06] * niemeyer steps out for lunch [16:07] niemeyer, yeah, good food for thought -- thanks :) [17:37] niemeyer: ping [17:37] fwereade_: ping [17:50] rog: Pongus [17:50] niemeyer: just wanted to have a word about the strictness of provider config attributes [17:51] rog: Ok [17:51] niemeyer: you said yesterday that they shouldn't be strict, but we had tests specifically checking for strictness. just wanted to check that it's ok to relax the checks. [17:51] niemeyer: i've proposed the CL anyway. [17:51] rog: I'm not sure about what this is about [17:51] niemeyer: EnvironConfig [17:51] rog: I don't recall saying anything about strictness [17:52] [16:05:25] rog: No provider should break if config.COnfig has an attribute that it doesn't know about [17:53] rog: Yeah, that's still the case [17:53] niemeyer: but at least one provider *was* breaking when it saw an unknown attribute [17:53] niemeyer: (and we had a test to check it) [17:53] rog: I can't imagine how that would have happened.. they don't validate the config.Config internals [17:54] niemeyer: environs.Provider.SetConfig [17:54] rog: ? [17:54] niemeyer: the provider sees all the attributes in the config [17:54] niemeyer: including (now) agent-version [17:55] rog: I said something else [17:55] rog: They don't validate the config.Config internals [17:55] rog: What is breaking, more precisely/ [17:55] ? [17:56] niemeyer: your comment didn't mention internals. [17:56] rog: config.New validates itself [17:56] rog: I can't imagine how that would have happened.. they don't validate the config.Config internals [17:56] niemeyer: they validate the attributes they get from the config [17:56] niemeyer: SetConfig was failing [17:56] rog: What is breaking, more precisely? [17:56] rog: file and line, please [17:57] niemeyer: well, the symptom i saw was that the provisioner failed to make a valid environment [17:57] niemeyer: the cause was: [17:58] niemeyer: environs/dummy/environs.go, checker.Coerce [17:59] niemeyer: (in Validate) [17:59] rog: There are no general attributes in there [17:59] rog: The file and line where an environment validates the general config.Config attributes, please? [17:59] niemeyer: ah, should config.Config know about agent-version? [17:59] rog: Yes [17:59] niemeyer: ok [18:00] niemeyer: that makes sense. [18:00] rog: Sweet [18:01] niemeyer: ok, thanks. i'll mark that branch as WIP [18:01] rog: np [18:02] niemeyer: gotta go now. see you tomorrow. [18:02] rog: have a good time [18:02] niemeyer: have fun [18:02] rog: Thanks