/srv/irclogs.ubuntu.com/2020/05/27/#cloud-init.txt

=== vrubiolo1 is now known as vrubiolo
=== Cadmus_ is now known as Cadmus
AnhVoMSFT@smoser @Odd_Bloke that clock jump is expected for VMs that have been pre-provisioned. cloud-init can block "waiting for media state change" for hours or days, or in some extreme case weeks. Is there an undesirable behavior arising from the clock jump?14:25
AnhVoMSFTlooking at the log you provided in the ticket I could confirm from our data that the VM indeed was pre-provisioned. The prediction isn't based on the user's particular usage but rather based on the overall demand for the particular vm size/region/image...14:29
smoserAnhVoMSFT: but it seems unlikely (to me at least) that that system was a pre-provision14:38
Odd_Blokesmoser: Didn't Anh just confirm that it was pre-provisioned?14:42
Odd_Bloke(And it sounds like the pre-provisioning doesn't happen per-user, but instead happens within a region and then the pre-provisioned instances are assigned to an account on "launch".  Given that, no user can infer whether to expect pre-provisioned VMs or not.)14:44
smoserwell, yes. but i didn't read that before typing. :)~14:44
AnhVoMSFTyes, it was indeed a pre-provisioned VM (confirmed from cloud-init log itself, and from the backend, using the data available in cloud-init log)14:46
* smoser downloads the 'logs.tgz.gz' file which is infact a gzipped gzipped tarball14:46
AnhVoMSFTlol - i just clickeda couple times on 7z and finally got to the log. I did wonder why it was gzipped a couple times14:47
smoseri suspect that 'ubuntu-bug' is doing something generically now that it wasn't originally doing14:51
smoseror launchpad is magically gzipping files longer than X or something.14:51
smoserit feels almost too perfect to me14:54
smoserthat the system did not generate *any* journal entries betwee May 17 at 17:03 and May 26 at 13:5214:55
Odd_BlokeI believe pre-provisioned VMs are suspended?14:56
Odd_Bloke(Maybe I'm inventing that as an explanation for this behaviour though. :p)14:56
smoserwell.. some time ago they told me that that was just not possible14:56
smoseras i suggested that is how they should do it.14:56
AnhVoMSFTwhether it's suspended or not is an implementation detail that can change, I believe. I think today they're not suspended14:56
smoseri susggesetd, as all the cloud-init magic would seem generally unnecessary if it got suspended.14:57
AnhVoMSFThowever they might be in the future as they figure out some way to do it (I'm not in that team but did hear some plan about it a while back)14:57
smoserthe platform could just say "oh, this instance id isn't ready yet - stop its cpu"14:57
Odd_BlokeYeah, I guess properly suspended wouldn't bump the timestamps the way we're seeing.14:58
smoserwell, it would14:58
AnhVoMSFTthe system is indeed eerily quiet during that time. I think we ran tcpdump and saw almost no incoming/outgoing packet during that time14:58
smoseras your laptop counts uptime even when suspended14:58
smoser(i think... althoguh maybe i saw somethign about a kernel feature that did or did not do that)14:58
AnhVoMSFTi think the cloud-init "magic" was meant to save on kernel initialization and python module loading overhead15:00
AnhVoMSFTfor smaller VM sizes a smaller number of IOPS is allocated to the VM and as such they would benefit more from pre-provisioning15:02
AnhVoMSFT@Odd_Bloke did you guys cut an SRU yet?15:08
AnhVoMSFTI saw a github release 6 days ago ubuntu/20.2-30-g8bcf1c06-0ubuntu1 - is this the SRU?15:09
blackboxswAnhVoMSFT: we just landed branches last night to fixup a daily build recipe. and yes AnhVoMSFT that 'version' of cloud-init will be what we kick off the SRU for.15:12
blackboxswAnhVoMSFT: I'll talk with the team today. I hope to queue the upload of the SRU this afternoon15:13
blackboxswand will post to this channel and the mailinglist when ready for our verification.15:13
Odd_BlokeAnhVoMSFT: We expect to be doing another SRU in the next 3-6 weeks for https://github.com/canonical/cloud-init/pull/35815:16
falcojrhrmph17:50
falcojrlooks like pyflakes doesn't provide a way to ignore a line17:50
falcojrand it's complaining about my "from feature_overrides import *" line17:50
falcojrcan we ditch pyflakes and pycodestyle in favor of flake8?17:50
falcojrdoesn't make sense to use two different tools when one covers the same functionality17:51
falcojrand lets you ignore lines :D17:51
falcojrpyflakes github even says "If you like Pyflakes but also want stylistic checks, you want flake8, which combines Pyflakes with style checks against PEP 8 and adds per-project configuration ability."17:52
meena19:50 <falcojr> can we ditch pyflakes and pycodestyle in favor of flake8? ← i thought i had recently seen a commit that got rid of flake8 xD17:58
powersjfalcojr, the feature flags need to import *?18:00
falcojryeah, as a means to provide a way to override them18:03
falcojrdiscussion on it starts here18:03
falcojrhttps://github.com/canonical/cloud-init/pull/367#issuecomment-63021350018:03
* powersj has some reading to do18:05
falcojrhuh, didn't know it was ever in the project, but it was removed here18:07
falcojrhttps://github.com/canonical/cloud-init/commit/80dfb3b023a268d6d6204220665c2cf43eac66df18:07
falcojrflake8 entails everything pyflakes and pycodestyle does18:07
meenai know, i use it… elsewhere.18:12
rharperOdd_Bloke: so meena 's https://github.com/canonical/cloud-init/pull/385  is good to go, except github shows it waiting on travis status, however, the two runs for the PR are green, https://travis-ci.org/github/canonical/cloud-init/builds/69105457318:27
rharpermeena: nice! close/open does the trick =)18:42
rharpernew job pending18:42
blackboxswparide: thanks for all the reviews on the ubuntu/*  branches dropping pyflakes. I've checked our daily build CI runs for focal and we are all green on lxd/kvm using the newly built debs from yesterday.   rharper Odd_Bloke paride I think we want to turn on our ec2-f CI integration test running and drop ec2-e https://jenkins.ubuntu.com/server/view/cloud-init,%20curtin,%20streams/job/cloud-init-integration-ec2-f/18:49
blackboxsw^ what do you folks think ^ on the jenkins running for ec2-f: on ec2-e: off?18:49
blackboxswor both on.18:49
blackboxswor even ec2-g ec2-f ec2-b would probably be more appropriate18:50
rharperblackboxsw: e is not yet EOL, no ?18:50
rharperso, +1 on ec2-g, f and b18:50
rharperand I suspect we leave e on  until EoL18:50
blackboxswrharper: nope you're right18:51
blackboxswI'll enable them now. and put a PR up for server-jenkins-jobs to fix that (and the default )18:51
rharperhrm,  ubuntu-distro-info  ; I thought used to show the EoL date (or days of support left etc)18:52
rharperis that gone now ?18:52
rharperor am I thinking of a different tool ?18:52
blackboxswI aways looked at the raw /usr/share/distro-info/ubuntu.csv18:53
blackboxswnow there are two eols :)18:53
blackboxswwith esm around18:53
blackboxswwell 3 actually: eol,eol-server,eol-esm18:53
Odd_Blokefalcojr: Yep, I also want to switch back to flake8 for a task I have on my plate ATM.18:54
Odd_Blokefalcojr: But given my current state (back pain, for those following along at home), you should feel free to go ahead and DIY.18:54
rharperblackboxsw: heh18:55
rharperblackboxsw: so close, 2020-07-1718:56
blackboxswok so we'll turn it on and add a timebomb for 2020-07-1718:56
blackboxswlike if date >= 2020-07-17 raise RuntimeError :)18:57
blackboxswRuntimeError('remember to turn this job off after 2020-07-17')18:57
rharperhehe, no need for timebombs;  I don't think19:00
rharpermaybe a trello card19:00
Odd_Blokerharper: I think you were thinking of `ubuntu-distro-info --days=eol --series eoan`19:06
rharperyes19:06
rharperthe no-input help message not the default --help message19:06
rharper=/19:06
* rharper needs more breadcumbs 19:07
Odd_Blokerharper: I only know the minutiae of u-d-i because, well, lol: https://github.com/OddBloke/distro-info-rs19:10
rharpernice!19:11
Odd_BlokeI think that needs updating for ESM, actuallly.19:11
kamoserHi all, when I have a package list like "packages:19:38
kamoserhow can I ensure 2 and 3 are installed even if 1 fails?19:39
kamoserReason for this is to simplify installs across distros. So in case the first package works on Amazon Linux but fails on Ubuntu, I want the rest of the packages to install19:40
meenakamoser: you could use a jinja2 template for your cloud-config19:40
kamosermeena Thanks. I assume you mean write statements based on the distro like "install package if Ubuntu"19:47
kamoserI will look into that, I have use Jinja with Salt previously19:47
meenais everyone fleeing Salt rn?19:47
rharperkamoser: what meena means is your #cloud-config file can *be* a jinja2 template directly, cloud-init itself can fill out the template with cloud-init provided values, like the distro name;   ##template: jinja\n#cloud-config\npackages:\n{{ jinja logic here}}19:48
rharperkamoser: it's also a reasonable feature request,  if you'd like, file an issue at https://bugs.launchpad.net/cloud-init/+filebug19:49
kamoserrharper Thanks! I will do that as well. It would be hard to guarantee the package list doesn't change in the future, and our AMIs build automatically. Appreciate the help from both of you.19:53
rharperkamoser: so, you might look at using a #include URL to your list19:54
rharperso you can independently modify the "packages" cloud-config from the AMI itself19:54
rharpercloud-init will fetch cloud-config from a URL19:54
rharperyou can use object store as well, but only via http (not sure if you need it to be pulled via https);19:54
kamoserrharper awesome options. thanks :)19:56
rharperyw19:56
meenarharper: i… disagree :P failures should fail… although, installing packages does tend to be very transitively… <word that explains things>20:18
rharpermeena: I think we're on the same page ... I would not change the *default* behavior; rather, if folks wanted to ignore install failures, that seems like a reasonable option for users to control;20:18
rharpermeena: another though would be to extend the config space, to a dictionary, which could specify package lists under distro keys;20:19
rharperit's worth having a bug to discuss options20:19
meenarharper: *nod *nod *nod20:20
blackboxswrharper: Odd_Bloke game of would you rather: our new-upstream-snapshot automatically updates to latest commit on master, and we released to groovy a few days ago so other commits have landed. Do we want to extend new-upstream-snapshot to take a commitish from which to 'snapshot' or do we want to propose a new groovy upload right now  and queue an upload for SRU with what has currently landed since 8bcf1c0620:31
kamoserI changed my template to say "## template: jinja20:31
kamoser#cloud-config". Should the header remain as Content-Type: text/cloud-config or should it be changed to text/jinja2? I don't see examples in the docs that clarify this point, but I am probably being dumb.20:31
blackboxswrharper: Odd_Bloke queuing a groovy upload should be 5 mins of work20:31
blackboxsw+1 review time.20:31
blackboxswan extension to new-upstream-snapshot to take an optional commitish  could be helpful for future SRUs if we know that reviewers will trail authors when reviewing the upload PRs20:32
blackboxswhere's the list of extra commits in tip of master at the moment https://paste.ubuntu.com/p/jScGYQWVFY/20:34
blackboxswone functional change for ubuntu, couple unit tests/CI, contributors signed up and bsd enablement for cfg mgmt (doesn't affect ubuntu-proper)20:35
rharperblackboxsw: ok ...  I need to do a PR on new-upstream-snapshot too to help for the "first-time-sru" scenario ;  maybe you ran into it already ;  I currently used: new-upstream-snapshot --no-bugs --sur-bug XXXX which mostly DTRT (with exception of not appending ~XX.YY.1 to the release version string20:42
blackboxswright rharper https://trello.com/c/YZue6zO9/35-new-upstream-snapshot-needs-to-dtrt-and-append-proper-prefix-when-a-release-is-stable-on-first-sru20:44
rharperblackboxsw: heheh20:44
blackboxswwe have a coupe of onetime items that we need to fixup for SRU20:44
rharper\o/20:44
blackboxswI added your mention to that item, as I was going to manually 'handle'  that in the ubuntu/focal SRU for cloud-init20:45
blackboxswI think it'd be better to sort the new-upstream-snapshot for that20:45
blackboxswthen future us can forget all about that pain20:45
blackboxswok I'll put up a minor new-upstream-snapshot to take an optional commitish param20:46
blackboxswrharper: want me to add functionality to inspect ubuntu.csv or are you already working that20:46
blackboxswhrm hold the phone I think new-upstream-snapshot takes a positional commitish20:49
rharperblackboxsw: not working anything at the moment;  fixing up some curtin vmtest issues pre-sru20:57
blackboxswrharper: want to weigh in on this level of manual for ubuntu/xenial ?21:20
rharper?21:20
blackboxswrharper: https://github.com/canonical/cloud-init/pull/39321:20
rharperlooking21:21
blackboxswsince we did a one-off new-upstream-snapshot that we didn't release, the tool doesn't handle consolidating multiple UNRELEASED changelog entries into one from two separate new-upstream-snapshots21:21
blackboxswso I had to manually move around a couple of entries21:21
blackboxswper steps 1-321:21
rharperah21:21
rharperyes, I've always worried about these21:22
rharperI think instead of writing "steps", it'd be worth showing a diff between what the new-upstream-snapshot does; and what we actually want to commit ?21:22
blackboxswyeah I didn't really want to add specific debian/changelog content parsing logic in new-upstream-snapshot if we can avoid it21:22
blackboxswsure that works21:22
rharperso do it once with no changes, then again with your manual steps and show the changes ...  folks can look at the delta and see what they need to change during changelog edit I think21:23
rharperand I suspect, if we can automate that combintation of un-released snapshots, it would be a good backlog item to do (it's not often but nice for tooling to handle this stuff)21:23
Odd_Blokeblackboxsw: +1 on cutting a new groovy release (unless I'm too late and you've already committed to not doing that, then don't sweat it :p)21:25
blackboxswOdd_Bloke: cutting groovy is also easy and I'll push that now. since I have to rework ubuntu/xenial anyway a bit to show a manual diff let's do it21:26
blackboxswPR coming Odd_Bloke21:26
Odd_Blokefalcojr: https://github.com/canonical/cloud-init/pull/392 <-- we're unblocked on the flake8 issue, thanks to powersj21:28
blackboxswOdd_Bloke: https://github.com/canonical/cloud-init/pull/39421:29
falcojrlol, I was about to push basically the same thing21:30
Odd_Blokeblackboxsw: Approved.21:31
blackboxswOdd_Bloke: thanks uploading21:32
blackboxswat least our frequency of groovy uploads is healthy21:32
blackboxswnow to get SRUs healthy21:32
powersjfalcojr, sorry :P21:34
falcojrhaha, np21:34
blackboxswcommunity notice: ubuntu/groovy-proposed] cloud-init 20.2-38-g8377897b-0ubuntu1 (Accepted)21:35
falcojrover time we should fix some of those. E.g., whitespace around operators or the hanging indents21:35
blackboxswcommunity notice: ubuntu Groovy 20.10 has an upload representing tip of master that will show up in cloudimages in the coming days21:35
powersjagreed21:35
falcojrflake8 is a little more picky than the other tools were21:35
falcojralso, extend the max line length21:36
* falcojr runs away21:36
Odd_BlokeI would like to keep to 80 lines, but I would not object to figuring out a way to blacken the codebase over time.21:38
Odd_BlokeUpstream have been a little reticent to engage in partial formatting.  It's a reasonable position to take, but it does make it hard for projects with a lot of history to move, because I don't really want `git blame` to be forever ruined by a formatting commit.21:40
Odd_BlokeWell, I guess more than a little reticent: https://github.com/psf/black/issues/13421:42
blackboxswrharper: here's the ubuntu/xenial  SRU branch https://github.com/canonical/cloud-init/pull/39521:50
blackboxswif that approach makes sense I'll have something comparable for bionic eoan and focal I believe21:51
rharperblackboxsw: lemme look22:00
kamoserSome lines omitted but why doesn't this work on EC2 user data? "Content-Type: text/jinja2;22:16
kamoser## template: jinja22:16
kamoser#cloud-config22:16
kamoserpackages:22:16
kamoser - {{ v1.distro }}"22:16
kamoserJust says CI_MISSING_JINJA_VAR/distro22:16
rharperkamoser: one sec22:18
rharperkamoser: cloud-init --version ? what are you currently running there?  and Ubuntu image or Amazon Linux ?22:19
kamoserubuntu/images/hvm-ssd/ubuntu-bionic-18.04-amd64-server-20191002 (ami-04b9e92b5572fa0d1)22:20
kamoserand /usr/bin/cloud-init 19.2-36-g059d049c-0ubuntu1~18.04.122:20
kamoserTo test it, I'm running /usr/bin/cloud-init -d init then I'm looking at the file /var/lib/cloud/instance/cloud-config.txt which is where I see the statement CI_MISSING_JINJA_VAR/distro22:21
rharpery22:21
kamoserkeeps kicking me. reason is, I am just trying to debug why my user data won't work on ec2.22:26
rharperkamoser: ok, I can reproduce, that *seems* like  a bug,  you should be able to use v1.distro or distro, the original jinja commit mentions22:26
rharperAdditionally, any standardized instance-data.json keys scoped below a22:26
rharper    '<v#>' key will be promoted as a top-level key for ease of reference in22:26
rharper    templates. This means that '{{ local_hostname }}' is the same as using the22:26
rharper    latest '{{ v#.local_hostname }}'.22:26
rharpertry with just {{ distro }}22:27
rharperfor now22:27
rharperhrm, nope; thats broken too22:27
kamoserBummer. Should I just be using bash script to workaround? Basically what I'm trying to achieve is Ubuntu doesn't have package "A" so I was writing Jinja that said "if package is not Ubuntu" to go with my cloud-config packages list.22:29
kamoserI was hoping the package list would come out as e.g. RHEL has packages A, B but Ubuntu only has packages B. So I inserted a Jinja if statement into the middle of my cloud-config "packages" list.22:30
rharperkamoser: well, we need to fix our bug, but that won't help you for now;  you can in your shell script use fetch the distro value via /run/cloud-init/instance-data.json  ;;; use jq on it or whatever else you need22:31
kamoserNo worries, will do.22:33
rharperkamoser: ah, I think on bionic, we don't have the newer keys available;22:36
rharperkamoser: this will work on a focal image, but not bionic *yet*;  blackboxsw is starting our SRU process where we bring back the newer features into the older releases, so in a few weeks this should work on bionic;22:36
rharperkamoser: and you can see the current keys available with : cloud-init query --all , and test them out with cloud-init query -f "{{ variable }}"  ;  putting in "{{ distro }}" returns exactly what you saw on bionic;  here's it working on focal, for reference  https://paste.ubuntu.com/p/Db8djv3nNc/22:42
kamoserok awesome. great tip22:44
rharperkamoser: also, cloud-init devel render --user-data </path to your template file>  to render the whole thing22:48
blackboxswyeah +1 kamoser SRU will get you that 'distro' jinja variable :/ sry 'bout that22:49
blackboxswa bit delayed22:49
kamoserrharper excellent, now I can test a lot faster without startup/shutdown of the instance. No problem about the variable... only thing is, our customer specifically requested Ubuntu 18.04. But I am going to check if we can get the newer version22:50
rharperkamoser: it should be available in a few weeks;  if you *cant* wait till the SRU is done, you can try using our daily-ppa for bionic which runs cloud-init master built for bionic,  https://launchpad.net/~cloud-init-dev/+archive/ubuntu/daily22:51
kamoserThanks!22:52
blackboxswand kamoser you could also test using ubuntu groovy 20.10 which already has the fix22:53
blackboxswif that ubuntu release is available for you :/22:53
blackboxswthanks for the review rharper I've pushed ubuntu/bionic in the same light https://github.com/canonical/cloud-init/pull/39623:45

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