/srv/irclogs.ubuntu.com/2016/06/06/#cloud-init.txt

cpaelzersmoser: already around?11:20
cpaelzersmoser: while the former two quesitons are solved by time, I would still ahve another if you are around12:18
smosercpaelzer, here now.13:22
smoserwhat sup?13:22
cpaelzerhiho13:23
cpaelzerI'm testing more nd more regarding the cloud-init issue you reported due to my merge13:23
cpaelzermost things are done, I found a few on top thou13:23
cpaelzerworking on these, but that was not the question13:23
cpaelzerat some point I'll have to throw it into a adt or ppa to test if it works there as well13:23
cpaelzersince packaging isn't in the repo's itself I wondered what the recommended way is to do so13:24
cpaelzerI mean there are many ways13:24
cpaelzerpull-lp-source - merge a bzr tree in13:24
cpaelzerbzr tree and merge a debian dir into that13:24
cpaelzeror something totally different13:24
cpaelzerI assume you don't do that manually each timne, so I wanted to know which way I should go to test ppa/adt builds13:24
cpaelzersmoser: ^^13:25
smosercpaelzer, right. need to test building in ppa.13:25
smoser ./packages/bddeb13:26
smoserit hsa --help, but largely i'd run:13:26
smoser ./packages/bddeb -S13:26
smoserthen13:26
smoser sbuild ...13:26
cpaelzer  /packages/bddeb -S gievs a .dsc and a orig tarball then?13:27
* cpaelzer is reading bddeb ...13:27
smoseryeah, it uses bzr export to get a .orig and then goes from there.13:27
cpaelzerok nice, then I can hit these stages once I fixed a corner case of the keyserver issues13:28
cpaelzersmoser: btw I also made sure I port fixes I did this way between curtin/cloud-init as I work on the same code for both13:28
cpaelzerso I hope to end the day with an update to the curtin MP and a new cloud-init MP13:28
smoserok. great.13:29
GivenToCodehi i have a custom cfg in /etc/cloud/cloud.cfg.d that specifies an fs_setup to mkfs ext4 on ephemeral0 (ec2), however on c3 instances types we get an error in the log that /dev/xvdb is already mounted when trying to mkfs...13:50
GivenToCodethis is 0.7.5-0ubuntu1.1813:50
GivenToCodeI would expect fs_setup to run before any mounting, right?13:51
GivenToCodethere is an entry for xvdb in fstab, and I've tried to override that by specifying a mounts [ ephemeral0, null ]13:52
cpaelzerGivenToCode: yes it should set up fs_setup things before the mount step of cloud-init14:11
cpaelzerGivenToCode: but I'd wonder if something else could mount it even before14:11
cpaelzerGivenToCode: depending on you influence to this environemnt you could add in your .cfg commant to check the status early on14:11
cpaelzerGivenToCode: like early_commands: checkmounts: 'mount'14:12
cpaelzerand then check that output if it really is mounted at the beginning14:13
cpaelzercpaelzer: sorry I'm mixing up things here - let me rethink14:14
cpaelzerwriting too muhc curtin / cloud-init code at the same time - that would have been the curtin answer14:14
cpaelzerGivenToCode: doc/examples/cloud-config-boot-cmds.txt should be better14:15
cpaelzerGivenToCode: if you prefer an url http://cloudinit.readthedocs.io/en/latest/topics/examples.html#run-commands-on-first-boot14:17
cpaelzersmoser: did the mirrorlist issues (the last one you added the skipif for) happen to you in sbuild as well, or only in the buildd's?14:49
smosercpaelzer, no. only in a buildd14:50
smosercpaelzer, but think about it working on centos14:50
cpaelzersmoser: k, thx - setting up a victim ppa then14:50
smoserwe want unit tests to work there.14:50
cpaelzersmoser: I already have14:50
smoserok.14:50
smoseri maeant to tell you this...14:50
smoserthere is a 'FilesystemMocking' class14:50
smoseror somethignt14:50
cpaelzersmoser: I already covered that - at least I think so :-)14:50
smoseraht basically mocks all fsreads.14:51
smoserto another directory that you can popoulate14:51
cpaelzersmoser: for this in particular it doesn't need a fs mocking class14:51
smoserok. thats fine.14:51
cpaelzerthe feature of influencing apt environment is very very ubuntu/debian specific14:51
cpaelzerso are the tests14:51
cpaelzerbut that can be nicely done with a skipIF to the apt binary14:51
cpaelzerI covered this and more and you can take a look once it is mature enough for a merge proposal14:52
cpaelzerfor now I seem to uncover further issues faster than I like and EOD is coming closer ...14:52
cpaelzer:-/14:52
smosercpaelzer, i dont know..14:53
smoserit is in fact debian/ubuntu specific14:53
smoserbut that does not mean the unit tests should not run elsewhere.14:53
cpaelzerfor the start I'd like to disable things so they work properly14:54
cpaelzerover time one can (r not) commit the time to enable this on more environments14:55
cpaelzerthat is what I'd prefer14:55
cpaelzerI feel to postpone too much as I try to get this done - so I wouldn't add a centos env test to the task list right now14:55
cpaelzerbut you are right overall - you want a centos dev on cloudinit to see when he breaks things14:56
smoserwell, thats fine. but generally speaking the failure i saw was from either a file existing or not existing (or a directory or something)14:56
smoseri'm not really sure14:56
smoserand the fact that that exists or does not exist is somethign that would ideally be covered by the unit test14:56
smoserwhich should not require the system its running on to be in a given state14:56
cpaelzerah that one - it is a file delivered by cloud-init itself, and we don't check if the file exists14:57
cpaelzerwe check if cloud-init "checks" if the file exists14:57
cpaelzerbecause that is the code path that it should take and that is what the unit test does14:57
cpaelzerthe file doesn't exist on my system either14:57
cpaelzerbut the test works14:57
cpaelzerwhat happens there is the issue in find_apt_mirror_info that I need to debug in the ppa environment, because I can't see locally what is breaking14:58
cpaelzeran issue in that function causes the one you have seen as follow on error14:58
smoserright. there is a build logo from an existing one if you wantd.14:58
cpaelzerI have checked the two logs you linked14:58
smoseryah. ok.14:59
cpaelzerbut I need more debug data on it14:59
smoseryou're doing well,. sorry to sound like i'm giving you flack14:59
cpaelzerfor now I'm unhappy wit hthe gpg key things - I wanted to fix them right14:59
smoseryou wrote a bunch of test cases for stuff that wasnt' tested and fixed a bunch of stuff and there was fallout14:59
smoserthe first part is +10014:59
smoser)14:59
cpaelzerI'm fine and we will make it good :-)14:59
cpaelzerthanks14:59
smoserthe second part is admittedly *my* fault and cloud-init fault for accepting your MP before it built in a ppa14:59
smoser:)14:59
cpaelzerso I added a nice fallback in case network is unavailable - but it will use real network if it is available14:59
cpaelzerunfortunately now that is "can" work it complains in sbuild envs for things that are not writable15:00
cpaelzerwill get it done ...15:00
smoserplease dont depend on presense of a keyserver15:00
cpaelzerjust gets a longer and longer task :-)15:00
smoserthose things really suck15:00
cpaelzersmoser: thats what I ment - I don't DEPEND anymore, but IF I can reach it properly I do15:00
smoserthat will cause arbitrary failures15:00
cpaelzerand if I can't reach it, it has a fallback that works15:00
cpaelzerso the test is happy with and without keyserver15:01
cpaelzerit even works with broken keyservers or random dns names15:01
cpaelzerbut IF it works it just is closer to the real thing15:01
cpaelzerwhich isn't bad for a unit test15:01
smoseri was honestly fairly OK with not unit testing that shell blob. and prefer that to cloud-init's unit tests mucking with my .gpg dir15:01
cpaelzerhehe15:02
cpaelzerit isn't a shell blob anymore15:02
cpaelzer:-)15:02
smoserok. but i still would really rather it not ever modify my .gpg dir15:02
cpaelzerthatr with the .gpg dir is what I have to tackle next15:02
cpaelzerfor sbuild env anyway15:02
cpaelzersmoser: so you tihnk it is ok to throw parts away and mock that side of things?15:02
cpaelzerok, I can do that - that will throw away some code that cost me some sweat today, but it was good for the learning still15:03
cpaelzerat least we got the shell blob to become python as you wanted as well, thanks to a nice suggestion of rharper and some polishing I did15:06
rharpercpaelzer: nice15:07
cpaelzerI think with the plan to not mess around with .gpg at all in the tests I won't complete it today anyway15:07
cpaelzersmoser: do you mind if it is tomorrow and not today that you get the next MP revision?15:07
rharperyeah, I'd be very dubious of relying on a .gpg dir15:07
rharperrather a tmpdir and export GPG var to point to it15:08
rharpercertainly GPG will check ENV for that location15:08
cpaelzerrharper: it has an argument15:08
cpaelzerrharper: just need to find a way to insert that into the subp's15:08
cpaelzerI still want to test the original code and not mock it all15:08
rharpersure, lemme see if I've example of setting env for subp15:09
smoseryou can just mock the output of gpg15:09
smosercapture that call really is i think the right way to do it.15:09
cpaelzerI'd mock the gpg calls but then assert on them to make sure they were poked the right way15:10
smoserhonestly, mocking the call to that shell blob as i did, we have 2 lines of untested code out of that.15:10
smoserand no mucking with your .gpg15:10
cpaelzermucking vs mocking :-P15:10
smoserfor code that hasnt changed and worked fine for 4 years (except for arguably invalid user input)15:10
smoserbasically, i dont want you to spend a bunch of time making sure we get test coverage on that.15:11
cpaelzerok15:11
cpaelzerI'll try to mock it then and get it working tomorrow15:11
rharpercpaelzer: Popen takes a env= param; that's not exposed in subp IIRC, but one could,  then myenv = os.environ_copy(), and myenv[VAR]=VAL , pass env=myenv;15:12
cpaelzerrharper: thanks for checking, but given the requirements - for now - I'd go with smoser and "just" mock some things15:12
rharperyep15:12
smosersubp takes env also.15:14
smoseryeah.15:14
rharpernice15:24
GivenToCodecpaelzer, yes something is mounting everything in fstab before fs_setup, we don't have anything custom running before cloud-init15:24
GivenToCodeok, i think the fix is to remove it from fstab when we bake the image15:38
ajorgsmoser: Can I submit GitHub pull requests instead of bzr branches for contributions?15:59
smoserajorg, wont be github pull requests. but launchpad git pull requests should be shortly.16:02
smoserajorg, basically upstream code path will still be launchpad but revision control in git16:02
ajorgokay, I'll try to learn bzr for today and maybe leave some of our more interesting patches for when git is available.16:02
ajorgIf I did a terrible job of preparing this, it would be good to correct me now as I have several more patches I'll be trying to submit this week: https://code.launchpad.net/~ajorgens/cloud-init/python26/+merge/29657516:08
smoserajorg, that looks fine. i'm really sorry about regressing 2.6 function16:09
ajorgThanks.16:09
ajorgBy way of introduction, I'm the cloud-init maintainer at AWS.16:09
ajorg(for the Amazon Linux AMI)16:09
ajorgWe have a feature or two, several bugfixes, and a bunch of backward compatibility stuff for our 0.5 fork from before Yum / RPM were supported.16:10
ajorgI'd like to upstream whatever parts are palatable.16:11
smoserwe need to get some c-i in place that can test on a 2.6.  the thing that makes it hard is that there is actally not even a python2.6 *available* in a supported ubuntu release (12.04 shipped 2.7)16:11
ajorgAnything I can do to get that in place?16:11
ajorgCentOS 6 testing would be prudent, and would cover 2.616:12
smoserharlowja_at_home, has mentioned some options with his remote_tox16:12
ajorgcool16:12
smoserbut yeah, we need to get this stuff in place.16:12
harlowja_at_homehttps://github.com/harlowja/remote_tox ifu care16:12
smoserdict comprehension is just so nice16:13
smoseri think thats the right word16:13
ajorgI know!16:13
smoser{a:b for a, b in d.items()}16:13
harlowja_at_homedict((a,b) for a, b in d.items()) ?16:13
harlowja_at_homejust use the word 'dict' lol16:13
smoserharlowja_at_home, deal.16:13
ajorgAmazon Linux AMI has been on 2.7 for a few releases, so we won't be a fruitful source of 2.6 patches going forward.16:14
ajorghmm, I get to learn how to do author attribution in bzr for some of these16:15
smoser?16:16
smoserauthor attribution ?16:16
ajorgassuming it's possible, submitting a patch in someone else's name (other authors @amazon.com)16:16
ajorgI know how to do it in git.16:17
smoserah. well you can commit with '--author='16:25
smoserthat sprobably the thing you want.16:25
smoserthen you become 'committer' and author is author16:25
ajorgperfect, very much like git16:28
ajorgthank you16:28
smoserlarsks, fyi, i just uploaded a 0.29 tarball with your growpart fix https://launchpad.net/cloud-utils/trunk/0.2917:06
larskssmoser: thanks for the heads up!17:10
harlowjaok backs17:49
larsksThis is a dumb question...under ubuntu, "python3 setup.py install ..." wants to put cloud-init into site-packages, but that dir doesn't exist.  What's the right way to install it?19:08
larsksAh, --prefix=/usr/local seems to be the thing.19:11
smoseryeah, need some --prefix.19:12
smoser./packages/bddeb though would probably be preferable in most cases19:12
larsksThis is just for testing, not packaging...I was just confused by the "site-packages" does not exist error.19:12
larsksApparently I haven't run setup.py on an ubuntu system before.19:13

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