/srv/irclogs.ubuntu.com/2013/01/29/#juju-dev.txt

=== slank is now known as slank_away
niemeyerNight all01:26
wallyworldjam: hi, you around?05:20
jamhey wallyworld05:30
wallyworldhi, stupid question, i cannot get a go install or build etc to include any of the openstack stuff05:31
wallyworldit seems like the openstack package is ignored for me05:31
jamwallyworld: what command are you running, and what result are you expecting? You mean being able to run 'juju foo' with openstack as the environ?05:31
wallyworldyes05:32
jamor you expect something in $GOPATH/bin/...05:32
wallyworldso i "go install launchpad.net/juu-core/..."05:32
wallyworldand my go bin dire is updatred05:32
wallyworldwith the latest juju05:32
wallyworldbut onloy if i change somthing in ec2 package05:32
wallyworldif i tweak something in openstack package the build/install process seems to ignore it05:33
wallyworldso that implies the openstack stuff is not being included05:33
jamwallyworld: right, I'm guessing we are missing the registration of the openstack provider05:33
wallyworldand matches what i see cause the openstack init() is not being run05:34
wallyworldthe registration is done inside init()05:34
wallyworldand init() is not being run for me since the go install seems to be ignoring my openstack package05:34
jamwallyworld: look at launchpad.net/juju-core/cmd/main.go05:34
jamit does "import _ "launchpadb.net/juju-core/environs/ec2"05:35
jamwe probably just need to add "openstack" there.05:35
wallyworldah ok, that makes sense05:35
fwereadejam, wallyworld: that's right :)05:35
fwereadejam, wallyworld: good mornings05:36
wallyworldthanks, i didn't know about that - was driving me crazy05:36
jamgood early morning to you as well, fwereade05:36
wallyworldmorninh05:36
wallyworldso till now it seems no one has tried to test go juju with openstack apart from running hte tests05:36
fwereadewallyworld, that's weird, I could swear dimitern told me you had it bootstrapping -- maybe that's via the live tests though05:37
wallyworldyeah, i suspect so05:37
wallyworldand i thought i'd take a moment today to try stuff out so to speak05:38
fwereadewallyworld, +105:38
wallyworldwith no luck till now :-)05:38
jamwallyworld: I thought he had, but I thought he had just done a local patch for it. It is how I would have tested it.05:39
wallyworldjam: maybe it's time to plug it in then?05:40
fwereadewallyworld, jam, I think so, definitely05:40
fwereadewallyworld, jam, I would be +1 on some very basic tests that just verify that we will accept a trivial config for each of the providers that "ought" to be registered05:40
wallyworldfwereade: so with the juju go, running "juju bootstrap" does not create a default environments.yaml like pyjuju, right?05:41
fwereadewallyworld, that's right; I think there's a bug related t it05:41
wallyworldok, np.05:41
wallyworld+1 to adding a few simple tests also05:41
fwereadewallyworld, it's https://bugs.launchpad.net/juju-core/+bug/99361605:42
jamwallyworld: so if we are actually at a point where 'juju bootstrap' with a openstack config doesn't barf/cause corruption, I'm happy to expose it.05:42
_mup_Bug #993616: We should ship a boilerplate environments.yaml. <juju:Confirmed> <juju-core:Triaged> < https://launchpad.net/bugs/993616 >05:42
fwereadewallyworld, it looks like it has some good samples in there05:42
jamfwereade: what is the standard for testing actual binaries?05:42
jamI don't think I've seen much testing of it in the code.05:42
fwereadejam, we have thus far got away with testing main() in-package05:43
fwereadejam, I would also be +1 on smart improvements to this... there's at least one test which actually builds go code05:44
fwereadejam, I think that's the test for --upload-tools, perhaps05:44
wallyworldjam: the main issue i see with exposing openstack by default is perhaps the lack of a suitable public bucket05:44
jamwallyworld: we have a shared account now, I think I sent you the access keys05:45
wallyworldbut if we ship a yaml that has stuff commented out, neither openstack nor ec2 will work out of the box anyway05:45
jamwe can turn that into the public buckte for now.05:45
wallyworldjam: right, but we wouldn't want to ship those keys05:45
jamwallyworld: "public bucket"05:46
jamwe use the shared account to create a readable bucket05:46
jamwhich other people can use05:46
wallyworldok, sorry, brain fade05:46
jamwallyworld: so we should be able to do something like set up a test double, override the appropriate env variables, run 'juju bootstrap', and inspect the double afterwards05:49
jamif you want a bit of an end-to-end (but with doubles) test.05:49
jamthat (IMO) makes a pretty decent smoke test05:50
wallyworldyeah, agree05:50
wallyworldi also want to try it on an openstack instance (ie mine) to see how it goes05:50
jamwallyworld: certainly. I just wouldn't put your account details into the test suite :)05:52
wallyworldnever fear, i was just wanting to run juju locally05:52
wallyworldnot the tests, the actual tools themselves05:53
jamcertainly05:53
wallyworldbbiab, have to take son to physio06:00
fwereadejam, if you have a moment, would you take a look at https://codereview.appspot.com/7227045/ please? and consider in particular the rambling about InferEndpoints, which I am starting to believe is mildly crackful06:08
jamfwereade: looking at the test, it does feel like there should be a call like AddRelation that does the infer first and then adds them. Given you are doing retries in case the service definition changes, it does seem like a combined op.06:39
fwereadejam, cool, thanks06:40
fwereadeniemeyer, good morning06:41
fwereadeniemeyer, midnight feeding? :)06:41
jamniemeyer: is this good morning? or good evening? :)06:41
fwereadeTheMue, morning07:08
fwereadedimitern, morning07:09
fwereadeTheMue, free for a quick call?07:09
TheMuefwereade: could we do it a bit later? i've to step out to the post office in a few moments, just packing a package i have to sent out today. ;)07:10
dimiternfwereade, TheMue: morning07:10
fwereadeTheMue, I expect so -- I'll need to pop out for a bit in an hour or so myself07:10
fwereadeTheMue, when will you be back?07:11
TheMuefwereade: i think in 30 minutes, but let's talk now07:11
fwereadeTheMue, ok, cool, should be quick07:12
rogpeppefwereade, TheMue, jam, dimitern, wallyworld: morning!07:49
dimiternrogpeppe: morning!07:51
niemeyerfwereade: Heya08:01
niemeyerjam: Yo08:01
niemeyerfwereade, jam: Sorry, missed the messages earlier08:01
niemeyerfwereade: Yeah, kind of :)08:01
niemeyerMaking use of the quiet time, though08:02
fwereadeniemeyer, enjoy it while you can :)08:10
fwereadegents, popping out for a bit08:10
fwereaderogpeppe, are you free for a call about the API etc?09:10
rogpeppefwereade: definitely09:10
rogpeppefwereade: one mo, i'll paste you an initial CL09:10
fwereaderogpeppe, cool09:11
rogpeppefwereade: https://codereview.appspot.com/687805209:11
dimiternjam, mgz, wallyworld: PTAL https://codereview.appspot.com/7228058/10:12
* wallyworld looks10:13
dimiternfwereade, rogpeppe: also, this one is closely related: https://codereview.appspot.com/7241045/ to ^^10:17
wallyworlddimitern: done10:22
dimiternwallyworld: thanks!10:23
wallyworldnp. 'see' you at the standup10:23
fwereadedimitern, cheers, on it shortly10:24
rogpeppedimitern: reviewed10:44
dimiternrogpeppe: cheers!10:45
fwereadedimitern, I think I'm in agreement with rogpeppe -- why is it that GetPrivateAddress needs to be exported?11:02
dimiternfwereade: because I need to call it in the tests, which are in a separate module11:02
fwereadedimitern, that sounds like a job for export_test.go11:03
dimiternfwereade: yes, but would it be usable from openstack then? tests are in openstack_test and putting it in export_test will make it available for tests, but not for the openstack module I think11:04
fwereadedimitern, but shouldn't it really be tests against the openstack Instance type anyway?11:04
dimiternfwereade: well, initially it was a method of instance (lower case one - in provider.go), but then creating an empty instance only so I can call it on it seemed wrong11:05
fwereadedimitern, also, shouldn't Instance.DNSName be returning the public address? I suspect I'm hopelessly confused here ;)11:05
dimiternfwereade: no, the same logic is ported from py-juju - private address is used, the public one is not available (at least not always), until you set a floating IP to the instance11:06
fwereadedimitern, ah, ok, sorry, you told me that the other day11:07
dimiternfwereade: yeah, but anyway we don't need the public address there or dns name - just an address to access the instance - private will do11:07
fwereadedimitern, so, wait, don't we need some public address so we can talk to the "bootstrap" node from outside? isn't that done via DNSName()?11:08
dimiternfwereade: I'm not sure, but I think it's not used from outside11:09
dimiternfwereade: maybe we should have a short call to discuss this with whoever knows best about how is this supposed to work11:10
fwereadedimitern, ISTM that we have to talk to the bootstrap node from outside11:10
fwereaderogpeppe, ping11:10
dimiternfwereade: well, how did it work in py-juju then?11:10
rogpeppefwereade: pong11:11
fwereaderogpeppe, what's your understanding of DNSName() re public/private address?11:11
fwereadedimitern, I have no idea :)11:12
rogpeppefwereade: the only important thing AFAIR is that it should return a publicly usable address11:12
fwereaderogpeppe, that was what I thought :)11:12
rogpeppefwereade: because that's what we use to connect to a unit from outside11:12
rogpeppefwereade: nothing in juju connects to machines, i think11:13
fwereaderogpeppe, define "nothing in juju" please :)11:13
rogpeppefwereade: bah. ykwim :-)11:14
rogpeppedimitern: when you say "would it be usable from openstack", what openstack package are you referring to there?11:14
dimiternrogpeppe: environs/openstack11:14
rogpeppedimitern: any function defined in openstack is callable from openstack11:15
dimiternrogpeppe: the problem is the tests are in openstack_test11:15
rogpeppedimitern: then you can use export_test11:15
dimiternrogpeppe: and still use it in both openstack and openstack_test ?11:16
rogpeppedimitern: or define some tests in openstack instead, if that's more appropriate11:16
rogpeppedimitern: sure11:16
fwereadedimitern, hence export_test.go -- that will be in package openstack, but thanks to the _test.go name will only be built with the tests11:16
rogpeppedimitern: in export_test:11:16
fwereadedimitern, you won't be able to use export_test.go stuff in openstack11:16
rogpeppefunc GetPrivateAddress(addresses map[string][]nova.IPAddress) (string, error) {return getPrivateAddress(addresses) }11:16
fwereadedimitern, so you have an exported name that calls the unexported function11:16
fwereadedimitern, what rogpeppe said :)11:17
dimiternrogpeppe: ok, I'll that then11:17
dimiternfwereade: still not sure about the DNSName semantics though11:17
rogpeppedimitern: generally we try not to put significant code in export_test - it's used to make things available for the external tests only.11:17
fwereadedimitern, it kinda looks like you're always returning a private address there11:18
fwereadedimitern, I think I'd be ok with a private address if and only if no public one is available11:18
rogpeppedimitern: private addresses are pretty much useless for the purposes juju uses DNSName for11:18
fwereadedimitern, but DNSName() should usually return a public one11:18
dimiternfwereade: I still think we better discuss this - with mgz as well, he has better view on the py openstack provider11:18
rogpeppefwereade: i tihnk i disagree - it's misleading if juju ssh tries to connect to an address that doesn't work11:19
dimiternI need to wrap my mind around it a bit11:19
fwereadedimitern, ISTM that the python uses a private one only if it can't get a public one11:19
fwereaderogpeppe, ^11:19
dimiternfwereade: where do you see this?11:19
rogpeppefwereade: what's the use of doing that?11:19
fwereaderogpeppe, dimitern, mgz: my unlettered reading of this is that some openstacks have nothing public, but that the client is connecting from the same network, so it's "ok"11:20
rogpeppefwereade: hmm, if that's really true, then it might be ok11:20
fwereadedimitern, providers/openstack/machine.py:6211:20
dimiternfwereade: yeah, I see this - so it's fine to do it like this?11:21
fwereadedimitern, I think that falling back to a private address when no public one exists is *probably* ok, assuming we get mgz to confirm we're not smoking crack11:22
dimiternmgz: ping11:23
fwereadedimitern, but the current approach of always returning private is not ok, I think11:23
dimiternfwereade: well, if we need definitely a public IP always it changes things quite a bit11:23
dimiternfwereade: we i'll then need to provision a floating IP to each machine we're starting in the environment11:24
fwereadedimitern, I think I'm failing to communicate11:24
fwereadedimitern, if a public address is available, we should definitely use that11:24
rogpeppefwereade: maybe we should have an environ parameter, say private-addresses, saying whether we want to use private or public addresses11:24
fwereadedimitern, if not, ISTM that falling back to a private address is roughly sane11:24
dimiternfwereade: it's never available for canonistack and I doubt it will be anything but rare in other cases11:25
rogpeppefwereade: when it's false, we could try to allocate floating ip addresses, or whatever's necessary to make dns names public11:25
fwereadedimitern, assuming my reasoning holds -- I was not privy to the thinking behind this behaviour in python, and I would like some input from someone who's done this before ;)11:25
dimiternrogpeppe: dns name allocation is also supported somewhat, but it's a different API call and likely to be similar to how floating IPs are assigned11:26
fwereaderogpeppe, yeah, why does it have to be DNSName()? is it not SomeStringThatWillGetYouToTheInstance()?11:26
rogpeppefwereade: well, it's SomeStringThatWillGetYouTotheInstanceFromSomewhere() :-)11:27
fwereaderogpeppe, ha, yeah11:27
rogpeppefwereade: and it's the "somewhere" that we can't easily second guess11:27
dimiternrogpeppe: I was thinking about that :)11:27
fwereadedimitern, what time's your standup again?11:27
dimiternfwereade: now11:28
fwereadedimitern, please ask mgz then, and we shall reconvene shortly?11:29
dimiternfwereade: sure, once he comes round11:32
fwereadedimitern, cool11:32
mgzdimitern: hey11:33
* mgz reads discussion11:34
jammramm: we're mumbling if you want to unmute11:34
mrammcool be on in 1 min11:35
jammramm: you were echoing11:36
mgzso, for now returning whatever you can (by the logic from Python) for DNSName will get things working11:40
rogpeppefwereade: ping11:49
fwereaderogpeppe, pong11:49
rogpeppefwereade: i'm looking at auth stuff11:49
rogpeppefwereade: and wondering about the "admin" of SetAdminPassword11:49
rogpeppefwereade: i'm wondering if it might be more appropriate if the "admin" was actually "client"11:49
rogpeppefwereade: because Admin sounds like it has superuser properties, but i don't think that's what we want to give it11:50
fwereaderogpeppe, -1, I think we will before too long have to worry about other users with fewer privileges11:50
rogpeppefwereade: indeed, and i think that "client" can more easily mutate into other usernames11:51
fwereaderogpeppe, who should have those privileges if not whoever set up the environment?11:51
rogpeppefwereade: i'm not sure that anyone has all the privileges11:51
fwereaderogpeppe, this may be something we need a call to cover properly11:51
rogpeppefwereade: for instance, i don't think we want to enable a dodgy admin to act as a uniter11:51
fwereaderogpeppe, ok -- but I think whoever set up the environment should have all applicable privileges on that environment -- and "admin" seems to fit that better than just "client" which is IMO way too generi11:52
fwereaderogpeppe, at least we're not calling them "root" ;011:53
fwereaderogpeppe, btw, we don't have any ssh proxy support in state.Open, do we..?11:53
rogpeppefwereade: i'm also looking at it from the perspective of the actual mechanics of logging in. here's the code i currently have: http://paste.ubuntu.com/1585690/11:53
rogpeppefwereade: no. do we want it?11:54
fwereaderogpeppe, given what mgz said above, yes, probably, if we want canonistack to work11:54
rogpeppefwereade: where would the proxy live?11:54
fwereaderogpeppe, you ssh into canonistack instances via chinstrap AIUI11:55
rogpeppefwereade: the question wrt the above code is: what underlying type does State.Entity return when EntityName=="admin" ?11:55
* rogpeppe hasn't heard of chinstrap11:55
fwereaderogpeppe, IMO we need a state.User11:56
rogpeppefwereade: i think setting passwords directly on the applicable entities is fine. but we may need state.User too11:56
fwereaderogpeppe, I'm 90% sure we need a state.User, but I need to talk to you about it11:57
fwereaderogpeppe, I imagine it would have worked transparently when we were using SSH directly, because everybody would have had their proxies set up11:57
rogpeppefwereade: what is chinstrap?11:58
rogpeppefwereade: ah, it's a machine!11:58
rogpeppefwereade: we don't need ssh proxying, just a straightforward tcp tunnel11:58
rogpeppes/tunnel/forwarder/11:58
rogpeppefwereade: but maybe sshd can provide that.11:59
fwereaderogpeppe, just realised I need to eat before team meeting12:00
rogpeppefwereade: ok, enjoy12:00
fwereadebbiab :)12:00
=== TheRealMue is now known as TheMue
wallyworld_jam: i'm trying to lbox submit those branches and the very first one is failing with a sad gofmt, complaining about a file which doesn't even exist. have you seen that before?12:31
rogpeppewallyworld_: that sounds a bit weird. if gofmt is talking about a file, i'm pretty sure it must be there.12:49
rogpeppewallyworld_: have you tried go fmt ./... from the project root?12:49
wallyworld_yeah, tell me about it. but 'ls' says otherwise12:49
wallyworld_yep, no issues12:49
rogpeppewallyworld_: try running the same command as lbox does: find * -name '*.go' | xargs gofmt -l12:50
rogpeppewallyworld_: and see if it prints anything12:50
wallyworld_yeah, did that too12:50
wallyworld_let me see what it said12:50
wallyworld_no output, so happy12:51
wallyworld_yet lbox submit complains12:51
wallyworld_i did wipe my local go bin dir and did a go install launchpad/net/lbox earlier12:51
rogpeppewallyworld_: try putting a debug statement in .lbox.check to see if it's actually running; and include the value of $BADFMT too.12:52
rogpeppes/a debug/an echo/12:52
wallyworld_yep, will do12:53
wallyworld_ah, complains branch is not clean, i'll have to comment out that bit12:54
rogpeppewallyworld_: just commit it...12:54
rogpeppewallyworld_: (then revert it later)12:54
wallyworld_ok12:55
wallyworld_hmmm. my echo wasn't printed12:57
wallyworld_now i'm confused12:57
rogpeppewallyworld_: sanity check failed :-)12:57
wallyworld_yeah, but that's not something i expected to fail, it's just worked previously12:58
wallyworld_and yet something is running go fmt12:58
rogpeppewallyworld_: that's what sanity checks are all about :-)12:58
rogpeppewallyworld_: more: something is saying "gofmt is sad", right?12:59
wallyworld_yes12:59
rogpeppewallyworld_: which means *a* lbox.check script is running, from somewhere...12:59
wallyworld_for a non existant file12:59
wallyworld_yeah, i'll have to try and track it down12:59
rogpeppewallyworld_: how about running lbox --versose --debug ?12:59
rogpeppes/versose/verbose/12:59
jampoke for our hangout?12:59
wallyworld_good idea, didn't realise those optins were there13:00
rogpeppeon my way13:00
* fwereade joins13:00
TheMuehangout link?13:01
jammgz: poke for the hangout13:01
jamhttps://plus.google.com/hangouts/_/33acfc2c8af8792568274fa110371db956f9fde713:02
jamw7z: https://plus.google.com/hangouts/_/33acfc2c8af8792568274fa110371db956f9fde713:02
rogpeppeniemeyer: meeting?13:05
niemeyerrogpeppe: Sorry, yep13:11
wallyworld_rogpeppe: figured it out - jam's fault :-P13:11
wallyworld_sad go fmt file in trunk which was not there when i started my branch13:12
jamwallyworld_: I'm willing to take the blame, I accidentally committed something directly that I was trying to submit via botd13:16
jamsorry about that.13:16
wallyworld_np13:16
wallyworld_jam: i've submitted my stuff, needing to merge trunk (and hence your changes) first. there were some conflicts which i think i've done correctly. but it would be cool if you could check13:28
rogpeppefwereade: i'm just considering adding a user api to the state. we'd use it for admin only to start with, but potentially expandable in several directions. what do think of this? http://paste.ubuntu.com/1585936/13:56
fwereaderogpeppe, that looks roughly sane, I'll want to have a call again in a bit but my brain is currently a touch overloaded14:06
rogpeppefwereade: np!14:06
dimiternrogpeppe, wallyworld: follow-up https://codereview.appspot.com/722805814:38
mgzrogpeppe: what was your trick for doing an initial codereview thing? I can just propose current trunk against an empty (or r1) branch for the current state to come up in diff, for instance14:39
=== slank_away is now known as slank
* niemeyer => lunch15:08
dimiternrogpeppe, mgz: follow-up on https://codereview.appspot.com/7241045/15:10
mgzdimitern: looking15:16
mgz...I still don't like this struct-list-test+loop thing15:41
dimiternmgz: well, I like it more each time :) so compact and expressive15:42
mgzit's longer than the original!15:43
dimiternmgz: it's not yes, I changed it as we discussed - use public if available, otherwise use the private - as a compromise15:43
dimiternmgz: aah longer15:44
mgzeach test in python is 5-7 lines, with pretty formatting15:44
mgzand that's the *complete* test15:44
mgznot just a test definition that then needs overly complicated testing code that lives somewhere off the page15:44
dimiternmgz: anyway it does what's supposed and it's easy to extend, etc.15:44
mgzeach of these definitions is 8 lines, and that's without any test code, or the struct defintion15:45
mgzit's harder to do particular customisations for special cases though15:45
mgzyou'd end up having to add a new field to your struct as a marker15:45
dimiternmgz: it's definitely shorter than individual test case methods + comments for each15:46
mgzadd that to the each struct constructor (or used the named param idiom), and then special case that in the testing codde15:46
mgzyeah, because there are no comments15:46
mgzso, you've no idea what the expected result is...15:46
mgzanyway, looks fine apart from me disliking the style (which is idiomatic here, so correct for you to do...)15:47
dimiternmgz: ok :) is it LGTM then?15:48
mgzsec, hitting m shortly15:48
fwereadeok gents, I've been on since 6am and I'm a bit fried now; I'll probably swing by later, but I'm off to decompress for a bit15:50
mgzdimitern: okay, get landing :)15:53
mgzhave a nice rest fwereade :)15:53
dimiternmgz: cheers15:53
dimiternrogpeppe: sorry I missed your last comments, will do a follow-up CL16:17
rogpeppedimitern: np16:17
rogpeppedimitern: just makes the docs look a bit more professional, i think16:18
dimiternrogpeppe: yeah, I agree - wasn't sure if using func-style comments for struct fields is ok16:18
rogpeppedimitern: it's not always done, but i think it looks better when it is. particularly when some are longer.16:19
dimiternrogpeppe: yes, if it's a whole line, rather than a short one at the end of the line16:20
rogpeppedimitern: yeah.16:21
dimiternrogpeppe: and here it is: https://codereview.appspot.com/723505816:30
rogpeppedimitern: LGTM with one typo16:32
dimiternrogpeppe: cheers16:32
TheMueYeah, build of Juju on OS X works. Will test it later.17:11
rogpeppea CL to review, if anyone fancies, nothing too onerous: https://codereview.appspot.com/7226056/17:30
rogpeppethat's me for the day18:04
rogpeppeg'night all!18:04

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