/srv/irclogs.ubuntu.com/2020/08/24/#smooth-operator.txt

Chipacagooooooooooooooooooooooooooooooood  morning!07:52
bthomasMorning Chipaca : Hope you had a good break08:10
mupPR operator#383 closed: ops/lib: use repr less with paths, and os.path.join more <Created by chipaca> <Merged by chipaca> <https://github.com/canonical/operator/pull/383>08:10
Chipacabthomas: I did!08:11
ChipacaI could've had another day's worth of it :-D08:11
bthomasYep. Never enough. :)08:11
Chipacadunno, another two days would've had me programming something08:12
Chipacaone would've gotten me to finish putting up a bit of ikea furniture that's in my backlog08:12
Chipacabthomas: how was your weekend?08:13
bthomasChipaca: Cleaning the house (not so much fun), Cooking (more fun), doing math (most fun) :-)08:14
Chipaca:) nice08:14
Chipacabthomas: if you're in the mood for little bit of code review, #381 could use that08:14
mupPR #381: we should call harness.cleanup in unit tests now that we use resources there :-) <Created by chipaca> <https://github.com/canonical/operator/pull/381>08:14
bthomasChipaca: will have a look now08:15
Chipacaand #382 …08:15
mupPR #382: not all operating systems let you rename over an existing file <Created by chipaca> <https://github.com/canonical/operator/pull/382>08:15
Chipaca… and #38908:16
mupPR #389: minor docs fix <Created by justinmclark> <https://github.com/canonical/operator/pull/389>08:16
bthomasDone.08:24
mupPR operator#384 closed: make test_infra pass on windows <Created by chipaca> <Merged by chipaca> <https://github.com/canonical/operator/pull/384>08:25
bthomasOdd. Kubectl config set-context microk8s is not working this morning.08:27
bthomasoops it is use-context08:27
bthomasAwesome choice of two command names.08:28
Chipacayou know more k stuff than i do08:29
Chipacawhat's use-context? (what even is a context)08:29
Chipacakubectl needs its version of https://git-man-page-generator.lokaltog.net/08:30
bthomasChipaca: I use kubectl to work with both microk8s and minikube. I have a single config file with two contexts, one for each. I can switch which of the two clusters I am working with using use-context.08:30
bthomasI don't think I know more kube than you. Knowing some silly fact about the ginormous gargutan framework does not count.08:31
Chipacaisn't that begging for you to forget you're in the wrong context and do unspeakable things to production when you meant to tear down staging?08:31
bthomasNot if you are an obsessive cumpulsive neat freak and methodical checker :-). But yes you are right there is that risk. But it is quite convienent too. Besides I only run one cluster at a time to reduce power drain on my laptop.08:32
mupPR operator#385 closed: do not assume / is path separator for resource paths <Created by chipaca> <Merged by chipaca> <https://github.com/canonical/operator/pull/385>08:38
Chipacaok travis is already backed up08:43
Chipacatime for a break08:43
bthomasMy prometheus pod deployed using the charm, seems to be stuck in "PodInitializing" state. describe-pod shows one warning "pod has unbound immediate PersistentVolumeClaims". The charm metadata.yaml has a "storage" section that points to "filesystem". So I am not sure why pod can't get its storage volume.09:14
bthomaslooks like I am in for some hardcore k8s debugging since that is the only way to debug charms on k8s.09:15
mupIssue operator#378 closed: Docstyle for `ops` is Google doc style but parsed with Sphinx <Created by justinmclark> <Closed by chipaca> <https://github.com/canonical/operator/issues/378>10:07
mupPR operator#389 closed: minor docs fix <Created by justinmclark> <Merged by chipaca> <https://github.com/canonical/operator/pull/389>10:07
Chipacabthomas: if in need of break from hardcore k8s debugging, break glass^W^W click link: https://i.redd.it/qpdsiofjrsi51.jpg10:08
Chipaca(allegedly taken over the weekend in Richmond Park here in London)10:09
bthomasChipaca: that is a very crisp image. I like photography too. Are you an avid photographer ?10:10
bthomasmy camera is a bit old though Nikon D9010:10
bthomasI can see you have good composition skils -- keeping subject off center10:11
Chipacai am not an avid photographer10:11
Chipacai am an avid collecter of background images :-p10:11
bthomasha ha10:11
Chipacabthomas: that one in particular is by u/ageitgey via https://www.reddit.com/r/london/comments/if8luz/richmond_park_tonight/10:12
Chipacaagain, allegedly10:12
bthomasThat thread has a few other good ones too.10:14
Chipacaayup10:15
Chipacabthomas: the first time i knew i wanted a big 4k monitor was probably a year ago, due to a very similar image10:15
bthomasChipaca: you may want to wait a bit. Transparent OLED TVs just came out.10:16
Chipacait's still on my wishlist, because there's a list10:16
bthomasOh yeah. The wishlist. hmmm10:17
* bthomas goes to national-lottery.co.uk10:17
Chipacabthomas: there's always something that just came out :)10:18
bthomasI think there is a capitalist conspiracy to bankrupt hard working middle class folk10:19
Chipaca<shocked pikachu/>10:29
bthomasChipaca: juju storage in my model reports "No storage to display". Any idea if this could be a reason why a k8s persistentVolumeClaim is not being satisfied ?10:33
Chipacabthomas: i'm afraid i don't know10:33
bthomasno problems. will give it a shot anyway.10:34
Chipacabthomas: the only thing i know that might by even remotely connected is that if you specify a min-juju-version of 2.8 juju won't default to giving you persistent storage10:34
bthomasthanks. my juju version is indeed 2.8.110:35
Chipacabthomas: right but does your metadata.yaml say min-juju-version10:35
bthomasChipaca: metadata.yaml does not mention min-juju-version10:35
Chipacaah, then you should still have one10:36
Chipacaaiui at least10:36
Chipacabut that's the operator pod, dunno about the application pod10:36
bthomasI can't think of any other reason, so will try and see if allocating storage to app/model fixes the issue10:37
* bthomas heads of to mine morsels of wisdom from juju doc mountain10:37
axinohello10:46
axino"charmcraft build" does't include my "lib" directory (which only has one subdirectory, and inside this subdir, a symlink). Is this expected ?10:46
axinoif I add a empty file to lib/interface/, that file is included10:47
Chipacaaxino: hello10:47
Chipacaaxino: this is not expected, if you're running a new enough charmcraft10:48
Chipacaaxino: what charmcraft are you running? (what's "charmcraft version")10:48
axinoChipaca: Version: 0.3.1+58.g0ccec6710:48
axinoChipaca: FYI I just filed https://github.com/canonical/charmcraft/issues/136 :)10:48
axinoChipaca: https://pastebin.canonical.com/p/c7SSCBjbXp/ is the "tree" for the lib directory10:49
axinothe "a" file is in the zip, the symlink is not. Do zipfiles even support symlinks ?10:49
Chipacaaxino: zipfiles do kinda support symlinks using a de-facto-standard extension to the spec10:50
Chipacaaxino: we have not implemented it, so we flatten symlinks in charms for now (it's on the TODO)10:50
axinohmm10:51
Chipacaaxino: i'm sure facundo will be all over that when he gets here :)10:52
axinoI'm surprised no one has run into that10:52
axinoI must be doing something wrong10:52
Chipacaaxino: we've recently rewritten how we build the zip, so it's possible people depending on this behaviour aren't running edge yet10:53
Chipacaaxino: so thank you for being our guinea pig :-)10:53
axino"for dirpath, dirnames, filenames in os.walk(buildpath_str, followlinks=True):"10:53
axinofollowlinks may be the issue10:53
axinoChipaca: Version: 0.3.1 fails in another way : charmcraft internal error! OSError: [Errno 40] Too many levels of symbolic links:10:56
axino'/home/ubuntu/charm-k8s-gunicorn/build/mod/interface-pgsql/pgsql/opslib/pgsql/opslib/pgsql/opslib/pgsql/opslib/pgsql/opslib/pgsql/opslib/pgsql/opslib/pgsql/opslib/pgsql/opslib/pgsql/opslib/pgsql/opslib/pgsql/opslib/pgsql/opslib/pgsql/opslib/pgsql/opslib/pgsql/opslib/pgsql/opslib/pgsql/opslib/pgsql/opslib/pgsql/opslib/pgsql/opslib/pgsql/opslib/pgsql/opslib/pgsql/opslib/pgsql/opslib/pgsql/opslib/pgsql10:56
axino/opslib/pgsql/opslib/pgsql/opslib/pgsql/opslib/pgsql/opslib/pgsql/opslib/pgsql/opslib/pgsql/opslib/pgsql/opslib/pgsql/opslib/pgsql/opslib/pgsql/opslib/pgsql/opslib/pgsql/opslib/pgsql' (full execution logs in /home/ubuntu/snap/charmcraft/common/charmcraft-log-jo0o807z)10:56
Chipacammm, delicious10:56
axinomod/interface-pgsql/pgsql/opslib/pgsql is a symlink to ..10:56
Chipacaaxino: if you build (using edge) with --verbose, it might shine some light on it10:57
axinoI just filed a bug because there was no --verbose :)10:58
axinocharmcraft (edge) 0.3.1+58.g0ccec67 from John Lenton (chipaca) refreshed10:58
axinocharmcraft: error: unrecognized arguments: --verbose10:58
Chipacaaxino: try charmcraft --verbose build11:00
Chipacaaxino: there is a verbose, but argparse is weird11:01
Chipacathat's being fixed in #13511:01
mupPR #135: Operator Framework charm writing guide <Created by VariableDeclared> <Closed by niemeyer> <https://github.com/canonical/operator/pull/135>11:01
Chipacacharmcraft#13511:01
mupPR charmcraft#135: Support the global options also after the command is given <Created by facundobatista> <https://github.com/canonical/charmcraft/pull/135>11:01
axinoah11:01
axinowell OK11:02
axinodoesn't really help as to why the file is missing11:02
axinohttps://pastebin.canonical.com/p/YZMYwRWyPr/11:03
axinogotta lunch :)11:03
facubatista¡Muy buenos días a todos!11:16
bthomasmorning facubatista11:20
Chipacafacubatista: heyy11:20
facubatistahola bthomas, Chipaca11:20
Chipacafacubatista: charmcraft#136 might be worth your attention11:20
mupIssue charmcraft#136: charmcraft build needs a --verbose option <Created by axinojolais> <https://github.com/canonical/charmcraft/issues/136>11:21
Chipacawait no not taht one11:21
Chipacafacubatista: heh, i thought axino had filed a bug for their symlink woes11:21
Chipacafacubatista: let me summarise11:22
Chipacafacubatista: they have this: https://pastebin.canonical.com/p/c7SSCBjbXp/11:22
Chipacafacubatista: if they remove the 'a' file, the whole 'lib' is not included by "charmcraft build"11:23
Chipacafacubatista: (using edge)11:23
facubatistaChipaca, no lib and no interface are included?11:24
facubatistaChipaca, axino, it works here, https://paste.ubuntu.com/p/vXG3PYZP2G/ , let's try to find the difference with that11:41
facubatista(it looks I'm not replicating that ok)11:41
facubatistaaxino, can I get the build logs? thanks!11:41
axinofacubatista: what's "unzip -l test.charm | grep lib" ?11:45
facubatista        0  2020-08-24 08:30   lib/interface/pgsql11:46
facubatista(my interface-pgsql is empty)11:46
facubatistaChipaca, I have an unplanned kids' school meeting, do you need me in the Postgresql meeting? I can be there if you do11:47
Chipacafacubatista: nah, go11:57
facubatistaChipaca, thanks11:57
Chipacasorry for the delay replying, my shopping arrived11:57
mupIssue operator#371 closed: Use controller storage if no local storage exists <Created by stub42> <Closed by chipaca> <https://github.com/canonical/operator/issues/371>12:00
mupPR operator#374 closed: use controller-side storage automatically in some cases <Created by chipaca> <Merged by chipaca> <https://github.com/canonical/operator/pull/374>12:00
facubatistaChipaca, no worries! the school meeting is virtual, I'm already there :)12:02
axinofacubatista: interesting12:14
axinofacubatista: my "build" dir has lib/interface/pgsql as a directory12:14
facubatistaaxino, ah12:15
axinobut it's not in the zip12:15
facubatistaaxino, we know about that bug, I'm waiting for review to land the fix :) https://github.com/canonical/charmcraft/pull/13112:15
mupPR charmcraft#131: Respect the symlink even if it's a directory when building <Created by facundobatista> <https://github.com/canonical/charmcraft/pull/131>12:16
axinoOK12:16
axinofacubatista: I'm just surprised that it works for you12:16
facubatistaaxino, for me it's a file12:16
facubatistanot a dir12:17
axinook12:17
axinofacubatista: what's mod/interface-pgsql for you ?12:18
axinoa file or a dir ?12:18
Chipacabthomas: can i pester you for a review of #382? super easy one :)12:19
mupPR #382: not all operating systems let you rename over an existing file <Created by chipaca> <https://github.com/canonical/operator/pull/382>12:19
facubatistaaxino, a file12:19
bthomasChipaca: will have a look now12:19
mupPR operator#381 closed: we should call harness.cleanup in unit tests now that we use resources there :-) <Created by chipaca> <Merged by chipaca> <https://github.com/canonical/operator/pull/381>12:19
axinofacubatista: ah well it's a dir for me12:19
Chipacabthomas: thanks12:19
facubatistaaxino, right, that's the difference12:20
axinofacubatista: also my .jujuignore has "*__pycache__*" and "*.py[cod]", yet files like venv/yaml/__pycache__/events.cpython-38.pyc are included in the zipfile12:20
facubatistaaxino, can I see your build logs?12:21
axinofacubatista: https://pastebin.canonical.com/p/YZMYwRWyPr/ ?12:21
facubatistaaxino, what you specify in .jujuignore is not considered for the venv directory; that venv directory is a obscure thing that may change in the future (or not) and has all Python dependencies12:23
facubatistaaxino, we can not ignore stuff from there, we may break those dependencies12:23
axinofacubatista: isn't __pycache__ always safely ignorable ?12:24
Chipacai mean, we could call pip with --no-compile12:26
bthomasChipaca: I do not quite understand why backup version_path to version_backup. Then write to version_path and run setup(). And then copy version_backup back to version_path.12:35
Chipacabthomas: version.py in the repo gets the version by calling git12:35
bthomasAh Ok. I see now.12:35
Chipacabthomas: version.py in a packaged and released version gets the version from just setting a constant12:35
Chipaca:)12:36
bthomasgot it.12:36
bthomasAlthough IMHO this needs a small comment :-)12:36
bthomasdone12:37
Chipacawhee12:38
ChipacaI do have one question though12:39
ChipacaLUNCH?12:39
* Chipaca searches for an answer12:40
bthomasjust had and now back to k8s. Looks like microk8s ingress controller is crashing.12:40
bthomasthinking about mentioning it on microk8s channel12:40
bthomasSeems like it is crashing because port 80 is already in use12:41
mupPR operator#382 closed: not all operating systems let you rename over an existing file <Created by chipaca> <Merged by chipaca> <https://github.com/canonical/operator/pull/382>12:48
Chipacaaugh12:55
Chipacaof COURSE the default encoding on windows is not utf812:55
axino<+Chipaca> facubatista: heh, i thought axino had filed a bug for their symlink woes12:59
axinoshould I ?12:59
Chipacaaxino: i just misunderstood what bug you filed; you found several13:00
Chipacaaxino: I think facubatista has a handle on the other issue now though; I'll defer to him13:00
axinoI just "mv gunicorn.charm gunicorn.charm.zip ; zip -yru gunicorn.charm.zip lib ; mv gunicorn.charm.zip gunicorn.charm" for now13:01
Chipacaaxino: is the moving needed?13:03
Chipaca(i know it won't tab complete)13:03
* facubatista is back13:06
axinoChipaca: zip appears to ignore non-.zip file, and I didn't find a way to change this via cmdline option13:06
Chipacafacubatista: the change to universal newlines broke something :-( booo13:10
Chipacafacubatista: i did test, just not the right thing :)13:10
facubatistaChipaca, you're talking about the "ops in window" journey?13:11
Chipacafacubatista: 3.5 doesn't let you say what encoding to use to bytes->str, and defaults to the wrong thing13:11
Chipacafacubatista: yes :)13:11
Chipacafacubatista: just complaining, here13:11
facubatista:)13:12
mupPR operator#391 opened: turns out universal_newlines is the wrong answer, on 3.5 <Created by chipaca> <https://github.com/canonical/operator/pull/391>13:18
Chipacai could use reviews of the above ^ plz (it's easy!)13:37
justinclarkTaking a look, Chipaca14:07
bthomasChipaca: I was wondering why the replace call is not replacing os.linesep. I mean why is it safe to assume linesep will not be "\r" for instance ?14:40
Chipacabthomas: nobody's been that evil :-D14:45
bthomasold MacOS is :-)14:46
Chipacanah, old macos was \n\r14:46
bthomaswait, I though ...14:46
bthomasbut still \n\r will leak through then.14:46
Chipacayep14:47
Chipacabthomas: i might be wrong about old macos tho14:47
Chipacapython's linesep had it as \r it seems14:48
bthomasinteresting14:48
* bthomas loves WikiPedia https://en.wikipedia.org/wiki/Newline14:48
Chipacabthomas: otoh the pythons we support only know of \n and \r\n14:49
Chipacastill, it's a good idea to use it14:49
bthomasno worries. i will leave that choice upto you. approving now.14:50
Chipacabthomas: wikipedia agrees with you about linesep on old macs, and emacs' C-X RET F utf-8-mac agrees with that also14:56
Chipacaso i was completely wrong, and left wondering what was going on with Perl and newlines when I learned that factoid14:56
Chipacaunfortunately this means I will _never_ forget this :-/14:57
* Chipaca wastes neurons on silly things14:57
bthomasInteresting Chipaca : have not used emacs to convert line endings in ages.14:57
* bthomas thinks Chipaca will become a walking encyclopedia of arcane and inconcequential facts14:58
bthomas:-)14:58
Chipacayeap, that's me14:59
Chipacabthomas: going back a little bit, os.linesep is a str not a bytes, so i needed to do it differently than the trivial change, but i think it's better for it15:00
bthomasah did not notice that15:02
mupPR operator#391 closed: turns out universal_newlines is the wrong answer, on 3.5 <Created by chipaca> <Merged by chipaca> <https://github.com/canonical/operator/pull/391>15:09
crodriguezIs there an easy way to retrieve the kubernetes namespace name in a charm, with the framework?   I was trying to use the env var "JUJU_OPERATOR_NAMESPACE" but I hit this issue https://bugs.launchpad.net/juju/+bug/1892255/comments/515:14
facubatistabthomas, justinclark, I'd appreciate a review of https://github.com/canonical/charmcraft/pull/131 , thanks!16:08
mupPR charmcraft#131: Respect the symlink even if it's a directory when building <Created by facundobatista> <https://github.com/canonical/charmcraft/pull/131>16:08
justinclarkfacubatista, looks good to me16:28
facubatistajustinclark, thanks!16:52
crodriguezI have an issue with a charm I recently coded with the operator framework. It is a subordinate charm and it should do the same operations on all units to which it is deployed. However, it looks like it install packages (https://git.launchpad.net/~camille.rodriguez/charm-iscsi-connector/tree/src/charm.py?h=initial#n74) only on the leader unit, even if I did not specify anywhere "is_leader"16:56
bthomaskubectl pv and kubectl pvc show me that status of all persistent volumes and persistent volume claims is "Bound" . Does this mean that the Warning message I see when I do kubectl describe pod prometheus-0 was only temporary . Anybody ?16:56
crodriguezI do not understand why it is doing so. Every other aspect of the charm is correctly installed on all units  (it is mostly configuring  config files)16:57
justinclarkI'm still learning, so I may not be much help crodriguez.. But I do have a question - can you tell if the "on_install" hook fires at all for the subordinate charm?17:07
crodriguezjustinclark, yeah I should check that.... maybe it's just because that install hook is by default ran only on leaders. I'll test it and let you know, thanks!17:10
crodriguezBut I might file a bug .. it should be "installed" on all units17:10
justinclarkAny luck crodriguez?18:31
crodriguez_I'm digging justinclark . A test on my local openstack was successful and it installed the packages on both leader/non-leader units. So I'm trying to figure out what happened different in the customer's environment18:53
crodriguez_it's probable that it's an issue with my charm code and not the framework18:53
crodriguez_hmm... Idk. In both environments, the install event is triggered, but in one, the apt.cache update and install does not happen19:07
justinclarkInteresting. My initial guesses would be Python versions / apt.cache versions ¯\_(ツ)_/¯19:37
justinclarkSorry for not being much help here!19:38
justinclarkI am trying to defer a "peer_joined" event until an database relation is available [1]. But in my test case, the deferred event isn't being reemitted when I add a new relation/unit [2]. My understanding is that a deferred event handler will be run when the very next event is triggered. Can anyone point me in the correct direction here?20:38
justinclark[1] https://github.com/justinmclark/grafana-charm-base/blob/20cc8461a746a880227829228699eb4a5b0da1a0/src/charm.py#L14420:38
justinclark[2] https://github.com/justinmclark/grafana-charm-base/blob/20cc8461a746a880227829228699eb4a5b0da1a0/test/unit/test_charm.py#L8620:38

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