[05:37] <jam> crodriguez, error should be used sparingly, because it means the charm can't do anything else other than retry the hook that failed
[05:37] <jam> so Blocked is much more what you want than Error
[07:28] <jam> morning ChanServ
[07:28] <jam> Chipaca, I mean
[08:53] <stub> Last I looked, eggs seemed deprecated for everything, replaced by wheels. https://packaging.python.org/discussions/wheel-vs-egg/
[08:56] <Chipaca> jam: morning :-)
[08:56] <Chipaca> i guess the question then is: is there a way to make 'setup.py install' not go eggy?
[08:58] <jam> Chipaca, isn't that zip_safe=False ?
[08:58] <Chipaca> jam: that'll install a decompressed egg, which isn't pretty (even though it works)
[08:58] <Chipaca> anyway, back to init for me :)
[08:58]  * Chipaca writes systemd in python
[08:58] <Chipaca> wait no not again
[08:59] <jam> Chipaca, https://stackoverflow.com/questions/48550546/how-to-install-a-wheel-style-package-using-setup-py
[08:59] <jam> seems to say you have to "setup.py wheel; then pip install .whl"
[08:59] <jam> that's pretty ugly user experience
[09:00] <Chipaca> jam: just 'pip install .' works fine :)
[09:01] <Chipaca> jam: otoh, 'python setup.py develop' might also work
[09:01] <jam> Chipaca, indeed. I can certainly switch to that, just is unfortunate that the ingrained method wasn't improved
[09:01] <Chipaca> i still think dropping an __init__.py in commands is the right thing, for least surprise
[09:01] <jam> Chipaca, should charmcraft master be calling itself 0.2 ? isn't it 0.3 pre?
[09:02] <Chipaca> jam: 0.2.0+59.gab2e71e.dirty
[09:02] <jam> Chipaca, ah, because it is many commits past 0.2
[09:02] <Chipaca> yep
[09:02] <Chipaca> 59, in this case
[09:02] <jam> good/bad of using git version
[09:03] <jam> it doesn't do 'pre' well :)
[09:03] <Chipaca> correct :)
[09:03] <jam> I guess you could tag 0.3beta ...
[09:04] <jam> Chipaca, I think it should know how many more commits you need for 0.3 and then you'd have a nice count down
[09:04] <jam> and you'd
[09:04] <jam> know when you're done coding. :)
[09:04] <Chipaca> jam: I like the way reality looks from where you're standing
[09:04] <jam> btw, any comments on charmcraft#90 ?
[09:04] <mup> PR charmcraft#90: charmcraft/jujuignore.py: ability to parse .jujuignore <Created by jameinel> <https://github.com/canonical/charmcraft/pull/90>
[09:04] <Chipaca> jam: i haven't even peeked yet
[09:05] <Chipaca> i'll do that now
[09:30] <jam> Chipaca, bind charm chatc?
[09:30] <Chipaca> d'oh, omw
[09:49] <jam> barryprice, https://juju.is/docs/k8s-charms-tutorial mentions having a ports section
[09:49] <jam> which states "protocol: TCP"
[09:49] <jam> I would guess you change that to protocol: UDP
[09:50] <jam> I couldn't say off hand if you need both TCP and UDP whether that is 2 separate port declarations, 2 separate protocol declarations, or something like "protocol: TCP,UDP"
[09:50] <barryprice> jam: yup, that's actually what I have here, I will see how that goes - if it's that simple then great
[09:50] <barryprice> my assumption was two declarations but I'll play around with it
[09:52] <jam> barryprice, Ports        []ContainerPort `json:"ports,omitempty" yaml:"ports,omitempty"`
[09:52] <jam> ports is a list, but protocol is just a string.
[09:52] <jam> still not sure
[09:54] <jam> barryprice, the k8s docs seem to say that UDP support depends on the cloud, and nginx as an ingress controller has some confusing discusison
[09:54] <jam> https://kubernetes.github.io/ingress-nginx/user-guide/exposing-tcp-udp-services/
[09:55] <jam> I think you noted that it was part of a ConfigMap of the ingress service, which seems a bit surprising
[09:56] <barryprice> jam: yup, that's the page that sent me looking into how to set a ConfigMap
[09:56] <barryprice> the second example on that page is for UDP/53
[09:56] <jam> barryprice, if I understand that page correctly, the main problem is that you need to change the ConfigMap of some other service in response to you deploying *your* service.
[09:57] <jam> eg, that is having NGINX running as the ingress controller listen on 53 so that it can proxy for the actual application behind it
[09:58] <jam> barryprice, I would certainly just start with a port declaration for protocol: UDP and then see where that gets you
[09:59] <barryprice> jam: will do, hopefully get something working in the next hour before I EOD, I'll let you know
[10:27] <barryprice> keep finding silly bugs in the image, and have to rebuild each time - hopefully this round
[10:30] <barryprice> jam: ok that works for me locally with microk8s
[10:30] <barryprice> App   Version  Status  Scale  Charm     Store  Rev  OS          Address         Notes
[10:31] <barryprice> bind           active      1  bind-k8s  local    8  kubernetes  10.152.183.197
[10:31] <barryprice> Unit     Workload  Agent  Address     Ports          Message
[10:31] <barryprice> bind/9*  active    idle   10.1.68.21  53/TCP,53/UDP  Pod configured
[10:31] <barryprice> and from a terminal on my laptop, outside the pods, "dig @10.152.183.197 ubuntu.com" gives me a correct result
[10:32] <Chipaca> jam, facubatista, should we skip the bug revue today?
[10:32] <jam> Chipaca, either way for me
[10:42] <Chipaca> huh, charmcraft tests don't run here now
[10:47] <Chipaca> jam: do they work for you, on charmcraft master?
[10:57] <jam> Chipaca, they pass on my branch, I'll check master
[10:58] <facubatista> ¡Muy buenos días a todos!
[10:59] <Chipaca> facubatista: 👋
[11:00] <jam> morning facubatista
[11:00] <jam> Chipaca, so I had to update my dependencies for master
[11:00] <jam> but once I did that, the tests passed
[11:00] <Chipaca> facubatista: charmcraft tests on master don't work for me (E   ModuleNotFoundError: No module named 'tests.factory') and was wondering if i needed to do anything
[11:01] <facubatista> do you have a tests/factory.py file?
[11:01] <jam> I d
[11:01] <jam> o
[11:01] <Chipaca> i do
[11:01] <Chipaca> and i can import it
[11:02] <Chipaca> by hand from a python running from the same place i run the tests
[11:02] <jam> Chipaca, want to come by the bug review hangout and we'll chat on it?
[11:02] <Chipaca> sure
[11:26] <Chipaca> jam, facubatista, https://docs.pytest.org/en/latest/pythonpath.html#pytest-vs-python-m-pytest
[11:30] <jam> Chipaca, which as I read it says "put an __init__.py and things will work" :)
[11:30] <Chipaca> there's also a strong recommendation of using src/
[11:30] <Chipaca> but that doesn't fix my issue :-/
[11:33] <Chipaca> --import-mode=importlib fixes all my woes \o/
[11:33] <jam> Chipaca, https://blog.ionelmc.ro/2014/05/25/python-packaging/#the-structure seems to say the advantage is that you have to install in order to do tests
[11:34] <jam> I find that extra step to be a bit onerous to a code test code test code test lifecycel
[11:34] <jam> build in place is pretty good
[11:34] <Chipaca> yeah
[11:34] <Chipaca> also 2014 is SO six years ago
[11:34] <jam> Chipaca, it also explicitly breaks your version.py cheats
[11:35] <Chipaca> unfortunately --import-mode=importlib requires pytest 6
[11:35] <jam> Chipaca, and they say "use tox" but my explicit problem with tox is the 10+s it adds to each test iteration
[11:35] <Chipaca> and this is all because the init templates include a 'tests' directory, btw
[11:38] <Chipaca> also, there's a test in charmcraft that looks at the flags that are used to run the test instead of .. something else? but maybe that's a 6.0 breakage, looking
[11:40] <Chipaca> no, this is test breakage
[11:40] <Chipaca> facubatista: :-(
[11:41] <Chipaca> facubatista: if you run pytest with any flags at all, they're passed straight in to e.g. test_main_no_args
[11:41] <Chipaca> and fail
[11:42] <Chipaca> facubatista: e.g., python -m pytest --log-auto-indent=on
[11:43]  * facubatista is trying to understand these lines
[11:45] <Chipaca> facubatista: ╌╼╍╾╌╼╍╾╌╼╍╾╌╼╍╾╌
[11:45]  * Chipaca helps
[11:57] <facubatista> Chipaca, I don't see how is possible to happen what my eyes are seeing; if you still need my help let's HO
[11:59] <Chipaca> facubatista: osm ho now tho
[12:23] <Chipaca> davigar15_: trying to 'charm push' a .charm doesn't immediately tell me to do one so maybe it'll work? i don't have the right credentials to try :)
[12:23] <Chipaca> facubatista: can we have a meet
[12:24] <Chipaca> facubatista: (standup)
[12:28] <Chipaca> facubatista: "tan"
[12:29] <facubatista> :)
[12:32]  * Chipaca enquires about lunch
[13:34] <crodriguez> jam: I understand that, but there are some cases where you need the charm to be in error. It's also a lot easier to troubleshoot because error gives you access to the debug-hooks and resolve actions.
[13:35] <jam> crodriguez, sure. if you need error, by all means use it, just realize the implications
[13:39] <crodriguez> jam: yeah it's for a specific case. So I think a class "ErrorStatus" should be added to ops.model
[13:39] <jam> crodriguez, you can always raise an exception.
[13:39] <jam> Juju doesn't let us set Error status
[13:39] <jam> it only happens as a result of exit nonzero
[13:39] <crodriguez> yes it does.. well it was an option in the reactive framework at least
[13:40] <jam> I'll double check
[13:41] <crodriguez> I'll dig to see how it was done in reactive
[13:46] <Chipaca> jam: ah! (?s:<regexp>) is new in 3.6
[13:46] <Chipaca> jam: you want (?s)<regexp>
[13:47] <jam> Chipaca, or I can just set the flag on the compile
[13:47] <jam> Chipaca, do you prefer having it in the regex?
[13:47] <Chipaca> i prefer having it in a flag :)
[13:49] <jam> Chipaca, also adding a test for paths with '\n' in them if we want DOTALL to be set
[13:50] <jam> (which fnmatch did, so I'm following suit)
[13:52] <jam> crodriguez, $ juju run --unit ubuntu-lite/0 'status-set error flobar'
[13:52] <jam> ERROR invalid status "error", expected one of [maintenance blocked waiting active]
[13:53] <jam> I'm not sure how reactive was handling error, but it isn't allowed by status-set
[13:53] <jam> It may be that we can call 'status-set blocked message' and then raise an exception to return nonzero
[13:53] <jam> but we'd need a reasonable mechanism
[13:54] <crodriguez> jam: alright yeah maybe they did a workaround for that. I can settle for a blocked status for now to do what I need to do, thanks for double-checking
[14:00] <jam> looking here: https://github.com/juju/charm-helpers/blob/master/charmhelpers/core/hookenv.py#L62
[14:00] <jam> and here:https://github.com/juju/charm-helpers/blob/master/charmhelpers/core/hookenv.py#L1123
[14:00] <jam> it seems that using error would just raise a ValueError
[14:00] <jam> unless I'm reading it wrong
[14:01] <jam> (or the code has changed in the meantime)
[15:14] <facubatista> jam, .jujuignore rules are pretty much the same ones than .gitignore, right? https://git-scm.com/docs/gitignore#_pattern_format
[15:24] <jam> facubatista, they were modeled after them, yes
[16:12]  * Chipaca runs the tests against the 'charmcraft init'-generated code and wonders if it's enough meta-programming
[16:19] <Chipaca> why don't pathlib.Path objects have a chdir() that's a context manager?
[16:20] <Chipaca> as in: with tmp_path.chdir(): …
[16:30] <facubatista> Chipaca, meeting?
[16:31] <Chipaca> oops
[17:14] <Chipaca> facubatista: for the sys.argv thing, are you fixing that or should I?
[17:14] <Chipaca> facubatista: I need to pass arguments to pytest now, how would you prefer I did that?
[17:15] <facubatista> Chipaca, if you fix the sys.argv thing, you can pass args to pytest, right?
[17:15] <Chipaca> facubatista: yes, from run_tests
[17:15] <facubatista> Chipaca, the fix is just removing the sys.argv default from the function definition, right?
[17:15] <Chipaca> facubatista: yes
[17:15] <facubatista> you can include that in your branch
[17:15] <Chipaca> facubatista: i can push a pr to do just that
[17:15] <Chipaca> or i can include it, indeed
[17:16] <Chipaca> ok
[17:16] <facubatista> thanks
[17:34] <Chipaca> brb (gpg agent died, easiest way to get it back is restarting the session)
[17:46] <Chipaca> facubatista: https://github.com/canonical/charmcraft/pull/91 fwiw
[17:46] <mup> PR charmcraft#91: First pass at 'charmcraft init' <Created by chipaca> <https://github.com/canonical/charmcraft/pull/91>
[17:46] <facubatista> wee
[17:46] <Chipaca> and i'm off to make dinner & etc
[17:46] <Chipaca> ttfn
[17:46] <facubatista> ack
[18:46] <facubatista> Chipaca, please remember https://github.com/canonical/charmcraft/pull/89
[18:46] <mup> PR charmcraft#89: Store release <Created by facundobatista> <https://github.com/canonical/charmcraft/pull/89>
[18:47] <facubatista> (and I think there's a problem with Travis... that PR is not listed at all in https://travis-ci.org/github/canonical/charmcraft/builds )
[20:42]  * facubatista eods