/srv/irclogs.ubuntu.com/2014/01/08/#juju-dev.txt

thumperdavecheney: got a  golang question00:00
thumperdavecheney: I have a slice of structures back from the api client00:00
thumperdavecheney: and I want to serialize these out using either json or yaml00:00
thumperbut I want some of the fields to be omitted if empty or zero00:00
thumperbut I don't want to annotate the structure in the api00:00
thumperas it doesn't care about serialization00:01
thumperhow can I handle this sanely?00:01
davecheney...00:07
davecheneythumper: as i understand it, you use a tag on the struct00:07
davecheneyif you don't want to do that, then maybe write something that takes the struct, and returns a map00:07
thumperbut I don't want to annotate the struct00:07
thumperhmm...00:07
davecheneyso you can elide the fields you don't want to seralise00:07
davecheneywhy don't you want to annotate the struct00:07
davecheneythat is like saying 'i want to drive to town', but I don't want to use a car00:08
thumperbecause I think it is messy and detracts from the intent00:08
davecheneyok then00:08
thumperbut if it is the simplest way, I'll just leave a mess00:08
davecheneybut then you can't complain that this isn't super easy00:08
thumperI just think it would be nice for golang to support decoupling this00:08
davecheneywrite a function that takes the struct and returns a map with the fields you want to jsonise00:09
* thumper vomits a little into his mouth00:09
* thumper goes to annotate the struct00:09
davecheneythumper: why are you complainin00:10
thumperdavecheney: actually...00:10
davecheneythe json package suppors exactly what you want to do00:10
davecheneybut you don't want to use it00:10
thumperdavecheney: how does the default serialization handle embedded structs?00:10
davecheneyand this is somehow the json package's fault ?00:10
davecheneythumper: from memory, as if they were collapsed into the main struct00:11
thumperhmm...00:11
* thumper writes a function00:11
thumperI think it is cleaner00:11
davecheneyafaik it is like a depth first traversal00:11
davecheneytype t struct { a int; b int; C; d int }00:11
davecheneyorder goes00:11
davecheneya, b, C.something, C.something else, d00:12
davecheneya, b and d sohuld be upper case in that example00:12
* thumper nods00:14
thumperahh poo00:57
thumperwallyworld_: your authentication worker is killing my local provider00:58
wallyworld_really?01:00
wallyworld_in what way?01:01
thumperwallyworld_: http://paste.ubuntu.com/6712278/01:03
thumperwallyworld_: I don't have an ubuntu user01:03
wallyworld_whereas nodes in the cloud do01:04
thumperaye01:04
wallyworld_bollocks01:04
wallyworld_hmmm01:04
thumperI wonder if we should just skip it for machine 0 on the local provider01:04
thumperlocal provider is a little special for machine 001:05
wallyworld_easiest solution for now01:05
* thumper nods01:05
thumpercare to work something up with that?01:05
wallyworld_i've got a bunch of stuff in progess01:05
thumperI'm debugging my run stuff01:05
thumper..01:05
wallyworld_just a sec, door knock01:05
thumperhmm01:05
wallyworld_thumper: can it wait till tomorrow? or is it blocking you?01:07
thumperwallyworld_: it doesn't appear to be blocking01:07
thumperso I'm just going to hide those error messages for now01:07
wallyworld_ok, but if it does need attention before tomorrow, let me know01:07
thumperI've hacked up a branch ti not start it, as hiding the errors wasn't going to cut it01:20
thumperhow can I easily poke (as in read) the internal mongo state?01:40
axwfor what purpose?01:40
wallyworld_you can get at the various collections off the state object, and query those directly01:42
thumperfrom a shell, I want to poke into the mongo db to read bits01:44
axwthumper: mongo --ssl -u admin -p <admin-secret> localhost:37017/admin01:48
axwthen "use juju"01:48
thumperhmm... auth fails01:53
thumperI tried the admin secret from the environments file01:53
thumperthis is for the local provider01:53
axwfrom .jenv?01:53
thumperno01:53
axw.jenv is what gets used, would be best to check that they're the same01:54
axwtho I thought it got carried over01:54
thumperaxw: it is the same...01:54
axwhmk01:54
thumperoh go...03:16
* thumper sighs03:16
* thumper gets bitten by variable capture of anonymous function inside a loop03:16
jammgz: poke10:47
=== gary_poster|away is now known as gary_poster
bacmorning jcastro14:31
bacjcastro: adding a couple of bullets is easy. you got the text?  would rather do this just once.14:44
jcastroyeah14:47
jcastroit's what I sent to the list earlier this week14:47
jcastrolet me find it14:47
jcastrohttps://lists.ubuntu.com/archives/juju/2014-January/003347.html14:48
bacjcastro: thanks.  will do it right now.14:49
jcastrook14:50
dstroppamerge proposal for Joyent Provider: https://code.launchpad.net/~dstroppa/juju-core/joyent-provider-storage/+merge/20085115:19
dstroppaand https://codereview.appspot.com/49050044/15:19
mgzthis one does depend on the new gojoyent library, if I could get someone else to have a look at that mp as well that'd be really great15:30
natefinchSomeone needs to write a DeepDiff for use in tests instead of DeepEquals.  Expected: <wall of text>  Obtained: <very slightly different wall of text> is unhelpful.  :/16:48
mgz:)16:48
=== negronjl_ is now known as negronjl
natefinchwonder if it would work to just pipe the output of deep equals into a textual diff16:50
jcastrohi guys18:46
jcastrohttp://pastebin.ubuntu.com/6716390/18:46
jcastroI have set default-series: precise for this environment18:46
jcastroand it seems to ignore it? In addition to the error18:47
natefinchjcastro: sorry, have been heads-down... did you figure anything out?19:27
jcastroI found AWS works. :)19:27
natefinchjcastro: local is tricky19:27
jcastronatefinch, ok I was just debating whether to file a bug19:40
jcastroor if you guys knew it was broken in trusty already19:40
* rogpeppe is done19:41
rogpeppeg'night all19:41
natefinchrogpeppe: time for a very quick question?19:44
natefinchmorning thumper20:00
thumpermorning20:00
thumperoops20:06
thumperleft my amazon environment up last night20:06
thumperonly four machines20:06
thumpernatefinch: do you know if fwereade is back at work?20:06
natefinchthumper: travelling today I bevieve20:08
natefinchthumper: did you hear about my $2000 AWS bill for last month?20:08
thumperno...20:08
thumperouch20:08
thumperwhat happened there?20:08
natefinchthumper: was twiddling with AWS Web gui, since I was having trouble getting juju to bring up the instance type I wanted.  Don't rmemeber why, but I was in US-West when I normally do stuff in US-East20:09
natefinchthumper: left up a large dedicated instance all month (dedicated evidently means $2 / hour)20:09
natefinchthumper: because it was in West, and I normally look at east, I didn't even see it20:10
thumperdamn20:10
natefinchthumper: Called Amazon, luckily they were really nice about it, saw I didn't access it all month and after a couple days told me they'd waive the fee20:10
thumpernice20:12
natefinchthumper:  Found out there's some nice notifications you can set up to email you if it looks like you're going over a certain amount for your monthly bill.  I set that right up, let me tell you.20:14
thumpernatefinch: can you please email that to the juju-dev list?20:14
thumperI'd like to know20:14
natefinchthumper: sure ting20:14
natefinchthumper: had actually thought I should, but got bogged down in other things.  Definitely a good thing to keep us from similar infractions.20:15
* thumper nods20:18
jcastrohey thumper20:24
jcastrohttp://pastebin.ubuntu.com/6716390/20:24
thumperhi jcastro20:24
jcastroI can't get local working on trusty.20:24
thumper?!20:25
jcastroI know right!20:25
marcoceppi_jcastro: installing edge os releases? y u no compile juju from trunk20:25
thumperjcastro: can you run lxc-ls yourself?20:25
thumpero/ marcoceppi_20:25
jcastrothumper, ah, no I can't, so probably an lxc problem20:26
marcoceppi_\o thumper20:26
jcastrothat just manifests in juju?20:26
* thumper nods20:26
thumperjcastro: we just use the lxc command line20:26
jcastroack20:26
thumperif they aren't working, we are screwed20:26
jcastroI'll go hunt down someone on server20:26
thumperkk20:26
thumperyou know who to chase?20:26
marcoceppi_serge?20:26
thumperaye20:26
thumperhe'd be my first target :)20:26
thumperjcastro: perhaps I should upgrade to trusty?20:27
thumperwith saucy, no devs were running it until just before release20:27
thumperso issues came late20:28
natefinchthumper: it's a good point.   Roger's on Trusty, but I think that's it AFAIK20:28
jcastroyeah so we were just discussing this in our call20:28
jcastrothumper, also20:29
jcastroit looks like it tried to spawn a trusty image even though I set series in environments.yaml as precise20:29
thumperjcastro: machine 0 is your machine20:30
thumperand not a container20:30
thumperthe host20:30
jcastrooh, right, the bootstrap is always the host os!20:30
thumperjcastro: did you sudo bootstrap?20:41
jcastroyeah20:41
jcastrooh dude, did non-needing-sudo-bootstrap land and I not know about it?20:41
thumperno20:42
* thumper thinks20:42
thumperjcastro: I'm thinking...20:42
rogpeppenatefinch: what was your question?20:42
thumperjcastro: perhaps the behaviour changed20:42
thumperjcastro: luckily now we have status doing everything in the api server20:43
thumperin the past, it was doing some of the processing locally20:43
thumperso status would try to iterate...20:43
natefinchrogpeppe: you had secondaries stuck in StartupState2, I'm seeing that now... how did you fix it?20:43
thumperjcastro: try this for me: sudu juju status20:43
* thumper wonders if that'll work20:43
jcastrothumper, ok give me a few minutes, accidentally bootstrapped into AWS20:44
thumperjcastro: also, can I get you to try with trunk?20:47
jcastrook so sudo juju status works20:48
jcastrothumper, is there a guide/instructions for how to build trunk?20:49
thumperjcastro: I'm guessing that lxc-ls used to work on saucy without sudo20:50
thumperjcastro: but in trusty it doesn't20:50
jcastrothat seems so20:50
thumpernatefinch: do you know if the 1.17 dev build contains the status in api?20:50
thumperjcastro: which juju version?20:50
jcastro1.16.5-trusty-amd6420:51
thumperjcastro: can you try the 1.17 version from the ppa?20:51
thumpersaves building it20:52
natefinchthumper: I was pretty sure status was pretty recently done, so I would expect not?  But I forget20:52
thumpernatefinch: I think dimiter got it in before christmas20:52
thumperand 1.17 was released after taht20:52
jcastrothumper, I can, should I wait to see what stgraber has to say about lxc-ls?20:52
thumperjcastro: I'm 91% certain this is the issue20:52
jcastrook20:52
jcastroGoing for it20:52
natefinchthumper: releases are for people who actually use juju.  As a developer, I try to be above such things. ;)20:52
thumpernatefinch: obviously I build trunk too :)20:53
=== hatch_ is now known as hatch
rogpeppenatefinch: if you wait, it goes from StartUp2 to Recovering and then to Secondary20:54
rogpeppenatefinch: takes about 30s for me20:55
jcastrojorge@jilldactyl:~$ sudo juju bootstrap20:55
jcastroERROR Get http://10.0.3.1:8040/provider-state: dial tcp 10.0.3.1:8040: connection refused20:55
natefinchrogpeppe: hmm.... waited 120 seconds, figured that would probably do it.  maybe I'm doing someting wrong20:55
rogpeppenatefinch: did you add the keyfile stuff?20:55
natefinchrogpeppe: oh yeah... no, I did not20:56
natefinchrogpeppe: remind me what that is again?  my brain is pretty fried20:56
rogpeppenatefinch: it can be worth changing the mongo instance stuff so that it logs messages printed by mongo20:56
natefinchrogpeppe: probably, yeah20:56
jcastrothumper, serge and stgraber confirm you need sudo for lxc-ls20:59
jcastrobut now I get this crazy connection refused business20:59
thumperjcastro: really nice of them to let us know that they are changing behaviour...21:00
thumperat least trunk works...21:00
natefinchrogpeppe: ahh - you mean make them all use the same ssl keyFile?21:00
rogpeppenatefinch: here's some diffs: http://paste.ubuntu.com/6717106/21:00
jcastrothumper, hey so I think we dodged a bullet, other than me wasting an hour21:00
rogpeppenatefinch: yeah21:00
jcastrothumper, aka maybe some of you guys should start testing on trusty?21:01
rogpepperight, i'm not here :-)21:01
thumperjcastro: I'll bring it up at the meeting tonight21:01
jcastrothumper, final release is 99 days, so 3 months "feels" right imo21:02
jcastroway better than 2 cycles ago. :)21:02
thumperjcastro: what do you mean "feels" right?21:02
thumperjcastro: as in, start using trusty?21:02
jcastroyeah21:03
jcastrothumper, your 91% is correct21:10
jcastrowith 1.17 it works fine21:11
jcastrosinzui, is 1.17 going into trusty or one after that?21:13
sinzuijcastro, we are trying to avoid putting unstable juju into trusty. trusty users can subscribe to the devel ppa21:14
jcastrook21:14
jcastrobut local is broken with 1.16.5 in trusty21:14
sinzuiLots more is broken in 1.17.0...it doesn't work with existing 1.16.5 deployments21:15
jcastroheh, awesome21:15
sinzuijcastro, 1.18 will be available in a few weeks, this Month21:15
jcastrook21:16
jcastroI'll send a warning to the list21:16
jcastrothis really only effects people testing during the audit21:17
sinzuijcastro, how is 1.16.5 on trusty?21:19
jcastroI didn't get past the status21:19
jcastrosinzui, I'll ask for feedback while I am at it!21:20
sinzuijcastro, It works for me. It did this morning and it does for me now21:20
thumpersinzui: what version of juju are you running?21:21
jcastrohttp://pastebin.ubuntu.com/6716390/21:21
jcastroyou don't get that?21:21
sinzui1.16.5 and 1.17.0 I switch through out the day as needed21:21
sinzuiI have been on trusty Since November21:21
jcastroare you up to date today?21:21
sinzuijcastro, No I don't21:22
sinzuijcastro, in fact http://pastebin.ubuntu.com/6717232/ status is the same as running it with sudo, which wan't true under saucy21:24
sinzuiI can see the machines with trusty+1.16.521:24
jcastrohuh, so what just happened to me then21:25
sinzuijcastro, do you need to do the dance of checking that the /var/lib/lxc/* is sane, that cloud-init images are fresh, and that the juju local dir is sane? I still need to manually remove lxc container from time to time because destroy-env doesn't21:27
jcastrohuh, cloud image is from 5 december21:29
jcastroI'll keep an eye out wrt. clean up though21:30
jcastroI thought we had fixed that21:30
thumperI thought we had too21:30
jcastrothumper, ooh, forcing me to explicitly mention the environment before I destroy is very nice21:35
natefinchjcastro: I did that.  Glad you like it :)21:36
thumperjcastro: less likely to destroy production now :)21:36
jcastrowell done!21:36
jcastroI also like the switch mention21:36
jcastroamazon -> local21:36
jcastrothat's nice too21:36
* natefinch is going to name his production environment DONT_DESTROY_ME____SERIOUSLY21:36
jcastroIF_ITS_FRIDAY_DO_NOT_TOUCH21:38
natefinchlol21:38
marcoceppi_hey, where do you guys install lbox from?21:47
thumperamrwe build it :-)22:06
thumpermarcoceppi_: we build it22:06
marcoceppi_thumper: cool adding /usr/lib/go/bin to my path now22:07
jcastrothumper, a "how to build and run juju from source" page on the docs wouldn't be a bad idea22:07
thumperjcastro: sounds like a good idea22:08
* thumper wishes for list comprehension in golang again22:09
marcoceppi_thumper: for plugins, if I run `juju help charm proof` will juju pass the additional arguments to the plugin in addition to the --help flag?22:10
jcastrothumper, that was a snarky way of assigning something to you. :p22:10
* thumper dodges that bullet22:11
thumpermarcoceppi_: no, I don't think so22:12
marcoceppi_thumper: cool, jw22:12
marcoceppi_How do you guys log in with your @canonical.com addresses to codereview from lbox? I keep getting authentication denied22:53
thumperum...22:56
thumpermarcoceppi_: do you have the email address you are trying linked with your launchpad account?22:56
thumpermarcoceppi_: at some stage I had a real password on that email address stored with google22:57
thumperand that is what I use to authenticate22:57
thumperI've lost track of how I set that up22:57
marcoceppi_thumper: I'll give that a go22:57
wallyworld_thumper: i've added some code to not start the auth worker for local provider. but there's no easy way to test it that i can see22:59
thumperwallyworld_: no, probably not...22:59
thumperI don't know how to help with that bit22:59
wallyworld_i'll just propose as is and you can review?23:00
wallyworld_i don't think we test for the other local provider hackery23:00
wallyworld_thumper: https://codereview.appspot.com/49340043   i think i did the correct thing23:10
wallyworld_thumper: the auth worker runs on all nodes, not just bootstrap23:17
thumperwallyworld_: I know, but we only want it to not work on the bootstrap23:18
thumperthe other nodes are fine23:18
wallyworld_ah ok23:18
wallyworld_and i do recall ubuntu user created for null provider, so i'll tweak the check23:18
thumperOMG!!!23:26
thumperour tests suck23:27
thumperFFS23:27
* thumper tries to work out how to unfuck this test23:27
* thumper takes a deep breath as he realises it is his fault23:28
* thumper is heading out to lunch with his birthday girl + rest of the family23:39
thumperbbl23:39

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