/srv/irclogs.ubuntu.com/2012/05/16/#juju-dev.txt

hazmatSpamapS, the versions vary across the env00:00
hazmatsorry poor naming choice00:00
SpamapSversions of juju, but as long as provisioning agent doesn't pass a zk secret.. you just wouldn't have a zk secret, right?00:00
hazmatmixed mode == multiple versions extant in the env00:00
SpamapSsure ok I don't care what you call it, I just want it to work :)00:00
hazmatSpamapS, yup.. no otp identity token, nothing to do00:00
SpamapSIts the only thing I really think we have to get into 12.04.100:01
SpamapSeverything else we can pull people to PPA I think00:01
hazmatSpamapS, my timeline is  bit stretched00:01
SpamapSif we merged it now00:01
SpamapSwould it just break all add-units ?00:01
hazmatSpamapS, its not done, i still need to propogate identities to all the agents00:02
hazmatSpamapS, so with the move to august for 12.04.1 what's the date for last merge00:02
* SpamapS makes the FAIL face00:02
hazmatyou wanted 6 weeks00:02
SpamapSoh dude00:02
SpamapSI don't care about *actual* 12.04.100:02
SpamapSJune 6 man. I don't want to hold onto trunk like this for 3 months00:02
SpamapSIf we can't get it in, we can't get it in.00:03
SpamapSc'est la vie.00:03
hazmatactually i take that back, there is a branch that does the agent identity thing00:03
hazmatSpamapS, let's just branch then00:03
hazmatSpamapS, you want 9 weeks of no changes ?00:04
hazmatfor 12.04.1?00:04
SpamapSNo stress. I just think, priority wise, thats the only one that really needs to get back to the conservative "hey whats this thing juju" users that will use it from the distro.00:04
hazmatjune 6th isn't going to happen, i'm fully booked till june 14th00:04
SpamapShazmat: alright, then we won't ship stuff to those users.00:04
hazmati'd have to pull a resource to make other stuff move00:04
SpamapSor we'll branch a stable branch.00:04
SpamapSDon't stress, thats the key.00:05
SpamapSIt happens, or it doesn't, but no heroic efforts are needed.00:05
hazmatSpamapS, too late.... my post uds bliss has passed00:05
SpamapShazmat: thats why we have deadlines00:05
SpamapSso we *don't* have to stress00:05
SpamapSimmovable deadlines even00:05
hazmatSpamapS, that works when you only have one deadline maybe, but when you have four concurrently, its a bit different00:05
SpamapSthats why stuff needs to be done *before* feature freeze00:05
SpamapSeven in universe/unsupported .. we shouldn't target to go nuts the last week of the cycle.00:06
SpamapShazmat: meh, it still works. You have a deadline, you know how much time you have available for this one project. Its not enough.. resource starvation communicated. No stress.00:06
hazmatack00:06
SpamapSAnd I can set expectations for the precise-updates version appropriately as well.00:07
SpamapSI think instead I'll just try and make an 'unstable' PPA on June 6, and make sure there's some way to get juju-origin to use it.00:08
SpamapSthen we can just freeze ppa:juju/ppa onto the galapgos release, which I hope we can call 0.5.1, and then just start building trunk into ppa:juju/unstable and let users know they should get on that one if they want the new stuff from honolulu00:09
hazmatSpamapS, so 12.04.1 got moved back a month, why doesn't our deadline move with it?00:12
=== flaviamissi_ is now known as flaviamissi
hazmatamusing.. https://bugs.launchpad.net/edubuntu/+bug/100000000:48
jimbakeryes, a nice variant on https://bugs.launchpad.net/ubuntu/+bug/101:03
SpamapShazmat: because I want trunk to open up for features03:52
hazmatSpamapS, then let's cut a precise branch, but that should still change june 6th to july 6th03:59
SpamapShazmat: we can just make the precise packaging branch the precise branch :)04:01
SpamapShazmat: in fact, with the Low priority stuff thats been landing in galapagos, I think I may give up on trying to ship "galapagos" into precise-updates04:03
SpamapShazmat: the idea was extreme discipline so we could adhere to SRU policy. That has basically gone out the window.04:06
hazmatSpamapS, i think we have different notions of extreme.. anyways.. the question to me at the moment is what in the current set of revs doesn't meet that notion, we can revert, cut the branch, and reapply to trunk04:10
SpamapShazmat: Well the SRU policy is pretty clear that only high impact bugs will be SRU'd04:21
SpamapShazmat: so, cosmetic fixes are generally rejected, and with the heavy testing requirement, are kind of a waste of time.04:22
hazmatSpamapS, but things aren't tested in isolation?04:22
SpamapShazmat: plus we have to extract each and every one into its own quilt patch so SRU team can review each change. It just becomes a lot of red tape and b.s. for cosmetic fixes.04:22
hazmatSpamapS, this also applies to universe?04:22
hazmator that thing formerly known as04:23
hazmathm04:23
SpamapShazmat: yes, the only difference is that with universe, the community is expected to do the fixes (which, since we're juju devs.. we are considered the community)04:23
hazmatamusing04:23
SpamapSthe policy is identical, just the expectation of response is different.04:23
hazmatSpamapS, so outside of 536, i could probably a valid case for each of the other 4 commits04:23
hazmatSpamapS, also we need the output formating fix that bcsaller is working on wrt to not having python stringification of values04:25
hazmatie. one more04:25
SpamapShazmat: we also have the problem of not being able to test from -proposed easily. ;)04:26
hazmatyeah.. i got lost in the weeds trying to make local use cloud-image so i didnt have to implement that twice04:27
hazmat lp:~hazmat/juju/proposed-support ;-)04:28
SpamapSso many branches04:29
SpamapSso little time :)04:29
SpamapShazmat: I'm willing to do all the test verification on even the Low priority bugs .. as long as the SRU team is willing to review the uploads.04:32
SpamapShazmat: I figure if we ship 3 - 5 in an upload every 2 weeks the SRU team should be ok with that.04:33
hazmatSpamapS, any reason not to go ahead and cut the precise branch now04:36
SpamapShazmat: we have.. its at lp:ubuntu/juju04:38
SpamapSactually lp:ubuntu/precise/juju ;)04:38
hazmatgotcha04:38
hazmatcool04:38
SpamapShazmat: so I'll just manage the flow of things from lp:juju -> lp:ubuntu/precise/juju :)04:42
SpamapShazmat: and you guys can keep doing trivials as long as they don't cause me any conflicts. :)04:42
davecheneyrogpeppe: you in the house ?06:37
fwereadedavecheney, heyhey07:12
fwereadedavecheney, instance id is not the same as machine id; machine id is juju-internal but instance id is provider-supplied07:13
fwereadedavecheney, the providers don't have any reason I'm aware of to know about the details of juju state, so I don't think they should know about instance ids07:14
fwereadedavecheney, gaah, providers should not know about *machine* ids07:14
fwereadedavecheney, they should deal purely with *instance* ids07:15
fwereadedavecheney, the machine state should contain the corresponding instance id which you can use to shut down the machine07:16
rogpeppemornin' to anyone who's around...09:46
Aramhi there.10:12
rogpeppeAram: if you don't type my irc alias, i don't see your remark!11:32
Aram:).11:32
rogpeppelunch12:32
niemeyerHello!13:01
niemeyerI suspect my Thinkpad's battery has just died on me13:01
niemeyerQuick reboot..13:02
rogpeppeniemeyer: hiya13:09
niemeyerrogpeppe: Heya13:10
niemeyerLooks like battery is no more indeed13:10
rogpeppeniemeyer: bummer13:10
rogpeppeniemeyer: about List: i've gone with directories, but said that it should return the entire (recursive) contents of the directory. that means you can find out the entire contents of a bucket without explicitly recurring.13:12
niemeyerrogpeppe: Ok13:13
niemeyerrogpeppe: Where do I get a replacement bat in the UK?13:14
rogpeppeniemeyer: also, you said you had a couple of suggestions around that paste. do you remember another?13:14
rogpeppeniemeyer: in the UK i'd order it on the internet13:14
rogpeppeniemeyer: why UK?13:14
niemeyerrogpeppe: ROTFL.. *really*!? You'd use the *internet*!13:15
niemeyer:-)13:15
rogpeppeniemeyer: i can't be more specific - i'd froogle it.13:15
niemeyerrogpeppe: Yeah, got it.. I just had a good laugh :)13:15
niemeyerrogpeppe: I may be going there in a couple of weeks13:15
rogpeppeniemeyer: cool. whereabouts?13:15
niemeyerrogpeppe: London13:16
niemeyerrogpeppe: There's a sprint being planned and I was invited to help out as possible13:17
rogpeppeniemeyer: would it be helpful if i sourced a battery for you?13:17
niemeyerrogpeppe: Not sure.. if I can find a good spot to buy it, I might just send it to the office.13:18
niemeyerrogpeppe: I'd appreciate your help in case the place doesn't take international credit cards, though13:18
rogpeppeniemeyer: sounds like a good plan. that also sounds like a possibility.13:18
niemeyerrogpeppe: I'll have a look later at Amazon UK to see if I can find anything13:19
rogpeppeniemeyer: usually they do, but you might find the exchange rate isn't great.13:19
niemeyerFor now, just put my battery in the fridge for it to relax for a moment13:19
niemeyerrogpeppe: The exchange rate with credit cards is controlled by the government.. they're forced to use the official rates13:19
rogpeppechill out that battery man13:19
niemeyerrogpeppe: I'll just have to pay 6% extra of tax, unfortunately13:20
rogpeppeniemeyer: really? i never knew that.13:20
rogpeppeniemeyer: on top of our 20% VAT?13:20
niemeyerrogpeppe: Yeah.. financial operations tax in Brazil13:20
niemeyerrogpeppe: To discourage people from buying stuff abroad, is my guess13:20
niemeyerrogpeppe: Silly13:20
rogpeppeniemeyer: sounds like you *do* want me to buy it for you :-)13:21
niemeyerrogpeppe: Hehe, thanks, but don't worry for now..13:21
rogpeppeniemeyer: just let me know if you need it13:21
niemeyerThis is the second time this happens to me, btw13:22
niemeyerLast Thinkpad I had, the exact same happened13:22
niemeyerLooks like Lenovo has issues with batteries13:22
Aramwhat model is this thinkpad?13:23
niemeyerAram: T41013:41
AramI have one as well.13:41
Aramcurious that you had problems, I never had battery problems with any thinkpad.13:42
Aramhad a lot of problems with dells and hps though13:43
niemeyerAram: It's the second time13:52
niemeyerAram: Last one died in the same way13:52
Aramstrange.13:52
niemeyerAram: Maybe I use it too much? :)13:52
niemeyerrogpeppe: My current battery costs £164.16 at Lenovo (!!)14:07
rogpeppeniemeyer: yeah, they're way expensive.14:07
rogpeppeniemeyer: i was looking at getting a spare recently.14:07
niemeyerIt's almost the price of a whole laptop these days14:07
rogpeppeniemeyer: you can get an OEM battery14:07
rogpeppeniemeyer: but who knows how good it'll be...14:07
niemeyerOh, found the same one on Amazon uk for £84.5614:09
rogpeppeniemeyer: that's cool. link?14:10
niemeyerI wonder how long it's been in stock though.. that's always an issue with batteries14:10
niemeyerrogpeppe: http://www.amazon.co.uk/Lenovo-ThinkPad-Battery-55-battery/dp/B003FXQ3ZK/ref=sr_1_1?ie=UTF8&qid=1337177298&sr=8-114:10
rogpeppeniemeyer: given that they're the cheapest supplier, maybe they'll be clearing stock quickly...14:11
rogpeppeniemeyer: interesting to see how much of a markup lenovo direct has though.14:12
niemeyerrogpeppe: Yeah.. even if the cheap one lasts half as long, it's still ok :)14:13
rogpeppeniemeyer: some bizarre behaviour from gnu tar: http://paste.ubuntu.com/990736/14:21
niemeyerReading14:22
rogpeppeniemeyer: i can work around it with tar xzf /dev/fd/0, but....14:22
niemeyerrogpeppe: Weird indeed14:22
rogpeppeniemeyer: ah! i've found the problem.14:23
niemeyerrogpeppe: Oh?14:23
rogpeppeniemeyer: i had a bogus version of tar in my path14:23
rogpeppeniemeyer: it's a pity our tests will fail if someone has an odd environment. but i don't want to hard-code /usr/bin/tar ...14:25
rogpeppepwd14:25
niemeyerrogpeppe: Yeah, this is fine IMO14:37
niemeyerrogpeppe: All kinds of crazy things can happen if you has a buggy env14:38
niemeyers/you/one14:38
niemeyerrogpeppe: Btw, the battery death reminded me that I started the mgo zk in the trip to Brazil14:38
niemeyerrogpeppe: Looking really nice so far14:38
rogpeppeniemeyer: it's a bit weird really, because one of the original advantages of unix is that you can customise your commands.14:38
niemeyerrogpeppe: Next time I have a moment I'll start on watches14:39
rogpeppeniemeyer: cool. have you proof-of-concept-ed the watchers?14:39
rogpeppeoh, ok14:39
niemeyerrogpeppe: Not yet, but I have a pretty good idea about how to implement them now14:39
niemeyerrogpeppe: I started the research on the trip14:39
niemeyerrogpeppe: It's quite racy, so has to be carefully thought out14:39
rogpeppeniemeyer: yeah. it's a critical component.14:40
niemeyerrogpeppe: I'm planning to use the internal replication mechanism to do it.. I *think* it'll end up quite nice14:40
Arammaybe we should do like the web guys that try to detect browser capability and serve custom pages depending on that, that way we could support user customized environments :P.14:40
* Aram hides.14:40
rogpeppeniemeyer: it'll be interesting to see how the benchmarks (network bandwidth & latency particularly) work out14:40
niemeyerrogpeppe: Quite optimistic on that regard14:41
rogpeppeAram: ./configure :-)14:41
niemeyerrogpeppe: Don't be silly.. we should start with autoconf.sh14:41
rogpeppeniemeyer: good to hear14:41
rogpeppeniemeyer: of course!14:41
rogpeppenot14:42
niemeyer:-)14:42
niemeyerautoconf.sh => configure => make.. it's crazy how people end up finding that normal14:42
rogpeppethe whole notion of probing a system to find out what kind of thing it is is bogus14:42
Aramyeah, that worked so well for cross compiling :).14:43
rogpeppetbh, i wouldn't mind setting PATH=/bin:/usr/bin14:43
Aramthat's what I do most of the time in my scripts.14:43
rogpeppeAram: it's a reasonably sane approach.14:44
rogpeppeniemeyer: question: do you think List should return the full path names of the files, or the pathnames with the dir prefix stripped off?14:51
rogpeppeniemeyer: i'm starting to question how much effort i want to put in to make S3 buckets look like directories.14:52
rogpeppeniemeyer: maybe we *should* just use a prefix model14:52
niemeyerrogpeppe: I'm happy with that too14:53
rogpeppeniemeyer: i think i'll go with that for the time being as the path of least resistance.14:53
niemeyerrogpeppe: Full path names sounds simpler14:53
rogpeppeniemeyer: then we don't have to worry about the impedance mismatch. and we can revisit the decision later if we need to.14:54
niemeyerrogpeppe: Yeah14:54
niemeyerrogpeppe: Btw, I'm thinking we'll end up having some kind of manifest file for the generic HTTP public provider14:55
niemeyerrogpeppe: This will also make that simpler14:55
rogpeppeniemeyer: no need to use the Separator stuff either.14:55
niemeyerrogpeppe: Definitely14:55
rogpeppeniemeyer: the manifest file should be auto-generated, otherwise we've got a problem with two clients uploading tools concurrently.14:56
niemeyerrogpeppe: This is about the public storage15:00
niemeyerrogpeppe: For the private storage we should be able to list our stuff15:01
niemeyerrogpeppe: Which will be guaranteed, given we're hopefully moving towards a internal storage mechanism15:01
rogpeppeniemeyer: ok, that seems reasonable. the interface can be the same in both cases (StorageReader)15:01
niemeyerrogpeppe: RIght15:02
* rogpeppe quite likes the StorageReader/StorageWriter distinction.15:02
niemeyerrogpeppe: Btw, I was going to suggest this before my ISP broke yesterday: StorageReadWriter may be spelled as Storage only15:02
niemeyerrogpeppe: StorageReader, StorageWriter, and Storage15:02
rogpeppeniemeyer: that works15:02
rogpeppe+115:02
niemeyerSupa'15:02
niemeyer:)15:02
niemeyerOk, it's lunch time here15:04
niemeyerBack soon.. reviews on the afternoon today15:04
rogpeppeniemeyer: enjoy15:09
Aramniemeyer: why does your battery stats indicate 0 for the cycle count?16:01
Arams/does/do/16:02
niemeyerAram: Probably side effect of death16:08
rogpeppeniemeyer: https://codereview.appspot.com/614504316:12
rogpeppeniemeyer: slightly worried that the branch is too big now and i'll need to spend some more hours splitting it up... :-|16:13
rogpeppeniemeyer: i'm going to have to go soon16:56
niemeyerrogpeppe: I'll have a careful look16:59
rogpeppeniemeyer: just replied to https://codereview.appspot.com/6215045/ . it would probably be good to have a chat about this tomorrow.17:15
niemeyerrogpeppe: Sure17:16
niemeyerrogpeppe: There's a leap in your description that I can't follow17:17
niemeyerrogpeppe: "by making Environ.Check operate directly on a map[string]interface{}, we make that possible."17:17
niemeyerrogpeppe: Nothing has to change in the way CheckConfig works to make that possible17:17
rogpeppeniemeyer: how do we merge the attributes generated when marshalling an environment with the other attributes held in the environment settings node?17:27
rogpeppeniemeyer: (i don't have to go immediately, BTW)17:27
* rogpeppe is trying to recall all the discussion points that came up with fwereade and dfc at the time.17:32
niemeyerrogpeppe: Hm17:33
niemeyerrogpeppe: I don't understand hte problem17:33
niemeyerrogpeppe: Check isn't about merging17:33
niemeyerrogpeppe: ConfigCheck is about validation and coercion17:33
rogpeppeniemeyer: Check has to parse the attributes that are created with Marshal (or whatever it would be called)17:33
rogpeppeniemeyer: so it helps if the two things read and write the same structure17:34
niemeyerrogpeppe: That's fine.. there's still no reason to change the function signature17:35
rogpeppeniemeyer: i don't see how it can work. what if Marshal returns a single int?17:35
niemeyerrogpeppe: I still don't get what problem you're trying to solve, sorry.. ConfigCheck returns a schema checker, which checks the schema by validating and coercing to the proper types in case it is valid17:36
niemeyerrogpeppe: What is Marshal?17:36
niemeyerrogpeppe: What problem are we trying to solve?17:37
rogpeppeniemeyer: ok, so...17:37
rogpeppeniemeyer: when we bootstrap, we need to ask the environment to save some of itself to the State.17:37
rogpeppeniemeyer: or at least that needs to happen at some point17:37
niemeyerYep17:37
niemeyerI'm with you17:38
rogpeppeniemeyer: so the question is: how does that happen? and once we've got the settings inside the State, how do we create an Environ from them?17:38
niemeyerrogpeppe: We create an environment by retrieving the ConfigNode for the environment configuration, and providing the Map() onto a new environment via Open.17:39
niemeyerrogpeppe: Another Option is to provide the ConfigNode itself onto Open, and change Open's signature to take a Getter, for example.17:39
niemeyerrogpeppe: Neither of those options require any changes to ConfigChecker17:40
rogpeppeniemeyer: that doesn't work - Open expects a nicely formatted structure that has been produced through Check.17:40
niemeyerrogpeppe: No, it doesn't.. there's no Check today, and neither of us mentioned anything about it so far17:40
rogpeppeniemeyer: ok, i'm proposing to rename Coerce to Check.17:40
niemeyerrogpeppe: Yes, I can see *that* :-)17:40
niemeyerrogpeppe: But you didn't mention why, and I can't see any reason to17:40
rogpeppeniemeyer: but the point is: all the preconditions are checked there. if we start passing attributes directly to Open, then the checks will have to go there too.17:41
niemeyerrogpeppe: One thing isn't related to the other in any way..17:41
niemeyerrogpeppe: If you pass a Getter into Open, there's no guarantee it's right either17:42
rogpeppeniemeyer: i wasn't proposing to pass a Getter into Open17:42
rogpeppeniemeyer: i was proposing to pass a Getter into *Check*17:42
niemeyerrogpeppe: Yeah, you're proposing something else, and I'm trying to guess why17:42
rogpeppeniemeyer: then Check can do all the checks it does right now.17:42
niemeyerrogpeppe: Yes, you were proposing that, but you didn't say why, and I can't see any reason to do that in the explanation above17:42
niemeyerrogpeppe: We seem to be a bit stuck on the lack of reasoning around htat17:43
rogpeppeniemeyer: it depends if you think the current division of labour works well or not17:43
niemeyerrogpeppe: It works very well today, and nothing I can see above seems to change that17:43
rogpeppeniemeyer: currently the Coerce method checks that all the fields are there and have sane values17:43
rogpeppeniemeyer: if we start passing unchecked values to Open, then that checking will have to move into Open.17:44
niemeyerrogpeppe: The values we pass today onto Open are checked. Renaming a method doesn't solve anything.17:44
rogpeppe[18:39:22] <niemeyer> rogpeppe: We create an environment by retrieving the ConfigNode for the environment configuration, and providing the Map() onto a new environment via Open.17:44
niemeyerrogpeppe: Yes!?17:44
rogpeppeniemeyer: so in that case, where is the checking done?17:45
niemeyerrogpeppe: I *really* hope we're not saving an invalid configuration onto the state!?17:45
rogpeppeniemeyer: who knows? we need to check it.17:45
niemeyerrogpeppe: No, sorry.. this is a broken design17:45
rogpeppeniemeyer: also, currently Check saves everything into a nice private structure.17:46
niemeyerrogpeppe: If you want to valid the state, it should be on its way in, not on its way out17:46
rogpeppeniemeyer: state is external.17:46
rogpeppeniemeyer: we might have got the version checking wrong17:46
rogpeppeniemeyer: we don't want to do unchecked type conversions.17:46
niemeyerrogpeppe: Besides that, validating the state would mean passing the result of Map() onto exactly the same validation & coercion function17:47
niemeyerrogpeppe: Which goes back onto the point that there's unjustified fuzz around that method17:47
rogpeppeniemeyer: i don't find it fuzzy. the Coerce and Open methods have a close relationship, but it's well defined.17:47
niemeyerrogpeppe: Yep. It's well define, works, and it's all good. You're suggesting we change the method name and signature and introduce an interface, because...? I don't know.17:48
rogpeppeniemeyer: i'm proposing passing the ConfigNode, in some form, to Coerce.17:48
niemeyerrogpeppe: Because...?17:48
rogpeppeniemeyer: so that Coerce can do exactly the same checking that it does when it gets stuff from environments.yaml17:49
rogpeppeniemeyer: with no code needing to be changed.17:49
niemeyerrogpeppe: ConfigCheck can do exactly that, today, with no changes to its signature, and no new interfaces.17:49
rogpeppeniemeyer: ConfigCheck?17:51
rogpeppeniemeyer: ConfigChecker, oh yes17:51
rogpeppeniemeyer: so what happens the other way around?17:52
rogpeppeniemeyer: i.e. how do we do the marshalling?17:52
niemeyerrogpeppe: the other way around we return.. :-)17:52
rogpeppeniemeyer: do we require that Marshal always return a map[string]interface{} ?17:53
niemeyerrogpeppe: env.Config() map[string]interface{} seems easy enough17:53
rogpeppeniemeyer: ok, so if we return map[string]interface{}, can't we guarantee that Coerce is called with that same type?17:54
rogpeppeniemeyer: and reflect that in the type signature17:54
niemeyerrogpeppe: That sounds fine to me.. I believe it's already called with that type today, right?17:54
niemeyerrogpeppe: We just don't enforce it by passing it via an interface{}17:54
niemeyerrogpeppe: But we could, and it sounds sane to do it17:55
rogpeppeniemeyer: to change the type signature?17:55
niemeyerrogpeppe: To be explicit that what we're passing in today is a map.. it's already a map17:55
rogpeppeniemeyer: explicit to the compiler, or just to document it?17:56
niemeyerrogpeppe: Explicit to the compiler..17:56
rogpeppeniemeyer: ok. so... what we've ended up with there is *almost* the same as what i was proposing.17:57
rogpeppeniemeyer: the only difference being that if we use Getter and Setter we can pass in the ConfigNode directly.17:57
niemeyerrogpeppe: That's my point the whole time.. you're proposing a change that isn't necessary, because what we have already works17:57
rogpeppeniemeyer: fair enough. it saves some code doing to map copying, but we can use map[string]interface{} throughout if we like.17:59
rogpeppes/doing to/doing the/17:59
niemeyerrogpeppe: I don't think it saves any code.. the current scheme needs *less* code, actually17:59
rogpeppeniemeyer: (what's being passed to Coerce currently isn't actually map[string]interface{} BTW)17:59
niemeyerrogpeppe: Because we work natively with maps on both ends17:59
rogpeppeniemeyer: really?17:59
rogpeppeniemeyer: one side we've got map[interface{}]interface{}; the other we've got *ConfigNode18:00
rogpeppe(which already has Get and Set methods)18:00
niemeyerrogpeppe: What's below ConfigNode?18:00
niemeyerrogpeppe: What does ConfigNode.Map return?18:01
niemeyerrogpeppe: It's a map on both ends, really18:01
niemeyerrogpeppe: The fact it's a map[interface{}] is also irrelevant.. we'll never have non-strings on that first level18:01
niemeyer1: WOAH!?18:02
rogpeppeniemeyer: it's not type-compatible with map[string], so we'll have to copy it to pass it in18:02
niemeyer:)18:02
niemeyerrogpeppe: Why can't we just have map[string]?18:02
rogpeppeniemeyer: because that's not what goyaml.Unmarshal returns.... or maybe we could make it...18:02
niemeyerrogpeppe: Coerce..18:02
* rogpeppe has a look18:02
rogpeppeniemeyer: maybe ReadEnvironsBytes could unmarshal into map[string]map[string]interface{}18:04
niemeyerrogpeppe: Coerce is what has to manage it18:04
rogpeppeniemeyer: not necessarily, i think18:04
* niemeyer waits for the light bulb to show up18:05
rogpeppeniemeyer: the problem currently is that ReadEnvironsBytes produces a map[interface{}]interface{} which is then passed to Coerce18:05
rogpeppeniemeyer: but i *think* we can unmarshal into map[string]interface{} at the top level and save the Coerce checking18:06
rogpeppeniemeyer: (of course Coerce would still need to check other things, but we could make its signature map[string] and avoid the map copying.18:06
rogpeppe)18:06
niemeyerrogpeppe: We can't..18:07
rogpeppeniemeyer: oh. no?18:07
niemeyerrogpeppe: Coerce validates the values, and transforms them onto expected types18:07
rogpeppeniemeyer: go on18:07
niemeyerThat's it..18:07
rogpeppeniemeyer: what if the signature of Coerce was Coerce(map[string]interface{}) (interface{}, error) ?18:08
niemeyerrogpeppe: It would still not help.. coerce coerces18:08
rogpeppeniemeyer: i.e. that Coerce took the exact output of Marshal as input18:08
rogpeppeniemeyer: that's fine.18:08
niemeyerOk then :)18:08
niemeyerI'll stop arguing and let you read the code18:08
rogpeppeniemeyer: ok, so i'm ok with using map[string]interface{} throughout rather than Getter/Setter, i think.18:09
niemeyerrogpeppe: Sounds great, thanks18:10
rogpeppeniemeyer: hmm, might not work very well with the schema package, which uses map[interface{}]interface{} throughout.18:12
niemeyerI see a light bulb starting to show up :-)18:12
rogpeppeniemeyer: i'm not convinced we gain much from using the schema package tbh18:14
niemeyerrogpeppe: Let's not throw the baby out with the bath please.. we have to walk forward18:14
rogpeppeniemeyer: it's higher-order code, but just a few type checks would be equivalent.18:14
niemeyerrogpeppe: There's zero reason to do by hand what the schema package does elegantly18:15
niemeyerrogpeppe: It's ready, works18:15
niemeyerrogpeppe: I believe FieldMap can return a map[string]interface{}, though18:15
rogpeppeniemeyer: nope.18:15
niemeyerrogpeppe: FieldMap is supposed to work with strings already.. we can enforce it in its return value I believe18:15
rogpeppeniemeyer: hence my v.(schema.MapType) conversion18:15
niemeyerrogpeppe: Don't know what you mean18:16
rogpeppeniemeyer: in fieldMapC.Coerce: out := make(MapType, l)18:16
niemeyerrogpeppe: can != does today18:17
rogpeppeniemeyer: that would make for a very different schema package. (one that i'd like to see, i agree, but not the one we have today, which outputs a small set of known types, rather than coercing to a specified type)18:17
niemeyerrogpeppe: Do you want me to code on that *very* different schema package?18:18
niemeyerrogpeppe: I bet the patch is less than 10 lines long18:18
rogpeppeniemeyer: all we're using schema for currently is the equivalent of: x, ok := m["field"].(string)18:18
niemeyerrogpeppe: and consists of removals18:18
niemeyerand a couple of replacements18:18
rogpeppeniemeyer: really?18:19
* niemeyer writes it18:19
rogpeppeniemeyer: but still, we've got all this higher-order machinery, but we're not using any of it in any particularly useful way.18:20
niemeyerrogpeppe: We are, it works, today, let's *please* move on!18:20
niemeyerrogpeppe: I really don't want to be moving backwards and doing checks by hand when we have that nice mechanism in place already18:20
rogpeppeniemeyer: it's because it was making it awkward that i was considering avoiding its use. changing its use is about 10 minutes work.18:21
niemeyerrogpeppe: I don't want to be checking whether it's int32 or int6418:21
niemeyerrogpeppe: Or whether it's something else entirely18:21
rogpeppeniemeyer: will we actually have any int-valued keys?18:21
rogpeppevalues i mean18:21
niemeyerrogpeppe: No, it's impossible..18:22
niemeyer:-/18:22
rogpeppeniemeyer: i mean, are there any int values that we actually *want*?18:22
rogpeppeniemeyer: because that's the only time that int32 vs int64 makes a difference.18:23
niemeyerrogpeppe: Please try to ponder about your question for a moment18:23
niemeyerrogpeppe: This is getting non-productive18:23
rogpeppeniemeyer: this is the kind of thing i was thinking of. i think it compares favourably to the current code. it actually reduces the overall line count (by 30 lines) and easier to understand IMHO, because you don't need to understand how schema works to follow the logic. i'll leave things as they are, but i think ewe should at least consider this possibility.19:02
rogpeppehttp://paste.ubuntu.com/991155/19:02
rogpeppeall tests pass BTW19:03
rogpeppes/ewe/we/19:03
rogpepperight, i really should go now.19:05
niemeyerrogpeppe: How does it reduce the line count? Seems to have the same number of lines19:05
rogpeppeniemeyer: sorry for the distraction19:05
rogpeppeniemeyer: the line count goes down in other places (the schema helpers in ec2/util.go for example)19:05
niemeyerrogpeppe: The errors are bogus, though19:07
rogpeppeniemeyer: it could be more compact with a little table19:07
niemeyerrogpeppe: That's one important benefit from the schema package19:07
rogpeppeniemeyer: as always, i think it's a trade-off. the higher order stuff is worth it when it really makes things easier to understand and reduces the line count by lots.19:08
rogpeppeniemeyer: in this case, i'm not convinced of its worth.19:08
niemeyerrogpeppe: It think it's worth based on these factors19:08
rogpeppes/worth/worse/ ?19:08
niemeyerrogpeppe: Yeah19:09
niemeyerrogpeppe: Error checking, for example19:09
rogpeppeniemeyer: all the error checking in schema is implicit - to understand the logic in config.go you have to understand the schema package (which isn't trivial)19:10
niemeyerrogpeppe: https://codereview.appspot.com/621205419:10
niemeyerrogpeppe: Implicit?19:10
rogpeppeniemeyer: yes, it's not obvious what inputs will result in what errors. (or even what code is calling what, due to the indirect nature of the schema.Checker)19:11
niemeyerrogpeppe: Sorry, I don't get it.. bad input will result in errors19:11
niemeyerrogpeppe: bad types, missing fields19:11
niemeyerrogpeppe: There's nothing implicit about that19:11
rogpeppeniemeyer: yes, and all that logic is defined within schema.19:11
niemeyerrogpeppe: Yep!19:12
rogpeppeniemeyer: which is quite complex.19:12
niemeyerrogpeppe: and it seems to work19:12
niemeyerrogpeppe: Not really..19:12
rogpeppeniemeyer: i'm saying we can cut out all that complexity and still reduce line count.19:12
niemeyerrogpeppe: It's used in ec2, in charm config, in charm meta, ...19:12
rogpeppeniemeyer: ec2 is what i was suggesting losing it in...19:13
niemeyerrogpeppe: Yes, and I'm pointing out you're not getting rid of schema19:13
niemeyerActually, that combined checker is excessively complex for schema..19:14
niemeyerThere's a lot of stuff being done by hand there..19:15
niemeyer                        c.authorizedKeys = maybeString(m["authorized-keys"], "")19:15
niemeyer!?19:15
rogpeppeniemeyer: that's necessary, because that key may not exist19:16
rogpeppewell, i suppose i could do: c.authorizedKeys, _ = m["..."]19:16
niemeyerrogpeppe: And how's this any simpler:19:17
niemeyerc.authorizedKeysPath, err = configString(false, m, "authorized-keys-path", "")19:17
niemeyer?19:17
rogpeppeniemeyer: because all the logic is right there.19:17
niemeyerrogpeppe: Yeah, because you're reimplementing the schema package right there.. sorry, I don't see the point19:18
niemeyerhttp://paste.ubuntu.com/991192/19:19
rogpeppeniemeyer: yeah, i agree there are arguments both ways. i think currently that making the Environs interface simpler would be a good thing (and it can still use schema inside if it wants), but i can see arguments for keeping it as it is too.19:20
rogpeppeniemeyer: i really have to go :-)19:21
niemeyerrogpeppe: Once we have some spare time, we can even make schema unmarshal directly onto the struct19:21
niemeyerrogpeppe: That was already my plan, but I never got to it19:21
rogpeppeniemeyer: +119:21
rogpeppeniemeyer: now *that* will be properly useful :-)19:21
niemeyerrogpeppe: yeah..19:22
rogpeppe(for all kinds of things)19:22
niemeyerrogpeppe: It's already on the way to that19:22
rogpeppeanyway, i have an idea.19:22
rogpeppewill propose something tomorrow19:23
rogpeppeif you manage to look at https://codereview.appspot.com/6145043/ that would be scrumptiolicious. :-)19:24
rogpeppesee you tomorrow, have a good rest-of-day.19:24
rogpeppeniemeyer: ^19:24
niemeyerrogpeppe: Thanks, have a good one too19:24
niemeyerTime for an afternoon food break... biab20:28
=== flaviamissi_ is now known as flaviamissi
niemeyerPhew.. long branch..22:14
* niemeyer steps out.. back later for another round22:15

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