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

=== rangerpbzzzz is now known as rangerpb
tz__Good morning, I’m having trouble debugging my cloud-config script.  I’m on ubuntu 16.04.  I edit /var/lib/cloud/instance/user-data.txt and run cloud-init --debug init, but i get the same error message of “Unhandled non-multipart (text/x-not-multipart) userdata: ‘b’{‘…’” every time i run it, regardless of changes to user-data.txt15:02
smosertz__, cloud-init does not re-read that file.15:03
smoserit reads form the datasource.15:03
tz__can i edit the data source on digital ocean after the VPS has been launched?15:04
smosernot terribly easily.15:04
smoserfor debugging quick launches i suggest using lxc15:04
tz__how can i iterate quickly on the cloud-config file then without having to destroy, create a droplet?15:04
smosersince you already have one up, try this15:05
smosersudo lxd init15:05
smoserancer its questions15:05
smoserthen as non-root15:05
smosers/ancer/answer/15:05
smoserthen as non-root15:05
smoserlxc image copy ubuntu-daily:xenial local: --alias xenial --auto-update15:07
smoseractually, i woudl install zfs first (apt-get install zfs)15:07
=== shardy is now known as shardy_afk
smoserthen you can use zfs with lxc which is much faster.15:07
smoserthen you launch new instances with15:07
smoser lxc image copy ubuntu-daily:xenial local: --alias xenial --auto-update15:07
smoserfudge15:07
smosersorr.15:07
smoserlaunch a new instance with user data in file 'user-data' like:15:08
smoserlxc launch ubuntu-daily:xenial my-name "--config=user.user-data=$(cat ./user-data)"15:08
tz__okay cool, trying it out now15:09
tz__thanks smoser!15:09
tz__is there anyway to see cloud init output inline when i launch?15:11
tz__or whats the best way to see the cloud init output?15:11
smoserno. actually.15:12
smoserthat sucks.15:12
smoserat least not easily15:13
smoseryou probably can15:13
smoserbut you have to fiddle with the config options of the container15:13
smoserlxc used to put console output right in front of you15:13
smoserbut lxc2.0 does not.15:13
tz__hmmm so how do people build the cloud config the first time? im probably gonna have to edit it 100 times before i get it right15:13
smosertz__ but you can easily enough do things like:15:13
smoser lxc exec NAME tail -f /var/log/cloud-init.log15:14
smosertz__, if you're passing cloud-config, the first thing is that it needs to be valid yaml15:14
smoserso checking that is as simple as:15:14
smoser python -c 'import yaml; yaml.load(open("your-user-data"))'15:14
tz__okay, that passes at least15:16
tz__got “Failed to shellify” then a dumb of all the runcmds15:18
tz__okay, i think it’s because i have blank lines (trying to split up the runcmds into sensible chunks)15:20
tz__smoser: thanks for your help, i’m now seeing cloud-init debug information15:23
smosertz__, couple things...15:25
smoseryou can do a print() of the loaded yaml to make sure it looks like you epxect15:25
smoserand also yaml "anchors" are useful for making things readable15:25
smoserlook at http://paste.ubuntu.com/22322345/15:26
tz__okay, i’ll check that out15:29
tz__thanks!15:29
=== shardy_afk is now known as shardy
tz__is there such a thing as cloud config snippets? a repo of best installations of, for example, redis?18:01
tz__node, databases, node app18:01
tz__sshd_config18:02
smosertz__, no.18:02
tz__sad.18:02
=== shardy is now known as shardy_afk
tz__seems like it would be super valuable since cloud configs are cross platform(ish)18:03
tz__check out what you want on the box, and it generates the cloud config for you18:04
smoserharlowja, around ?18:04
harlowjasup18:05
smoserhttps://code.launchpad.net/~smoser/cloud-init/+git/cloud-init/+ref/version-info18:05
smoseractually..18:05
smoserlet me propose for merge to make it easier for you18:05
harlowjathx :-P18:05
harlowjado we need to start using git rebase more also?18:06
harlowjato avoid crap histories?18:06
harlowjarebase then push --force18:06
smoserhttps://code.launchpad.net/~smoser/cloud-init/+git/cloud-init/+merge/30217618:08
smoserharlowja, are you trolling ?18:08
harlowjanot really :-P18:08
smoserthats been my biggest pain ever.18:08
smoser2 things that bzr did better than git18:09
smosera.) bzr commit -p18:09
harlowjau just gotta know how to use git right ;)18:09
smoser  (this just shows diff in the EDITOR window, so you can write your message and look at the diff)18:09
harlowjahttp://blog.adamspiers.org/2015/03/24/why-and-how-to-correctly-amend-github-pull-requests/#sec-318:09
smoserb.) uses '--first-parent' by default behaviori for git log18:09
harlowjaits the same crap for github PRs that most people don't know how to do :-P18:09
harlowjahttp://blog.adamspiers.org/2015/03/24/why-and-how-to-correctly-amend-github-pull-requests/18:10
smoserusing first-parent by default is genious18:10
smosergenius18:10
harlowjaya, bzr prob did that nicer18:10
harlowjagerrit forces it18:10
harlowjabut github doesn't18:10
smoserit means that people dont have to squash and throw away data18:10
smoserin order to avoid crap history18:10
harlowjaya, fair18:10
smoseri almost consider just getting crap history18:10
smoserand saying "please use --first-parent"18:11
smoserso there... at that mp, i tested building of rpm.18:11
harlowjacool18:12
harlowjahow'd that go18:12
harlowjaha18:12
smoser http://paste.ubuntu.com/22339840/18:12
smoserthe way to build is this:18:13
smoser http://paste.ubuntu.com/22339872/18:13
harlowjacools18:13
smoserthat does it all in an lxc container, but basic path is there.18:13
harlowjawill use that :-P18:13
smoserright. no one. although maybe sometime soon honestly as we want to get c-i on centos18:13
smoserlarsks, you probably have thoughts on my brpm stuff18:14
smoser spec looks like thsi: http://paste.ubuntu.com/22339840/18:14
harlowjaso only other thing i'm not sure about is18:14
harlowjasay i have a addon that doesn't really belong in cloud-init, but i need to add it into cloud-init18:14
harlowjai can show u this addon if u really care18:15
harlowjahow do i make sure that the version number won't mess with the upstream one18:15
smoserby default, we dont bump the 'Release' as iunderstand thats like "packaging release" in debian and in order to get a new version of that, you  kind of had to bump the source release so 'Version' would go up.18:15
harlowjak18:15
smoserexample ?18:15
harlowjaa godaddy module addon18:16
harlowjaconfig module18:16
smoserah.18:16
smoserand you have patches/ that you use --patches ?18:16
harlowjathis one its not yet a patch, but ya, its equivalent to18:16
larsksThis is where I wish cloud-init using something like stevedore for discovering out-of-tree modules...18:17
harlowjaright18:17
harlowjahttps://gist.github.com/harlowja/e6d79d1de62e0edd821bedf76bfd5a2018:17
harlowjasmoser thats part of that module18:17
harlowjabunch of crap that getting out of puppet (doing it in puppet and half of it in cloud-init was causing stupid issues)18:17
harlowjaso fixing that by just moving some of it to a cloud-nit module18:17
smoserright.18:17
smoserso how should we do that?18:17
harlowjaso stevedore is one option18:18
smoseryou want yours to be bigger than trunk or something.18:18
smoserthe version ?18:18
smoseris that what we're talking about ?18:18
harlowjawell i either need the release to be bigger or smaller :-P18:18
smoseryeah, larsks i do want to support out-of-tree moduels.18:18
smoserand datasources.18:18
harlowjaoorrr go the path of larsks with stevedore18:18
harlowjai can cook up osmething with stevedore18:19
smoserwe already have enough dynamic loading18:19
harlowja(yet another runtime dep...)18:19
smoserwe dont need to add stevedoor for it.18:19
harlowjastevedore is just a tiny wrapper over entrypoints18:19
harlowjawhich is a python thing18:19
smoserand /me cries everytime he runs a stevedore-using executable18:19
harlowjastevedore shouldn't make u cry18:19
smoserstat stat stat stat stat disk io disk io18:19
harlowjaits pretty dinky in all reality18:19
* larsks cries every time he sees another project re-implement the same basic features.18:20
harlowjastevedore is a light layer over the python entrypoints stuff18:20
harlowjaso either use stevedore, or i just use entrypoints like stevedore is doing18:20
harlowjacloud-init right now has its custom thing18:20
smoseri dont know.18:20
harlowjahttps://github.com/openstack/stevedore/blob/master/stevedore/extension.py#L14718:20
harlowjathats really the 'thing' that does this, lol18:20
smoseri'm very much feeling pain of startup performance right now.18:20
harlowja'eps = list(pkg_resources.iter_entry_points(namespace))'18:20
harlowjamainly that, ha18:21
smoserand also feel pain of external dependencies.18:21
harlowjathe rest of stevedore is just lue18:21
harlowja*glue18:21
harlowjaso i'm in the middle between larsks and smoser18:21
harlowjain that if i could use something like entrypoints18:21
larsksAn entrypoints-based internal implementation would I guess be fine.18:21
harlowjathen i can get rid of this complexity :-P18:21
harlowjalarsks ya, i can easily make something dinky using entrypoints18:22
harlowjaits not really that hard, ha18:22
harlowjahttps://github.com/openstack/stevedore/blob/master/stevedore/extension.py#L153 is the loop, and the other code is the finding18:22
harlowjanot magical crazy stuff, ha18:22
harlowjawhich is why stevedore is a dinky layer18:22
larsksYeah.  also, pkg_resources.iter_entry_points may have most of what we need...18:23
harlowjayup18:23
smoserso 2 thigns i'd like to support out of tree18:25
smosera.) config modules18:25
smoserb.) datasources18:25
smoserand thats easy enough to "find" them.18:25
smoserbut getting them into the right order is somethign we dont have. no way to declare a dependency or something.18:25
smoserso at the momemnt a list of datasources and a list of modules at each stage.18:25
smoserharlowja, so back to your version / thing...18:26
smoserwhat were you saying ?18:26
larskssmoser: well, config modules get an ordering from cloud.cfg.18:26
smoserdoes using that version with a git cause issues for you?18:26
harlowjasmoser i forget18:26
smoserlarsks, ah. yeah, but not if they're just laid down on disk.18:26
smoserie, ideally you just put new modules in some directory and they get found18:26
smoserand datasources too18:26
harlowjasomeway of making sure that a godaddy built cloud-init.rpm doesn't use the same stuff (Version...) as a public cloud-init.rpm18:26
smoserharlowja, we could expose branch18:27
larsksharlowja: add a suffix to the package name (cloud-init-godaddy) and make it obsolete the other one?18:27
smoserin the spec18:27
harlowjalarsks ah, that might work to18:27
harlowjauntil we have this stevedore and ... stuff18:27
harlowjathen i can get out of this :-P18:28
larskssmoser: looked briefly at your brpm changes, which seem fine, but there is a weird try/except block at the top of brpm that seems to be a noop (it catches any exception...and raises it)18:29
smoserlarsks, yeah its stupid18:35
smoserfor flake818:35
smoserit complains about module level imports not at top of filel18:35
smoserharlowja, you know of a nicer way to work around that ?18:37
harlowjanot sure18:37
larskssmoser, I don't see that if I remove the try/except block.  no complaints from flake8 (https://asciinema.org/a/bbqseaf84npuoon71hciwvc99)18:38
larsks(where flake8 == 2.4.1)18:38
smoserhow'd you do that larsks ?18:39
larsksdo which?18:40
smoserthe asciicinima thing18:40
larskshttps://asciinema.org/18:40
larsksThere is a simple 'asciinema' cli tool18:40
larsksLooks like you need a ppa for ubuntu.  Seems to be packaged for fedora and debian...18:41
smoserwell, its really pep8 . pep8 1.7.0 here does not like it.18:41
larsksInteresting.  I seem to have 1.5.7.  I guess I would add a comment there, otherwise everyone who looks at the code is going to ask the same question :)18:41
smoseryeah18:41
smoserdeal18:41
harlowjahmmm asciinema neat18:42
smoserif "avoid-pep8-E402-import-not-top-of-file":18:45
smoser  import ...18:46
smosercommitting that18:46
smoserharlowja,19:16
smoserhttps://bugs.launchpad.net/cloud-init/+bug/160353319:16
smoseris fix committed ?19:16
harlowjai think so19:22
harlowjaassuming its still carried forward with the git stuff (and not lost)19:23
=== shardy_afk is now known as shardy
smoserhey all. i have some changes here locally.21:46
smoseri'm going to mark a 0.7.7 release soon. tonight or tomorrow.21:47
smoserand call it released.21:47
smoserand then we can work towards a quick 0.7.8 iteration on that.21:47
smoserthe git stuff now in i think.21:47
JayFsmoser: http://lists.openstack.org/pipermail/openstack-dev/2016-August/101007.html is something you might find interesting22:03
=== rangerpb is now known as rangerpbzzzz
harlowjacool22:37
tz__anyone have a snippet that shows how to pull a repo from github?  I have http://pastie.org/private/kpnunfkgktxxse2m4xwsga , but problems ensue23:29

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