/srv/irclogs.ubuntu.com/2013/03/27/#juju-dev.txt

davecheneyyeah, the flags package isn't as flexible as some00:00
davecheneyyou have a usage() method which you can override, but from memory it doesn't have knowledge of the flags that have been defined so can't kind of convert the flag set into a usage document00:01
davecheneyhmm00:01
davecheneyactually that isn't true00:01
davecheneyit does do that00:01
davecheneygimme two secs00:01
davecheneybigjools: you want flag.PrintDefaults()00:05
bigjoolsok thanks00:06
bigjoolsI wasn't quite sure how the Usage() thing fits it, the docs don't make it obvious00:06
davecheneyUsage is called when you pass a flag that doesn't parse or is not known00:06
bigjoolshow is it overridden?00:09
bigjools(that's the bit that wasn't obvious, sorry)00:09
davecheneyflag.Usage = func() { ... ; flag.PrintDefaults }00:10
* thumper heads out to get a floor for the new shed...00:10
davecheneyflag.Usage = func() { ... ; flag.PrintDefaults() }00:11
bigjoolsoh that was more simple than I'd expected00:12
bigjoolsthanks00:12
davecheneyflag.Usage is a variable with type func()00:12
davecheneyso you can call it, with flag.Usage()00:13
davecheneysort of like a javascript function00:13
davecheneyin a slot00:13
thumperwow that took a lot longer than I thought it would01:39
davecheneywallyworld: 2013/03/27 01:43:40 ERROR JUJU:jujud:machine cmd/jujud: provisioning worker: failed to GET object provider-state from container ehmegerd-bhukett, caused by: https://region-a.geo-1.objects.hpcloudsvc.com/v1/17031369947864/ehmegerd-bhukett/provider-state%!(EXTRA string=failed executing the request), caused by: Get https://region-a.geo-1.objects.hpcloudsvc.com/v1/17031369947864/ehmegerd-bhukett/provider-state: lookup region-a.ge01:44
davecheney^ get that pretty constantly inside hp01:44
davecheneycan you confirm that, for you, deploying inside hp works ?01:44
davecheneyif so, then i'll push out this damnable release01:44
wallyworlddavecheney: i deployed yesterday, from tip. i don't recognise that error offhand. what rev are you looking to release? i'll do a deployment and check01:45
davecheneywallyworld: juju-core_1.9.12-3~1064~quantal1_amd64.deb01:46
davecheneyit's the usual nonsense that hp cloud cannot resolve its own endpoing internally01:46
wallyworlddavecheney: i deployed a bootstrap node and also a mysql node to check the debug log stuff. you saying that hp has known issues in this area?01:47
davecheneyi have not raised an issue with hp01:47
davecheneyi can assert that deploying into hp rarely works01:47
davecheneyfor me01:47
davecheneyon my accont01:47
wallyworldwell that sucks01:47
davecheneyscrew it01:47
davecheneyif you've had some success01:47
davecheneythat is a good enough test01:47
davecheneyi'll push out the release01:48
wallyworldwell, it did work for me from source yes01:48
wallyworldbut it's not good it isn't reliable01:48
davecheneysame here, have to --upload-tools for hp01:48
wallyworlddavecheney: and cause i'm running raring, i need to hard code the version to precise in the code otherwise it's a pita01:49
wallyworldbut upload-tools works fine if i do that01:49
wallyworldand deploy on a precise image01:49
davecheneyi don't think this is related to series01:49
davecheneythe error is related to dns name resolution01:50
wallyworldno, just mentioning for completeness01:50
davecheneyok01:50
wallyworldfull disclosure and all that01:50
davecheneyroger01:50
wallyworlddavecheney: dumb question - the deb contains juju-core rev 1064. does it just pull in tip of goose trunk? what control is there over the rev nr of goose we bake in? what if we didn't want goose tip but an earlier revision?01:57
davecheneywallyworld: the recipe does a pull from tip02:06
davecheneythere is no real control02:06
wallyworld:-(02:06
wallyworldok02:06
wallyworldwcpgw02:06
davecheneyhttps://code.launchpad.net/~dave-cheney/+recipe/juju-core02:06
davecheneyok, time to break for lunch02:07
thumperdavecheney: ping03:26
thumperhttp://play.golang.org/p/ohvYEDuBbz, cc bigjools03:26
davecheneythumper: /me looks03:26
bigjoolswas about to do the same :)03:26
davecheneyyup03:27
davecheneyyou've got two things there03:27
davecheney1, a typed nil03:27
davecheney2, you can have a method on a nil value03:27
bigjools!!!!!!!!03:27
davecheneyerr, not the right word, but you understand03:27
bigjoolsmadness, but ok thanks03:28
davecheneybigjools: Go isn't like C++, there isn't a pointer to a virtual method table03:29
davecheneyyou anre't really dispatching to a method03:29
davecheneyjust calling a function with the receiver as the first argument03:29
davecheneyit's just syntactic tomfoolery03:29
sidneiohai folks, are things into a 'it now works with canonistack, no hacks involved' yet?03:29
bigjoolsit still confuses me that nil turns into something else03:29
davecheneysidnei: nope03:29
* sidnei sets reminder for +7d03:30
davecheneybigjools: so there are types03:30
davecheneypointer types03:30
davecheneyand what those values point too03:30
bigjoolsnil magically turns into an object03:30
davecheneysidnei: set it for post 13.0403:30
sidneiah, thanks!03:30
davecheneysidnei: waaaaaaay past 13.0403:30
sidneimore like 2014? :)03:31
davecheneybigjools: nil is just the zero value for a pointer03:31
davecheneyif you have a pointer value03:31
davecheney*Error03:31
davecheneyactually03:31
davecheneyvar e *Error03:31
davecheneyit's value is nil, (well, 0, or close too)03:31
davecheneysidnei: probably not that bad, but the problems we have with canonistack aren't completely within the domain of Juju03:31
davecheneyso calling e.Error()03:32
davecheneyis actually doing03:32
davecheneyfunc Error(e *Error) String03:32
davecheneyand as nothing references the e inside that function call03:32
davecheneyit's ok that e is nil03:32
sidneidavecheney: still the public ips thing?03:32
davecheneysidnei: yup03:32
sidnei:/03:32
davecheneyipv4 isn't going to get any less scarece03:32
thumperdavecheney: what is InjectMachine, and what is the instanceId?03:33
bigjoolsdavecheney: thanks for the explanation. I have to get used to the way Go works here then.03:33
sidneiand why does it need public ips again?03:33
davecheneythumper: is this jeopardy ?03:33
davecheneybigjools: no worries03:33
thumperdavecheney: no, I was hoping you'd know03:33
davecheneyalthough I don't have much experience isn't this similar to how python does method dispatch ?03:34
bigjoolsdavecheney: so how do I rearrange my code to DWIM?03:34
davecheneybigjools: let me loook again03:34
bigjoolsI want an "error" that has more info on it03:34
* thumper shakes his head...03:35
thumperInjectMachine is used in exactly one place03:35
thumperbootstrap03:35
thumperwtf03:35
thumperdavecheney: what is the machine instance id?03:37
thumperdavecheney: any idea?03:38
thumperoh...03:38
thumperthe provider instance id03:38
thumperwhich when I'm wanting to start a new machine...03:38
bigjoolsdavecheney: actually I can just change foo() to return an error I think, so no worries03:38
thumperit should be empty right03:38
thumper?03:38
thumperso the provider picks it up and sets it...03:38
* thumper answered his owne question03:39
davecheneybigjools: http://play.golang.org/p/58xsXh9GMp03:39
davecheneymaybe that wasn't what you were asking03:39
davecheneythumper: ok, sorry, now to your question03:39
davecheneythumper: this is bootstrapping isn't it ?03:40
davecheneyit is a bit hairy03:40
thumperwell, inject machine is03:40
thumperbut I was more just wondering about the instance id for the machine03:40
thumperbut I'm pretty sure that the provider sets it03:40
thumperwhen the machine has been started03:40
bigjoolsdavecheney: that's pretty much it, thanbks03:41
davecheneybigjools: np03:41
thumperdavecheney: I've almost forced this code into the shape I want04:12
thumperalmost...04:12
thumpersometimes I think we are being too clever :)04:12
thumperdavecheney: in what situations does the transaction runner return txn.ErrAborted ?04:14
davecheneythumper: i do not know the answer to that04:15
thumperdavecheney: kk04:15
davecheneysoz04:15
thumperdavecheney: shouldn't really panic should I?04:20
thumperdavecheney: perhaps just return an error that says "shouldn't really get here, oops"04:21
davecheneyif it really is impossible, then panic sounds good04:23
thumperwell, it could be an edge case I haven't thought of04:24
davecheneyid would expect pushback in the review04:25
thumperlets see :)04:26
thumperI need tests anyway04:27
thumper...04:27
thumperadded state.Unit.AssignToNewMachine()04:27
thumperok, tests later...04:31
thumperlike.. tomorrow04:31
thumperciao04:31
=== _mup__ is now known as _mup_
dimiternmorning all07:49
fwereadedimitern, heyhey08:03
thumperevening08:06
* thumper decided to get the tests done now, so first round of reviews can happen before I leave for easter08:07
thumperrogpeppe: you around?08:09
benonsoftwaresort08:11
benonsoftwareOops, sorry about that.08:16
thumpermorning fwereade08:19
fwereadethumper, heyhey08:19
thumperfwereade: I'm just writing the tests for the assign to new machine in one transaction work08:19
thumperfwereade: which includes the AssignNew policy08:20
fwereadethumper, ok, cool08:20
thumperfwereade: I'm up now so I can get a first review of it before I stop for easter :)08:20
fwereadethumper, much appreciated :)08:20
thumperfwereade: actually I have a few questions...08:23
fwereadethumper, g+ in about 5 mins ok for you?08:23
thumperfwereade: let me poke this with a stick first :)08:23
thumperfwereade: given a state.Unit, how do you get the Machine it is running on?08:29
thumperfwereade: the closest I can see is DeployerName()08:30
thumperfwereade: which doesn't actually give me what I want08:30
thumperfwereade: ok to add methods?08:30
fwereadethumper, AssignedMachineId IIRC08:33
thumperfwereade: ah, yes08:33
thumperfwereade: so what is the normal way to get a machine given an ID?08:34
thumperfrom the outside?08:34
thumperie, a test package08:34
fwereadethumper, State.Machine() takes an id08:34
thumpercool08:34
thumperfwereade: another dumb question, given a machine, how do I see what units are deployed on it?08:38
thumperPrinciples doesn't seem to be mentioned in any reasonable public method for access08:38
fwereadethumper, Units() returns all units including subordinates08:39
thumperahh... it is using the doc "principal" name, not "Principal"08:40
fwereadethumper, if you need just the principals you could filter that by Unit.IsPrincipal()08:40
thumperand my search was case sensitive08:40
thumperfwereade: it is a test, there is only a princpal :)08:40
fwereadethumper, cool :)08:40
thumperfwereade: it is testing that the machine gets the principal set as well as the unit geting the machine id set08:40
fwereadethumper, cool08:40
thumperfwereade: is there an assert thingy for length of a slice?08:42
fwereadethumper, HasLen08:42
* fwereade realises he wants to break compatibility with the released tools within 4 hours of their release; examines his conscience08:43
thumper:)08:43
* fwereade decides that the assignment policy change will do that anyway, as will a bunch of other things probably, decides not to worry about it08:44
thumperfwereade: hmm... you can't get the Series for a unit...08:45
thumperfwereade: are you expected to go through the charm?08:45
thumperfwereade: sorry, service?08:45
fwereadethumper, you're not really expected to ask from outside at the unit level, describe use case a little more?08:45
thumperfwereade: inside the test, I want to create a machine with the correct series for the unit, to make sure it isn't claimed in AssignToNewMachine08:46
fwereadethumper, I'd just create one with the charm's series08:46
thumperfwereade: to do that, I need to know the series of the unit08:46
fwereadethumper, unit series is just a denormalised copy of the charm series08:47
thumperfwereade: I'm not liking the number of dots here...08:48
thumperlet me show you.08:48
rogpeppethumper: hiya08:48
thumperfwereade: nm... too many returns with value,err08:51
thumperrogpeppe: I had a question for you08:51
rogpeppethumper: ask away08:51
fwereadethumper, haha, automatic trainwreck protection ;p08:51
thumperrogpeppe: perhaps best asked over a hangout if you have time08:51
rogpeppethumper: sure08:51
thumperfwereade: verbose mode on08:51
thumperrogpeppe: shall I start one?08:51
rogpeppethumper: do you wanna start... yeah08:51
dimiternfwereade: when updating RelationCount is it ok to also change the doc field or you're expected to call Refresh after SetCharm to get the updated value?09:12
fwereadedimitern, it's not visible externally, and it's not going to be accurate anyway in a multi-user context09:12
fwereadedimitern, just don't bother changing it IMO09:13
dimiternfwereade: ok, but in tests I used Refresh and added ServiceRelationCount(svc) -> int in export_test09:13
rogpeppefwereade, dimitern: do any of the operations inspect it to decide what kind of transaction to start with?09:13
thumperfwereade: so testing charms always use the series "series" ?09:13
dimiternrogpeppe: no, but it was not updated after adding new peer rels09:14
fwereadethumper, they don;t *have* to but in parctice I think they do09:14
thumperok09:14
fwereaderogpeppe, dimitern: actually they do, but the counts are assumed in general not to be accurate09:14
rogpeppefwereade: if they're not accurate, why bother looking at them?09:14
rogpeppefwereade: that would seem to me to be a reasonable argument for refreshing the count09:15
rogpeppefwereade: personally, i think that assuming the current in-memory state is any kind of indicator of remote state is a bit bogus09:15
fwereaderogpeppe, it might be right, and probably will be if it's a fresh object, which in practice it always is except in tests09:16
fwereaderogpeppe, but trying to keep it accurate in a long-lived object seems pretty pointless09:17
rogpeppefwereade: fair enough09:17
fwereaderogpeppe, the time to pay for the extra roundtrips is when we need to use them, I think09:18
thumperah... seriously? no NotEqual ?09:18
rogpeppethumper: Not(Equals)09:19
* thumper sighs09:19
rogpeppethumper: 3 more characters doesn't seem too bad to me, and it's general functionality.09:20
rogpeppeif you want NotEqual: var NotEqual = Not(Equals) :-)09:21
thumperrogpeppe: for me it is more that it should be so commonly used, it should have its own09:21
thumper:)09:21
thumpersuppose someone submits that to gocheck?09:21
thumperbags not09:21
rogpeppethumper: it's just sugar09:21
thumperrogpeppe: sugar is good09:22
thumperrogpeppe: half of go is sugar09:22
rogpeppethumper: and not that commonly used (20 out of 1621 uses of Equals in the code base)09:22
thumperfor us maybe :)09:22
rogpeppethumper: really? i beg to disagree.09:22
thumperok09:22
thumperwe can disagree09:23
rogpeppethumper: there are one or two sugary bits in go (some automatic type promotions) but most is basic functionality, i think09:23
rogpeppethumper: by "sugar" i mean "something that can easily be made from a combination of other existing parts"09:25
thumperfwereade: what is the best way to make a unit not alive for a test?09:29
fwereadethumper, Destroy makes it Dying09:29
thumperta09:29
fwereadethumper, EnsureDead makes it Dead (and will probably work straight-off in a test context)09:29
fwereadethumper, Remove requires that EnsureDead has already been called and actually removes it from the db09:30
thumperdestroy is enough, ta09:30
dimiternfwereade, rogpeppe: I think this should be ready now, would you take a look please? https://codereview.appspot.com/8034043/09:33
fwereadedimitern, ack09:33
* thumper is done09:47
thumpertests written, all tests currently running prior to proposing09:47
* thumper goes to put on the kettle, tea time09:47
TheMuefwereade: ping, read your review, so we can talk about it now09:49
thumperw00t09:50
thumperall pass09:50
* thumper does the lbox dance09:50
* fwereade cheers at thumper09:50
* fwereade applauds the dance09:50
* TheMue cheers too, because he knows that feeling09:50
fwereadeTheMue, would you start a hangout please? will join in <5m09:50
TheMuefwereade: will do09:51
thumperfwereade: https://codereview.appspot.com/784504809:53
thumperand I'm logging off now09:53
thumpersee y'all tomorrow09:53
dimiternfwereade: i'm pinging you :)09:54
dimiternfwereade: wanna start a hangout?09:55
fwereadedimitern, sorry, need to chat to TheMue first09:55
dimiternfwereade: sure, np09:55
fwereadeTheMue, here09:55
TheMuedimitern: i'll try to be fast ;)09:55
dimiternTheMue: no worries09:55
TheMuefwereade: ho is started, you should have an invitation09:56
fwereadeTheMue, ah, sorry, was looking at my canonical account09:57
fwereadedimitern, ping10:18
dimiternfwereade: here10:18
* fwereade starts hangout10:18
=== teknico_ is now known as teknico
fwereadeTheMue, dimitern: I'm just WIPing your branches for now so I can see what I'm doing on +activereviews10:30
dimiternfwereade: sure, I noticed that :) it's a pity lbox propose doesn't do this somehow10:31
fwereadedimitern, lbox propose -wip10:31
TheMuefwereade: sure10:31
rogpeppefwereade: is juju destroy-machine supposed to work?10:32
fwereaderogpeppe, depends... in what context? ;p10:32
dimiternfwereade: I don't think -wip sets the MP to WIP10:32
rogpeppefwereade: i just tried to use it, and nothing seems to be destroyed10:32
rogpeppefwereade: the instance stubbornly remains there10:32
fwereadedimitern, I don't think it shoudl destroy anything10:33
fwereaderogpeppe, ok, the machine is Dead but the provisioner doesn't pick it up?10:33
rogpeppefwereade: i don't know for sure if the machine is Dead.10:33
fwereaderogpeppe, check the machine logs maybe?10:33
rogpeppefwereade: am doing that right now10:34
fwereaderogpeppe, cheers10:34
rogpeppefwereade: ha, i've been running this juju env for less than a day, with 3 units and the all-machines.log is already 24MB10:37
fwereaderogpeppe, how much of that is state/watcher logs?10:38
rogpeppefwereade: first estimate: 83%10:39
rogpeppefwereade: mostly "loading new events"10:40
rogpeppefwereade: 'cos that happens every 5 seconds10:40
fwereaderogpeppe, yeah, thought so :/10:41
fwereaderogpeppe, I don't want to switch off debug logging, but I don't want to see that stuff ATM, and I don't want to drop that logging either10:42
rogpeppefwereade: we should just raise the log level a bit10:43
rogpeppefwereade: well actually10:43
fwereaderogpeppe, no, because other stuff logged at debug level *is* handy10:43
rogpeppefwereade: the "loading new events" messages could go10:43
fwereaderogpeppe, +110:43
rogpeppefwereade: it's nice to see when new events actually come in10:43
jamfwereade: ian and I discussed the possibility of having DEBUG messages always logged locally, but rsyslogd would only sync INFO and higher10:44
jamor something like that.10:44
fwereadejam, yeah, that would be reasonable too10:45
jamfwereade: alternatively, you should be able to post-filter with "juju debug-log | grep -v DEBUG" or whatever, since all the tags should be well defined. But yeah, some of that was "tweaking as we find a good balance"10:46
jamwe talked about DEBUG default off, until user requested, INFO only local, Notice and above global.10:46
rogpeppefwereade: 82% of the size is from "loading new events"10:48
fwereaderogpeppe, ok, let's just drop that one10:49
jamrogpeppe: clearly that means when the logs are rotated it will trivially compress, right? :)10:49
* rogpeppe prefers logs with greater signal to noise ration10:50
rogpeppefwereade: the log size reduces by 95% with grep -v 'loading new|synchronizing watcher'10:53
rogpeppefwereade: so i'll remove the synchronizing watcher message too10:53
fwereaderogpeppe, jam: hmm, good point about compression actually10:54
fwereaderogpeppe, the reason I am nervous is that I can all too easily imagine us encountering surprising watcher behaviour at scale10:54
fwereaderogpeppe, ...but then, at scale, the sheer volume of messages may become crippling10:55
* fwereade grumbles vaguely10:55
rogpeppefwereade: is it really worth printing log events for non-events ?10:55
rogpeppefwereade: one thing: i see many more connect requests than i would expect10:56
fwereaderogpeppe, well, it allows us to distinguish between "nothing happened" and "the watcher is blocked"10:56
fwereaderogpeppe, oh yes?10:56
rogpeppefwereade: like, over 4000 in the last day10:56
fwereaderogpeppe, what exactly are you referring to by connect requests? the machine agent reconnecting to state?10:57
rogpeppefwereade: yeah. well, mgo dialling the state server, at any rate10:57
rogpeppefwereade: looks like it happens every 3 minutes10:58
fwereaderogpeppe, that is... somewhat alarming10:58
fwereaderogpeppe, anything obvious in the logs preceding the attempts?10:59
rogpeppefwereade: i wonder if there's a connection between that three minutes and this line in mgo:10:59
rogpeppesession.SetSyncTimeout(3 * time.Minute)10:59
rogpeppehmm, no, that's in a test!10:59
rogpeppefwereade: no not AFAICSS10:59
rogpeppefwereade: ah, i think it must be const syncServersDelay = 3 * time.Minute11:05
fwereaderogpeppe, ha, I don't recognise that at all11:16
dimiternfwereade: indeed, when I commented out the RC++ block I started getting ErrExCont on destroy :)11:19
fwereadedimitern, cool, my mental model remains accurate :)11:19
dimiternfwereade: it's done and I like how the test got simplified, check it out11:26
=== teknico_ is now known as teknico
mattywrogpeppe, any idea why running go test in the juju-core/state/apiserver package might never terminate?11:39
rogpeppemattyw: it can happen that a test fails and then things hang up trying to tear down.11:40
rogpeppemattyw: (it's an issue that needs fixing)11:40
rogpeppemattyw: try running go test -gocheck.vv11:40
rogpeppemattyw: then you'll see all the test output as it happens11:40
rogpeppemattyw: so you'll know where it's hanging11:40
mattywrogpeppe, you're right http://pastebin.ubuntu.com/5652025/11:43
rogpeppemattyw: ah, i suspected that actually11:43
rogpeppemattyw: you need a version of mongo that supports ssl11:44
rogpeppemattyw: i think there might be an apt repo for it, but i'm not sure.11:44
rogpeppemattyw: i got it from the s3 bucket that juju gets it from11:44
mattywrogpeppe, I can try installing one by hand11:45
mattywrogpeppe, good plan11:45
fwereadedimitern, LGTM with trivials11:45
fwereadeeveryone else, need to be hospitable for a bit until cath comes back11:45
rogpeppemattyw: http://juju-dist.s3.amazonaws.com/tools/mongo-2.2.0-precise-amd64.tgz11:47
mattywrogpeppe, just installing it from there11:47
mattywrogpeppe, thanks very much11:47
mattywrogpeppe, did I mention I like the api?11:47
rogpeppemattyw: i think you did. that's nice to hear!11:48
dimiternfwereade: cheers11:48
rogpeppemattyw: what do you like about it, BTW?11:48
mattywrogpeppe, at the moment just the fact that a client doesn't really need to do anything to get data about units, I don't have to parse json or handle connections. I just sit on a channel11:49
rogpeppemattyw: cool. we aim to please :-)11:50
mattywrogpeppe, something that is confusing though is there doesn't seem to be a way for me to get ServiceInfo from a get. It would be nice to just watch the deltas for *params.UnitInfo, then for each one get the service details by doing a ServiceGet(u.Name) and get a params.ServiceInfo back11:51
rogpeppemattyw: you should see the service details too, as they arrive11:52
rogpeppemattyw: although the service will arrive in the same set of deltas as the unit of that service, there's currently no guarantee that the service will appear first in that slice.11:53
mattywrogpeppe, but I'll have to keep track of them myself, it could be lasier by just watching for units then asking for the data each time (although now I think about it when a unit gets remove that would be messy)11:53
rogpeppemattyw: (that was a policy decision taken because the GUI, the main consumer of the API currently, doesn't care)11:53
mattywrogpeppe, in fact, the more I think about it, the more I think it's best I keep track of them myself11:54
rogpeppemattyw: keeping track yourself should be easy, yeah11:54
mattywrogpeppe, at the moment I watch for UnitInfo and ServiceInfo11:54
rogpeppemattyw: all you need to do is keep a map[string]*params.ServiceInfo11:54
rogpeppemattyw: and assign to it when things change11:54
mattywrogpeppe, exactly what i'm doing11:54
mattywrogpeppe, good to know I'm on the right track11:55
* TheMue enjoys a short lunch break11:59
* dimitern lunch as well12:01
mattywrogpeppe, thanks, that seems to be working a treat now12:01
rogpeppemattyw: great12:01
mattywrogpeppe, something you might be able to answer without my trying it out. That sample you sent me yesterday. Would I be able to run that from within a deployed unit? Would it need any extra info to connect the the environment?12:03
rogpeppemattyw: from within a deployed unit, you'd need slightly different code12:04
rogpeppemattyw: this is an issue that the GUI team have too, in fact.12:04
rogpeppefwereade: what do you think of the idea of making the API server address available in an environment variable to hooks ?12:04
rogpeppefwereade: current the GUI charm is going delving in agent.conf files, which, while expedient, probably isn't a great long term solution12:05
fwereaderogpeppe, hmm, I need to think about that for a bit12:07
fwereaderogpeppe, definitely better than the current solution, but... :)12:08
rogpeppefwereade: what do see as the potential problems with it?12:08
=== BradCrittenden is now known as bac
rogpeppefwereade: oh yes, i just looked at the life status of those machines i tried to destroy - they're all dying, but nothing's reacting12:28
fwereaderogpeppe, I'm not sure there are any problems,  just hadn't really considered it12:30
rogpeppefwereade: yeah, i wondered at first, then thought "why not?"12:30
rogpeppefwereade: it's not going to be that uncommon for charms to want to talk to their juju environment in a proactive way12:31
fwereaderogpeppe, hmm, if you bounce the machine agents do they react then?12:31
rogpeppefwereade: i'm trying to remember which part of the machine agent is responsible for setting the machine to Dead12:32
fwereaderogpeppe, I guess the core of my unease is that we give hooks a very specific environment to work with, and giving them direct API access kinda does an end run around that12:32
fwereaderogpeppe, the Machiner12:32
rogpeppefwereade: they only get direct API access if someone specifically tells the charm the access key12:32
fwereaderogpeppe, true12:33
fwereaderogpeppe, I'm still wondering whether it makes more sense as a charm config param12:33
fwereaderogpeppe, probably not12:33
rogpeppefwereade: looks like the Machiner isn't actually started by the machine agent. oops.12:34
fwereaderogpeppe, well, crap12:34
fwereaderogpeppe, that*would* explain hte trouble you've been having with the live tests though12:35
rogpeppefwereade: ah!12:36
rogpeppefwereade: https://codereview.appspot.com/6938072/diff/3001/cmd/jujud/machine.go13:02
rogpeppefwereade: oops, i didn't spot it!13:02
fwereaderogpeppe, shit happens, my fault for crappy testing13:03
fwereaderogpeppe, IIRC we did discuss it and agreed that the complexities of the state-fuckery made it skippable13:03
fwereaderogpeppe, but that's clearly nonsense :)13:03
fwereaderogpeppe, except, hold on13:04
fwereaderogpeppe, we dropped machiner then13:04
fwereaderogpeppe, that was known13:04
rogpeppefwereade: yeah, i'm just trying to to see when it came back13:04
fwereaderogpeppe, because machiner was trying to do deployer's job13:04
fwereaderogpeppe, I could have sworn I put it back at some point13:04
fwereaderogpeppe, but, maybe I just didn't13:05
* fwereade heads off to lunch and maybe to find something to smack himself with13:05
=== frankban_ is now known as frankban
mattywrogpeppe, ping?13:12
rogpeppemattyw: pong?13:12
mattywrogpeppe, hi, I'm trying to write some unit tests for my api querying thing, I'm using state/apiserver/api_test.go as a guide13:13
rogpeppemattyw: ok13:14
rogpeppemattyw: that may or may not be a good idea :-)13:14
mattywrogpeppe, but there must be something I'm missing in the intitial setup because whenever I try to do anything in setUpScenario like AddUser, AddMachine or AddUnit I panic will a nil reference13:15
rogpeppemattyw: could you paste your code?13:15
mattywrogpeppe, just doing it...13:15
mattywrogpeppe, http://paste.ubuntu.com/565224313:17
mattywrogpeppe, I'm been just piling stuff into SetUpSuite to see what happens, each of these commands by themselves will blow up13:17
rogpeppemattyw: i'll just see what happens when i run your code13:18
mattywrogpeppe, ok thanks13:18
rogpeppemattyw: ok, i've found your problem13:22
rogpeppemattyw: try this: http://paste.ubuntu.com/5652259/13:24
rogpeppemattyw: problem 1) you were defining SetUpSuite but not calling the underlying JujuConnSuite SetUpSuite.13:25
mattywrogpeppe, seems to run, thanks very much, I was looking for something like JujuConnSuite.SetUptest(c) but couldn't find anything13:26
rogpeppemattyw: problem 2) JujuConnSuite only provides a State for individual tests, not for the whole suite.13:26
mattywrogpeppe, thanks again for your help13:26
rogpeppemattyw: np13:26
mattywrogpeppe, ok13:26
=== andrewdeane is now known as awd
rogpeppefwereade: ping13:50
fwereaderogpeppe, pong13:54
rogpeppefwereade: so... i've put Machiner back in the machine agent13:54
rogpeppefwereade: and i have a test that fails before and passes now: http://paste.ubuntu.com/5652331/13:54
rogpeppefwereade: but...13:55
rogpeppefwereade: i don't like the test, and i'm not sure of the best way to fix it13:55
rogpeppefwereade: do you see why it's flaky?13:55
fwereaderogpeppe, is it the 5s matching watcher refreshes?13:56
fwereaderogpeppe, or something else?13:56
rogpeppefwereade: yeah that's it13:56
=== wedgwood_away is now known as wedgwood
rogpeppefwereade: if the destroy happens a little bit later, then we really can take  5s to notice13:56
rogpeppefwereade: but we can't call StartSync because we don't have access to the machiner's state13:57
fwereaderogpeppe, check out cmd/jujud/deployer_test.go13:57
fwereaderogpeppe, which does Bad Things to get around that problem13:57
fwereaderogpeppe, but to be fair Worse Things have happened13:57
rogpeppefwereade: i'm wondering about a slightly more radical approach to StartSync13:57
fwereaderogpeppe, go on...13:58
rogpeppefwereade: how about we make StartSync global?13:58
rogpeppefwereade: so it syncs *all* watchers13:58
fwereaderogpeppe, I was afraid you were going to say that, but it is awfully tempting13:59
fwereaderogpeppe, that'd unfuck a number of other tests I think13:59
rogpeppefwereade: this is for testing, right?13:59
rogpeppefwereade: yeah13:59
rogpeppefwereade: and i can't really see much of a down side13:59
rogpeppefwereade: beyond the "global stuff is bad" thing14:00
fwereaderogpeppe, well, it's kinda papering over unhelpful factoring of the jujud stuff14:00
rogpeppefwereade: there are lots of places where we've got several states and we change one and want another watcher to react14:01
rogpeppefwereade: well, i say "lots"... i think that may be the case.14:01
rogpeppefwereade: with the jujud stuff, i think it's ok to do black box testing, but that does mean that the command will open its own state.14:02
fwereaderogpeppe, I would prefer it if we could see a way to get the state out of jujud, but IIRC I looked into it and it was somewhat ard to tract14:03
fwereaderogpeppe, I do honestly favour black box testing wherever possible, I just prefer much smaller boxes :)14:04
rogpeppefwereade: the problem is that the state in jujud is a changing thing14:04
rogpeppefwereade: because it can reload14:04
=== wedgwood is now known as wedgwood_away
fwereaderogpeppe, indeed so -- I do kinda think that mixing the state-opening up with the task-running is a bit of a code smell14:05
=== wedgwood_away is now known as wedgwood
rogpeppefwereade: well, it would be even worse if it wasn't14:06
fwereaderogpeppe, meeting btw14:06
=== wedgwood is now known as wedgwood_away
=== wedgwood_away is now known as wedgwood
rogpeppelunch14:32
=== teknico is now known as teknico_mobile
=== teknico_ is now known as teknico_mobile_
dimiternfwereade: wrt py-juju parity for upgrade-charm15:10
fwereadedimitern, oh yes15:10
dimiternfwereade: we still need those extra flags/args first, i think15:11
fwereadedimitern, ah, damn, --force15:11
fwereadedimitern, that's the only one that exists in python15:11
fwereadedimitern, IIRC15:11
fwereadedimitern, do double-check15:11
dimiternfwereade: which is different from --switch, right?15:11
fwereadedimitern, yeah15:14
fwereadedimitern, --force is just the second arg to SetCharm15:14
dimiternfwereade: your router acting funny again? :)15:14
fwereadedimitern, --switch is an awesome feature that it will at least be cheap and easy to add at some point in the future15:14
fwereadedimitern, no, I go distracted by some test failures15:15
fwereadedimitern, ==, !=, details details15:15
dimiternfwereade: then maybe I should do --force first before starting the other 2 cards (no card for --force though)15:15
fwereadedimitern, add a card for --force and please do no further work on upgrade-charm15:16
=== teknico__ is now known as teknico
fwereadedimitern, we have parity and we have way too much else to do to go beyond at this point15:16
dimiternfwereade: no, i meant you're dropping out quite often today :)15:16
fwereadedimitern, ah, hadn't even noticed :)15:16
dimiternfwereade: you mean add a card for --force, but not do it now?15:16
fwereadedimitern, I mean do --force, because that's necessary for parity15:17
dimiternfwereade: ok, got you15:17
fwereadedimitern, but, with regret, don't do any of the other upgrade-charm stuff15:17
dimiternfwereade: fine by me :) so i'll move the card for bug 1032557 in todo15:18
_mup_Bug #1032557: upgrade-charm should handle relation changes <upgrade-charm> <juju-core:In Progress by dimitern> < https://launchpad.net/bugs/1032557 >15:18
fwereadedimitern, cheers15:18
rogpeppefwereade: what do you think about moving state.Endpoint into the charm package?15:19
fwereaderogpeppe, not *quite* right, because of ServiceName15:20
rogpeppefwereade: we're pondering how api.Client.AddRelation should return details of the new relation15:20
rogpeppefwereade: and i'm suggesting it should return the endpoints15:20
rogpeppefwereade: but it can't use state.Endpoint15:20
=== teknico__ is now known as teknico_mobile
dimiternfwereade: will you be off on friday?15:22
fwereadedimitern, doubt it :)15:22
rogpeppefwereade: it could move into params, i suppose, but i don't like that15:22
dimiternfwereade: i'm swapping it15:22
rogpeppefwereade: the other alternative is a duplicate definition15:22
rogpeppefwereade: which i'm not greatly keen on either15:22
fwereaderogpeppe, how about everything *except* ServiceName as a charm.Endpoint, and embed a charm.Endpoint state.Endpoint?15:23
fwereades/state./in state./15:23
fwereaderogpeppe, then return... hmm... map[serviceName]charm.Endpoint? maybe?15:23
rogpeppefwereade: i was just thinking the same15:23
* fwereade peers into cloudy crystal ball for potential problems15:23
* fwereade can't see any obvious issues15:24
* fwereade wanted to do this a while ago, though, so he is biased15:25
rogpeppefwereade: did gustavo have issues with the idea?15:25
fwereaderogpeppe, (1) confusion over what "Endpoint" means (2) couldn't really see the point15:26
fwereaderogpeppe, so (2) is covered (and as a bonus state.RelationRole will move as well, yay); re (1) give it some thought, but I don't think it's a blocker15:27
rogpeppefwereade: i *think* (1) is ok.15:28
fwereaderogpeppe, well, it is... no worse than the current situation re "relation"15:29
fwereaderogpeppe, in fact it maps perfectly15:29
rogpeppefwereade: yeah. i think it's a useful ancillary data structure, even if nothing else in the charm package, erm, relates to it15:29
fwereaderogpeppe, [charm] relation, [charm] endpoint15:30
fwereaderogpeppe, well, hmm15:30
fwereaderogpeppe, it is actually *very* similar to a "charm relation"15:30
fwereaderogpeppe, maybe it actually is one15:31
rogpeppefwereade: i'm just thinking that, yeah15:31
rogpeppefwereade: although... it doesn't have the name15:31
rogpeppefwereade: and Optional is a bit weird15:31
fwereaderogpeppe, but that already exists, and doesn't have the name because it lives in a map15:31
fwereaderogpeppe, or the role, similarly15:32
rogpeppefwereade: Relation is really a specifier for a relation, and Endpoint represents an intantiated relation15:32
rogpeppeinstantiated15:32
fwereaderogpeppe, interestingly, Optional and Limit probably *should* be in state.Endpoint15:33
rogpeppefwereade: that's a good point actually15:33
fwereaderogpeppe, how would you feel about tacking name/role onto charm.Relation, and filling the fields when parsing a Meta?15:33
fwereaderogpeppe, I think that's the only place charm.Relations come from15:34
rogpeppefwereade: that would mean implementing Meta.UnmarshalBSON and Meta.UnmarshalJSON i guess. but that's not a bad thing, probably.15:36
fwereaderogpeppe, I don't see a problem there but I may be myopic15:37
rogpeppefwereade: it's just more code to write :-)15:37
fwereaderogpeppe, heh15:37
fwereadeblast, sorry, bbiab15:38
rogpeppefwereade: actually, i don't think we do need those Unmarshal methods15:41
rogpeppefwereade: as long as we don't mind a bit of redundancy in the json15:42
fwereaderogpeppe, cool15:48
rogpeppefwereade: and i'll add (in state): type Endpoint struct {ServiceName string; charm.Relation}15:49
dimiternthere it is: upgrade-charm --force - https://codereview.appspot.com/7838054/15:49
fwereaderogpeppe, sgtm15:50
fwereadedimitern, cheers15:50
dimiternfwereade: it's almost trivial, just the wording of the help text probably needs a closer look15:51
fwereadedimitern, yeah, that's the only thing that's exercising me ATM15:52
dimiternfwereade: :) I didn't know of that meaning of exercising - what's worrying you there?15:54
fwereadedimitern, trying to think of neater wording -- have some suggestions in the review15:56
dimiternfwereade: cool, thanks15:57
dimiternfwereade: surprisingly? probably unexpectedly is better15:58
fwereadedimitern, as you like, I had that to begin with and then changed it :)15:58
dimiternfwereade: well a surprise is usually associated with good things at first glance, while unexpected things are usually not good (i think)15:59
dimitern(while both can mean the opposite i agree)16:00
fwereadedimitern, I'm thinking of "surprising" as negative in a computery context16:00
fwereadedimitern, law of least surprise and all that16:00
dimiternfwereade: yeah, but you're more likely to see "unexpected error" than "surprising error" :)16:00
fwereadedimitern, I don't feel very strongly either way, go with unexpected16:01
dimiternfwereade: ok, thanks16:01
dimiternfwereade: are you feeling strongly against dropping the log.warning there? I think it's beneficial for analysing what went wrong with an upgrade through the logs more easily16:08
dimiternfwereade: s/dropping/leaving/16:08
dimiternrogpeppe: if you have 5m for an easy review - https://codereview.appspot.com/7838054/16:09
rogpeppedimitern: quite busy at present trying to unblock teknico_mobile; will look in a bit16:10
dimiternrogpeppe: sure, no rush16:10
* rogpeppe accumulated 7 things on the paper "to do" list this morning...16:10
fwereadedimitern, logs in the CLI are generally just dropped16:12
dimiternfwereade: really? i was wondering why there are hardly any in the other commands16:12
fwereadedimitern, it's because we generally don't have any sane mechanism for getting output back to the user there16:13
fwereadedimitern, if you really wanted to, you could write something to ctx.Stderr16:13
dimiternfwereade: hmm.. it's a pity, but ok then - will drop it16:13
fwereadedimitern, but I think I'd need a bit more reason to actually do so16:13
fwereadedimitern, cheers16:14
rogpeppefwereade: charm.Role rather than charm.RelationRole ?16:14
fwereaderogpeppe, let's stick with RelationRole, it's that little bit more explicit16:18
rogpeppefwereade: ok16:18
rogpeppefwereade: changing all those Endpoint literals is a right pain...16:53
fwereaderogpeppe, agreed16:53
rogpeppefwereade: i think it looks nicer with field names though16:53
fwereaderogpeppe, almost certainly16:53
fwereadedimitern, I'm starting to feel more strongly about "surprisingly"16:57
fwereadedimitern, "unexpectedly" doesn't quite seem to cover the "lol I just changed the file you were editing" scenarios I worry about with --force16:58
rogpeppefwereade: FWIW i almost never see "surprising" in an error message context16:59
rogpeppefwereade: "unexpected" is usual, i think16:59
fwereaderogpeppe, it's a warning in documentation, not an error message17:01
rogpeppefwereade: ah17:01
rogpeppefwereade: forgive me for jumping totally without context!17:01
fwereaderogpeppe, no worries :)17:01
=== bac_ is now known as bac
dimiternrogpeppe: exactly my point - unexpected is more common17:10
dimiternfwereade: but if you lean more towards surprisingly, I'll change it, np17:11
fwereadedimitern, I've come to peace with it, suggested a slight tweak in the review and LGTM17:11
dimiternfwereade: thanks17:12
dimiterni'll submit it once i have one more LGTM17:14
fwereadejam, fwiw I think sync-tools is awesome, but I haven't finished the review and I'm afraid I have to go for now17:15
jamfwereade: np, I think ian was going to look at it in his morning17:15
jamthanks17:15
rogpeppefwereade: i'm wondering if i should go ahead with the global StartSync thing. i know it would knock 10s off the api tests for one.17:20
fwereaderogpeppe, alternative to global StartSync17:21
fwereaderogpeppe, testing method on Watcher that set the refresh period to 50ms?17:22
fwereaderogpeppe, most of all I'd like to just be able to sync the actual States we care about, but I can accept that that's probably too hard17:22
rogpeppefwereade: there are various tests that fail when you do that, but i wanna fix those anyway17:23
rogpeppefwereade: that is a reasonable alternative.17:23
fwereaderogpeppe, (the refresh period is package global, right?)17:24
rogpeppefwereade: yes17:24
fwereaderogpeppe, just feels a touch less evil to me17:24
rogpeppefwereade: it's certainly less code17:24
fwereaderogpeppe, that too ;)17:24
rogpeppefwereade: it's quite amusing setting the sync period to 50ms and see how many tests fail. i recommend it for a laugh.17:25
fwereaderogpeppe, I'll save my bitter laughs for tomorrow, I think, I really must go :)17:25
fwereadegn all17:25
rogpeppefwereade: night night17:25
rogpeppedimitern: a large CL, but mostly mechanical: https://codereview.appspot.com/8055044/17:28
dimiternrogpeppe: will take a look shortly17:35
rogpeppedimitern: thanks!17:35
rogpeppetrivial deletion-only CL, anyone? https://codereview.appspot.com/792504517:43
dimiternrogpeppe: while i'm on the first one, would you have a look at my cl?17:47
dimiternhttps://codereview.appspot.com/7838054/17:48
rogpeppedimitern: on it17:48
dimiternrogpeppe: cheers17:49
rogpeppedimitern: LGTM17:50
dimiternrogpeppe: awesome, i can submit it later then, tyvm17:50
dimiternrogpeppe: you got 2 reviews17:59
rogpeppedimitern: thanks!17:59
rogpeppei'm off for the day. g'night all.18:25
thumpermorning19:39
wallyworldfwereade_: hi20:48
thumpermorning wallyworld21:05
wallyworldgday21:05
wallyworldhow's things?21:06
thumperwallyworld: good21:08
thumperwallyworld: waiting for dave to turn up, and deciding to learn about our upgrade methods while I wait21:08
wallyworldjuju upgrade?21:09
thumperwallyworld: as they are the only areas I need to fix for my version.Current.die.die.die branch21:09
thumperaye21:09
wallyworldcan't wait for that branch to land21:09
thumperwallyworld: feel like a review?21:10
wallyworldsure, why not21:11
thumperhttps://codereview.appspot.com/7845048/21:11
wallyworldthumper: just read the cover letter - what happens to those existing machines that are not used anymore - do they get cleaned up eventually?21:13
thumpernot automagically afaik21:13
thumperbut I'm not sure21:13
thumpermaybe21:13
thumperit certainly requires some thought21:13
thumperor looking into21:13
thumperbut I'm not sure actually21:13
thumperthere is always destroy-machine21:14
thumperI think we should have a timeout somewhere21:14
wallyworldyou'd like to think that juju would "Do the right thing" and not leave stuff lying around21:14
thumperthat says if a machine is lying idle for greater than X minutes21:14
thumperkill it21:14
thumperI agree, DTRT™ is good21:14
thumperwallyworld: but I have a feeling that is another hunk of work21:15
wallyworldi think we are at the stage where stuff works, but there's a lot of rough edges to get rid of to productise it21:15
* thumper nods21:15
thumperworth adding bug reports (good ones)21:15
thumperfor those rough edges21:16
thumperas I don't think it is a huge amount of work to polish them off21:16
wallyworldstill seems like a fair bit of must do stuff for 13.04 though21:16
thumperwallyworld: I don't think it will be polished for 13.0421:23
wallyworldme either21:23
thumperwallyworld: mostly functional I think is what we are heading for21:23
wallyworldthumper: i don't fully grok the addMachine/addMachineOps logic, but the branch looks nice, and the tests are good21:26
wallyworldso i'll +1 it for what that's worth21:26
thumper:)21:26
thumperyou get your name in the commit21:27
thumperI'll await dave :)21:27
thumperwallyworld: I've spent this week learning about the mongo transaction ops21:27
wallyworldyeah, best to get an informed opinion :-)21:27
wallyworldi really don't like how we write directly to mongo21:27
wallyworldand not go through a middle tier service21:28
thumperwallyworld: well, we are moving to that with the API21:29
thumperwallyworld: so, it is happening21:29
wallyworldyeah, that's good. better late than never i guess21:29
thumpermorning davecheney22:15
thumperdavecheney: looking for another +1 on https://codereview.appspot.com/7845048/ as wallyworld isn't entirely confident22:15
davecheneyokie dokes22:16
davecheneythumper: still reviewing22:28
thumperdavecheney: :)22:28
davecheneygot sidetracked by some rage22:28
thumperdavecheney: fingers crossed, we can get this landed today22:31
davecheneythumper: going to be one more round of changes I think22:44
davecheneyjust for the turd polishing22:44
thumperok22:45
* thumper is happy to learn22:45
davecheneythere is one thing in there that will make you throw a chair22:47
davecheneysoz22:47
thumperoh?22:47
thumperwhy?22:47
davecheneyhttps://codereview.appspot.com/7845048/#msg622:47
thumperdavecheney: with regard to the FitsTypeOf...22:53
thumperdavecheney: I think it is a flawed test22:53
thumperdavecheney: it is potentially also possible for different providers to use a different policy22:53
thumperdavecheney: so specifying a result there is wrong22:53
thumperdavecheney: but the method returns a particular type22:54
davecheneythumper: the thing i saw was sometimes we use an Equals test, othertimes FitsTypeOf22:54
thumperdavecheney: so saying "FitsTypeOf" is really just saying, does the language work22:54
davecheneyi think both are valid, but is it possible to stick to one for all the cases ?22:54
thumperdavecheney: I think the FitsTypeOf is wrong, and happy to remove it22:54
davecheney+122:54
davecheneyi was just after consistency22:55
thumperand with respect to the typed constants, I was just following convention22:55
thumperI hold no strong opinions there22:55
davecheneybut i'll take that argument as well22:55
davecheneyfair enough re typed constants22:55
davecheneyyou don't need to get bogged down in that22:55
davecheneyjust something to remember22:55
thumperworst constant ever. state.MaxUnitsPerHost ?22:55
thumperI don't get that comment22:55
davecheneyyeah, that current constant is terrible22:55
davecheneyJobHostUnits ?22:55
davecheneysomething ?22:55
davecheneystate.MaxUnitsPerHost is my suggestion22:56
thumperoh, no.. this already exists22:56
thumperthis is a job type for the machine22:56
thumpersaying it hosts units22:56
davecheneyright, so still the worst constnt ever22:57
thumperanyway, I'm off to the gym now22:57
davecheneyi had no idea what it meant22:57
davecheneyroger22:57
thumperdavecheney: I agree it is shitty, but I'm keeping it for now :)22:57
davecheneyfair enough22:58
davecheneyLGTM. submit and go to the gym22:58
=== wedgwood is now known as wedgwood_away

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