/srv/irclogs.ubuntu.com/2012/08/23/#juju-dev.txt

twobottux`aujuju: How can I manage multiple administrators with juju? <http://askubuntu.com/questions/179230/how-can-i-manage-multiple-administrators-with-juju>03:02
rogpeppefwereade_: mornin'07:18
fwereade_rogpeppe, heyhey07:18
rogpeppefwereade_: how's the uniter trauma going?07:18
fwereade_rogpeppe, I *think* it's starting to feel sane again :)07:19
fwereade_rogpeppe, I'll see what I can pull together this morning :)07:20
rogpeppefwereade_: cool. i haven't got what the suggested change is. is it to do with using bzr for the upgrading?07:20
fwereade_rogpeppe, that's actually quite a small part of it -- the stuff I've been having difficulty with is the relatively innocuous suggestion that there shouldn't be any distinction between forced and unforced upgrade operations, and uh, something else I forget07:21
rogpeppeinteresting07:21
rogpeppefwereade_: BTW i just discovered a piece of cmd/juju testing which is fairly crackful - all the DeploySuite tests are executed 4 times each!07:23
fwereade_rogpeppe, golly07:23
fwereade_rogpeppe, how did that happen?07:23
rogpeppefwereade_: it's 'cos other command test suites are embedding DeploySuite07:24
rogpeppefwereade_: not quite sure how that got past my radar07:24
fwereade_rogpeppe, gaaaaah07:24
fwereade_rogpeppe, well, hey, faster tests :)07:24
fwereade_rogpeppe, nice catch07:24
rogpeppefwereade_: now i just have to work out how much of DeploySuite can be replaced by JujuConnSuite07:24
* fwereade_ hopes lots07:25
rogpeppefwereade_: lots but... maybe not all; i think perhaps the JUJU_REPOSITORY setting needs to remain07:25
fwereade_rogpeppe, still :)07:25
rogpeppeyeah07:25
TheMuemorning08:41
fwereade_TheMue, heyhey08:44
TheMuefwereade_: heya08:44
* niemeyer waves08:54
fwereade_niemeyer, heyhey08:59
fwereade_niemeyer, nice response :)09:00
fwereade_niemeyer, (on the list)09:00
niemeyerfwereade_: Morning!09:02
niemeyerfwereade_: Cheers.. tricky too09:02
fwereade_getting coffee + sunlight, bbs09:07
niemeyerNice plan09:07
niemeyerNo sun here yet, but I could get some coffee09:08
TheMueniemeyer, Aram: you should get a link to a document via mail. so far e don't use very much watchers in trunk.10:58
Aramcheers.10:58
niemeyerTheMue: Sure, but the question is which watchers are needed/used10:59
niemeyerTheMue: You can talk to William to see details of the unit agent, and the Python code base for evaluation10:59
Aramniemeyer: I tried yesterday an experiment. I saw that you defined a local M type in txn and used that instead of the cluncky bson.M. I tried the same with bson.D in mstate. I did a local type D []bson.DocElem and then s/bson\.D/D/g but it won't work, any idea why.11:00
TheMueniemeyer: yes, i think especially in fwereade_s queue are several usages11:01
niemeyerAram: Yeah, bson.D is handled specially internally11:01
Araminteresting.11:01
niemeyerAram: I guess we could make it check for the element type instead11:01
niemeyerAram: Will have a look as I'm preparing an update11:01
niemeyer(mainly to get a few details of txn polished)11:02
fwereade_TheMue, offhand, the watchers I do/will need for the UA are: Service.WatchRelations; Service.WatchCharm; Unit.WatchResolved; Unit.WatchLife;  RelationUnit.Watch11:18
fwereade_Aram, ^^11:18
TheMuefwereade_: hehe, thx, just scanning your proposals11:18
fwereade_TheMue, Aram: of those, only the last one should be tricky11:19
Aramfwereade_: thank you kind sir11:19
Aramyep11:19
fwereade_TheMue, Aram: if I find I've forgotten one I'll let you know ;)11:19
TheMuefwereade_: great, thx again11:19
TheMueAram: I'll add it to the file11:20
* fwereade_ sighs with relief -- the Uniter has been massaged into a new shape, which passes (near-enough-exactly) the original tests :)11:31
fwereade_(excluding actual upgrades, not everything in place there yet, but I feel vindicated all the same :))11:32
* niemeyer sighs with fwereade_11:32
fwereade_niemeyer, ok, I has a plan11:32
fwereade_niemeyer, I want a damn uniter, so I intend to crudely hack out everything charm-related that I don't need, just to do a single dumb install without sufficiently smart recovery11:33
fwereade_niemeyer, happily your suggestions made it a hell of a lot easier to do that, much easier to decouple charmy modes from hooky modes11:34
niemeyerfwereade_: +1!11:34
niemeyerfwereade_: Glad to hear the refactoring went well11:35
fwereade_niemeyer, rough order, then: basic-uniter; charm-smart-upgrades; uniter-upgrade-charm; uniter-with-relations11:35
fwereade_niemeyer, in which uuc depends on csu depends on bu; and uwr hopefully just depends on bu11:36
TheMuefwereade_: Found a NeedsUpgradeWatcher in uniter/modes.go, but not yet in trunk. is it in one of your proposals too?11:36
fwereade_TheMue, I killed that the other day11:36
fwereade_TheMue, replaced by Service.WatchCharm11:36
TheMuefwereade_: ah, fine, will kill it too ;)11:36
fwereade_TheMue, cheers :)11:37
niemeyerfwereade_: Neat11:37
fwereade_niemeyer, yeah, it did -- it took a depressingly long time to find something that didn't acively hurt to look at11:37
fwereade_niemeyer, in fact, I'd better try to document the proposed charm.Manager (sorry :( ) API so you can point out all the ways it's crackful before I go too far ;)11:38
niemeyerfwereade_: I'd be happy to have a look11:40
fwereade_niemeyer, actually, huh, it should obviously be charm.Directory :/11:42
niemeyerfwereade_: I'm not sure.. we have charm.Dir already :)11:42
fwereade_niemeyer, hmm :)11:42
fwereade_niemeyer, I'll stick with manager for now, then, Directory isn't actually quite right because it needs to keep other stuff in a separate state dir11:43
fwereade_niemeyer, http://paste.ubuntu.com/1162551/12:18
* fwereade_ tries not to look anxious12:18
niemeyerfwereade_: Looks quite nice :-)12:19
fwereade_niemeyer, cool :)12:20
niemeyerfwereade_: Slightly surprised to see state.Charm there, for some reason12:20
fwereade_niemeyer, I *think* it's the right type to use in general; maybe crackfulness will become apparent when you see it used :)12:20
niemeyerfwereade_: func (*Manager) ReadStatus() (Status, *state.Charm, error)12:21
niemeyerfwereade_: How can the manager know the *state.Charm* in use?12:21
fwereade_niemeyer, (man, it did take forever to figure out the right bits -- for a while I had a separate Operation type which really seemed like a good idea)12:21
niemeyerfwereade_: I'd expect it to know the URL instead12:21
fwereade_niemeyer, it's passed a *state.State on create (whoops, forgot that bit)12:22
fwereade_niemeyer, entirely so that it can give back a *state.Charm when asked12:22
niemeyerfwereade_: Yeah, I'm arguing that this is a bit awkward12:22
niemeyerfwereade_: It should really give back the URL, IMO12:22
fwereade_niemeyer, I *think* it works out better like this than messing around creating them in the Uniter12:22
niemeyerfwereade_: I think it breaks down a level of encapsulation for little benefit12:23
niemeyerfwereade_: state.Charm(url)12:23
fwereade_niemeyer, but, well, feedback like this is why I showed you -- thanks :)12:23
niemeyerfwereade_: That's all it takes12:23
niemeyerfwereade_: Thanks :)12:24
fwereade_niemeyer, I was on the fence, and I think it saved a couple of lines of code, but you're right -- cleaner API > cleaner client code12:25
fwereade_brb12:29
TheMuelunchtime12:55
niemeyerAram: Curious12:58
niemeyerAram: Turns out I was wrong12:58
Aramyes12:58
niemeyerAram: bson.D isn't special12:59
niemeyerAram: It's already looking at the element type it seems12:59
Aramso what's the issue?12:59
Aramhmm12:59
niemeyerAram: Ah, hmm13:01
niemeyerAram: No, I'm wrong again13:01
niemeyerAram: It's used explicitly through different logic..13:02
Aramok.13:02
Aramniemeyer: this should work as an Assert in txn, right?13:04
Arambson.D{{"$or", []bson.D{13:04
Arambson.D{{"needsupgrade", nil}},13:04
Arambson.D{{"needsupgrade", NeedsUpgrade{Upgrade: true, Force: force}}},13:04
Aram}},13:04
Aram}13:04
Aramjust an $or query...13:05
AramI have a mysterious issue here.13:05
niemeyerAram: You're probably getting caught into the difference of non-existence vs. nil13:05
niemeyerAram: That said, this stuff has changed in state in the past couple of days13:06
niemeyerAram: It's a lot more friendly to mstate now13:06
niemeyerAram: It's probably easier to migrate it13:06
Aramok, I'll do that, but I'm still interested in the issue.13:06
Aramit fails if needsupgrade was already set to that value.13:07
Arambut why would it, the assertion should hold true in that case, right?13:07
AramI have another $or assert like that, also one of the options is nil, and that works fine.13:08
niemeyerAram: Yeah, it's worth understanding why that is happening before moving on13:15
niemeyerAram: Ah13:15
niemeyerAram: []bson.D isn't right13:15
niemeyerAram: Is that even working?13:16
niemeyerAram: I mean., compiling13:16
Aramsure.13:16
Aramall my $or queries are []bson.D13:16
niemeyerAram: Hmm, sorry, I'm on crack.. it's right13:17
niemeyerAram: What is the value like in the database?"13:17
niemeyerAram: At the moment the assertion fails13:17
AramNeedsUpgrade{Upgrade: true, Force: force}13:17
Aramexactly what the assertion says13:17
AramI add it once in the begining, it matches nil and it puts it in the db, then I try to add it again which should also work13:18
Arambut I get txn.ErrAborted13:18
niemeyerAram: Ah, hmm13:20
niemeyerAram: I know what's wrong13:20
niemeyerAram: Let me confirm it13:20
niemeyerAram: Yeah13:21
Aramso what is?13:21
niemeyerAram: txn is using "$or" too13:21
niemeyerAram: I'll add a test and fix it13:21
niemeyerAram: Thanks for persisting on it13:22
Aramso it's a txn bug?13:22
Aramheh.13:22
Aramgreat.13:22
niemeyerAram: Yeah.. I was (ab)using $or internally to make it cheaper to build the query13:23
niemeyerAram: I have to mix the queries instead13:24
niemeyerAram: So it ended up like {"$or": [{"$or": ...}]}13:25
hazmatwill juju-core use mongodb to distribute charm files instead of provider storage?13:30
Aramno.13:30
Aram(or at least not yet?)13:31
niemeyerAram: Curious.. i can't reproduce it in a test13:34
niemeyerhazmat, Aram: It will, it doesn't yet13:34
niemeyerAram: Ah, got it13:36
niemeyerAram: I can't reproduce it13:45
niemeyerAram: Can you please paste the snippet of code that is failing?13:45
hazmatniemeyer, with the move to that, the only use of provider storage will be the client map to api/db servers? or is the plan to ditch provider object storage entirely?13:46
niemeyerhazmat: We may be able to ditch it entirely, but that's a bit off still13:47
niemeyerAram: It looks like the nesting actually works13:48
Aramniemeyer: I will try to produce a self contained example13:48
niemeyerAram: Can you please just paste the snippet first?13:49
Aramsure13:49
hazmatniemeyer, cool, thats fine, i'm just talking future speak to an interested provider.13:49
niemeyerhazmat: I see, I do hope we're able to handle without the provider storage13:49
niemeyerAram: I've addressed the custom []DocElem, btw13:50
niemeyerAram: Will be out, probably as soon as we nail down why you're having trouble13:50
Aramniemeyer: http://paste.ubuntu.com/1162690/13:53
AramI've marked the failed assert13:53
Aramwith THIS FAILS13:53
niemeyerAram: Thanks13:56
niemeyerAram: This test passes, btw: http://paste.ubuntu.com/1162673/13:56
Aramniemeyer: wrote a self reproducing test13:57
niemeyerAram: Oh, brilliant!13:57
Aramniemeyer: works with go run13:57
Aramhttp://paste.ubuntu.com/1162701/13:57
niemeyerAram: I'll try moving that onto a test case13:57
niemeyerAram: Uh oh13:58
niemeyerAram: This is bogus13:58
Aramniemeyer: wait, something is worng13:58
niemeyerAram: Yeah13:58
niemeyerAram: It's this bit: {{"a", nil}, {"a", "a"}}13:58
niemeyerAram: This isn't a list of documents13:58
niemeyerAram: It's a single document with two repeated fields13:59
niemeyerAram: But that's not what you have in the real code13:59
Aramit isn't?13:59
Aramsel := bson.D{{"$or", []bson.D{13:59
Arambson.D{{"needsupgrade", nil}},13:59
Arambson.D{{"needsupgrade", nu}},13:59
Aram}},13:59
Aram}13:59
Aramthat's the real code13:59
niemeyerAram: Right.. that's not what the self-contained example has14:00
niemeyerAram: The example is wrong, the real code is right14:00
Aramright14:01
Aramwell, let me fix that14:01
niemeyerAram: Btw, the THIS FAILS seems misplaced14:01
niemeyerAram: It's pointing to a get rather than a set14:01
niemeyerAram: Is the the set right above it the proper place?14:02
Aramniemeyer: yeah, sorry.14:02
Aramthe set above14:02
Aramniemeyer: fixed my self contained example: http://paste.ubuntu.com/1162716/14:06
Arambut I can't reproduce it either14:06
Aramit works there14:06
Aramand it's a good test, if I change "a" to b "b" in the assert, it fails the second change, which is correct.14:07
Aramso nothing wrong on the txn side.14:07
niemeyerAram: and the only way to get ErrAborted is really for the assertion to fail14:10
niemeyerAram: Nothing else returns it.. so it's a bit puzzling14:10
Aramyeah, what's difference between the self contained example and the real code... the assertion is the same.14:10
Aramthe only difference is that one is a *string and one is a *T14:11
niemeyerAram: Can you please enable mgo.SetDebug(true) right before executing the failing statement, so we can see what's running?14:11
niemeyerAram: Ah, and mgo.SetLogger(c)14:11
niemeyerAram: Hmmmmmm14:12
niemeyerAram: Let me check something14:12
Aramniemeyer: debug log: http://paste.ubuntu.com/1162725/14:13
niemeyerAram: I bet it's the reordering of the fields14:13
niemeyerAram: Yeaahhhh14:15
Araminteresting.14:16
niemeyerAram: http://pastebin.ubuntu.com/1162730/14:16
Aramhmm...14:17
niemeyerAram: txn is using a map to inject some data in the inserted document (such as its id, revno, etc)14:17
niemeyerAram: Will have to change it to a bson.D to avoid his14:17
niemeyerthis14:17
Aramso it was a real bug, after all14:18
niemeyerAram: Yep, can't reorder fields since people can trust on it14:22
niemeyerAram: Thanks for the care on this, btw14:31
Aramwelcme14:34
fwereade_niemeyer, also, 3rd time's the charm... maybe... https://codereview.appspot.com/648205315:23
fwereade_niemeyer, and on that bombshell, I am *exhausted*, and am going to knock off a little early today -- I'll almost certainly be back on later with my heart in my mouth ;)15:23
fwereade_later all15:24
Aramcheers15:24
fwereade_(and if anyone else is kinda lounging around, not sure what to do with themselves, please do take a look...)15:25
fwereade_;p15:25
niemeyerfwereade_: Get some good rest!15:29
niemeyer  * installation (not really resumable, except by luck)15:42
niemeyerLOL15:42
TheMueAram: you got the list of the test comparison, now i'll focus on adding the missing ones16:11
niemeyerLunch16:13
TheMueniemeyer: enjoy16:15
* niemeyer waves17:37
rogpeppei'm off now. struggling with test stuff all day, hopefully make more progress tomorrow.17:43
rogpeppesee yous tomorrow17:44
niemeyerrogpeppe: Have a good time17:55
niemeyerfwereade_: I hope the review on the first branch makes sense18:18
niemeyerDoc appointment.. back in 30-60mins19:11
=== fss_ is now known as fss
niemeyerfwereade_: Uniter <321:24
fwereade_niemeyer, w00t!21:53
niemeyerfwereade_: I was actually looking at the modes rather than the Uniter itself.. that stuff is superb21:54
niemeyerfwereade_: Can almost read it to a child :)21:55
fwereade_niemeyer, I was hoping you'd like it :D21:55
fwereade_niemeyer, it will get a touch heavier when we add the various other watches, but actually much less so than one might fear21:56
niemeyerfwereade_: Of course, but the mechanism itself is straightforward21:56
niemeyerfwereade_: Easy to navigate mentally between the states21:56
fwereade_niemeyer, yep -- you remember I originally wanted to make them types? I though the setup would be significant enough to hurt, but actually it really isn't21:57
fwereade_niemeyer, and yeah, just 2 more modes, upgrading and conflicted21:58
fwereade_niemeyer, I have a sketch with a mildly interesting helper type for ModeStarted, but it doesn't become relevant until upgrades *and* relations are in play... and even then it's a touch marginal, will be interesting to see if it's worthwhile when I'm watching lifecycles as well22:00
niemeyerfwereade_: Yeah22:01
fwereade_niemeyer, good comments on the preceding review, btw, I think I will refrain from addressing them until I'm a bit soberer ;)22:02
niemeyerfwereade_: LOL22:04
niemeyerfwereade_: Sounds like a plan :)22:04
niemeyerdavechen1y: Heya23:17
davechen1yniemeyer: hey23:18
niemeyerdavecheney: Regarding the env config23:43
davecheneyyes23:43
niemeyerdavecheney: I think what you did is sane, and I was thinking of something that is not an issue..23:43
davecheneyok, phew23:43
niemeyerdavecheney: My main concern is that we shouldn't have in state something that is an invalid environ.Config23:43
niemeyererm23:43
niemeyerenvirons/config.Config23:44
davecheneyniemeyer: right, i don't think that is a problem with this proposal23:44
niemeyerdavecheney: Otherwise the whole thing will break down when we try to make state.EnvironConfig() return a first class type23:44
niemeyerdavecheney: yeah.. the fields being removed are fine23:44
niemeyerdavecheney: They're specific to the environ23:44
davecheneyyup23:44

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