/srv/irclogs.ubuntu.com/2012/07/13/#juju-dev.txt

wrtpdavecheney: hiya04:49
wrtpdavecheney: FYI here's a sketch of the possible firewall-management code: http://paste.ubuntu.com/1089246/04:52
wrtpdavecheney: (we discussed it when you weren't around)04:52
* davecheney reads wrtp 05:22
wrtpdavecheney: actually, i realise that i didn't update it for the most recent version of the OpenPorts API: http://paste.ubuntu.com/1089282/05:44
davecheneywrtp: on da phone, hang on05:47
wrtpdavecheney: np05:48
davecheneywrtp: that propsal looks good05:55
wrtpdavecheney: cool05:55
davecheneyopen question, are you, i and frank all trying to eat the same elephant ?05:56
davecheneythis is simlar to the branch be proposed on wednesday05:56
wrtpdavecheney: i hope so05:56
wrtpdavecheney: this was a response to frank's proposal05:57
davecheneyhe was approaching it from the state side, which sort of makes sense because in the py version there is a state.FirewallManager05:57
wrtpdavecheney: i'm not quite sure why he did it actually, as it's really just part of the PA, but it was useful for focusing all the issues in one place05:57
wrtpdavecheney: ah!05:57
davecheneybut it does exactly that, although simpler05:58
wrtpdavecheney: i hadn't quite got that it was in state05:58
davecheneyfor every machine or unit, it registers a callback (it == firewall manager)05:58
davecheneythen does (stuff) when that callback fires05:58
wrtpdavecheney: the main difference is that in the python version, it checks the "real" state every time.05:58
davecheneyin some ways in twisted it's simpler05:58
davecheneyin our version we need to start and manage a watcher goroutine05:58
wrtpdavecheney: whereas this CL keeps track of the state and only issues OpenPort/ClosePort requests at well-defined times05:59
davecheneythis is the <-serviceChange bit ?05:59
wrtpdavecheney: yeah. there's only one central goroutine that manages the whole thing06:00
davecheneywrtp: here is the problem i see06:00
wrtpdavecheney: i had difficulty keeping track of all the potential state interactions when there were multiple independent goroutines operating on it.06:00
davecheneyif we have N port watchers, how do we funnel all those change messages into a single channel ?06:00
wrtpdavecheney: easy06:01
wrtpdavecheney: just start a goroutine for each watcher06:01
davecheneycan we pass a channel to watchPort ?06:01
davecheneyyup, goroutine that watches the watcher and forwardst he messages (means more tomb.Tombs ..)06:01
wrtpdavecheney: which prepends some data and sends on a central channel06:01
wrtpdavecheney: i think we can get away without any more tombs06:01
davecheneywrtp: i'd like to try06:01
davecheneynothing wrong with tomb06:02
davecheneybut less of everything is better, when there are going to be a lot of these port watchers06:02
wrtpdavecheney: the only thing wrong with tomb is that it's more heavyweight than necessary sometimes06:02
davecheneywrtp: i have to step out for a few hours, but will be online from ~8/9 my time this evening06:02
wrtpdavecheney: ok06:02
wrtpdavecheney: i think that all the mux goroutines can watch the same tomb06:02
davecheneywrtp: that would be excellent, because the most likely cause of them wanting to die is the firewaller goroutine exiting06:03
davecheneyalso, http://codereview.appspot.com/6333067/06:03
davecheneyi imagine this would be a valid chassis for your proposal ?06:04
wrtpdavecheney: absolutely06:04
wrtpdavecheney: frank is now working on integrating my sketch with your chassis06:04
davecheneywrtp: could I ask for some of your time today to get a run through of that chassis06:04
wrtpdavecheney: definitely06:05
davecheneyit doesn't do anyhthing at the moment so the amount of review should be minimal06:05
davecheneyespecially at is a carbon copy of the provisioner06:05
davecheneywhich makes me wonder if some of the dulication can be factored out06:05
wrtpdavecheney: it looks fine to me at first glance06:05
davecheneybut that is not important right now06:05
davecheneywrtp: just got an email from minux, he sent me a photo out front of building 47 on the google campus with some of the go team06:06
wrtpdavecheney: cool. link?06:06
davecheneyi'll forward it06:07
davecheneywrtp: in ya gmail06:10
wrtpdavecheney: rob looks very blues brothers06:11
wrtpdavecheney: thanks, BTW06:11
davecheneywrtp: have a good one, be online later06:19
wrtpdavecheney: how long?06:20
* wrtp can't remember time zones!06:20
wrtpdavecheney: np, just worked it out06:21
wrtpdavecheney: i'll be around06:21
wrtpfwereade_, TheMue: mornin'07:30
fwereade_wrtp, TheMue: similarly :)07:30
fwereade_wrtp, so, what am I doing in ComposeConfig that I don't need to? :)07:31
wrtpfwereade_: i have an idea, but i haven't quite been able to make it work yet07:31
fwereade_wrtp, yeah, my experience has been that it's a bit harder than it sounds like it should be ;)07:32
* fwereade_ looks sadly at this morning's conflicts07:32
wrtpfwereade_: here's what i what i'm trying: http://paste.ubuntu.com/1089407/07:32
fwereade_wrtp, hmm, interesting07:33
wrtpfwereade_: but there's a problem.07:34
fwereade_wrtp, I felt that we were doing so much with the maps that the internal types just complicated matters07:34
wrtpfwereade_: both the provider config and the config config require fields that have defaults provided by the other.07:34
wrtpfwereade_: so the initial config.Compose fails because it hasn't got a default-series07:35
fwereade_wrtp, yeah, indeed, it's fiddly07:35
wrtpfwereade_: i like the security that the internal type buys us07:37
wrtpfwereade_: it doesn't seem right that core after the initial configuration is still type coercing07:38
wrtps/core/code/07:38
fwereade_wrtp, agreed, very much so; but converting back and forth between dicts and internal types *all the damn time*, because the composition api needs dicts (or at least divt-backed configs) seems even worse07:39
wrtpfwereade_: i'm not sure07:40
fwereade_wrtp, and niemeyer seems very convinced that an enviroment config "really is" a map07:40
wrtpfwereade_: outside of a provider, yes07:41
fwereade_wrtp, I consider that argument to be utterly invalid, it's as much a map as every single other type in the system07:41
wrtpfwereade_: inside a provider, it's a known thing07:41
fwereade_wrtp, that is a serialization format, surely? just like for every other type in the system that we serialize..?07:41
wrtpfwereade_: the difficulty is that it's not just a serialisation format - it's a serialisation that we want to process, rather than just unmarshal.07:43
TheMuewrtp, fwereade_ : Oh, sorry, morning from my side too. Just had received my malt #29, a Laphroaig Cask Strength Batch 004 *yummy*07:43
wrtpTheMue: don't drink it all this morning!07:43
TheMuewrtp: hehe, no, will open it this evening07:44
fwereade_wrtp, well, I see no good reason not to just marshal/unmarshal the type as a real type once we know what it is, and to handle *all* the funky processing at user input time07:44
fwereade_TheMue, nice07:44
wrtpfwereade_: what about secrets?07:45
wrtpfwereade_: i.e. how can we marshal the type without some info?07:46
wrtpfwereade_: also, SetAttr07:46
wrtpfwereade_: we need to be able to set environment attributes, but just marshalling and unmarshalling doesn't easily allow that07:47
fwereade_wrtp, I'm not sure I follow your concerns07:47
fwereade_wrtp, the secrets thing maybe needs a little bit of rearrangement07:48
fwereade_wrtp, but then I've been asked not to think about secrets for now anyway07:48
fwereade_wrtp, and the type could surely handle user-defined config files, and env-set command data, in the same way?07:49
wrtpfwereade_: part of the cause of the current issues, i think, is the way that concerns about the config are divided between the config package and the provider package07:50
wrtpfwereade_: if the provider did it all, i don't think there would be so much of a problem.07:51
fwereade_wrtp, wouldn't that just mean that we need to duplicate everything in config across every provider?07:51
fwereade_wrtp, I am maybe taking this whole situation a little personally07:51
fwereade_wrtp, because the very first thing I did when I joined the team was to unpick the ec2 provider so we could actually use the common bits in orchestra07:52
fwereade_wrtp, and it was not easy07:52
wrtpfwereade_: of course, you'd need to be careful about consistency across providers, but that's true in any case07:52
wrtpfwereade_: i don't think it would mean that we'd need to duplicate everything.07:53
fwereade_wrtp, and what I see in go is a wilful refusal to heed the lessons of the python port -- it feels like a deliberate decision was made to replicate a known mistake in the python :/07:53
wrtpfwereade_: there would be some duplication, yes, but anything substantial could be factored out and put in the environs package07:53
wrtpfwereade_: that's always been the intention07:54
wrtpfwereade_: if the providers are in charge, they can choose what shared bits to use from the environs package07:54
wrtpfwereade_: (readAuthorizedKeys being one example)07:54
wrtps/the intention/my intention/07:55
wrtps/the environs package/any package we choose to put shared bits in/07:56
fwereade_wrtp, I just don't see how it's a good idea from any perspective except the let's-just-hack-it-together-quickly one07:56
fwereade_wrtp, which I thought it was our avowed intention to avoid07:57
wrtpfwereade_: which code duplication are you particularly thinking of here?07:57
fwereade_wrtp, all the bootstrap/could-init stuff, default-series and authorized-keys, things like we discussed yesterday with ports handling on instance start08:00
fwereade_wrtp, the prts handling I agree was not well factored in the python08:00
wrtpfwereade_: prts?08:00
fwereade_wrtp, sorry, ports08:00
wrtpah08:00
wrtpfwereade_: it has always been my intention to move environs/ec2/cloudinit.go to environs/cloudinit.go when it's needed08:02
wrtpfwereade_: it was designed to be used by any package (hence the "providerType" field)08:02
wrtps/package/provider/08:02
wrtpfwereade_: same with readAuthorizedKeys08:02
fwereade_wrtp, and so what we end up with is bits of common code mixed in with provider-specific code, and a big nasty surprise waiting for us when we try to actually use them elsewhere08:02
fwereade_wrtp, I suspect you are going to say it's ok to duplicate all the structural code (ie doing the right things at the right time) across the providers08:03
wrtpfwereade_: i think we end up with providers having a coherent interface and using what is necessary to fulfil that interface08:03
wrtpfwereade_: the tests will test that we've got the structural stuff right08:03
wrtpfwereade_: and it will all end up nicely clear and understandable, i hope08:04
fwereade_wrtp, I hope you're right08:05
fwereade_wrtp, IMO you've severely underestimated the subtleties08:05
wrtpfwereade_: maybe i have. i put my faith in encapsulation :-)08:06
fwereade_wrtp, and duplication :/08:06
TheMuewrtp: Did you thought about this way http://paste.ubuntu.com/1089445/ to send all machnine unit changes to the firewaller?08:07
wrtpfwereade_: we're guessing about that. yes, there will be code similarities between providers, but i'm hoping there won't be significant duplication08:07
TheMuewrtp: So the main loop of the firewaller handles all like you porposed.08:07
wrtpTheMue: not quite08:08
wrtpTheMue: one mo08:08
fwereade_wrtp, sorry, I'm just feeling generally negative about things because, wtf, this whole config saga08:08
wrtpfwereade_: i totally understand08:09
fwereade_wrtp, honestly I'm thinking it's all sunk costs, fuck it, just use a map throughout08:09
* wrtp resists, but is perhaps weakening. seems a pity but...08:10
fwereade_wrtp, the trouble is this is *another* week pissed up the wall08:12
wrtpfwereade_: agreed08:12
wrtpfwereade_: let's just do it08:12
fwereade_wrtp, "let's return actual configs from State.EnvironConfig"; "sounds good"; for {"ok, I'll give it a go"; "no, not like that"} :/08:13
wrtpfwereade_: :-(08:14
fwereade_wrtp, and all I wanted to do was to fix state.Initialize so I could fix the high-priority default-series bug that was assigned to me, pulling me away from the unit agent stuff08:17
wrtpTheMue: something like this perhaps? http://paste.ubuntu.com/1089457/08:18
wrtpfwereade_: yeah, it's gone a bit out of control08:18
wrtpTheMue: it's important that the changes on the channel include the information about what the change is about.08:19
wrtpTheMue: slightly more accurate: http://paste.ubuntu.com/1089462/08:23
TheMuewrtp: ah, thx08:23
TheMuewrtp: funnily it will drive the whole stuff into the same complexity direction as before, but with a cleaner interface08:24
wrtpTheMue: the important difference is that the state is only managed in one goroutine08:24
wrtpTheMue: stuff like that machine loop goroutine is just a conduit - it does nothing active08:25
wrtpTheMue: and that, i think, makes everything easier to reason about08:25
TheMuewrtp: yip08:26
wrtpTheMue: http://www.youtube.com/watch?v=SPPS8vExLmE :-)08:27
TheMuewrtp: ;) yip08:31
Aramhey.10:26
wrtpAram: yo10:27
wrtpfwereade_: ping10:41
TheMueAram: Hi10:44
wrtpfwereade_: i know it's way too late, but once i thought of this idea, i had to try it out. it feels much nicer to me, but it might be total crack. http://paste.ubuntu.com/1089617/10:47
fwereade_wrtp, thanks -- I'll try to look at it this pm, but cath's away and I'll be with laura :( (well, :) as well, but you know ;))10:50
wrtpfwereade_: if you want to declare your train wrecked and you like this idea, i'd be ok to take the flak from here if you like.10:50
wrtpfwereade_: ok10:50
fwereade_wrtp, it's appreciated, I'll think on it :)10:51
fwereade_wrtp, thanks :)10:51
wrtpfwereade_: that code passes the dummy tests BTW10:52
wrtpfwereade_: although i haven't added a test for default-series10:53
TheMueHmm, starting with useful tests without blowing the whole stuff up isn't simple.12:26
wrtpfwereade_, davecheney, TheMue: here's an configuration alternative. it feels quite a bit cleaner to me than env-config-trainwreck. i wonder what you think: https://codereview.appspot.com/6343107/14:04
wrtpi *think* it provides as much flexibility as the other, but doesn't require nearly as much messing around with maps14:05
wrtpthe heart of the proposal is in https://codereview.appspot.com/6343107/diff/1/environs/interface.go14:06
TheMuewrtp: Could you enlighten me, what is this "authorized-keys" stuff in config.go?14:16
wrtpTheMue: authorized-keys is a standard environment setting across all providers14:17
wrtpTheMue: it's also possible to use authorized-keys-path, which gives the name of a file containing the authorized keys14:17
wrtpTheMue: the authorized keys are ssh keys14:18
TheMuewrtp: per config entry?14:18
wrtpTheMue: yeah14:18
TheMuewrtp: ok, understand14:18
wrtpTheMue: that is, each config entry can have a different set of auth keys14:18
TheMuewrtp: How variable is the config scheme?14:19
wrtpTheMue: as variable as we want to make it14:19
TheMuewrtp: In the sense of "per software version", not in the sense of "how much possibilities this software has", sorry.14:20
wrtpTheMue: currently the fields i've put into config.go are a good guess at common functionality14:20
wrtpTheMue: i guess we'd want to keep things backwardly compatible14:20
TheMuewrtp: ok, otherwise I would use direct yaml or json marshalling of a strcut scheme representing the configuration14:21
TheMuewrtp: but if we need this generic approach it't ok14:21
wrtpTheMue: we can't do that, because each provider has a different set of attributes14:22
wrtpTheMue: config.go is an attempt to factor out some common functionality between providers.14:23
TheMuewrtp: so the config types have to be defined per provider. today he also as to know, which configuration variables he retrieves from the config, so it's kinda hard coded14:23
wrtpTheMue: only the common functionality is hard coded14:24
TheMuewrtp: and the names of variables a provider accesses14:24
wrtpTheMue: but each provider knows which attributes it supports, of course14:24
TheMuewrtp: that's what I mean, exactly14:24
wrtpTheMue: how could the provider get its configuration data otherwise?14:25
TheMuewrtp: Kind of ReadConfig(filename, &myTopStruct), internally simply using an unmarshalling of e.g. json14:26
wrtpTheMue: but myTopStruct has to hard code the fields names in just the same way14:27
wrtps/fields/field/14:27
wrtpTheMue: but also, there are several sections in the file, each with a different provider and a different set of attributes. i don't know how the above could work with that14:27
TheMuewrtp: yes, indeed, only the generic part is simpler14:28
TheMuewrtp: in both ways we can have runtime errors, yes14:28
wrtpTheMue: what would the type of myTopStruct look like?14:29
TheMuewrtp: that depends on the provider14:29
wrtpTheMue: you don't know the provider before you read the file14:29
wrtpTheMue: we're using the schema package to do a similar kind of thing.14:30
wrtpTheMue: it doesn't marshal to a struct sadly14:30
wrtps/marshal/unmarshal/14:30
TheMuewrtp: ok, I see14:42
Aram"<pnielsen> Aram: technically both can modify the struct, but one will be modifying copies, the other one will be modifying the "original""14:48
AramI hate such redundant and pointless "corrections" on IRC.14:48
Aramread between the lines!14:48
TheMueAram: *lol*14:54
=== jimbaker` is now known as jimbaker
rogpeppeTheMue, Aram, fwereade_: a code review if anyone cares for it: https://codereview.appspot.com/634411316:05
rogpeppeTheMue: it's the implementation of OpenPorts etc that the firewaller code will use16:05
fwereade_rogpeppe, I'm very unlikely to get to that, but I really like the approach you took on the config stuff16:21
rogpeppefwereade_: really? cool.16:21
fwereade_rogpeppe, I think it has unexamined fiddlinesses (in the review) but it's still going to be way way nicer16:22
rogpeppefwereade_: i felt it was a bit of a last-ditch attempt, but after trying to work with it, i was tending to agree with you about the train wreck16:22
rogpeppefwereade_: ah, a review! you're a lovely man.16:22
rogpeppefwereade_: it definitely needs lots more tests - i didn't want to waste any more time on it if it was a dead end.16:23
fwereade_rogpeppe, IMO, s/last-ditch attempt/fantastic diving save/16:23
rogpeppefwereade_: BTW should authorized-keys be optional in general?16:30
fwereade_rogpeppe, I think we always need it16:30
fwereade_rogpeppe, otherwise we can't connect to state16:31
rogpeppefwereade_: but should the fields be optional?16:31
rogpeppefwereade_: (assuming we can fetch something from $HOME)16:31
fwereade_rogpeppe, input-wise, yes, but a Config with empty authorizedKeys should be an error I think16:31
rogpeppefwereade_: agreed16:32
rogpeppefwereade_: ah, and that's why i put authorized-keys everywhere16:32
rogpeppefwereade_: because we can't rely on any being in the testing user's home16:33
fwereade_rogpeppe, yeah16:33
fwereade_rogpeppe, that has tripped up a fair number of users I know about16:34
fwereade_rogpeppe, so, probably, a whole bunch more that never said anything ;)16:34
rogpeppefwereade_: it's awkward to make the dummy provider add a authorized-keys default16:35
rogpeppefwereade_: i wonder if we should set $HOME=/tmp/something in every test suite16:37
fwereade_rogpeppe, +116:37
fwereade_rogpeppe, c.MkDir() anyway16:38
rogpeppefwereade_: yeah16:38
rogpeppefunc init() {os.Setenv("HOME", "/dsvfkdsalewnfcldsakj") } :-)16:39
fwereade_haha16:39
rogpeppefwereade_: should default-series be optional?16:40
rogpeppefwereade_: (defaulting to environs.CurrentSeries, if so, presumably)16:40
fwereade_rogpeppe, I think that's OK to get from there, yeah16:40
rogpeppefwereade_: "16:51
rogpeppeit shouldn't16:51
rogpeppeeven be possible to look at a Conn's Environ's config, because it is likely to16:51
rogpeppebe wrong.16:51
rogpeppe"16:51
rogpeppewhat do you mean by that?16:51
rogpeppei'm off for the weekend.17:01
rogpeppehave a great weekend everyone!17:01

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