/srv/irclogs.ubuntu.com/2013/09/13/#juju-dev.txt

thumperwallyworld: you back?01:23
wallyworldthumper: yes01:51
thumperwallyworld: cool, Rietveld: https://codereview.appspot.com/1369004302:00
wallyworldlooking02:00
axwthumper: I missed a few minutes of the meeting yesterday when there was some talk about the SanityCheckConstraints stuff. Just wanted to check if it's doing what you want it to do, re containers02:12
thumperaxw: a chat would be good :)02:12
axwok02:12
thumperlet me just finish off what I'm doing02:13
thumperand I'll poke02:13
axwnps02:13
wallyworldthumper: done. i have a small one for you if.when you have a moment https://codereview.appspot.com/1327404502:17
thumperwallyworld: done, and one for you Rietveld: https://codereview.appspot.com/1369104302:35
thumperaxw: hangout?02:35
axwthumper: yup02:35
* wallyworld looks02:35
thumperaxw https://plus.google.com/hangouts/_/111aeaf1ea142cc8d744a4af72f06a427b54f212?hl=en02:36
axwthumper: https://code.launchpad.net/~axwalk/juju-core/sanity-check-constraints/+merge/18501502:39
wallyworldthumper: did you forget a pre-req on your mp?02:49
thumperwallyworld: yes02:49
thumperoops02:49
wallyworldnp :-)02:49
wallyworldi thought i saw the same code again :-)02:49
wallyworldDebugHook failure on bot :-(02:53
wallyworldresubmit time02:54
jamwallyworld: https://codereview.appspot.com/13679044/03:23
wallyworldlooking03:24
wallyworlddone03:24
jamI thought it might be close to your heart03:24
wallyworld:-)03:24
thumperwallyworld: there is no content to check03:27
thumperwallyworld: it is a notify only, sends struct{}03:27
wallyworldoh?03:28
thumperwallyworld: basicly it says "hey, something changed"03:28
thumperyeah03:28
thumperthat is how it03:28
wallyworldthat's not good imo03:28
thumperis implemented03:28
wallyworldbad design :-(03:28
thumperit is what it is03:28
wallyworldintroduces race conditions03:28
wallyworldbad, bad, bad03:28
thumpernot that we really care about03:28
thumpernot really03:28
thumpernot in this use case at least03:28
thumperbut yes03:28
thumperI do agree with you03:28
* wallyworld sigh heavily :-(03:29
thumperwallyworld: so much for being funny03:36
wallyworldhuh?03:37
thumperwallyworld: no one should call the api with no values03:37
wallyworldoh :-)03:37
thumperI'll add an early return03:37
thumperif you insist03:37
wallyworldonly if you want03:37
thumperbut it should never happen03:37
wallyworldthumper: small one? https://codereview.appspot.com/1327205104:19
* thumper looks at wallyworld's review04:21
wallyworld\o/04:22
thumperland it04:24
wallyworldthumper: thanks :-)04:25
* thumper actually tries his code04:58
thumperhmm...05:03
thumperwhy is everything written twice in the local log file05:03
thumperI don't recall this happening before05:03
thumperhaha05:11
thumperoops05:11
thumpermy fault05:11
thumperarse biscuits05:11
thumperhmm will be fixed in two commits05:12
* thumper submits a fix05:25
thumperoh poo05:26
* thumper has a solution to the poo05:28
thumperbut not today05:28
thumperwallyworld: Rietveld: https://codereview.appspot.com/1369404305:29
* thumper EODs05:38
thumperwallyworld: and another Rietveld: https://codereview.appspot.com/1358704505:38
thumperaxw: sorry I didn't get to yours today, slightly more effort than I though actually getting through my stuff05:39
thumperhave a good weekend folks05:39
axwthumper: no worries05:39
axwyou too05:39
thumperwallyworld: if you want land the first one line fix for the duplicate lines, you should be fine.05:39
wallyworldlooking05:41
thumperwallyworld: unfortunately I think the cloudinit tests are going to blow on that branch05:44
* thumper checks05:44
wallyworldah. i hit approved, so we'll see i guess05:44
thumperI just confirmed they break05:47
thumpercommitting a fix now05:47
thumperand running al the tests05:47
wallyworldok05:48
thumperjust one lot of fixes05:49
thumperhmm hasn't failed yet05:50
wallyworldi'll resubmit when it fails05:51
thumperta05:51
* thumper leaves now05:51
rogpeppemornin' all06:06
rogpeppequick review anyone? https://codereview.appspot.com/13300050/07:04
rogpeppefwereade__, dimitern: ^07:04
fwereade__rogpeppe, taking a look07:21
fwereade__rogpeppe, eh, reviewed already07:21
rogpeppefwereade__: two pairs of eyes wouldn't harm07:21
* fwereade__ is enhappied by this07:21
fwereade__rogpeppe, sure07:21
fwereade__rogpeppe, LGTM too, nice07:23
fwereade__davecheney, fix-tools-release-script has been up for a while, is something blocking it?07:23
fwereade__davecheney, eh, that's not its name, but close enough07:24
davecheneyfwereade__: not following you, sorry07:24
* davecheney does not feel blocked today07:24
fwereade__davecheney, https://code.launchpad.net/~dave-cheney/juju-core/153-fix-release-tools-script/+merge/18355607:24
* fwereade__ approves of this state of affairs07:24
davecheneyoh, i just missed that07:24
davecheneyor the bot was screwed07:24
davecheneyor seomthing07:24
fwereade__probably :)07:25
davecheneydone07:25
davecheneythanks for the reminder07:25
davecheneyah, now i remember07:25
davecheneythat also needs to be backported to 1.14.007:25
davecheneyhmm, actually, no need to backport07:34
dimiternmorning07:55
TheMuedimitern: morning07:57
fwereade__dimitern, heyhey08:01
fwereade__dimitern, I was just thinking of provisioner and the authkeys-from-env-config thing08:02
fwereade__dimitern, at the api level I think there's a pretty serious difference between the lxc and the environ provisioners08:02
rogpeppefwereade__: i think i tend to agree - they could easily be two API facades08:03
rogpeppefwereade__: (LocalProvisioner and GlobalProvisioner perhaps)08:04
dimiternfwereade__, rogpeppe, so 2 facades then08:04
fwereade__rogpeppe, dimitern08:04
rogpeppefwereade__08:05
fwereade__rogpeppe, dimitern: sorry having trouble articulating08:05
fwereade__rogpeppe, dimitern: ok, they both watch the environment config08:05
rogpeppefwereade__: we really need to split the env config08:05
fwereade__rogpeppe, dimitern: the env prov because it needs it, the local one because that's where it gets its authkeys from08:05
fwereade__rogpeppe, dimitern: but in api terms08:06
fwereade__rogpeppe, dimitern: those auth keys should be expressed as a property of the *machine*08:06
rogpeppefwereade__: interesting; yes, that seems right to me08:06
fwereade__rogpeppe, dimitern: and in *both* cases we should be getting authkeys from a machiney api08:06
dimiternfwereade__, sorry, I don't get that08:07
fwereade__rogpeppe, dimitern: then in the local case no need for an env config watch (other than that's how the machine auth watch is implemented in the background)08:07
dimiternfwereade__, why of a machine?08:07
fwereade__dimitern, because it's obviously not an env property08:07
fwereade__dimitern, it's really a user property08:08
fwereade__dimitern, but it applies per machine08:08
fwereade__dimitern, and we need t figure it out in the context of provisioning an actual machine08:08
dimiternfwereade__, sorry, still waking up - what auth keys are we talking about?08:08
fwereade__dimitern, ah ok -- the ssh authorized_keys is set up by cloudinit08:09
fwereade__dimitern, that information is stored in environ config08:09
fwereade__dimitern, because we smoke lots of crack08:09
fwereade__dimitern, and because of this the lxc provisioner depends on an environment watch that it should not08:09
dimiternfwereade__, ah, ok, yeah08:09
fwereade__dimitern, and the env provisioner uses its env watch for both the env that it needs, and the authkeys that come almost accidentally08:10
dimiternfwereade__, and you need the lxc provisioner to watch machines and get this info from a machine?08:10
fwereade__dimitern, possibly08:11
fwereade__dimitern, it may not in fact be practical given time constraints08:11
fwereade__dimitern, but you are in a better position to determine precise feasibility than I am08:11
fwereade__dimitern, so I wanted to make you aware of the forces that have shaped the current implementation and where I think they've led us astray08:12
dimiternfwereade__, my plan for today is to land the uniter and finish of some misc cleanup tasks around the api, so i can start on the provisioner next week08:12
fwereade__dimitern, cool, just giving you a heads up :)08:12
fwereade__dimitern, thanks08:12
dimiternfwereade__, cheers :)08:12
dimiternfwereade__, I still need to do a ec2 live test in addition to the local one, as rogpeppe  suggested https://codereview.appspot.com/13401050/08:13
=== tasdomas_afk is now known as tasdomas
dimiternfwereade__, btw I found and interesting panic in the cmd package yesterday08:20
dimiternfwereade__, with a local environment, going into ~/.juju/local/log/ and then destroying the env; trying any juju command gives a panic "getcwd: .. something"08:21
=== tasdomas is now known as tasdomas_afk
rogpeppefwereade__: fairly trivial CL: https://codereview.appspot.com/1364804808:56
rogpeppedimitern, TheMue, anyone: ^08:56
TheMue*click*08:57
TheMuerogpeppe: reviewed09:02
axwdimitern: there's an intermittent test failure in apiuniter - do you know about this?09:10
axwhttps://code.launchpad.net/~axwalk/juju-core/sshstorage/+merge/184708/comments/42169409:10
dimiternaxw, you should've left that one alone actually09:11
axw?09:11
dimiternaxw, it's going away and now I'm facing some conflicts with my branch that removes it09:11
axwok09:11
dimiternmgz, how do you resolve a conflict like this? Conflict adding files to worker/apiuniter.  Created directory.09:11
dimiternmgz, I want it gone09:12
axwsorry dimitern I'm not talking about the debug-hook one if that's what you think09:12
axwthis is different09:12
mgzdimitern: bzr rm the dir, then bzr resolve on that path09:12
dimiternmgz, that worked, thanks09:14
dimiternaxw, worker/apiuniter is going away entirely09:14
axwdimitern: okey dokey09:14
dimiternaxw, sorry, I should've mentioned that09:15
axwnps09:15
fwereade__TheMue, ping09:25
rogpeppefwereade__, dimitern, TheMue: this is the avoid-allFatal CL for inclusion in 1.14: https://codereview.appspot.com/1369604309:28
TheMuefwereade__: pong09:28
fwereade__dimitern, would you take a look quickly?09:29
fwereade__TheMue, just wanted to check everything was clear re status data dict09:29
fwereade__TheMue, and to clarify something I may not have touched on09:30
fwereade__TheMue, the data dict will be used by the api to cross-reference what relation(s) may have encountered error(s)09:30
dimiternfwereade__, rogpeppe, looking09:30
fwereade__TheMue, so the relation therein must be identified in a way that they can understand09:31
rogpeppedimitern: there's no new code in there, BTW09:31
rogpeppedimitern: just patches selectively applied from trunk09:31
TheMuefwereade__: they = GUI?09:31
fwereade__TheMue, in the narrow, yes; in general, consumers of the public api09:31
TheMuefwereade__: ok09:32
dimiternrogpeppe, shouldn't CodeNotFound also be fatal?09:32
fwereade__TheMue, so your choices are key, tag, or id09:32
fwereade__TheMue, tag is most in keeping with the rest of the ui, but it's a strange thing to store inside state09:33
rogpeppedimitern: that's orthogonal to this fix, i think09:34
TheMuefwereade__: never have been in contact with tags so far. short explanation?09:34
dimiternrogpeppe, LGTM09:34
fwereade__TheMue, key is not at all in keeping with the rest of the api, *except* that it's how they already identify relations, because that's how relations are identified in the AllWatcher stream09:34
rogpeppedimitern: i wanted to port this change only, but if you think other stuff should go into 1.14 too, then it should be considered09:34
rogpeppedimitern: thanks09:34
fwereade__TheMue, unit-wordpress-7, machine-7-lxc-3, service-nyancat, user-fwereade09:35
TheMuefwereade__: ah, thx09:35
fwereade__TheMue, relation-wordpress.db#mysql.server09:35
dimiternrogpeppe, no, let's keep it simpler - we're close to releasing 2.0 (or whatever) soon anyway as stable09:35
rogpeppedimitern: thanks09:36
rogpeppedimitern: i'll just do a live test, as it is the release, then i'll merge09:36
TheMuefwereade__: keys would be most natural for me09:37
fwereade__TheMue, so, anyway, I'm kinda -1 on keeping tags in the info dict -- storing tags in state feels like a layering violation09:37
fwereade__TheMue, key is a little bit sucky but convenient in many ways09:38
TheMuefwereade__: why sucky?09:38
fwereade__TheMue, because the API should be using a consistent vocabulary09:41
fwereade__TheMue, tags were formalized for the api and are used here there and everywhere09:42
fwereade__TheMue, but very inconsistently in the case of the public api09:42
fwereade__TheMue, hence the key in the relation info from allwatcher09:42
dimiternwoohoo! finally the uniter got merged09:42
* fwereade__ cheers at dimitern09:42
dimiternthis marks the end of a 3-week struggle :)09:43
TheMuedimitern: *clap* *clap*09:43
dimiternthanks guys09:43
TheMuefwereade__: yep, just reading the API how it uses tags09:44
fwereade__TheMue, however it is not really appropriate for the uniter to be thinking in terms of key, because that's really an internal state thing09:46
fwereade__TheMue, so09:46
fwereade__TheMue, I am starting to feel that id is actually the best identifier09:47
TheMuefwereade__: while digging deeper i'm getting the same idea09:47
fwereade__TheMue, the trouble with that is that we don't put it in the relation info dict from the allwatcher09:47
TheMuefwereade__: one moment, will take a look there09:48
fwereade__TheMue, so if we do id (which which I *think* we actually should) we need to report it in RelationInfo09:48
fwereade__TheMue, and that's not hard but it does need to be done so we can construct a sensible status dict09:48
fwereade__rogpeppe, that LGTM too fwiw09:51
rogpeppefwereade__: thanks09:51
fwereade__TheMue, id is strictly superior to key anyway, because it's actually unique09:54
TheMuefwereade__: so RelationInfo has to be extended by "Id int"?09:57
fwereade__TheMue, yeah09:58
fwereade__TheMue, should literally just be a matter of adding the field and trusting in the miracle of reflection09:58
TheMuefwereade__: ok, trying to get a picture out of those puzzle pieces ;)09:58
TheMuefwereade__: hehe09:58
TheMuefwereade__: the hard part is, that the bso annotation of Key is _id :)09:59
fwereade__TheMue, I know, that code in particular is a sort of nexus of suck09:59
TheMue*lol*10:00
TheMuefwereade__: just seen, EntityId() of RelationInfo returns "relation" as kind and the key as id. now the struct has an Id field. how shall i explain this weird stuff to my children? :/10:19
fwereade__TheMue, oh, hell, EntityId is *really* badly named then10:19
fwereade__TheMue, I guess that everywhere we use Id is really pretty wrong except for on Relation10:20
fwereade__TheMue, but relation has a Key that should be name and is serialized as _id10:20
fwereade__TheMue, however10:20
TheMuefwereade__: so it's aboslutely logical *rofl*10:21
fwereade__TheMue, it's completely screwed up10:21
TheMuefwereade__: it's called "semantical encryption"10:21
fwereade__TheMue, haha10:22
fwereade__TheMue, fwiw adding relation id to RelationInfo is a good in itself, I reckon that'd make a nice trivial CL in itself10:27
TheMuefwereade__: ok, will separate it10:30
fwereade__TheMue, remember that will also need to be backported onto 1.1410:37
TheMuefwereade__: here i'll need assistance on how i have to apply the changes 1.1410:41
dimiternfwereade__, a small branch https://codereview.appspot.com/1347404610:41
fwereade__dimitern, had literally just opened it :)10:41
TheMuefwereade__: so far only worked on trunk10:41
dimiternfwereade__, :)10:41
fwereade__dimitern, nice, LGTM; just consider using Satisfies, I think it'd read a bit nicer10:45
dimiternfwereade__, you mean instead of jc.IsTrue ?10:46
fwereade__dimitern, yeah10:47
fwereade__dimitern, c.Check(err, jc.Satisfies, params.IsCodeUnauthorized)10:47
rogpeppefwereade__: standup?10:47
fwereade__dimitern, puts the err, which is what we're testing, front and centre10:47
fwereade__rogpeppe, oops10:47
dimiternfwereade__, well I don't think it'll read much nicer - instead  of c.Assert(params.IsCodeX(err), jc.IsTrue) it'll be c.Assert(err, jc.Satisfies, params.IsCodeX)10:48
fwereade__dimitern, it puts the value we're checking in the expected place10:48
dimiternfwereade__, ok, I can do that10:48
mgzgoooooogle10:49
TheMuefwereade__, dimitern: https://codereview.appspot.com/13252050/11:06
dimiternTheMue, reviewed11:07
TheMuedimitern: thx11:07
* TheMue => lunch11:52
rogpeppetrivial review, backport patch to 1.14, anyone? https://codereview.appspot.com/1325104711:53
dimiternrogpeppe, reviewed12:05
rogpeppedimitern: thanks!12:05
rogpeppefwereade__: you around for a quick chat about Prepare stuff?12:10
* rogpeppe expected hundreds of conflicts and only got three. fantastic!12:18
rogpeppefwereade__: ping12:29
rogpeppedimitern: yeah, the point about jc.Satisfies is not particularly that the assert looks nicer, but that if it fails, gocheck will print the actual error value that failed12:31
dimiternrogpeppe, ah, good to know12:35
rogpeppewallyworld, dimitern, fwereade__, TheMue, mgz: initial type declarations for proposed environment configuration storage scheme: https://codereview.appspot.com/1323505412:44
dimiternrogpeppe, will look a bit later12:45
rogpeppedimitern: thanks12:46
dimiternrogpeppe, say, how come your gocheck -> gc branches missed a lot of stuff in environs?12:46
rogpeppedimitern: for example?12:46
dimiternrogpeppe, or other places with more than 2 levels of nested dirs12:46
dimiternrogpeppe, like environs/jujutest/tests.go12:46
dimiternrogpeppe, or environs/jujutest/livetests.go12:47
fwereade__rogpeppe, pong, sorry12:47
rogpeppedimitern: it's because i excluded all files that didn't end in _test.go12:47
dimiternrogpeppe, ah :) I suspected that12:47
rogpeppedimitern: it helped exclude false positives, but yeah there's a bit of cleaning up to do12:47
rogpeppefwereade__: quick chat?12:47
fwereade__rogpeppe, yeah, sounds good, I'm just looking at that types CL12:49
rogpeppefwereade__: ah, cool. there's a bit more than that here: http://paste.ubuntu.com/6101477/12:49
rogpeppefwereade__: https://plus.google.com/hangouts/_/0d62d7c4bc1a5c5ba5bdc03d45dc0ad913031048?authuser=112:50
natefinchfwereade__: btw, it looks like the stuff with boolean operators in maas tags was actually not implemented in maas... there's a comment next to that code that reads "Currently tag constraints consist of just comma and/or whitespace tag names, all of are required for a match. Extending this to support full boolean expressions would be possible, and some forward compatibility is attempted."13:42
fwereade__natefinch, that is *awesome* news13:42
* fwereade__ is happy13:42
natefinchfwereade__: yep. so, it really is just "match all these tag names" with comma or whitespace delimiters13:43
mgznatefinch: what a nice comment that code has13:48
natefinchmgz: classic YAGNI though13:50
natefinchmgz:  or more likely, YAGII   - You Ain't Gonna Implement It13:51
mgzhm, it might have happened, maas has been yoyoing between being worked on and not for like a year now13:52
rogpeppefwereade__: so when/if that types proposal ok with you, i'll push it, then strip it down in the next CL, leaving some bits as TODOs.13:53
natefinchmgz: the docs don't say anything about it as far as I can tell, but that doesn't mean i wasn't implemented13:53
mgzmost of the complexity in that code is just for the pre-checking tag name validity13:53
mgzwhich, if I understood the previous conversation corectly, we're just not going to do in juju-core13:53
mgznatefinch: it wasn't implemented13:53
fwereade__rogpeppe, I would honestly prefer it if you would implement subsets that completed defined tasks, and extend as necessary to fulfil the other requirements13:54
natefinchmgz: it was my inclination not to check the tags before we make the API call. Seems like a waste. If you give a tag that doesn't exist, it won't match anything. Not sure if the API has a special response for using invalid tags13:54
rogpeppefwereade__: ok13:54
mgzit's historicailly not been a waste, because juju sucks at reporting errors when no machine mactches a constraint13:55
fwereade__rogpeppe, at the end you can point to how it exactly matched your original plan and I can be contrite :)13:55
mgzso, there was value in telling people early their constraint was impossible, rather than letting them sit looking at a pending machine in status for ever13:55
rogpeppefwereade__: :)13:56
fwereade__mgz, axw is pushing on that at the moment13:56
mgzfixing that issue is more relevent in juju-core, so less care up front is fine13:56
natefinchmgz: yeah, i was going to say, that sounds like something we should fix outside of maas13:56
mgzso, pretty much all you want to do is pass the string through to the maas machine allocation, possibly with a tiny bit of normalisation13:57
rvbanatefinch: fwiw, if you use tags which don't exist when acquiring a node in MAAS, you'll get a 400 error with the list of the non-existant tags in the response's content.14:00
natefinchrvba: nice, I had hoped so :)14:01
fwereade__natefinch, rvba: is there a way to ask about a list of tags, for preflighting?14:12
fwereade__natefinch, rvba: failing as early as possible still remains a good thing to do14:12
rvbafwereade__: yes, there is an api method to get the list of all the tags.14:13
natefinchfwereade__: yeah, but since tags can be added at any time, I'd feel better about just handling the error when we ask for a machine configuration that doesn't exist14:13
rvbaWhat natefinch said, this would introduce a race.14:13
fwereade__natefinch, yeah, the SanityCheckConstraints stuff is definitely secondary14:13
natefinchfwereade__: there should hopefully be very little visible difference to the user14:14
fwereade__rbva, tbh I'm not so concerned about people racing to use just-added tags ;p14:14
fwereade__rvba, but point taken nonetheless14:14
natefinchfwereade__: the docs say that tags can take a minute to propagate... I can totally see someone adding a tag and then trying to use it within that time frame14:14
rvbaExactly what I was about to say.14:15
natefinchfwereade__: though I guess it would probably just fail either way14:15
rvbaIf a tag uses a complex xpath expression in its definition, it can take a while to apply.14:15
fwereade__natefinch, rvba: ok, so it slightly increases the chance of us itting that window14:15
rvba(You can either define a tag manually (giving the list of nodes to which it applies) or define the tag with an xpath expression with will be matched against the hardware XML data [currently lshw + lldp] of all the tags)14:16
natefinchfwereade__: we actually need to fail in both spots anyway, since you could have a tag defined that no machines match anyway14:16
fwereade__natefinch, indeed so, I have been tending to resist putting too much effort into early failure anyway, when late failure needs to be handled better and can't ever be 100% avoided whatever we do with preflighting14:17
natefinchfwereade__: yep14:17
fwereade__natefinch, but, eh, if we have an early failure mechanism I'm not too bothered by juju saying "no" a tiny bit more often in very specific and somewhat questionable circumstances ;)14:18
fwereade__mgz, hey, machine address updates14:18
mgzif you want to catch bad tags, just copy the pyjuju logic straight14:19
fwereade__mgz, what's the latest story on what's responsible for what?14:19
fwereade__mgz, if it's provisioner-side that might also be useful for dealing with tags as they change14:19
mgzprovisioner puts addresses in state, charms and api gets addresses from state14:19
fwereade__(mgz, natefinch: this is also secondary to the focus though)14:20
fwereade__mgz, cool14:20
mgzmachiner/uniter do not put things in state14:20
fwereade__mgz, great, thanks14:20
mgzfwereade__: is it possible to change a service's constraints?14:21
mgzthe case I'm most wrroied about with tags is you have a long-lived deployment, and find at some late point that you can't add units any more because the tags you originally specified no longer apply14:21
fwereade__mgz, certainly you can14:27
fwereade__mgz, the interesting case to me is when you have a deployed machine whose tags change while it's running14:28
mgzthat's also interesting...14:29
natefinchfwereade__: seems like that would be similar to the case of changing the constraints on a service. If you suddenly up the memory requirement on a service, I presume we don't remove it from machines it's on if they don't fit the constraint14:29
fwereade__natefinch, yeah, I'm thinking about subsequently matching units against already-provisioned machines14:30
fwereade__natefinch, you want it on a machine with tag X; mahcine 7 has tag X; or maybe it just had it when it was provisioned14:30
dimiternI have a large review, but with mostly mechanical changes - anyone interested? https://codereview.appspot.com/1360604514:57
dimiternrogpeppe, ? ^^14:58
rogpeppedimitern: looking14:59
mgzooo, very virtuous dimitern15:03
dimiternmgz, what is?15:03
mgztackling import tidying all over the codebase15:04
dimiternmgz, yeah, well, rogpeppe did almost all of the gocheck stuff already, and many modules are properly formatted15:05
dimiternmgz, that'll give me some peace, rather than getting frustrated every now and again when I encounter a badly formatted file :)15:06
rogpeppedimitern: reviewed15:07
dimiternrogpeppe, thanks15:07
dimiternrogpeppe, you know, I raised a similar question some time ago and I was told it's about consistency and we should import even a single package n a block15:08
rogpeppedimitern: really?15:08
dimiternrogpeppe, yep15:08
rogpeppedimitern: i think it should be just fine. it seems pernickety to the point of ridiculousness.15:08
dimiternrogpeppe, these two places where the only ones that didn't follow the rule, and there are plenty of other files that do15:08
rogpeppedimitern: what if there are no imports at all? should we do import (\n) ?15:09
dimiternrogpeppe, :) no15:09
dimiternrogpeppe, so if you don't mind terribly let's have these 2 places follow the same pattern15:09
dimiternrogpeppe, again, it's about consistency15:09
rogpeppedimitern: fair enough. bleh, though.15:10
dimiternrogpeppe, great, thanks15:10
dimiternrogpeppe, https://codereview.appspot.com/13700043/ last one, i promise :)15:46
rogpeppedimitern: so we don't allow any upgrading across more than two minor versions?15:47
dimiternrogpeppe, that's the plan IIRC15:48
rogpeppedimitern: i'm a bit wary of doing this until our upgrade logic actually enforces that15:48
dimiternrogpeppe, I think it does now15:48
dimiternrogpeppe, there were some changes recently wrt that15:49
* dimitern brb15:49
rogpeppedimitern: can you find the place that does that?15:49
rogpeppedimitern: (of course, even that's not enough, because someone might do the 2nd upgrade before the first one has completed)15:50
dimiternrogpeppe, well, didn't we agree to remove these deprecated things?16:04
rogpeppedimitern: i'm just wary - would like to check that we are actually not breaking our compatibility promises16:04
dimiternrogpeppe, how can you guarantee that anyway?16:05
dimiternfwereade_, care to join in? ^^16:06
rogpeppedimitern: well, if we remove these compatibility things and we haven't got anything that checks that we can't upgrade too much too soon, then we know we're potentially breaking something, in a hard-to-diagnose way16:06
rogpeppedimitern: did you find the MP that made the check?16:07
dimiternrogpeppe, no, it was some time last week though16:08
* fwereade_ reads back16:09
rogpeppedimitern, fwereade_, natefinch: first branch in the config storage series: https://codereview.appspot.com/1353504516:09
TheMuefwereade_: ping16:09
fwereade_TheMue, pong if it's quick, I might get deeply involved here16:10
TheMuefwereade_: it's quick16:10
* fwereade_ is listening16:10
TheMuefwereade_: when changing the API we have also SetStatus with status and info as argument. adding data would make it incompatible16:11
fwereade_TheMue, how would it make it incompatible?16:12
TheMuefwereade_: third argument where right now are two.16:12
fwereade_TheMue, old client -- sets empty data, no change in behaviour16:12
fwereade_TheMue, old server -- ignores what gets set, no other change16:13
fwereade_TheMue, worst case -- old environment lacks hook error info until someone retries the hook16:13
fwereade_TheMue, am I missing some interaction?16:13
fwereade_rogpeppe, dimitern: regardless of 1.14, 1.12 is a problem still16:13
TheMuefwereade_: hmm, cannot detect right now. looks ok to me now16:14
fwereade_rogpeppe, dimitern: I have not seen that upgrade code landing, I'd need some evidence before I believed we had it16:14
dimiternfwereade_, how so?16:14
dimiternfwereade_, I looked and couldn't see it actually16:14
fwereade_dimitern, it'll jump versions16:14
dimiternfwereade_, rogpeppe, didn't we agree to make upgrades possible only +/- 2 minor versions?16:15
rogpeppedimitern: yes, i think we did16:15
fwereade_dimitern, rogpeppe: we did, but I don't think it's enforced anywhere16:15
rogpeppedimitern: but i haven't seen that change16:15
rogpeppedimitern: also, as it happens, that's not actually sufficient - i think we need some more checks to make it good16:16
dimiternfwereade_, rogpeppe, so we need that right now, yesterday even16:16
fwereade_dimitern, rogpeppe: I support the change you're making, but it needs verification (and probably backporting the fix into 1.14... and maybe even 1.12... if there's any way we can actually get that to people using it?)16:16
rogpeppedimitern, fwereade_: in particular, i think the upgrade-juju command should probably check that all agents are all at the current version16:16
fwereade_dimitern, yeah, exactly16:16
fwereade_rogpeppe, yeah, that sounds reasonable16:17
fwereade_rogpeppe, I suspect doing it non-racily will be challenging16:17
dimiternfwereade_, rogpeppe, what do you mean all agents?16:18
rogpeppefwereade_: well, it can't work correctly if two clients are both using upgrade-juju16:18
fwereade_dimitern, every machine and unit16:18
rogpeppefwereade_: but i think it'll work ok otherwise16:18
dimiternfwereade_, rogpeppe, we need to have a flag "upgradeable" somewhere and a worker setting that16:18
rogpeppefwereade_: i can't *think* of any particular race16:18
fwereade_rogpeppe, I was only even thinking about machines that are still being deployed from 2 upgrades ago ;p16:19
rogpeppedimitern: why so?16:19
fwereade_dimitern, I'm not sure about that16:19
dimiternrogpeppe, so we know the env has a stable, single version across16:19
fwereade_dimitern, very hard to keep track of16:19
fwereade_dimitern, rogpeppe: actually, we can do it ok I think16:19
dimiternfwereade_, why? the env provisioner can take care of that - or the master upgrader16:19
rogpeppedimitern, fwereade_: if we check that for all agents, their deployed version is the same as the global version, that's a global steady state16:20
fwereade_rogpeppe, dimitern: yeah, but the set of agents is not steady16:20
fwereade_rogpeppe, dimitern: an old machine might still be coming up with older code ;p16:20
fwereade_rogpeppe, dimitern: oh actually16:20
rogpeppefwereade_: is that a problem? they'll still have a state entry16:20
dimiternfwereade_, rogpeppe , I see how this can be racy16:21
fwereade_rogpeppe, dimitern: they *won't* have their version set16:21
rogpeppefwereade_: so we can refuse to upgrade if we find any of those16:21
fwereade_rogpeppe, dimitern: so it involves ops on 2 collections, and the possibility of state changing after either, but probably nbd16:21
rogpeppefwereade_: (which is catered for by the same logic)16:21
fwereade_rogpeppe, dimitern: s/ops/reads/16:21
rogpeppefwereade_: i'm not sure i understand16:21
dimiternfwereade_, rogpeppe , I think we're overcomplicating things here16:22
rogpeppefwereade_: i can't see that we need to any more than: for a := range all agents {if a.version != globalVersion {abort}}; set globalVersion  = newVersion16:22
dimiternfwereade_, rogpeppe, it's like *any* upgrade is as complex as a major version upgrade16:22
rogpeppefwereade_: only one op required16:22
dimiternrogpeppe, range all agents is volatile16:23
rogpeppedimitern: only if someone else is concurrently running add-unit16:23
dimiternrogpeppe, or add-relation with subordinate16:24
rogpeppedimitern: well, yes, running operations concurrently with upgrade-juju is probably a bad idea16:24
fwereade_rogpeppe, dimitern: isn't it (1) a query for any machine docs without agent version X; (2) a query for any unit docs without agent version X; (3) a single op asserting that environment agent version is still what we thought when we started checking16:24
fwereade_rogpeppe, dimitern: so that may actually be non-racy16:24
fwereade_rogpeppe, dimitern: because any added machines will be using the environment's agent-version16:25
fwereade_rogpeppe, dimitern: and iirc any added units will just use their machine's tools16:25
dimiternfwereade_, rogpeppe, sounds reasonable16:25
dimiternfwereade_, rogpeppe, can we implement some kinds of lock - "don't add any machines or units while this is active" ?16:26
fwereade_dimitern, I don't think we need it16:26
fwereade_dimitern, but we certainly could if we really did16:26
rogpeppefwereade_: ... except then we'd need to be able to break the lock...16:26
dimiternfwereade_, I think we do, at least for user-friendliness16:27
fwereade_dimitern, what's the user-facing consequence of what I suggested? I don't see how we can end up with bad machines that way16:27
dimiternfwereade_, so any concurrent add-unit or machine ops will fail with a meaningful message16:27
fwereade_dimitern, why should we fail them?16:27
dimiternfwereade_, because it takes more than a split second to upgrade all agents?16:28
fwereade_dimitern, they'll either get provisioned after we upgrade or before16:28
fwereade_dimitern, so they'll either get the new versoin, or the old version16:28
fwereade_dimitern, and if they get the old version they'll upgrade themselves as soon as they come up16:28
dimiternfwereade_, hmm..16:28
rogpeppefwereade_, dimitern: i *think* my original proposal still works16:29
fwereade_dimitern, and if they get provisioned with the old version, and take a long time to come up, they block the next upgrade because they haven't set any agent version so it certainly doesn't match new ;)16:29
fwereade_rogpeppe, I *think* I'm just talking around your suggestion -- check all agents16:30
rogpeppefwereade_, dimitern: the only difficulty is that if lots of people are adding units all the time, we won't be able to upgrade16:30
fwereade_rogpeppe, I originally thought it wouldn't work but now I think it will16:30
rogpeppefwereade_: cool16:30
dimiternfwereade_, rogpeppe, so 1) get all agents != new version (units and machines docs), 2) assert the version != changed, 3) start the upgrade16:30
fwereade_dimitern, get all non-matching units, abort if any found16:30
dimiternfwereade_, rogpeppe , if any agents come out of 1) - stop16:31
fwereade_dimitern, get all non-matching machines, abort if any found16:31
fwereade_dimitern, set agent version, asserting that it's still what it was when we first looked16:31
fwereade_dimitern, this will involve doing an end run around Settings, I suspect16:31
dimiternfwereade_, rogpeppe , this sounds like a plan - where should we call this method? in upgrader?16:31
rogpeppedimitern: no, in upgrade-juju16:31
fwereade_dimitern, it's got to be in the state code that actually tries to do the upgrade, surely16:32
rogpeppedimitern: i don't think any server-side logic needs to change16:32
rogpeppedimitern: it's just a client-side sanity check16:32
fwereade_rogpeppe, if it's not enforced it's not much of a sanity check16:32
dimiternrogpeppe, fwereade_, assuming we have this, what will it give us?16:32
dimiternfwereade_, rogpeppe, aborting the upgrade if any agent is using a different version - that's one16:33
fwereade_rogpeppe, less unpredictably edge case combinations of versions16:33
rogpeppedimitern: the ability to enforce stepped upgrades16:33
rogpeppedimitern: reliably16:33
fwereade_rogpeppe, OTOH it prevents us from unfucking a fucked environment which already has a mix16:33
dimiternfwereade_, rogpeppe, how about enforcing the newVersion is <= oldVersion.minor+216:33
rogpeppefwereade_: if there's an environment which already has a mix, we're fucked anyway because something isn't responding to the version16:34
fwereade_rogpeppe, or tools don;t exst for some particular arch/series16:34
fwereade_rogpeppe, we ought to be able to upgrade our way out of that situation16:34
rogpeppefwereade_: i think that's awkward16:34
fwereade_rogpeppe, I guess the total effort is going to be equivalent either way, you could probably just add the tools to the environment16:35
dimiternfwereade_, rogpeppe, ISTM these 2 things are orthogonal - enforcing a minor +/- 2 versions and not doing an upgrade in a mixed env16:35
rogpeppefwereade_: yeah16:35
fwereade_dimitern, I'm not even sure about allowing downgrades16:35
rogpeppedimitern: i think we should probably be enforcing no downgrades too16:35
rogpeppeha16:35
fwereade_dimitern, yeah, let's say no downgrades16:35
dimiternfwereade_, rogpeppe, ok then so +2 minor only16:36
dimiternfwereade_, rogpeppe, ah, I see now - by ensuring the version we know of is the same across the env we can just do I check with the local version in upgrade-juju16:36
rogpeppedimitern, fwereade_: for bonus points, upgrade-juju could automatically upgrade via as many minor versions as needed to get to the destination version16:36
dimiterns/do I/do one/16:37
rogpeppedimitern, fwereade_: if we *don't* do that, then it's going to an an enormous pain for people that aren't tracking every upgrade16:37
dimiternrogpeppe, fwereade_, ok, this deserves a feature card named "minor version upgrades"16:38
dimiternrogpeppe, fwereade_, and can be a stepping stone towards major version upgrades16:38
rogpeppedimitern, fwereade_: rather than locking, i wonder if two explicit commands "halt/resume" might work (and be potentially useful in other situations too)16:39
rogpeppedimitern, fwereade_: (orthogonal issue, i know, but just thinking)16:39
dimiternfwereade_, rogpeppe, halt/resume what?16:39
rogpeppedimitern: any changes to the state16:40
rogpeppedimitern: i.e. it would forbid any deploy, add-unit, destroy-unit etc etc16:40
rogpeppedimitern: (while "halted")16:40
dimiternrogpeppe, well, not *any* changes surely - we still need to change some stuff in state during upgrades, no?16:40
fwereade_rogpeppe, "not now" to both16:40
rogpeppefwereade_: +116:41
fwereade_rogpeppe, automatic stepping would be pretty cool though16:41
fwereade_rogpeppe, and possibly halt/resume in the further future still16:41
fwereade_definitely not something to do now though16:41
dimiternfwereade_, rogpeppe, ok, so regrettably we won't drop the deprecated stuff for now :/16:41
rogpeppedimitern: think so, i'm afraid16:42
dimiternrogpeppe, fwereade_, but this *needs* to be a blocker for 13.1016:42
rogpeppefwereade_: in case you missed it: https://codereview.appspot.com/1353504516:42
dimiternrogpeppe, fwereade_ , if not major, at least minor version upgrades should work16:42
natefinchrogpeppe: fwereade_: I notice that we're passing around constraints.Value in a lot of places, and not the pointer to it... is that on purpose?  It's currently 6 pointers (and now a slice) and it's only likely to get larger16:49
rogpeppenatefinch: i very much doubt that performance is an issue here16:50
natefinchrogpeppe: just tweaks my optimization radar16:50
rogpeppenatefinch: i switched mine off for juju long ago16:50
rogpeppenatefinch: we are hideously inefficient in so many places16:50
rogpeppenatefinch: but it really doesn't matter much - i'd measure in a real situation before optimising16:51
natefinchrogpeppe: yeah, I'm sure it doesn't matter... it's not like we're making lists of thousands of these things or something16:51
rogpeppenatefinch: think how long it takes to start an instance :-)16:52
natefinchrogpeppe: maybe if we didn't copy so much memory everywhere.... ;)   (joking, I know that's not the issue)16:52
=== natefinch is now known as natefinch-afk
fwereade_natefinch-afk, thus far the rationale has been that anywhere we have a constraints param we require actual constraints -- they may be empty, but they're not optional17:37
fwereade_natefinch-afk, they're *also* a type that's frequently tweaked before being operated on, and we'd need to audit quite carefully for changes17:38
fwereade_natefinch-afk, it is something that regularly surprises people though, so obviously it wasn't quite as transparently clear as I had hoped17:42
rogpepperight, time to stop17:48
rogpeppefwereade_: review of https://codereview.appspot.com/13535045/ appreciated if you have any time, thanks!17:48
rogpeppeg'night all17:48
=== natefinch-afk is now known as natefinch
natefinchfwereade_: I don't really see the difference between nil and the struct default... but I understand what you're saying17:54
fwereade_natefinch, there's something a bit off about having two legitimate ways to denote "no constraints"17:55
natefinchfwereade_: yes and no... it's similar to *uintptr .... what's the real difference between nil and 0?17:59
natefincher *uint6417:59
natefinchfwereade_: I get that one is *unset* and one is "I specifically said 0" ... but in the case of constraints, they're usually the same thing18:00
fwereade_natefinch, yeah, it probably wasn't the smartest thing I ever did18:03
natefinchfwereade_: every time I see the value getting passed, my eye twitches, that's all :)18:04
natefinchfwereade_: ironically, I had to write  IsEmpty(v constraints.Value) bool because we were doing straight struct comparison before, which don't work any more because the struct has a slice value in it now18:08
natefinchso now we have !IsEmpty(v) instead of v != constraints.Value{}18:09
=== BradCrittenden is now known as bac
TheMueso, good night and have a nice weekend all18:27
natefinchTheMue: good night18:27
marcoceppiWhen was debug-hooks implemented 1.13?18:38
natefinchmarcoceppi: code was merged in on 8/418:44
marcoceppinatefinch: yeah, found the release notes, 1.13.118:45
natefinchmarcoceppi: Cool.18:45
marcoceppinatefinch: no idea how well that feature is tested, but I've got someone in #juju whos trying it right now with maas18:47
natefinchmarcoceppi: I don't know... there are tests in the code, but for things like this,  there can be some distance between testing and reality18:50
marcoceppinatefinch: right, well, about to get some real data for you guys :)18:50
natefinchmarcoceppi: hey, I'm glad people are using it.  definitely keep an eye on if he's having trouble with anything, and let us know.18:51
marcoceppinatefinch: yeah, I told him to ping me if anything goes weird18:52
marcoceppinatefinch: I just realized how terrifying this command is18:53
natefinchmarcoceppi: haha yeah, of the ones we have, that's a doozy18:54
=== gary_poster is now known as gary_poster|away

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