[08:27] <mup> Issue operator#286 closed: charms/test_main should not use Pickle <Created by jameinel> <Closed by jameinel> <https://github.com/canonical/operator/issues/286>
[08:27] <mup> PR operator#363 closed: 0.8 test charm no pickle <Created by jameinel> <Merged by jameinel> <https://github.com/canonical/operator/pull/363>
[08:31] <Chipaca> ｇｏｏｏｏｏｏｄ  ｍｏｒｎｉｎｇ！
[08:53] <jam> morning Chipaca
[08:57] <Chipaca> jam: 👋 how's things?
[09:01] <jam> Chipaca, going pretty well. I still need your review on operator#364
[09:01] <mup> PR #364: ops/testing.py: Harness.begin_with_initial_hooks() <Created by jameinel> <https://github.com/canonical/operator/pull/364>
[09:02] <jam> Chipaca, I'll probably miss the standup today, I have a conflicting meeting
[09:02] <Chipaca> ack
[09:07] <jam> Chipaca, how's it with you?
[09:07] <Chipaca> jam: needing more coffee :)
[09:24]  * Chipaca has more coffee now
[09:48] <Chipaca> jam: instead of diving into preconditions, i've been tinkering with ops-lib-k8s
[09:49] <Chipaca> still haven't touched the tests though
[09:52] <mup> Issue operator#237 closed: Feature request: Harness helper function/flag to run initial hooks as juju would execute? <enhancement> <Created by Vultaire> <Closed by jameinel> <https://github.com/canonical/operator/issues/237>
[09:52] <mup> PR operator#364 closed: ops/testing.py: Harness.begin_with_initial_hooks() <Created by jameinel> <Merged by jameinel> <https://github.com/canonical/operator/pull/364>
[09:52] <jam> Chipaca, ah nice. I don't think I gave much feedback on that one, I should
[09:53] <Chipaca> jam: latest pr sets things up for them to work with opslib because design was wanting a real-world example of what a non-interface component looked like
[10:34] <gnuoy> Chipaca, I'm in the process of updating charmcraft issue 104. Would I be right in saying that for charms running in Juju <2.8 the operator framework needs to create the hook symlinks when the install hook runs ?
[10:34] <mup> Issue #104: Symlink for `hooks/upgrade-charm` is not created when missing <Created by evhan> <Closed by jameinel> <https://github.com/canonical/operator/issues/104>
[10:40]  * gnuoy assumes it should and updates the bug
[10:43] <Chipaca> gnuoy: yes
[10:43] <gnuoy> kk, thanks
[10:43] <Chipaca> gnuoy: bah, whatever hook runs first
[10:43] <gnuoy> yep, understood
[10:43] <Chipaca> in <2.8 on k8s that was 'start', for ex
[10:43] <Chipaca> and it couldbe upgrade-charm? i think
[10:44] <Chipaca> iffen you're upgrading :)
[10:45] <gnuoy> so I think the bug is correct, if you use charmcraft then a legacy deployment is never detected and the symlinks never created.
[10:46] <gnuoy> I assumed it was deliberate hence the min-version thing. I'll update the title.
[10:46] <Chipaca> gnuoy: what's a 'legacy deployment'?
[10:47] <gnuoy> Chipaca, I'm stealing the phrase from the ops framework. I believe it to mean a non-dispatch aware version of Juju
[10:47] <gnuoy> https://github.com/canonical/operator/blob/master/ops/main.py#L173
[10:47] <Chipaca> ah :)
[10:48] <Chipaca> gnuoy: this is with juju <2.8?
[10:48] <gnuoy> right
[10:48] <Chipaca> hmm™
[10:48] <gnuoy> I've put more detail in https://github.com/canonical/charmcraft/issues/104
[10:48] <Chipaca> thanks
[10:50] <Chipaca> gnuoy: this is code i wrote, so it cannot _possibly_ have bugs
[10:50] <gnuoy> haha, must be feature.
[10:52] <Chipaca> gnuoy: https://youtu.be/qhXjcZdk5QQ?t=52
[10:53] <gnuoy> exactly!
[10:59] <Chipaca> that's quite a pickle
[11:03] <facubatista> ¡Muy buenos días a todos!
[11:04] <Chipaca> facubatista: (null)
[11:04] <Chipaca> er
[11:04]  * Chipaca checks his config
[11:05] <facubatista> je
[11:05] <Chipaca> facubatista: 👋❗
[11:05] <Chipaca> much better
[11:06] <facubatista> https://imgflip.com/i/4adkoh
[11:06] <facubatista> :)
[11:07] <Chipaca> facubatista: https://www.bbc.com/future/article/20160325-the-names-that-break-computer-systems
[11:08] <bthomas> This one surely breaks a lot https://xkcd.com/327/ :-)
[11:09] <facubatista> Chipaca, my mother's last name is Muñiz, and I remember the real life in the pre-unicode era, everything was Mu#iz for her
[11:10] <facubatista> Chipaca, jam, in charmcraft#104, shouldn't the OF create the rest of the hooks?
[11:10] <mup> Issue charmcraft#104: Hook symlinks not created for deployments to environments running Juju < 2.8 <Created by gnuoy> <https://github.com/canonical/charmcraft/issues/104>
[11:10] <Chipaca> facubatista: remember manuel de la peXa?
[11:11] <Chipaca> facubatista: yes the problem is that charmcraft is setting things up in such a way that ops thinks it's in post-2.7
[11:12] <jam> Chipaca, facubatista : the code is still there: https://github.com/canonical/operator/blob/master/ops/main.py#L175
[11:12] <jam> and it is even called: https://github.com/canonical/operator/blob/master/ops/main.py#L334
[11:13] <Chipaca> jam: but the hooks are symlinks to dispatch
[11:13] <Chipaca> jam: and dispatch sets JUJU_DISPATCH_PATH
[11:13] <Chipaca> jam: and dispatch exists
[11:13] <Chipaca> and that's what ops uses to choose legacy or dispatch
[11:13] <facubatista> Chipaca, in current charmcraft, after zipping, remember hooks are not symlinks (but will be in future charmcrafts)
[11:14] <jam> Chipaca, but why is that a problem?
[11:14] <Chipaca> no difference, it's the fact that it sets JUJU_DISPATCH_PATH and exists that does it
[11:14] <gnuoy> self.is_dispatch_aware gets incorrectly set to True which causes an early exit from ensure_event_links
[11:14] <Chipaca> jam: because then no symlinks are created
[11:14] <jam> Chipaca, ah, dispatch is setting JUJU_DISPATCH_PATH, why would it do that?
[11:14] <jam> bad script no biscuit
[11:14] <jam> :)
[11:14] <Chipaca> jam: other bugs :)
[11:15] <Chipaca> need to dig
[11:15] <jam> Chipaca, ok. so it is a charmcraft bug (arguably), at the least, ops and charmcraft don't agree on signaling
[11:15] <Chipaca> yeup
[11:17] <facubatista> Chipaca, https://github.com/canonical/charmcraft/commit/a0bdc74c5b2b63eff9248ad8c192a2c9f8a0f5e1
[11:18] <Chipaca> yup
[11:27] <jam> Chipaca, thinking about multipass and snapcraft/charmcraft. I find it interesting with snaps that it is so dangerous to depend on a executable in $PATH that the preferred route is to expose a service for anyone to poke via the network
[11:27] <jam> Is it because it has been easier to grant Network as a policy than granting "access to executable Foo" as a policy?
[11:27] <Chipaca> jam: it isn't about it being dangerous, it's a limitation of the security layers
[11:29] <Chipaca> jam: (there's also the policy issue of letting a confined thing execute an unconfined thing meaning you've just unconfined the confined)
[11:30] <jam> Chipaca, so find a way to execute the unconfined thing via an HTTP post instead of a CLI exec
[11:33] <Chipaca> jam: the thing is already exposing a grpc api over a socket to itself
[11:34] <jam> Chipaca, I just mean, a CLI is an API just like an HTTP API is.snapcraft is able to confine things to not find executable, but doesn't have fine grained control to say what services you could talk to
[11:34] <jam> but it means people break their confinement via HTTP requests instead of via CLI requests
[11:57] <Chipaca> gnuoy: we're going to be 5 minutes late
[11:58] <gnuoy> sure np
[13:09] <Chipaca> jam, facubatista, wrt charmcraft#104, not super clear to me what we can do
[13:09] <mup> Issue charmcraft#104: Hook symlinks not created for deployments to environments running Juju < 2.8 <Created by gnuoy> <https://github.com/canonical/charmcraft/issues/104>
[13:09] <facubatista> Chipaca, create all hooks symlinks everytime?
[13:10] <Chipaca> that's less than ideal for a couple of reasons
[13:10] <Chipaca> the issue is that calling charm.py drops the name of the hook
[13:10] <Chipaca> that is, we lose sys.argv[0]
[13:10] <jam> Chipaca, not set JUJU_DISPATCH_PATH in dispatch
[13:10] <jam> ah right
[13:10] <Chipaca> so it seems to me
[13:10] <jam> is there a magic in 'exec' ?
[13:10] <Chipaca> that what we should do is set our _own_ variable
[13:11] <Chipaca> with blackjack and …
[13:11] <Chipaca> … built-in help?
[13:11] <Chipaca> jam: i think bash exec does, sh exec does not
[13:11] <Chipaca> but i'd have to double-check
[13:11] <jam> Chipaca, 'exec --help' says 'exec -a NAME'
[13:12] <Chipaca> right, that's bash
[13:12] <facubatista> Chipaca, the builtin help is a good idea, there's a recurrent question when dealing with this new "dispatch thing" that is "so I'm in here with debug-hook, how I call my hook manually?"
[13:12] <jam> $ /bin/dash -c 'exec -a foo echo hello'
[13:13] <Chipaca> jam: ooh, undocumented?
[13:13] <jam>  /bin/dash: 1: exec -a: not found
[13:13] <Chipaca> jam: b'doh
[13:13] <jam> nope, just copy&paste didn't work because IRC interpreted the opening '/' :)
[13:13] <jam> Chipaca, I'm not opposed to #!/bin/bash in dispatch
[13:14] <Chipaca> or we could make it a python script ]=)
[13:14] <facubatista> Chipaca, +1
[13:15] <Chipaca> but bash sounds alright for a last-minute thing
[13:15] <jam> facubatista, Chipaca we could. I know that breaks on RedHat because python3 isn't in the default instal
[13:15] <Chipaca> drop JUJU_DISPATCH_PATH, and use -a
[13:16] <Chipaca> or
[13:16] <Chipaca> OR
[13:16] <Chipaca> use symlinks
[13:16] <Chipaca> :)
[13:16] <facubatista> Chipaca, symlinks how?
[13:17] <Chipaca> this all goes away if we stop flattening symlinks
[13:17] <Chipaca> doesn't it?
[13:17] <Chipaca> (maybe it doesn't)
[13:17] <jam> Chipaca, if you change hooks/install => ../src/charm.py it would go away, but you can't do that because we want to put the "use the venv" somewhere
[13:17] <Chipaca> right
[13:18]  * Chipaca sets the venv on fire and sits back to watch
[13:18] <Chipaca> I'll write the "use bash w/exec -a" as the quickest way out
[13:23] <Chipaca> … that doesnt work
[13:24] <Chipaca> python's fiddling with argv
[13:30] <facubatista> Chipaca, you that know Unix (?), is it ok to have a space rigth after the shebang in "#! /usr/bin/env python3" ?
[14:34] <Chipaca> facubatista: yep (and they've been documented as required at some point, although weren't)
[14:36] <facubatista> thanks
[14:46] <Chipaca> facubatista: also, env -S exists (as of when? no idea)
[15:04] <ballot> Hello !
[15:05] <facubatista> hello ballot!
[15:06] <ballot> I'm looking for a way to retrieve the pod_spec using ops.testing. I see that self.harness.get_pod_spec is defined in 0.8 (https://github.com/canonical/operator/blame/master/ops/testing.py#L423). I guess I don't have a way to test this easily with 0.7 right ? :)
[15:07] <ballot> well, I don't really have a problem trying to use 0.8 for my charm tbh anyway, i'll give it a try
[15:15] <Chipaca> ballot: and 0.8 should be out this week :)
[15:15] <Chipaca> ballot: pre that, there wasn't an easy way of doing that, no
[15:16] <ballot> Chipaca: alright, just wanted to be sure I was not missing something. I have an issue with charmcraft build, I'll bring that to the right channel, thanks :)
[15:16] <Chipaca> ballot: 'charmcraft build' issues is also here :)
[15:16] <ballot> Ah !
[15:17] <Chipaca> ballot: unless you're building something so secret you can't talk about it in public :-D
[15:17] <ballot> Well, I put "-e git+https://github.com/canonical/operator.git@master#egg=ops" in my requirement.txt and confirmed it works with "pip install -r requirements.txt"
[15:17] <ballot> When I do charmcraft build, in the full log I have
[15:18] <ballot> https://pastebin.ubuntu.com/p/jmyJh58WCT/
[15:18] <ballot> (sorry bad habit of using the internal one)
[15:19] <Chipaca> whoa
[15:19] <facubatista> Chipaca, jam, where I can read about the order of first events sent by Juju?
[15:19] <ballot> It's fine, I can workaround it easily by manually pulling the wheel in the right location, but probably bug worthy. Just wanted to be sure it was not something obvious on my side
[15:20] <Chipaca> ballot: does that still happen if your requirements.txt has 'git+https://github.com/canonical/operator.git' instead of your more funky line?
[15:20] <ballot> Chipaca: let me try
[15:20] <jam> facubatista, https://discourse.juju.is/t/event-cycle/1117
[15:20] <facubatista> jam, thanks
[15:20] <jam> https://discourse.juju.is/t/charm-hooks/1040 and https://discourse.juju.is/t/the-hook-environment-hook-tools-and-how-hooks-are-run/1047 are also relevant
[15:22] <ballot> Chipaca:  :: ERROR: Could not detect requirement name for 'git+https://github.com/canonical/operator.git', please specify one with #egg=your_package_name
[15:22] <Chipaca> super strange, i've got that here and it works
[15:22] <ballot> Chipaca: also tried to remove the @master, but then, read-only filesystem again
[15:22] <Chipaca> ballot: this is with charmcraft 0.3 from the snap, yes?
[15:23] <ballot> Chipaca: yes
[15:23] <Chipaca> facubatista: ^ any ideas?
[15:23] <ballot> Chipaca: I think I know what happens, I just need to find in pip where is the default location for pulling the dependencies
[15:24] <ballot> Chipaca: ah, that's the "-e"
[15:24] <ballot> Chipaca: it works without the "-e"
[15:24] <Chipaca> augh
[15:24] <ballot> yeah right, makes sense
[15:24] <Chipaca> i totally ignored that :-)
[15:24]  * Chipaca needs a better parser in his brain
[15:24] <facubatista> the -e tries to install it in your home or something?
[15:24] <Chipaca> it's the "develop" thing
[15:25] <facubatista> Chipaca, I though it was why you suggested to use a simpler line
[15:25] <ballot> It's to point toward the module you're working on so you don't have to update your env
[15:25] <ballot> facubatista: yes, I missread, and did remove the "-e"
[15:25] <Chipaca> yep, like 'python setup.py develop'
[15:26] <Chipaca> ballot: but if you did that for a charm, you'd end up with a .pth and not the actual code you need inside your charm, right?
[15:26] <ballot> anyway, I don't think using -e makes sense for a charm anyway
[15:26] <ballot> Chipaca: yeah, it was merely a bad habit on my side
[15:27] <Chipaca> sounds like an argument against charmcraft supporting 'full' requirement.txt
[15:27] <Chipaca> :-/
[15:27]  * Chipaca oh noes
[15:27] <ballot> sorry :/
[15:27] <Chipaca> facubatista: maybe we should detect and fail early or with a clearer message
[15:28] <ballot> Chipaca: does charmcraft support constraints files ?
[15:28] <Chipaca> ballot: no
[15:28] <facubatista> Chipaca, let's use fades, that doesn't support "-e" :p
[15:29] <Chipaca> ballot: but not because of philosophical reasons, just nobody's asked us :-)
[15:30] <ballot> Chipaca: well, "priorities" :)
[15:31] <ballot> Chipaca: I'm not sure it's worth spending time on it right now. The only use case I see is if the application code and charm are hosted on the same repository, then to limit in one place some module version for the app, the charm and the tests, it's better to use constraints rather than repeating the limitation in all requirements.txt
[15:33] <Chipaca> k
[15:33] <Chipaca> i need to step out (physio! here's hoping for a better back)
[15:35] <ballot> Chipaca: np, thanks !:
[15:35] <ballot> My tests are running now :)
[15:35] <ballot> (well failing of course, as one would expect, but for good reasons now)
[15:45] <Chipaca> :-D
[15:45]  * Chipaca disappears into the sunset
[21:25]  * facubatista eods