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