UbuntuIRC / 2020 /05 /11 /#smooth-operator.txt
niansa
Initial commit
4aa5fce
[05:37] <jam> morning all
[07:57] <mup_> Issue operator#269 opened: Warn that model.unit.is_leader() can raise an exception <Created by timClicks> <https://github.com/canonical/operator/issues/269>
[08:02] <Chipaca> morning!
[08:36] <mup_> PR operator#218 closed: Add relation-created events <Created by dshcherb> <Closed by jameinel> <https://github.com/canonical/operator/pull/218>
[08:36] <mup_> PR operator#259 closed: Relation created event <Created by jameinel> <Merged by jameinel> <https://github.com/canonical/operator/pull/259>
[08:40] <Chipaca> jam: I'm going to create a separate 'docs' branch on github to debug the rtd, then propose a pr from that
[08:40] <jam> Chipaca, sounds good to me. The RTD docs that I saw linked over the weekend seemed to be missing all the actual *content* :)
[08:41] <Chipaca> jam: yeah, not sure what i broke :-(
[08:44] <jam> Chipaca, for user facing docs, I'm looking to remove __init__ comments and move them into class docstrings
[08:45] <jam> Chipaca, do you have a preference on type annotations between typing.Mapping and 'dict' ?
[08:46] <jam> Chipaca, the HTML title for https://www.sphinx-doc.org/en/master/ seems to say 4.0.0+ but pypi is 3.0.3 and you're saying that stable is <2 ?
[08:49] <Chipaca> jam: wrt typing.Mapping and dict, I'd go with dict for now for brevity
[08:49] <jam> Chipaca, for the class docstring, it feels a little weird because you want to document how to use the class as well as how to construct it, and the former is 'variables' while the latter is 'args'.
[08:49] <Chipaca> jam: sphinx-doc.org/en/stable is 1.8 yes
[08:50] <jam> Chipaca, that specific link takes me to en/master
[08:50] <Chipaca> er
[08:50] <Chipaca> jam: https://www.sphinx-doc.org/en/stable/usage/configuration.html
[08:50] <jam> ah, www matters
[08:51] <Chipaca> or maybe the deep link vs directory? dunno
[08:51] <Chipaca> jam: tbh my first reaction was 'why on earth are you getting sphinx<2', noticing it's what's tagged stable came later
[08:52] <jam> :)
[08:52] <jam> Chipaca, type annotations seem to poke at the 'recursive import' problem.
[08:52] <Chipaca> i haven't asked my friend on the inside as to whether there's a way to change that (it doesn't seem to be documented that you can)
[08:52] <jam> sorry, circular import problem
[08:53] <Chipaca> jam: using strings instead of obects doesn't help in that case?
[08:53] <jam> Chipaca, I didn't know you could
[08:54] <Chipaca> jam: i'm not sure it helps, i'm asking :) it's there for things like class C taking a D and class D taking a C
[08:54] <jam> Chipaca, https://www.python.org/dev/peps/pep-0563/
[08:54] <Chipaca> but not sure it copes with imports
[08:54] <jam> and reading through https://stackoverflow.com/questions/39740632/python-type-hinting-without-cyclic-imports
[08:54] <jam> which seems to say you can use 'if TYPE_CHECKING' to pre-import stuff
[08:55] <jam> Chipaca, from __future__ import annotations changes all type annotations to strings
[08:55] <jam> but only works for py 3.7??
[08:55] <Chipaca> jam: note that PEP is 3.7+
[08:55] <Chipaca> yeh
[08:58] <jam> I also don't know if I strictly cannot do what I want, I just noted that as I was trying to add a type annotation I was going to have to add an import just to satisfy that which felt like I was going to quickly run into circular imports
[09:06] <jam> Chipaca, I'm not a big fan that Optional gets remapped to Union[...,None]
[09:07] <Chipaca> jam: yeah i get why but i wish it had its own stringify
[09:07] <jam> because a default value might not be None, and loses the human message of what Optional is for
[09:14] <Chipaca> yep
[09:23] <Chipaca> aha! found the issue :)
[09:41] <Chipaca> jam: https://operator-framework.readthedocs.io/en/docs-tri/
[09:43] <jam> Chipaca, is that your recommended theme ?
[09:43] <jam> it generally looks like the content is there
[09:43] <Chipaca> jam: that's the default rtd theme
[09:44] <Chipaca> jam: which has a few nice features (like the 'edit on github' button)
[09:45] <Chipaca> jam: I don't know if it's enough to make type annotations work. They _should_ but i haven't tested.
[09:45] <Chipaca> i'll propose these changes into master now
[09:47] <mup_> PR operator#270 opened: docs: more tweaks so everything works on RTD <Created by chipaca> <https://github.com/canonical/operator/pull/270>
[09:48] <Chipaca> eeee, my laptop got back
[09:49] * Chipaca gets coffee
[10:26] <mup_> Issue operator#271 opened: Relation.role should be 'peer' not 'peers' <Created by jameinel> <https://github.com/canonical/operator/issues/271>
[10:45] <Chipaca> jam: "raises" is also interesting in that list
[10:46] <Chipaca> 'that list' being the one in napoleon/docstring.py:142
[10:48] <jam> Chipaca, yeah. raises I think I used in one place for Harness
[10:51] <Chipaca> :+1:
[10:55] <facubatista> Muy buenos días a todos!
[11:00] <Chipaca> facubatista: o/!
[11:00] <Chipaca> facubatista: just in time :-D
[11:00] <Chipaca> not sure why i thought you weren't coming to this one
[11:53] <vgrevtsev> hi team, a question: is there any example of using a new `dispatch` hook within the charms? the only reference I found was in the juju source code itself, which is better than nothing, but maybe someone have an example handy?
[11:54] <Chipaca> vgrevtsev: right now, all you do is symlink 'dispatch' to the main charm python file and that's it
[11:55] <Chipaca> vgrevtsev: and if you don't care about pre-dispatch jujus, you don't need hooks/ at all
[12:00] <vgrevtsev> hm, so it won't make any difference in the charm behaviour atm then?
[12:02] <vgrevtsev> do you know where can I get more information about the dispatch hook, is it somewhere available or it's kind of hidden knowledge? :) https://discourse.juju.is/t/charm-hooks/1040 there's no info yet...
[12:10] <jam> Chipaca, for now I added it as a URL in the description, I didn't see a way to have it as a more concrete object
[12:10] <Chipaca> vgrevtsev: you calling it a 'dispatch hook' makes me think you're misuinderstanding it
[12:10] <Chipaca> vgrevtsev: it's not a hook
[12:10] <Chipaca> vgrevtsev: it's a way of dispatching hooks
[12:10] <Chipaca> vgrevtsev: mostly it should be invisible to charm developers
[12:11] <vgrevtsev> Chipaca: probably, will be happyto learn what's it is in reality! I'm kinda new to the things so I'm sorry for a stupid questions :)
[12:11] <Chipaca> vgrevtsev: that is, today in juju the way it handles say an 'install' hook is by looking for hooks/install
[12:12] <Chipaca> vgrevtsev: once 2.8 is out it'll look for 'dispatch', and if that exists it'll run it instead of hooks/install, telling it 'yeah please run the install hook'
[12:12] <Chipaca> vgrevtsev: that's all it is
[12:12] <vgrevtsev> ok, got it
[12:12] <vgrevtsev> so, the new framework already supports this way of dispatching the hooks?
[12:13] <Chipaca> vgrevtsev: there is an initial implementation of support for it, and we'll be improving it with time, but yes
[12:13] <Chipaca> vgrevtsev: right now it supports a dispatch that's a symlink to the charm code
[12:13] <Chipaca> later we'll support some other scenarios :)
[12:13] <mup_> PR operator#272 opened: ops/charm.py: Update the Docstrings to Google style <Created by jameinel> <https://github.com/canonical/operator/pull/272>
[12:14] <Chipaca> facubatista: plz can i have review of #270? (or i could just land it if you're busy(
[12:14] <mup_> PR #270: docs: more tweaks so everything works on RTD <Created by chipaca> <https://github.com/canonical/operator/pull/270>
[12:14] <Chipaca> ))
[12:15] * Chipaca ~> lunch
[12:31] <facubatista> Chipaca, meeting?
[12:31] <Chipaca> yes
[13:00] <karimsye> missing a link to the google meeting
[13:01] <facubatista> indeed, I was about to say that
[13:02] <Chipaca> karimsye, jam, facubatista, added meet link
[13:32] * facubatista brb
[13:46] <Chipaca> laptop is indeed back, but i can't get the hardrive back into it because they've tightened the t5 screws harder than my screwdriver can handle :-(
[13:46] <Chipaca> so i've got a nice paperweight until i get a new screwdriver
[13:47] <mup_> PR operator#270 closed: docs: more tweaks so everything works on RTD <Created by chipaca> <Merged by chipaca> <https://github.com/canonical/operator/pull/270>
[13:47] <mthaddon> jam: is it worth t0mb0 investigating the "defer events stacking up" issue given our discussions earlier today, or is it no longer worth him doing that at this point? (I think he was planning to do this on Wednesday)
[13:50] <Chipaca> mthaddon: I'd like to know what it was you were seeing, fwiw
[13:51] <mthaddon> Chipaca: ack, thx
[13:51] <jam> mthaddon, at the very least it would be good to confirm that my prediction is accurate
[13:51] * mthaddon nods
[13:51] <jam> Chipaca, my working guess is that it is the 'same hook' that happens multiple times, and all of those instances of 'config-changed' end up as events in a queue
[13:55] <Chipaca> jam: but why would that have trouble in a low memory deploy
[13:55] <Chipaca> that's what i'd like to figure out (and potentially fix)
[13:56] <jam> Chipaca, I don't see how it has memory consequences as much as having "I've defered config-changed 10 times and now I get them all one-after-another"
[13:56] <jam> (defering config-changed never sounds like the right thing to do, because if the config is wrong, you have to wait until you get a new config-changed telling you that it might be correct now)
[13:56] <Chipaca> jam: right, but IIUC there were memory issues
[13:57] <jam> Chipaca, right, if that's true, then we definitely want to understand why
[14:00] <facubatista> Chipaca, do you have some WD40?
[14:09] <facubatista> jam, if I set manually the state to "maintenance" while installing some stuff, shall I manually set it out of that when finish? or that should happen automatically as the install hook ended fine?
[14:09] <jam> facubatista, Juju won't change states for you, as the state might span multiple hooks
[14:10] <jam> Chipaca, #252 would appreciate your approval
[14:10] <mup_> PR #252: ops/testing.py: document Harness in Google style <Created by jameinel> <https://github.com/canonical/operator/pull/252>
[14:10] <facubatista> jam, ack, thanks
[14:46] <Chipaca> jam: #252 GTG
[14:46] <mup_> PR #252: ops/testing.py: document Harness in Google style <Created by jameinel> <https://github.com/canonical/operator/pull/252>
[15:30] <Chipaca> jam: https://pastebin.ubuntu.com/p/mRZKVKV4Gc/ :-(
[15:32] * facubatista -> lunch
[16:16] * facubatista is back
[16:28] <Chipaca> https://github.com/sphinx-doc/sphinx/pull/7655 (fingers crossed)
[16:29] <mup_> PR sphinx-doc/sphinx#7655: Make sphinx.util.typing.stringify render optional unions better <Created by chipaca> <https://github.com/sphinx-doc/sphinx/pull/7655>
[17:05] * Chipaca steps away for dinner & etc
[18:51] * facubatista brb
[20:02] <Chipaca> facubatista: can you s/charm/charmcraft/ in charmcraft#1?
[20:04] <facubatista> Chipaca, ah, the name of the tool in argparse?
[20:04] <Chipaca> facubatista: and the files and the readme
[20:05] <facubatista> ah
[20:18] <facubatista> Chipaca, pushed
[21:02] <Chipaca> facubatista: +1 with some non-blocking nits
[21:02] <facubatista> Chipaca, thanks
[21:02] <Chipaca> facubatista: next time you push a commit to that pr it should trigger travis
[21:02] <facubatista> Chipaca, awesome
[22:29] <mup_> PR operator#273 opened: Moved create_model and create_framework from framework tests to a factory helper <Created by facundobatista> <https://github.com/canonical/operator/pull/273>