[04:03] Issue operator#293 opened: passing k8s_resources to pod.set_spec does not work [08:41] good morning peeps! [09:53] * Chipaca takes a break === mup__ is now known as mup_ [11:10] Muy buenos días a todos! [11:18] facubatista: 👋! [11:19] hola Chipaca :) [12:18] question: is it possible to emit an interface event that comes with a data structure which the charm then fills in with data? i tried it but it looks like the data that the charm set doesn't make its way back to the interface. i suppose it's cloned before being passed to the charm? [12:27] MarkMaglana: you'd need to implement custom serialisers and de-serialisers [12:27] MarkMaglana: other than that i'd expect it to work [12:28] Chipaca: got an example? That's not the `snapshot` and `restore` methods is it? [12:29] MarkMaglana: i don't have an example, no -- and yes, snapshot and restore [12:30] MarkMaglana: 'The current storage state is committed before and after each observer is notified.' (what it doesn't say is that _emit is just _reemit with more steps) [12:30] ie the event gets written out, and then read back in [12:37] OK thanks! Let me try that out then. [12:38] * Chipaca goes back to having lunch [12:40] facubatista: https://www.pythonpodcast.com/pip-resolver-dependency-management-episode-264/ fwiw [12:40] Chipaca, will read, after I finish the review of your branch [12:40] facubatista: I approve of this ordering [13:01] Chipaca: I may be doing something wrong. The data that the charm set doesn't make its way back to the interface. [13:01] Here's the data structure with custom snapshot and restore: https://github.com/relaxdiego/charm-k8s-alertmanager/blob/7704df683400057208a3f18d79eaf326ce64e22c/src/interface_prometheus.py#L14-L39 [13:02] Here's the interace's handler/emmitter: https://github.com/relaxdiego/charm-k8s-alertmanager/blob/7704df683400057208a3f18d79eaf326ce64e22c/src/interface_prometheus.py#L85-L95 [13:03] ...and here's the charm code that tries to modify the data structure: https://github.com/relaxdiego/charm-k8s-alertmanager/blob/7704df683400057208a3f18d79eaf326ce64e22c/src/charm.py#L73-L80 [13:18] MarkMaglana: and what do you see in the logs? [13:22] Chipaca: https://gist.github.com/relaxdiego/dc3af6827f150cd1b698e2da9106b603 [13:23] MarkMaglana: but that shows you getting the data [13:23] MarkMaglana: what are you seeing as broken? [13:23] from the interface to the charm, yes. i was hoping that the additional 'test': 'test1' that I set from inside the charm would make its way back to the interface. [13:24] see line 14 of that gist [13:26] ohhhh [13:27] MarkMaglana: sorry, I had misunderstood [13:28] MarkMaglana: I don't think that's going to work [13:28] did i misunderstand the concept of interfaces? i thought it was meant to be a dumb pipe that both ends of the interface can send and receive messages through. [13:41] facubatista: you froze [13:41] Chipaca: oh. I should call `framework.relation_data_set()` inside the charm, huh? [13:43] ok i need to revisit this. [13:43] time to call it a day for now [13:48] MarkMaglana: i don't see a relation_data_set, but let's talk more tomorrow [13:49] also ja_m comes on early tomorrow so maybe that's more timely for you (he's off today) [13:49] * Chipaca feels like half his brain is off today too [15:42] facubatista: addressed all your concerns with ops.lib except the have-a-dict-per-api one [15:42] still thinking about that one [15:43] Chipaca, ack, thanks! [15:44] facubatista: it can't be exactly as you show because then we'd risk overwriting an newer patch-level with an older one for the same api [15:44] but it's an easy tweak [15:44] yes, (api, patch) [15:44] but, but, not sure it's simpler. OT1H it's got a better behaviour in a pathologic case [15:45] facubatista: nah, you don't want the patch in that dict, just the api [15:45] Chipaca, in any case, even if we keep the current structure, let's think about "repeated" stuff there [15:45] and if d[api] < the_one_i_just_found, then replace it [15:45] facubatista: ok let's do that [15:45] mmm... you still need to put 5.4 in that structure, even if you have 5.5, because the user may specify 5.4 [15:46] facubatista: no they mayn't [15:46] facubatista: the user may only specify api, not patch [15:46] ah, right [15:46] so we only need to keep one [15:50] facubatista: that's we the list is kept sorted [15:50] facubatista: but [15:50] facubatista: the common case is going to be to have just one of these things [15:50] two is already stretching it [15:50] so the current approach seems fine [15:50] Chipaca, ok [15:51] if it turns out we're wrong about this and need to change to a dict because, it's a private, invisible change [15:51] so i'm happy as is [15:54] Chipaca, +1 with a comment [15:54] OTOH, I'm concerned about the quantity of exit points in None, after not finding exactly what we want, without any logging or anything. [15:54] this would make debugging that part of the lib really hard [15:55] facubatista: yes. I'm thinking about that a bit. [15:55] Chipaca, I propose to be silent only when checking all the sys.path and searching for "opslib" dir... but after that, if we do find a "opslib", we should log in debug why we're skipping what we found [15:55] facubatista: OTOH², I was thinking of writing a second ops.lib.use [15:55] ]:-) [15:56] a second one? [15:56] facubatista: one that you run at build time [15:56] facubatista: or at debug time [15:56] and it tells you what it would find, what you're missing, that sort of thing? [15:57] ops.lib.search [15:57] super verbose [15:57] "you have ops.lib.use('foo') but no foo anywhere", or "you have ops.lib.use('foo') but your requirements do not include those from the foo opslib" [15:57] dunno, spitballing here [15:57] ops.lib.use('foo', debug=True) [15:58] * Chipaca wonders why it's called 'spitballing', that's disgusting [15:58] verbose=True [15:58] explain=True [15:58] facubatista: i was thinking more "charmcraft build runs the charm with DEBUG_OPS_LIB=1" [15:58] "foo opslib found, discarding it because LIBPATCH constant is not an int" [15:59] in any case, these are incremental improvements we can … improve [15:59] or we can increment them :-p [16:00] Chipaca, checking this "at lib building" (through charmcraft, for example) would bring issues when all these checkings evolve ("it's clean when I build it but in production is not getting found", then to realize the user has OF 0.7 in dev and 0.6 in prod) [16:01] facubatista: so we should be logger.debug(...) stuff in any case [16:01] or logger.info() even [16:01] Chipaca, logging in debug why the opslib that we find is not really considered, at .use() time, would be a nice thing [16:01] right [16:02] in any case, after we find the "opslib" dir, none of those loggings should be seen, unless the lib itself is malformed [16:02] "misformed"? "misshaped"? [16:03] "an mp3 file of a scream"? [16:17] d'oh, forgot to drop the XXX [16:18] Chipaca, this is a good source about the "solver": https://github.com/pypa/pip/issues/988 [16:18] facubatista: ack [16:19] it starts ~7 years ago :) [16:19] facubatista: it's almost as if this stuff were hard [16:19] jajaja [16:19] go figure [16:43] * facubatista -> bank errands, bb~1h [17:56] * facubatista is back [18:48] PR operator#294 opened: Log when a served breakpoint is not really activated because of name mismatch [20:39] * facubatista eods