[07:52] gooooooooooooooooooooooooooooooood morning! [08:10] Morning Chipaca : Hope you had a good break [08:10] PR operator#383 closed: ops/lib: use repr less with paths, and os.path.join more [08:11] bthomas: I did! [08:11] I could've had another day's worth of it :-D [08:11] Yep. Never enough. :) [08:12] dunno, another two days would've had me programming something [08:12] one would've gotten me to finish putting up a bit of ikea furniture that's in my backlog [08:13] bthomas: how was your weekend? [08:14] Chipaca: Cleaning the house (not so much fun), Cooking (more fun), doing math (most fun) :-) [08:14] :) nice [08:14] bthomas: if you're in the mood for little bit of code review, #381 could use that [08:14] PR #381: we should call harness.cleanup in unit tests now that we use resources there :-) [08:15] Chipaca: will have a look now [08:15] and #382 … [08:15] PR #382: not all operating systems let you rename over an existing file [08:16] … and #389 [08:16] PR #389: minor docs fix [08:24] Done. [08:25] PR operator#384 closed: make test_infra pass on windows [08:27] Odd. Kubectl config set-context microk8s is not working this morning. [08:27] oops it is use-context [08:28] Awesome choice of two command names. [08:29] you know more k stuff than i do [08:29] what's use-context? (what even is a context) [08:30] kubectl needs its version of https://git-man-page-generator.lokaltog.net/ [08:30] Chipaca: 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:31] I don't think I know more kube than you. Knowing some silly fact about the ginormous gargutan framework does not count. [08:31] isn'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:32] Not 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:38] PR operator#385 closed: do not assume / is path separator for resource paths [08:43] ok travis is already backed up [08:43] time for a break [09:14] My 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:15] looks like I am in for some hardcore k8s debugging since that is the only way to debug charms on k8s. [10:07] Issue operator#378 closed: Docstyle for `ops` is Google doc style but parsed with Sphinx [10:07] PR operator#389 closed: minor docs fix [10:08] bthomas: if in need of break from hardcore k8s debugging, break glass^W^W click link: https://i.redd.it/qpdsiofjrsi51.jpg [10:09] (allegedly taken over the weekend in Richmond Park here in London) [10:10] Chipaca: that is a very crisp image. I like photography too. Are you an avid photographer ? [10:10] my camera is a bit old though Nikon D90 [10:11] I can see you have good composition skils -- keeping subject off center [10:11] i am not an avid photographer [10:11] i am an avid collecter of background images :-p [10:11] ha ha [10:12] bthomas: that one in particular is by u/ageitgey via https://www.reddit.com/r/london/comments/if8luz/richmond_park_tonight/ [10:12] again, allegedly [10:14] That thread has a few other good ones too. [10:15] ayup [10:15] bthomas: the first time i knew i wanted a big 4k monitor was probably a year ago, due to a very similar image [10:16] Chipaca: you may want to wait a bit. Transparent OLED TVs just came out. [10:16] it's still on my wishlist, because there's a list [10:17] Oh yeah. The wishlist. hmmm [10:17] * bthomas goes to national-lottery.co.uk [10:18] bthomas: there's always something that just came out :) [10:19] I think there is a capitalist conspiracy to bankrupt hard working middle class folk [10:29] [10:33] Chipaca: 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] bthomas: i'm afraid i don't know [10:34] no problems. will give it a shot anyway. [10:34] bthomas: 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 storage [10:35] thanks. my juju version is indeed 2.8.1 [10:35] bthomas: right but does your metadata.yaml say min-juju-version [10:35] Chipaca: metadata.yaml does not mention min-juju-version [10:36] ah, then you should still have one [10:36] aiui at least [10:36] but that's the operator pod, dunno about the application pod [10:37] I can't think of any other reason, so will try and see if allocating storage to app/model fixes the issue [10:37] * bthomas heads of to mine morsels of wisdom from juju doc mountain [10:46] hello [10:46] "charmcraft build" does't include my "lib" directory (which only has one subdirectory, and inside this subdir, a symlink). Is this expected ? [10:47] if I add a empty file to lib/interface/, that file is included [10:47] axino: hello [10:48] axino: this is not expected, if you're running a new enough charmcraft [10:48] axino: what charmcraft are you running? (what's "charmcraft version") [10:48] Chipaca: Version: 0.3.1+58.g0ccec67 [10:48] Chipaca: FYI I just filed https://github.com/canonical/charmcraft/issues/136 :) [10:49] Chipaca: https://pastebin.canonical.com/p/c7SSCBjbXp/ is the "tree" for the lib directory [10:49] the "a" file is in the zip, the symlink is not. Do zipfiles even support symlinks ? [10:50] axino: zipfiles do kinda support symlinks using a de-facto-standard extension to the spec [10:50] axino: we have not implemented it, so we flatten symlinks in charms for now (it's on the TODO) [10:51] hmm [10:52] axino: i'm sure facundo will be all over that when he gets here :) [10:52] I'm surprised no one has run into that [10:52] I must be doing something wrong [10:53] axino: we've recently rewritten how we build the zip, so it's possible people depending on this behaviour aren't running edge yet [10:53] axino: so thank you for being our guinea pig :-) [10:53] "for dirpath, dirnames, filenames in os.walk(buildpath_str, followlinks=True):" [10:53] followlinks may be the issue [10:56] Chipaca: Version: 0.3.1 fails in another way : charmcraft internal error! OSError: [Errno 40] Too many levels of symbolic links: [10:56] '/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/pgsql [10:56] /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] mmm, delicious [10:56] mod/interface-pgsql/pgsql/opslib/pgsql is a symlink to .. [10:57] axino: if you build (using edge) with --verbose, it might shine some light on it [10:58] I just filed a bug because there was no --verbose :) [10:58] charmcraft (edge) 0.3.1+58.g0ccec67 from John Lenton (chipaca) refreshed [10:58] charmcraft: error: unrecognized arguments: --verbose [11:00] axino: try charmcraft --verbose build [11:01] axino: there is a verbose, but argparse is weird [11:01] that's being fixed in #135 [11:01] PR #135: Operator Framework charm writing guide [11:01] charmcraft#135 [11:01] PR charmcraft#135: Support the global options also after the command is given [11:01] ah [11:02] well OK [11:02] doesn't really help as to why the file is missing [11:03] https://pastebin.canonical.com/p/YZMYwRWyPr/ [11:03] gotta lunch :) [11:16] ¡Muy buenos días a todos! [11:20] morning facubatista [11:20] facubatista: heyy [11:20] hola bthomas, Chipaca [11:20] facubatista: charmcraft#136 might be worth your attention [11:21] Issue charmcraft#136: charmcraft build needs a --verbose option [11:21] wait no not taht one [11:21] facubatista: heh, i thought axino had filed a bug for their symlink woes [11:22] facubatista: let me summarise [11:22] facubatista: they have this: https://pastebin.canonical.com/p/c7SSCBjbXp/ [11:23] facubatista: if they remove the 'a' file, the whole 'lib' is not included by "charmcraft build" [11:23] facubatista: (using edge) [11:24] Chipaca, no lib and no interface are included? [11:41] Chipaca, axino, it works here, https://paste.ubuntu.com/p/vXG3PYZP2G/ , let's try to find the difference with that [11:41] (it looks I'm not replicating that ok) [11:41] axino, can I get the build logs? thanks! [11:45] facubatista: what's "unzip -l test.charm | grep lib" ? [11:46] 0 2020-08-24 08:30 lib/interface/pgsql [11:46] (my interface-pgsql is empty) [11:47] Chipaca, I have an unplanned kids' school meeting, do you need me in the Postgresql meeting? I can be there if you do [11:57] facubatista: nah, go [11:57] Chipaca, thanks [11:57] sorry for the delay replying, my shopping arrived [12:00] Issue operator#371 closed: Use controller storage if no local storage exists [12:00] PR operator#374 closed: use controller-side storage automatically in some cases [12:02] Chipaca, no worries! the school meeting is virtual, I'm already there :) [12:14] facubatista: interesting [12:14] facubatista: my "build" dir has lib/interface/pgsql as a directory [12:15] axino, ah [12:15] but it's not in the zip [12:15] axino, we know about that bug, I'm waiting for review to land the fix :) https://github.com/canonical/charmcraft/pull/131 [12:16] PR charmcraft#131: Respect the symlink even if it's a directory when building [12:16] OK [12:16] facubatista: I'm just surprised that it works for you [12:16] axino, for me it's a file [12:17] not a dir [12:17] ok [12:18] facubatista: what's mod/interface-pgsql for you ? [12:18] a file or a dir ? [12:19] bthomas: can i pester you for a review of #382? super easy one :) [12:19] PR #382: not all operating systems let you rename over an existing file [12:19] axino, a file [12:19] Chipaca: will have a look now [12:19] PR operator#381 closed: we should call harness.cleanup in unit tests now that we use resources there :-) [12:19] facubatista: ah well it's a dir for me [12:19] bthomas: thanks [12:20] axino, right, that's the difference [12:20] facubatista: also my .jujuignore has "*__pycache__*" and "*.py[cod]", yet files like venv/yaml/__pycache__/events.cpython-38.pyc are included in the zipfile [12:21] axino, can I see your build logs? [12:21] facubatista: https://pastebin.canonical.com/p/YZMYwRWyPr/ ? [12:23] axino, 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 dependencies [12:23] axino, we can not ignore stuff from there, we may break those dependencies [12:24] facubatista: isn't __pycache__ always safely ignorable ? [12:26] i mean, we could call pip with --no-compile [12:35] Chipaca: 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] bthomas: version.py in the repo gets the version by calling git [12:35] Ah Ok. I see now. [12:35] bthomas: version.py in a packaged and released version gets the version from just setting a constant [12:36] :) [12:36] got it. [12:36] Although IMHO this needs a small comment :-) [12:37] done [12:38] whee [12:39] I do have one question though [12:39] LUNCH? [12:40] * Chipaca searches for an answer [12:40] just had and now back to k8s. Looks like microk8s ingress controller is crashing. [12:40] thinking about mentioning it on microk8s channel [12:41] Seems like it is crashing because port 80 is already in use [12:48] PR operator#382 closed: not all operating systems let you rename over an existing file [12:55] augh [12:55] of COURSE the default encoding on windows is not utf8 [12:59] <+Chipaca> facubatista: heh, i thought axino had filed a bug for their symlink woes [12:59] should I ? [13:00] axino: i just misunderstood what bug you filed; you found several [13:00] axino: I think facubatista has a handle on the other issue now though; I'll defer to him [13:01] I just "mv gunicorn.charm gunicorn.charm.zip ; zip -yru gunicorn.charm.zip lib ; mv gunicorn.charm.zip gunicorn.charm" for now [13:03] axino: is the moving needed? [13:03] (i know it won't tab complete) [13:06] * facubatista is back [13:06] Chipaca: zip appears to ignore non-.zip file, and I didn't find a way to change this via cmdline option [13:10] facubatista: the change to universal newlines broke something :-( booo [13:10] facubatista: i did test, just not the right thing :) [13:11] Chipaca, you're talking about the "ops in window" journey? [13:11] facubatista: 3.5 doesn't let you say what encoding to use to bytes->str, and defaults to the wrong thing [13:11] facubatista: yes :) [13:11] facubatista: just complaining, here [13:12] :) [13:18] PR operator#391 opened: turns out universal_newlines is the wrong answer, on 3.5 [13:37] i could use reviews of the above ^ plz (it's easy!) [14:07] Taking a look, Chipaca [14:40] Chipaca: 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:45] bthomas: nobody's been that evil :-D [14:46] old MacOS is :-) [14:46] nah, old macos was \n\r [14:46] wait, I though ... [14:46] but still \n\r will leak through then. [14:47] yep [14:47] bthomas: i might be wrong about old macos tho [14:48] python's linesep had it as \r it seems [14:48] interesting [14:48] * bthomas loves WikiPedia https://en.wikipedia.org/wiki/Newline [14:49] bthomas: otoh the pythons we support only know of \n and \r\n [14:49] still, it's a good idea to use it [14:50] no worries. i will leave that choice upto you. approving now. [14:56] bthomas: wikipedia agrees with you about linesep on old macs, and emacs' C-X RET F utf-8-mac agrees with that also [14:56] so i was completely wrong, and left wondering what was going on with Perl and newlines when I learned that factoid [14:57] unfortunately this means I will _never_ forget this :-/ [14:57] * Chipaca wastes neurons on silly things [14:57] Interesting Chipaca : have not used emacs to convert line endings in ages. [14:58] * bthomas thinks Chipaca will become a walking encyclopedia of arcane and inconcequential facts [14:58] :-) [14:59] yeap, that's me [15:00] bthomas: 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 it [15:02] ah did not notice that [15:09] PR operator#391 closed: turns out universal_newlines is the wrong answer, on 3.5 [15:14] Is 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/5 [16:08] bthomas, justinclark, I'd appreciate a review of https://github.com/canonical/charmcraft/pull/131 , thanks! [16:08] PR charmcraft#131: Respect the symlink even if it's a directory when building [16:28] facubatista, looks good to me [16:52] justinclark, thanks! [16:56] I 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] kubectl 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:57] I 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) [17:07] I'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:10] justinclark, 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] But I might file a bug .. it should be "installed" on all units [18:31] Any luck crodriguez? [18:53] 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 environment [18:53] it's probable that it's an issue with my charm code and not the framework [19:07] hmm... Idk. In both environments, the install event is triggered, but in one, the apt.cache update and install does not happen [19:37] Interesting. My initial guesses would be Python versions / apt.cache versions ¯\_(ツ)_/¯ [19:38] Sorry for not being much help here! [20:38] I 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] [1] https://github.com/justinmclark/grafana-charm-base/blob/20cc8461a746a880227829228699eb4a5b0da1a0/src/charm.py#L144 [20:38] [2] https://github.com/justinmclark/grafana-charm-base/blob/20cc8461a746a880227829228699eb4a5b0da1a0/test/unit/test_charm.py#L86