#smooth-operator 2020-08-10
<ballot> Hello folks. I'm back after few days off, I'll work on a CI job today. If you have the time to quickly glanced at https://code.launchpad.net/~ballot/charm-k8s-mm-pd-bot/+git/charm-k8s-mm-pd-bot/+merge/388497 . Feel free to ping me if you want to make it a peer review or something to go over it quicker
<Chipaca> ð
<bthomas> ðð¸ð¸ð­ ðð¸ð»ð·ð²ð·ð° ððµðµ
<bthomas>  
<bthomas> Chipaca: I am reading thourgh https://ops.readthedocs.io/en/latest/ . Is it ok if I make a list of all my questions and discuss with you and jam (when he is back), instead of asking them one by one on this channel. Alternatively I can create a mock pull request with questions, and notes within docs were they were not clear to me.
<Chipaca> bthomas: actually the latter sounds the most appealing to me
<bthomas> Ok will do
<mup> PR operator#368 opened: Clarify ops.testing.Harness.update_config usage <Created by darkalia> <https://github.com/canonical/operator/pull/368>
<facubatista> Â¡Muy buenos dÃ­as a todos!
<Chipaca> facubatista: heyy
<facubatista> hola Chipaca
<Chipaca> I have an awesome idea
<Chipaca> starts with L and rhymes with "hunch"
 * Chipaca hunts for food
<Chipaca> Facu: fun network day again?
<facundo__> Chipaca, :(
<mup> PR operator#369 opened: use yaml instead of json for pod-spec-set call <Created by chipaca> <https://github.com/canonical/operator/pull/369>
<ballot> Chipaca: thanks for the review. I've answered the comments and will fix what is needed
<Chipaca> ballot: thank you!
<Chipaca> ballot: i just pushed a pr to fix #293 but it needs IRL testing
<mup> Issue #293: passing k8s_resources to pod.set_spec does not work <juju-workaround> <Created by jetpackdanger> <https://github.com/canonical/operator/issues/293>
<ballot> Chipaca: if pjdc doesn't have the time to do it tonight I'll test it tomorrow if you wish
<Chipaca> ballot: i'd appreciate that, thank you
<bthomas> Chipaca: Work in progress (don't review) - will discuss in stand up : https://github.com/balbirthomas/operator/tree/improve-docs
<Chipaca> bthomas: ack
<Chipaca> heading in to the standup now
<Chipaca> WOOO 10 minute standup for the win
 * Facu -> lunch
 * Facu is back
<facubatista> for sure I have network micro-cuts, but I wonder why this is so affected by those
<facubatista> all the rest are resilient to the microcuts, mattermost, even videocalls
<facubatista> is it IRC? is it hexchat? is it freenode servers?
<Chipaca> Facu: i bet snapd isn't particularly happy with the microcuts either
<Chipaca> (try 'snap download 0ad' for example)
<Facu> it all depends on the timeout, right?
<Chipaca> on how stateful the connection is for the app, really
<Chipaca> videocalls will be doing stuff with multiple connections, sending (and receiving?) more than they need to be able to patch over those things afaik
<Chipaca> or at least it used to be that way :)
<facubatista> theorically they worked remotely on the router, let's see if my networking improves
<facubatista> it works it improved!
 * facubatista does a little dance
 * facubatista eods
<mup> PR operator#370 opened: Update README.md <Created by alejdg> <https://github.com/canonical/operator/pull/370>
#smooth-operator 2020-08-11
<jam> morning all
 * Chipaca struggles to find his voice
 * bthomas recommends some ginger tea
<mup> PR operator#369 closed: use yaml instead of json for pod-spec-set call <Created by chipaca> <Closed by chipaca> <https://github.com/canonical/operator/pull/369>
<Chipaca> oops
<mup> PR operator#369 opened: use yaml instead of json for pod-spec-set call <Created by chipaca> <https://github.com/canonical/operator/pull/369>
<facundo__> Â¡Muy buenos dÃ­as a todos!
<bthomas> ðð¬ð¬ð¡ ðð¬ð¯ð«ð¦ð«ð¤
<bthomas>  
<facubatista> hola bthomas :)
<bthomas> :)
<mup> PR operator#370 closed: Update README.md <Created by alejdg> <Merged by chipaca> <https://github.com/canonical/operator/pull/370>
<Chipaca> ballot: have you been able to set aside a bit of time for testing the fix to #293?
<mup> Issue #293: passing k8s_resources to pod.set_spec does not work <juju-workaround> <Created by jetpackdanger> <https://github.com/canonical/operator/issues/293>
<Chipaca> heh, i just realised why you said "if pjdc doesn't have the time"
<ballot> Chipaca: hello ! Not yet, was planning to do this afternoon. Since I need to compile juju and I have only go 1.12 setup on my laptop, I might have to do some tweak. The fix is committed but not released so I guess I need that to test fully the code
<Chipaca> ballot: why comile juju?
<Chipaca> ohh.... no i meant just the fix on operator side, ie #369
<mup> PR #369: use yaml instead of json for pod-spec-set call <Created by chipaca> <https://github.com/canonical/operator/pull/369>
<Chipaca> because after noticing the fix on juju side, i realised we'd still be broken on older jujus so we really should work around it ourselves as well
<ballot> Chipaca: aaaah, ok, much easier then :)
<ballot> I thought I needed the fix on both sides
<mup> PR operator#368 closed: Clarify ops.testing.Harness.update_config usage <Created by darkalia> <Merged by chipaca> <https://github.com/canonical/operator/pull/368>
<Chipaca> ballot: both fixes fix the issue independently :)
<Chipaca> off to lunch, bbl
<Chipaca> facubatista: #113 could use a re-review
<mup> Issue #113: Automatically transform config into pod spec <Created by knkski> <Closed by niemeyer> <https://github.com/canonical/operator/issues/113>
<Chipaca> er
<Chipaca> charmcraft#113
<mup> PR charmcraft#113: init: include series in metadata.yaml <Created by chipaca> <https://github.com/canonical/charmcraft/pull/113>
<Chipaca> narindergupta: ð
<narindergupta> Chipaca, hey I am starting work on writing a new k8s charm from scratch for Cassandra on k8s just need to know how to start with the k8s component in framework?
<Chipaca> narindergupta: so I pulled mark's work into https://github.com/chipaca/ops-lib-k8s
<Chipaca> narindergupta: the way you use it, add that to your requirements.txt, and then 'k8s = ops.lib.use("k8s", 0, "chipaca@canonical.com")'
<Chipaca> narindergupta: the "that" is "git+https://github.com/chipaca/ops-lib-k8s.git", but it'll be in pip as soon as it's "done" (at which point the API will bump to 1)
<Chipaca> narindergupta: am i making sense?
<narindergupta> Chipaca, so start with charm craft init then make the change
<Chipaca> yep!
<narindergupta> Chipaca, ok I think I can see that
<narindergupta> ops_lib_k8s-0.0.dev0+unknown.dist-info/ and ops-0.8.0.dist-info/ in c=venv
<narindergupta> After charm build
<Chipaca> 'charmcraft build' i hope :')
<facubatista> narindergupta, you should not use the 'charm' tool
<narindergupta> facubatista, I am using charmcraft
<facubatista> great
<facubatista> narindergupta, what is "c=venv"?
<narindergupta> What I meant is in venv directory
<narindergupta> Chipaca, yes I am able to start the work now and still has to go through the pod status to make sure I set the status in charm application as well. Do we still explicitly set the status?
<Chipaca> narindergupta: sorry i didn't follow that
<narindergupta> Chipaca, in my earlier charm I explicitly set the status of the application using activestatus call based on the pods status. Are we following the same as well?
<narindergupta> Like _on_start(self)
<narindergupta>         if (self.model.pod.is_leader()):
<narindergupta>             self.model.app.status = ActiveStatus('ready')
<narindergupta> Basically I wanted to set the application status as pod status if it is leader
<facubatista> narindergupta, I'm lost if you attempted to do that and didn't work, if it worked but you're not sure if it's the best way of doing it
<Chipaca> narindergupta: that is something the charm would do, yes
<Chipaca> narindergupta: I'm not sure if that's your question though
<narindergupta> Chipaca, yes that answers it and currently seeing to pass app data to k8s pod
<narindergupta> Will let you know if come across any issues
<Chipaca> narindergupta: also note you can write self.app.status (it's the same, just shorter)
<narindergupta> Chipaca, gotchu you that is helpful
<Chipaca> narindergupta: and AFAIK it's not pod.is_lader but unit.is_leader :)
<Chipaca> so you can write self.unit.is_leader
<narindergupta> Chipaca, thank you
<Chipaca> ok, i'm out of here
<Chipaca> ttfn!
<drewn3ss> qq, I'm moving from using submodule to pull mod/operator for the ops module to using charmcraft to build my charm.  What should be done with the dead symlink from $CHARM_ROOT/lib/ops that prior pointed to ../mod/operator/ops?  charmcraft dies on looking for where this symlinks to.  https://pastebin.ubuntu.com/p/GKmQy44jTm/
<drewn3ss> is there a specific path I should look for when doing import ops?
<drewn3ss> or is it just available in my built venv?
<drewn3ss> and I shouldn't worry about pathing
<drewn3ss> ok, I did a build of my charm.  the venv directory didn't get created....I see that requirements.txt at the top level is actually equivalent of wheelhouse for reactive.
<drewn3ss> that seems really weird, but I'll roll with it
<drewn3ss> I think long term it'll make more sense for people joinnig into charming, so I'm okay with the rename
<drewn3ss> answer: use requirements.txt to get the modules you want installed from pip into the charm's venv.
<drewn3ss> and remove symlinks and calls to lib paths for anything that was submoduled.
<drewn3ss> because the import will work because it's part of the venv
<narindergupta> Chipaca do you know why am I getting this error ERROR cannot repackage charm: symlink "config.yaml" is absolute: "/home/ubuntu/narinder/charm-k8s-cassandra/config.yaml"
<narindergupta> I am trying to deploy the charm but getting this error
<drewn3ss> how do I make charmcraft build include my CHARM_ROOT/files directory?
<drewn3ss> or /templates, or any other path for that matter
<drewn3ss> seems it pulls in /lib and /src and several .yaml/version files
<drewn3ss> I'd expected it to pull everything not in .jujuignore
<drewn3ss> facubatista: ^
<facubatista> drewn3ss, it will do that, I'm currently working on it: https://github.com/canonical/charmcraft/issues/39
<facubatista> narindergupta, how are you deploying the charm?
<drewn3ss> I see https://github.com/canonical/charmcraft/blob/master/charmcraft/commands/build.py#L123 if your entrypoint dir for build is same as your whole charm dir, then it skips all files
<facubatista> drewn3ss, the "entrypoint" is your main Python file, not a directory
<drewn3ss> ack
<facubatista> drewn3ss, to hack it until a proper solution is ready, you could include your files in the CHARM_OPTIONAL list
<facubatista> drewn3ss, in that build.py, line ~38
<drewn3ss> is that environmental, arg-able or am I forking the code?
<drewn3ss> forking the code...cool.
<drewn3ss> that's...a non-starter
<facubatista> drewn3ss, as I said, I'm working on the proper solution
<drewn3ss> thank you :)
<drewn3ss> I can also move my files dir to src
<drewn3ss> as it seems all of src is included
<drewn3ss> that's reasonable for now
 * facubatista eods
#smooth-operator 2020-08-12
<narindergupta> facubatista, I am using juju deploy .
<mup> Issue operator#371 opened: Use controller storage if no local storage exists <Created by stub42> <https://github.com/canonical/operator/issues/371>
<Chipaca> moin moin moin
<Chipaca> (my previous good morning went to the wrong channel)
<jam> morning @Chipaca
<Chipaca> heh, the mattermost effect
<bthomas> ð Good Morning ð
<Chipaca> ð
<bthomas> :) only missing a rattle snake
<Chipaca> I think I'm going to make the tests of a 'charmcraft init' charm fail
<Chipaca> until the author does the XXXs :)
<bthomas> How about a message saying what XXX is along with the failed message ?
<Chipaca> yup
<Chipaca> (that's already there)
<Chipaca> you see the messages when you charmcraft init already
<ballot> Hello !
<ballot> Chipaca: trying to test your code change, however, unlike pjdc, when I run a "juju run --unit mm-pd-bot/3 -- pod-spec-set --file /pod.json --k8s-resources /k8s.json", it hangs doing nothing
<ballot> same goes for any juju run really ...
<ballot> I realize I never tried a juju run on a k8s charm
<Chipaca> jam: that works, right?
<jam> Chipaca, I had just been trying to say good morning in mattermost, and immediately decided to say hello here instead
<jam> ballot, Chipaca IIRC in 2.8 you can't juju run on K8s because it uses 'juju ssh' under the hood and K8s containers don't run ssh
<jam> I think they are working on that for 2.9, though I would be surprised that it just hangs.
<Chipaca> ballot: ^ :-/
<ballot> interesting
<ballot> As a workaround, what would be the right move to use pod-spec-set with the right context then ?
<ballot> (lacking juju knowledge)
<jam> ballot, hack it into your charm and test that way?
<jam> kubectl exec ?
<jam> but kubectl wouldn't have the context
<ballot> i've created the file on the operator pod right now, but if I run it directly from there I have : ERROR JUJU_CONTEXT_ID not set
<ballot> yeah, that's the issue, I'm trying to see if Chipaca's branch fixes https://bugs.launchpad.net/juju/+bug/1880637
<ballot> what is strange is that pjdc could do it ...
<ballot> oh well I can try a more recent juju
<Chipaca> ballot: maybe he wasn't using a k8s charm
<ballot> nevermind I'll just hack through my charm and separate kubernetesResources from the pod_spec and test this way
<ballot> Chipaca: I doubt it, but I'll make it work somehow :). But after lunch. Never stand between a frenchman and his lunch !
 * Chipaca would never
<Chipaca> reminds me i need to go to the shops to set fire to some baguettes
 * Chipaca runs
<Chipaca> jk i need to buy some hydration â¦ pills? the fizzy kind
 * Chipaca bbiab
<facubatista> Â¡Muy buenos dÃ­as a todos!
<bthomas> Morning
<facubatista> hola bthomas
<bthomas> yep
<bthomas> how can I be for service facubatista
<bthomas> just watched the testing.Harness video by Paul Goins you gave me last week
<facubatista> awesome
<ballot> Chipaca: I confirm your fix works
<Chipaca> ballot: \\\\\oooo/////
<ballot> Chipaca: I have a WIP branch waiting for your change to land then :) : https://code.launchpad.net/~ballot/charm-k8s-mm-pd-bot/+git/charm-k8s-mm-pd-bot/+merge/389156
<ballot> The pastebin showing the fix : https://pastebin.ubuntu.com/p/VPpRGpr9D8/
<ballot> Updating the github PR
<mup> Issue operator#293 closed: passing k8s_resources to pod.set_spec does not work <juju-workaround> <Created by jetpackdanger> <Closed by chipaca> <https://github.com/canonical/operator/issues/293>
<mup> PR operator#369 closed: use yaml instead of json for pod-spec-set call <Created by chipaca> <Merged by chipaca> <https://github.com/canonical/operator/pull/369>
<Chipaca> ballot: ^^^ :)
<ballot> ah ! too fast for me :)
<ballot> Just updated the PR with my findings
<ballot> well, all good, I'll check for secrets and configmaps later on to have a real "k8s friendly" configuration pattern then, thanks for the help Chipaca
<Chipaca> thanks for testing!
<bthomas> I thought the standard for naming Python unittest tests was test_* . The prometheus charm has "tese" as a suffix. Also it is lacking a package initializer (__init__.py) so if I use a script such as "run_tests" it does not run any tests.
<Chipaca> bthomas: "tese"?
<bthomas> oops test_
<bthomas> test files are named charm_test.py instead of test_charm.py
 * bthomas goes to get coffee before standup
<Chipaca> jam: facubatista: what's a good value of foo in juju_version.has_foo() to know if the juju has state-set/state-get?
<Chipaca> has_state()? has_state_get()? has_controller_state()?
<facubatista> has_state_setting_capability()
<Chipaca> has_embalmed_ones()
<Chipaca> has_trained_ones()
<Chipaca> has_suckling_pigs()
<facubatista> can_set_state()
<Chipaca> has_mermaids()
<Chipaca> facubatista: can_haz_state()
<jam> Chipaca, supports_controller_storage is the one I like
<Chipaca> has_controller_storage? :)
<jam> Chipaca, if you want your has you can have it
 * Chipaca can has it
<Chipaca> jam: facubatista: poke
<facubatista> oops
<jam> sorry, just finishing standup
<Chipaca> facubatista: https://grammarist.com/idiom/lay-of-the-land-or-lie-of-the-land/
<crodriguez> good day everyone! I'm hitting this issue with a subordinate charm deployed on a ubuntu VM. I'm not sure what is causing it, any idea?  https://paste.ubuntu.com/p/pMmg365QR8/
<Chipaca> crodriguez: hi! at what point do you get that? doing what, i mean
<crodriguez> Chipaca, simply by deploying the charm. I don't think it has time to go through any events really, from what I can see in the logs. I didn't run into this before and I have been editing the charm, so maybe something I changed triggered this
<crodriguez> I'll go back a few commits and compare if I'm hitting that still
<Chipaca> crodriguez: 0.8 looks at JUJU_VERSION for some things, more than 0.7
<Chipaca> so it might be us
<Chipaca> but it's supposed to always be set, jam checked all the way back to 2.6 or sth
<crodriguez> I'm using juju 2.8.1
<crodriguez> it's just checking for the JUJU_VERSION environment variable, right?
<Chipaca> yep
<facubatista> crodriguez, good day!
<crodriguez> https://paste.ubuntu.com/p/V75wy85pq7/ humm maybe something changed in juju ?
<Chipaca> there's no JUJU env vars
<jam> crodriguez, "juju run --unit ubuntu/0 env"
<jam> That should create a hook environment, where env vars like JUJU_VERSION would be set.
<jam> they *aren't* set inside of an SSH session.
<narindergupta> Chipaca, I am still getting this error ERROR cannot repackage charm: symlink "config.yaml" is absolute: "/home/ubuntu/narinder/charm-k8s-cassandra/config.yaml"
<Chipaca> narindergupta: what are you trying to do?
<jam> narindergupta, Chipaca : If you are using charmcraft to build the charm, you need to do "charmcraft build; juju deploy ./CHARMNAME.charm"
<narindergupta> Chipaca, I build the charms using charmcraft and now trying to deploy
<jam> you can't deploy from the directory itself.
<narindergupta> jam, oh ok let me try tht
<crodriguez> ah thanks jam. So doing this, https://paste.ubuntu.com/p/rk8337KpJf/ , looks like the env is set correctly
<jam> crodriguez, for your initial pastebin, do you have a bit more context?
<jam> I wonder if we are failing to set JUJU_VERSION for something like "during collect-metrics hook"
<narindergupta> jam, ok I can confirm that your method is orking
<jam> narindergupta, great
<jam> narindergupta, I saw that when you were talking last night, but you weren't around for me to mention it :)
<crodriguez> jam I can get you a complete pastebin of the charm execution
<narindergupta> jam, no worries and thanks;
<jam> JUJU_VERSION in hook environments hasn't been around forever, but the line existed in 2017-09
<jam> so it definitely should be in ~2.4+
<narindergupta> jam, Chipaca I got an install hook error just wondering why we need install in k8s?
<jam> narindergupta, you don't have to implement it, but it is a point the framework itself uses to unpack/setup the python environment that the charm executes in.
<crodriguez> jam: https://paste.ubuntu.com/p/WZfMRkvgyn/ that's all there is in /var/log/juju/unit-iscsi-connector-0
<narindergupta> jam, in that case should I remove the install hook? As I am getting application-charm-k8s-cassandra: 14:03:28 ERROR juju.worker.uniter.operation hook "install" (via hook dispatching script: dispatch) failed: exit status 1
<jam> crodriguez, 2020-08-12 13:39:05 ERROR juju.worker.meterstatus runner.go:77 error running "meter-status-changed": exit status 1
<jam> so it is one of the metrics hooks
<narindergupta> And I am not aware about the dispatch script
<jam> narindergupta, it sounds more like you have a typo/etc in your Charm code, and during 'install' is the first time we try to load your code.
<jam> so its less about 'install' and more just we had a problem executing your charm
<jam> if you remove 'install' then we'll hit the same thing in whatever other hook we call.
<narindergupta> jam, ok let me read my  code once more time then
<jam> crodriguez, the reason we don't normally hit that (I believe) is because if you don't have a metrics.yaml file, then Juju doesn't fire the metrics hooks.
<crodriguez> mmh.. what is the metrics.yaml file for ? :)
<bthomas> Thank you for your suggestions in standup. That was a very useful discussion. Here is a start on the google docs (I will keep adding more questions iteratively as discussed) https://docs.google.com/document/d/14EKsjHtzXnOvY6vaI47VwFzl6MEQ6OxaSBHsN7bcG9Q/edit
<jam> crodriguez, hm. I don't see a metrics.yaml in your code, so I could be off base.
<jam> Chipaca, ^^ it looks like JUJU_VERSION isn't set in the metrics hooks, one more reason they should be normalized.
<crodriguez> narindergupta, jam, there is a way to add more debug logs (so you could see what failed during the install hook). I don't recall the command though, maybe jam remembers it ?
<jam> crodriguez, narindergupta : juju model-config logging-config="<root>=DEBUG" would certainly do it.
<jam> that will give a lot more logging information generally
<jam> bthomas, don't forget to ping here as well, in case we miss stuff getting added to the doc.
<bthomas> jam: will do
<jam> bthomas, also, you'll want to share the document with at least Comment rights
<narindergupta> jam, ok
<jam> bthomas, I'm only able to read that doc right now
<jam> (my standard is Everyone At Canonical can Comment)
<bthomas> jam: ofcourse. Let me fix that
<narindergupta> jam, in Kafka charm there was no install hook as it does not make sense for k8s charm
<bthomas> jam: anyone should be able to edit now. Let me know if that does not work
<jam> narindergupta, in Juju 2.7 it wasn't calling install, in 2.8 it always calls install. You don't have to implement it, but it is there to make things more regular
<narindergupta> jam, gotchu you
<narindergupta> jam, thanks
<mup> Issue operator#372 opened: JUJU_VERSION not set during metrics hooks <Created by jameinel> <https://github.com/canonical/operator/issues/372>
<jam> facubatista, I've pushed an update to charmcraft#99
<mup> PR charmcraft#99: charmcraft/jujuignore.py: Allow extending the list of patterns <Created by jameinel> <https://github.com/canonical/charmcraft/pull/99>
<facubatista> jam, is there any particular reason for the relative import from parent? and not using absolute as we do with the rest for that?
<crodriguez> jam re:metrics. Thanks for opening the bugs! It's not a blocker at least. My charm was stopped because of something else (my own charm code ofc), but it made me found this issue
<narindergupta> Chipaca, I am getting this error k8s = ops.lib.use("k8s", 0, "chipaca@canonical.com")
<narindergupta> NameError: name 'ops' is not defined
<Chipaca> narindergupta: you need to import ops.lib
<narindergupta> Chipaca, ok
<Chipaca> jam: metric hooks don't work with controller state, right?
<narindergupta> Chipaca, I am getting this error now ImportError: cannot find library "k8s" from "chipaca@canonical.com"
<Chipaca> narindergupta: did you add the requirements.txt line?
<narindergupta> Yes I have those two entries
<narindergupta> ops
<narindergupta> git+https://github.com/chipaca/ops-lib-k8s.git
<Chipaca> narindergupta: and where do you get that error?
<narindergupta> Chipaca, while executing k8s = ops.lib.use("k8s", 0, "chipaca@canonical.com")
<narindergupta> In the charm class code
<Chipaca> narindergupta: in a charm built with charmcraft?
<narindergupta> Yes it was build with charmcode
<narindergupta> charmcraft
<Chipaca> narindergupta: can i see the debug logs that lead up to that error please?
<narindergupta> And I can see k8s under venv
<narindergupta> Chipaca, http://paste.ubuntu.com/p/kzJrVyBzTR/
<narindergupta> Here is the http://paste.ubuntu.com/p/28hR8mTTmD src/charm.py
<Chipaca> why are there no debug logs from the framework there?
<Chipaca> narindergupta: can you look in venv/k8s to see if there's an 'opslib' directory there?
<narindergupta> Chipaca, I am not seeing any directly there named opslib
<narindergupta> Chipaca, build/venv contains  k8s  ops  ops-0.8.0.dist-info  ops_lib_k8s-0.0.dev0+unknown.dist-info  PyYAML-5.3.1.dist-info  test  yaml
<Chipaca> very strange
<narindergupta> And in ops/lib/ there is no k8s...
<narindergupta> Yeah
<Chipaca> give me a bit
<narindergupta> Sure no problem let me know in case need any info
<Chipaca> oh i know
 * Chipaca fixes
<narindergupta> :)
<Chipaca> narindergupta: try now
<narindergupta> Do I need to build again?
<narindergupta> Yes I can see opslib now
<narindergupta> Let me kill my controller and retry
<Chipaca> poor controller
<narindergupta> Chipaca, I know in microk8s that's the challenge
<jam> Chipaca, metrics hooks don't work with controller state. We have checks for 'collect-metrics' but didn't implement the same check for meter-status-changed, so that might be a different bug/fix we should do.
<jam> Chipaca, an update for 'is_restricted_context'
<Chipaca> right
<Chipaca> facubatista: i'm having an issue with my tests and logassert, where the tests pass on their own but fail when run in the whole suite
<Chipaca> facubatista: anything in particular i should look out for?
<Chipaca> facubatista: https://github.com/canonical/operator/compare/master...chipaca:more-heuristics-for-storage
<Chipaca> ideas welcome
<Chipaca> it might be something silly, looking at it for too long
<Chipaca> i'm going to take a break, get dinner, etc
<Chipaca> ttfn
<facubatista> Chipaca, will check
<facubatista> Chipaca, which logassert version do you have?
<Chipaca> facubatista: 5
<facubatista> let's see if I introduced a bug there :)
<Chipaca> unpossible
<facubatista> Chipaca, which is the specific test?
<Chipaca> facubatista: all of TestStorageHeuristics
<facubatista> Chipaca, I have a lot of other failures, I suspect because I'm getting messages of "yaml does not have libyaml extensions, using slower pure Python yaml", and tests don't expect that
<facubatista>     self.assertRegex(calls.pop(0), 'Using local storage: not a kubernetes charm')
<facubatista> AssertionError: Regex didn't match: 'Using local storage: not a kubernetes charm' not found in 'juju-log --log-level DEBUG yaml does not have libyaml extensions, using slower pure Python yaml loader'
<Chipaca> facubatista: that means you haven't run the tests in quite a while :-)
<Chipaca> and it also means we probably should fix that
<facubatista> Chipaca, yes and yes
<Chipaca> facubatista: 'apt build-dep python3-yaml' should get you the bits you need
<Chipaca> facubatista: in any case commenting out that log line should get you places
<facubatista> Chipaca, shall I rebuild the VM?
<facubatista> s/VM/venv/
<Chipaca> facubatista: i don't know what you're doing :)
<facubatista> Chipaca, I just apt build-dep as you suggested, error still happening
<facubatista> Chipaca, so, the difference I'm finding so far between running them all or running just a bunch is NOT logassert related
<facubatista> Chipaca, when running just test.test_main.TestStorageHeuristics, all is fine
<facubatista> Chipaca, but when running test.test_main, the test I'm supervising (test_fallback_to_current_juju_version__too_old) fails because
<facubatista> FileNotFoundError: [Errno 2] No such file or directory: 'juju-log'
<Chipaca> facubatista: huh
<Chipaca> facubatista: so probably it's our log setup code
<Chipaca> that's not getting reset
<Chipaca> facubatista: nice pointer. i'll follow it after dinner :)
<facubatista> Chipaca, the logger has all these handlers: [<JujuLogHandler (DEBUG)>, <JujuLogHandler (DEBUG)>, <JujuLogHandler (DEBUG)>, <JujuLogHandler (DEBUG)>, <JujuLogHandler (DEBUG)>, <JujuLogHandler (DEBUG)>]
<facubatista> Chipaca, ack, let me know if you need something else
<Chipaca> facubatista: where do you see those handlers?
<facubatista> Chipaca, I printed the handlers when logassert is hook
<facubatista> added this in l.38 of env/lib/python3.8/site-packages/logassert/logassert.py :
<facubatista>         print("========= prv", logger.handlers)
<Chipaca> facubatista: i get those errors if i remove the reset_logging from test_log
<Chipaca> anyway, i give up
<Chipaca> EOD for me
<Chipaca> tomorrow shall bring new joys
 * facubatista eods
#smooth-operator 2020-08-13
<Chipaca> ï½ï½ï½ï½ï½ï½ï½ï½ï½ï½ï½ï½ï½ï½ï½ï½ï½ï½ï½ï½ï½ï½ï½ï½ï½ï½ï½ï½ï½ï½ï½ï½ï½  ï½ï½ï½ï½ï½ï½ï½ï¼
<bthomas> ðºððð ððððððð
<bthomas>  
<Chipaca> bthomas: how're things going?
<bthomas> Chipaca: I working on how to refactor prometheus charm test cases to use ops.testing.Harness. The Harness supports testing the whole Charm class. Some of the test cases in the prometheus charm test utilties like "adapter/k8s.py" which makes rest calls to Kubernetes API server. This does not seem to fit the Harness framework. I am ignoring this for now and looking at what all can be refactored.
<bthomas> Also reading a bit of some of the python standard library docs
<jam> morning Chipaca
<bthomas> morning jam: looks like you are still jet lagged
<jam> bthomas, at one point I was thinking to always use my local time. Right now, I just always say good morning.
<jam> It is always morning somewhere
<bthomas> :-) It must be night there and you are awake.
<jam> bthomas, I haven't moved to the US yet. it is only 1pm here.
<bthomas> ah
<jam> I'm on a plane next Wednesday.
<Chipaca> fly cartesian
<jam> Chipaca, what voice is ChanServ giving you?
<Chipaca> jam: a blue one
<Chipaca> what a nightmare this logging thing
<Chipaca> reloading a module does not reset its globals, so test_log's reset_logging was wrong
<Chipaca> and it broke logassert for some reason i haven't been able to figure out
<Chipaca> mmm, pytest-xdist â ops test suite finishes in 12 seconds
<jam> Chipaca, shiny. How does xdist handle mock patching, etc. Just farmed out subsets to different processes?
<Chipaca> jam: yep, just farmed out
<Chipaca> jam: different from pytest-parallel which does threading (and breaks spectacularly)
<jam> Chipaca, I don't know if you ever used it, but 'subunit' from Robert Collins had a bunch of similar ideas
<Chipaca> used it for syncdaemon, a couple of lives ago
<bthomas> Which component is responsible for ensuring that status of a pods in an application unit deployed by a charm is correctly set ? Is it Juju/Kubernetes, the Operator Framework or the Charm ?
<jam> bthomas, the charm sets a basic status, Juju tempers that status as it knows that the pod hasn't finished starting yet.
<mup> PR operator#373 opened: fix up logging tests impacting global state so much <Created by chipaca> <https://github.com/canonical/operator/pull/373>
<Chipaca> jam: ^ that was biting me yesterday when trying to test the storage heuristics branch
<jam> Chipaca, responded
<Chipaca> jam: reÂ²sponded
<Chipaca> :)
<jam> rerere
<Chipaca> reeee
<jam> Chipaca, probably here is better for active conversation: What I'd like is that for whatever code path we are executing that is calling setup_root_logging, refactor it to not be called in the path that the test suite needs.
<Chipaca> jam: i could add a no_logging bool on main
<jam> Chipaca, from a side point, why are we triggering main itself for that many tests...
<Chipaca> jam: well, it is test_main :-p
<Chipaca> jam: I'll see if it can be pared down a bit, maybe i got carried away?
<Chipaca> the ones that call out to subprocess shouldn't need this
<jam> Chipaca, if it is only test_main then we are probably ok
<jam> (and test_log, but that is also explicit about logging)
<Chipaca> yep, only test_main
<jam> It just felt like lots of test suites, but that is just because we use inheritence to do scenarios
<Chipaca> and I think I should be able to take it off the _TestMain subclasses
<jam> I thought the inherited TestMain were using subprocess
<Chipaca> exactly, i'll see if those were needed
<Chipaca> give me 5
<Chipaca> jam: indeed i can drop all the _TestMain decorators
<Chipaca> that was silly of me, got carried away
<Chipaca> jam: better now?
<jam> Chipaca, yep. I'm curious why you need TestDispatch, something there where we are doing direct main() interaction?
<Chipaca> jam: all the test cases there call main directly
<facubatista> Â¡Muy buenos dÃ­as a todos!
<Chipaca> jam: via the one _check method
<jam> morning facubatista
<jam> Chipaca, approved
<bthomas> Morning facubatista
<Chipaca> facubatista: ðâ
<jam> https://www.ubuntusoftware.net/about/ looks like a trademark infringement waiting
<Chipaca> what the
<Chipaca> and with a german phone
<bthomas> Hell, almost certainly is an infringement
<jam> They aren't using the Circle of Friends at least
<facubatista> Chipaca, how is it breaking logassert? maybe we could improve logassert's resiliance?
<Chipaca> facubatista: I don't know :-) logassert doesn't see the logs
<Chipaca> facubatista: probably because test_log was doing logging.shutdown(); importlib.reload(logging)
<facubatista> ja
<Chipaca> facubatista: not sure logassert can be made resilient to that :)
<Chipaca> (and reload doesn't do what you'd expect with globals)
<facubatista> Chipaca, it doesn't re-load the module?
<Chipaca> facubatista: it reloads it, but the module's dict is reused
<Chipaca> facubatista: also,
<Chipaca> If a module imports objects from another module using from ... import ..., calling reload() for the other module does not redefine the objects imported from it â one way around this is to re-execute the from statement, another is to use import and qualified names (module.name) instead.
<facubatista> makes sense, yes
<facubatista> it looks like test_log can be improved, yes
<Chipaca> facubatista: and logging uses weakref which makes the whole thing harder to reason, for me
<Chipaca> facubatista: #373
<mup> PR #373: fix up logging tests impacting global state so much <Created by chipaca> <https://github.com/canonical/operator/pull/373>
<jam> Chipaca, any feedback on https://github.com/canonical/charmcraft/pull/99 so I can land that for Facu?
<mup> PR charmcraft#99: charmcraft/jujuignore.py: Allow extending the list of patterns <Created by jameinel> <https://github.com/canonical/charmcraft/pull/99>
<Chipaca> jam: me? reviewing _other_ people's code?
 * Chipaca apologises
<facubatista> jam, if you could change the "from .." thingie, it would be great, thanks!
<jam> facubatista, I just pushed the change
<facubatista> awesome, thanks!
<jam> Chipaca, apologizing for reviewing someone else's code? Or for misspelling apologises :P
 * Chipaca makes guises for Apollo
<Chipaca> jam: not sure why the test of relative imports changes so suddenly, for me
<Chipaca> year ye, hear ye: {**d} is weird
<jam> Chipaca, I thought it would be (.*d) :0
<jam> Chipaca, well, you might create .hidden file, but you'd never create a ..hidden file
<jam> I think it breaks the feeling of a path
<jam> ../foo is normal
<jam> ..foo is not
<Chipaca> jam: if d is a map object (as in collections.abc.Mapping), {**d} creates a copy of it (like dict(**d))
<Chipaca> if a and b are mappings, {**a, **b} creates a new, merged one
<jam> ah, I'd never tried to do that with {}.
<Chipaca> bah, in both cases it's not a copy/merged one but a dict with the k/v
<Chipaca> new from 3.5
<Chipaca> don't like it
<Chipaca> :)
<Chipaca> was reminded of it by somebody just now
<jam> bah humbug I say
<Chipaca> all them modern bows and arrows
<jam> Chipaca, I suppose it is a syntax like list[:]
<jam> but {**dict} doesn't quite ring the same to me
<Chipaca> hush, next they'll be doing [*list]
<Chipaca> waaait
<Chipaca> that already works
<Chipaca> /o\
<jam> Chipaca, I will be missing the next meeting. The finished processing my wife's passport but I have to go pick it up *right now* or they keep it over the weekend.
<Chipaca> jam: go go go
<jam> Chipaca, our scientists were so preoccupied with whether or not they could, they didnât stop to think if they should
<jam> [*list]
<Chipaca> jam: ask me about [*a, *b]
<jam> Chipaca, that looks to my eyes as creating [[1,2,3], [4,5,6]]
<Chipaca> jam: no that would be just [a,b]
<Chipaca> clearly * is the asplode operator
<bthomas> flake8 gives me W503. But if I fix that it gives me W504. Since W503 is deprecated I am adding it to the ignore list.
<Chipaca> bthomas: maybe your flake8 is old?
<Chipaca> bthomas: because that change was merged in 2018
<bthomas> Chipaca: Thanks. my flake8 version = 3.7.9 .
<Chipaca> bthomas: huh, i can't get those to trigger here
 * Chipaca tries a bit more
<narindergupta> Chipaca, hi good morning. I am in process of setting the environment variable in my pod spec do you know how can we setup for conaintaners somehow env: is not recognized
<narindergupta> ops.model.ModelError: b'ERROR json: unknown field "env"\n'
<narindergupta> I am using the template to define the pod spec and replacing the variable.
<Chipaca> narindergupta: can you show me the code?
<narindergupta> Chipaca, I started with this http://paste.ubuntu.com/p/v6GXk2RRKW/ but this is my current template file http://paste.ubuntu.com/p/pfFNs4vPwS/
<narindergupta> As I may ask to add more feature in k8s related to resources
<narindergupta> Chipaca, as K8s get auto scalability feature based on resource usage which is good way to do autoscaling as well.
<narindergupta> Chipaca, this is my http://paste.ubuntu.com/p/PGgR2Ccnt4/ charm.py
<bthomas> Chipaca: hmmm . It was triggering on this commit of mine https://github.com/balbirthomas/charm-k8s-prometheus/commit/d4a82c43d1e8f56a9bf1970dbf4aae73ebffb817 (second hunk)
 * bthomas rushes to get coffee before standup
<Chipaca> narindergupta: I think your problem is that in that first link, the 'env' block is indented such that it isnside a port
<Chipaca> narindergupta: I suspect most of those things aren't meant to be inside a port
<narindergupta> Chipaca, correct it is not the port let me fix that and restart
<narindergupta> I was trying to follow this https://raw.githubusercontent.com/kubernetes/website/master/content/en/examples/application/cassandra/cassandra-statefulset.yaml
<narindergupta> Chipaca, may I know what else is covered apart from port, env, readinessProbe,
<Chipaca> narindergupta: covered by what?
<narindergupta> By framework like when I tried resources, securityContext and lifecycle I got the same error
<Chipaca> narindergupta: because you're putting them under 'ports', and they don't go there
<Chipaca> narindergupta: this has nothing to do with the framework
<narindergupta> Oh ok
<facubatista> Chipaca, meeting?
<Chipaca> facubatista: trying to
<narindergupta> Chipaca, here is new modified file with correct syntax and hopefully it will work http://paste.ubuntu.com/p/s49Xhztf3Y/
<narindergupta> Chipaca, same error ops.model.ModelError: b'ERROR json: unknown field "resources"\n'
<narindergupta> application-charm-k8s-cassandra: 13:40:47 ERROR juju.worker.uniter.operation hook "start" (via hook dispatching script: dispatch) failed: exit status 1
<Chipaca> narindergupta: is this file supposed to have the same structure as the cassandra-statefulset.yaml you linked?
<narindergupta> Chipaca, this is pod spec I am planning to create through template and the way Cassandra deployed on kubernetes is the one from link I shared which I am trying to replicate through juju.
<narindergupta> Chipaca, while writing Kafka charm I used this http://paste.ubuntu.com/p/ZvCf8Drt3R/
<Chipaca> narindergupta: https://discourse.juju.is/t/updated-podspec-yaml-new-features/2124
<Chipaca> narindergupta: in particular, a lot of those things need to be under 'kubernetes'
<Chipaca> narindergupta: look for 'k8s specific container attributes'
<narindergupta> Oh ok
<Chipaca> facubatista: https://github.com/canonical/charmcraft/pull/116 fwiw
<mup> PR charmcraft#116: include install info in README <Created by chipaca> <https://github.com/canonical/charmcraft/pull/116>
<facubatista> ack
<Chipaca> facubatista: also plz can haz https://github.com/canonical/operator/pull/373
<mup> PR #373: fix up logging tests impacting global state so much <Created by chipaca> <https://github.com/canonical/operator/pull/373>
<Chipaca> facubatista: so i can merge it into the storage thing
<facubatista> Chipaca, reviewing
<Chipaca> facubatista: thanks!
<mup> PR operator#373 closed: fix up logging tests impacting global state so much <Created by chipaca> <Merged by chipaca> <https://github.com/canonical/operator/pull/373>
<mup> PR operator#374 opened: use controller-side storage automatically in some cases <Created by chipaca> <https://github.com/canonical/operator/pull/374>
<Chipaca> facubatista: i'm getting test failures on charmcraft master
<facubatista> nice! (not)
<Chipaca> facubatista: can you test if https://paste.ubuntu.com/p/4G3vG6zz9B/ still works for you in your particular env?
<facubatista> Chipaca, how are you running the tests?
<Chipaca> facubatista: in a virtualenv
<narindergupta> Chipaca, thanks I was able at least start the pod now as I have to remove few things and check back later the issues with template
<Chipaca> facubatista: using pytest
<Chipaca> narindergupta: good to hear
<facubatista> Chipaca, but that works for me... see https://pastebin.canonical.com/p/5vDkCkZYHM/ , l.1 is how I normally run the tests, l.22 is inside the venv
<Chipaca> facubatista: you seem to always have a PYTHONPATH i guess :)
<facubatista> Chipaca, oh, yes
<facubatista> Chipaca, testing your patch...
<facubatista> Chipaca, it worked, although I'd prefer this: https://paste.ubuntu.com/p/qZWs56W43k/
<Chipaca> facubatista: if you can reproduce a scenario where that is needed, sure :)
<Chipaca> i almost wrote exactly that, but, aiui if you don't need it outside you won't need it inside
<Chipaca> capisci?
<facubatista> Chipaca, is `export PYTHONPATH=` the way to "delete" a envvar?
<Chipaca> facubatista: unset
<Chipaca> facubatista: although most things don't differentiate between empty and unset
<facubatista> Chipaca, see https://paste.ubuntu.com/p/8p26CqbBvT/
<facubatista> I need the PYTHONPATH to the venv be reused, no matter if I had it before or not
<facubatista> Chipaca, forgot to include in that pastebin that my PYTHONPATH is normally set to '/home/facundo/.bin/pymods' (so the envvar is there, totally unrelated to any venv)
 * facubatista brb
<Chipaca> facubatista: you there?
<facubatista> yeap
<facubatista> Chipaca, yeap
<Chipaca> facubatista: something funky going on with the environ for test_main breaking setting TMPDIR, but i figured a workaround
<facubatista> TMPDIR?
<Chipaca> facubatista: explanation in a pr soon
<facubatista> incenption tests are hard
<facubatista> inception ones too
<Chipaca> facubatista: https://github.com/canonical/charmcraft/pull/117
<mup> PR charmcraft#117: a couple of fixes for tests <Created by chipaca> <https://github.com/canonical/charmcraft/pull/117>
<Chipaca> facubatista: fixes the leftover tmp dirses
<Chipaca> and with that i think i eod
 * Chipaca EODs
<facubatista> justinclark, easy PRs for you to start reviewing...
<facubatista> this is trivial: https://github.com/canonical/charmcraft/pull/116
<mup> PR charmcraft#116: include install info in README <Created by chipaca> <https://github.com/canonical/charmcraft/pull/116>
<facubatista> this is easy in the fix, but may lead you to read some code: https://github.com/canonical/charmcraft/pull/117
<mup> PR charmcraft#117: a couple of fixes for tests <Created by chipaca> <https://github.com/canonical/charmcraft/pull/117>
<facubatista> and this one is kind of easy too, and dives you right into complex code: https://github.com/canonical/charmcraft/pull/118
<mup> PR charmcraft#118: Some changes in preparation for big "include everything but jujuignored" branch <Created by facundobatista> <https://github.com/canonical/charmcraft/pull/118>
<justinclark> Awesome. I'll start going through these facubatista.
<facubatista> justinclark, awesome! let us know any questions
<narindergupta> Chipaca, do we know how to get IP address of a pod?
<drewn3ss> facubatista: I know you're working on issue #39, not sure how far along it is, but I just noticed the README[.md] is not included, hence, no info in charmstore uploads.  Miight be nice to pick up README and README.md in the mean time in current code, unless you're close.  This file can't be relocated to /src to be pulled in automatically.
<mup> PR #39: Change Relation.apps to Relation.app <Created by johnsca> <Merged by niemeyer> <https://github.com/canonical/operator/pull/39>
<facubatista> drewn3ss, I'm close on finishing #39, PRs are already proposed
<mup> PR #39: Change Relation.apps to Relation.app <Created by johnsca> <Merged by niemeyer> <https://github.com/canonical/operator/pull/39>
<drewn3ss> sweet, ta!
<facubatista> charmcraft#39, that is
<mup> Issue charmcraft#39: Include all project files (whatever is present there) <Created by facundobatista> <https://github.com/canonical/charmcraft/issues/39>
 * facubatista eods
#smooth-operator 2020-08-14
<mup> PR operator#375 opened: first pass at getting travis to do a windows run <Created by chipaca> <https://github.com/canonical/operator/pull/375>
<facubatista> Â¡Muy buenos dÃ­as a todos!
<Chipaca> FACUBATISTA: HELLO FROM WINDOWS
<Chipaca> :-D
 * Chipaca not really in windows
<facubatista> Chipaca, ah, I was about to ask you if needed to be rescued
<Chipaca> facubatista: https://travis-ci.org/github/canonical/operator/builds/717875138 tho
<facubatista> ugh
<Chipaca> facubatista: :)
<facubatista> Chipaca, let's talk about terminals? You know way more than I about those, and I need some direction here...
<Chipaca> i just wish i could trigger them directly instead of having to go me â github â travis
<Chipaca> facubatista: shoot
<facubatista> ho?
<facubatista> 1:1?
<Chipaca> facubatista: 1 sec
<Chipaca> facubatista: 1:1
<Chipaca> facubatista: https://github.com/paramiko/paramiko/blob/master/demos/interactive.py
<facubatista> oooohhh
<facubatista> wow Copyright (C) 2003-2007
<Chipaca> facubatista: the termios stuff is because of the echo issue i mentioned (which was 'details' also)
<Chipaca> facubatista: but, well, that's probably what we need
 * facubatista brb
 * facubatista is back
 * Chipaca lives
<bthomas> standup ?
<Chipaca> nah
<Chipaca> :-
<Chipaca> :-p
<bthomas> Chipaca: https://www.scivision.dev/python-calling-python-subprocess/
<Chipaca> bthomas: yep, it's quite likely that's at least part of it
<Chipaca> bthomas: thank you
<narindergupta> Chipaca, I am looking for method to get IP address o pod .  I am trying this one self.model.get_binding("").network.ingress_address but there is no binding exist in the kubernetes and it complains ops.model.ModelError: b'ERROR no binding name specified\n'
<mup> PR operator#376 opened: Move test_model to use Harness for resource, pod-spec tests <Created by chipaca> <https://github.com/canonical/operator/pull/376>
<facubatista> justinclark, Chipaca, I replaced relativise content by doing pathlib.Path(os.path.relpath(dst, src.parent)) and it worked! thanks!
<facubatista> my question is if I should leave those tests, or also just remove them
<facubatista> (and kill relativise itself)
<Chipaca> i don't understand how
<Chipaca> because i ran those things and got those results
<Chipaca> hmm
<facubatista> Chipaca, let's dig and reproduce, it may be some obscure thing that we better find now
<Chipaca> i'm definitely getting ../..... things now
<Chipaca> Â¯\_(ã)_/Â¯
<Chipaca> I blame justinclark
<Chipaca> he changed all the pythons everywhere just to prove his point
<Chipaca> that's clearly the only reasonable possibility
<justinclark> Haha it could have been a python version thing? I'm also not sure what happens if two paths don't contain a common ancestor.
<justinclark> I tested with 3.8
<Chipaca> >>> os.path.relpath(str(dst), str(src.parent))
<Chipaca> '../../baz1/baz2/baz3/dst.txt'
<Chipaca> ^ python 3.5
<Chipaca> (you need to str() the pathlibs, but other than that it works)
<facubatista> justinclark, for our case they always have a common ancestor, as they must be inside the projects dir
<facubatista> Chipaca, that result for which values of dst and parent?
<Chipaca> facubatista: in linux they'll always have a common ancestor ('/') :)
<Chipaca> windows might be more fun
<Chipaca> facubatista: the same ones justinclark used in https://github.com/canonical/charmcraft/pull/118#discussion_r470604335
<mup> PR charmcraft#118: Some changes in preparation for big "include everything but jujuignored" branch <Created by facundobatista> <https://github.com/canonical/charmcraft/pull/118>
<facubatista> Chipaca, justinclark, considering that in windows this can be tougher, and that the line it's not super small (`pathlib.Path(os.path.relpath(str(dst), str(src.parent)))`) I'll leave the 'relativise' function with the tests
<facubatista> pushed
<Chipaca> facubatista: you mean leave the function but it's just that line?
<facubatista> yeap
<facubatista> the separated function, with the tests, being that function just that ugly line
<justinclark> Approved
<justinclark> agreed - probably good to be safe and keep the tests for windows..
 * Chipaca â physio
<Chipaca> bbl to carry on porting fake_script to fake_pyscript
<Chipaca> the windows test suite read like a edgelord greentext
<Chipaca> they're all REEEEEEE
<facubatista> jajaja
<facubatista> Chipaca, justinclark, jam, dstathis, https://github.com/canonical/charmcraft/pull/112 is ready for review
<mup> PR charmcraft#112: Include everything but what is explicity ignored to Juju <Created by facundobatista> <https://github.com/canonical/charmcraft/pull/112>
<facubatista> (thanks)
<justinclark> Taking a look facubatista. This one will take a bit longer for me to wrap my head around. Even if someone beats me to it, I'm sure it'll still be a good exercise.
<facubatista> justinclark, exactly! thanks
<facubatista> ballot, I just annotated a couple of minor details in https://code.launchpad.net/~ballot/charm-k8s-mm-pd-bot/+git/charm-k8s-mm-pd-bot/+merge/388497 , thanks
<facubatista> Chipaca, ^
<dstathis> I'm having some issues with the operator tests
<dstathis> When I run them, I'm getting 18 errors
<dstathis> actually I think I figured it out
<facubatista> dstathis, show us in a pastebin how you're running the tests and the errors you get
<dstathis> all the errors have the message 'yaml does not have libyaml extensions, using slower pure Python yaml' somewhere in them
<dstathis> so I'm guessing that's the problem
<facubatista> dstathis, try doing 'apt build-dep python3-yaml'
<dstathis> I needed to install libyaml-dev which I had already done. The tricky bit was I needed to reinstall pyyaml with --no-cache-dir
<justinclark> I noticed that log message in the `ops.main` package ^ https://github.com/canonical/operator/blob/55158e3d1963106702222454c1cb8912c30dd077/ops/main.py#L302
<justinclark> Is there actually a "slower pure Python yaml loader" being used somewhere?
<facubatista> dstathis, looks like this is a good thing to annotate in the README, would you propose a PR for that? thanks
<mup> PR operator#377 opened: change fake_script so it always creates python scripts <Created by chipaca> <https://github.com/canonical/operator/pull/377>
<Chipaca> siiiiigh
<Chipaca> justinclark: if you 'pip install yaml' (as opposed to apt install), and don't have the libyaml bits, you'll use a pure-python one which can be significantly slower
<Chipaca> like 40Ã slower
<Chipaca> thus the warning
<Chipaca> but my melancholy sigh is because the fake_script PR is nasty, not because of yaml :)
<Chipaca> but anyway, I'm at EOW
<justinclark> Oh I see. Thanks Chipaca
<Chipaca> justinclark: no probs! have a good one
<mup> Issue operator#378 opened: Docstyle for `ops` is Google doc style but parsed with Sphinx <Created by justinmclark> <https://github.com/canonical/operator/issues/378>
<mup> PR operator#379 opened: Assume version 0.0.0 if JUJU_VERSION is not set <Created by dstathis> <https://github.com/canonical/operator/pull/379>
<mup> PR operator#380 opened: Add info about fixing pyyaml in README.md <Created by dstathis> <https://github.com/canonical/operator/pull/380>
<ballot> facubatista: Ack thanks. I didn't know for the docstring vs "pass", TIL !
<facubatista> ballot, :)
<ballot> facubatista: for the index in fir format style, that's a rule from job -1. It was really really really frowned upon to NOT use index there because we had to support python 2.6 and I guess the habit stuck with me :)
<facubatista> ballot, ah, yes, in the prehistory it was mandatory
<ballot> facubatista: prehistory is actually daily lives on some software, sadly :/
<ballot> facubatista: especially when you have to support ... centos 6
<facubatista> ugh
<ballot> oh well that's behind me now
<facubatista> right, charms are py3 only
<facubatista> >=3.5
<ballot> yup
<ballot> Will adapt accordingly next time I have to touch the charm
<facubatista> ballot, thanks!
<justinclark> facubatista: is there an issue or discussion somewhere that gives context to https://github.com/canonical/charmcraft/pull/112? I think that would help me understand what's going on.
<mup> PR charmcraft#112: Include everything but what is explicity ignored to Juju <Created by facundobatista> <https://github.com/canonical/charmcraft/pull/112>
<facubatista> justinclark, that issue, but note that inside that issue a discourse page is linked
<facubatista> that maybe will provide more context
<facubatista> the bottom line is: what should go inside a charm? we started nickpicking some specific parts (the charm, metadata.yaml, etc), but experience proved that people want more stuff in... so, what should we include? we ended up deciding "everything that is not being ignored by juju"
<justinclark> I might be blind.. Is there a linked issue in that PR? I see https://github.com/canonical/charmcraft/issues/39 which seems related to what you're saying
<justinclark> But that gives me plenty to work with ^ thanks facubatista
<facubatista> justinclark, ah, right, it's linked in the issue, not in the PR
<facubatista> there I linked the issue to the PR
 * facubatista eods and eows now
<facubatista> see you all on Tuesday!
<justinclark> Have a good holiday weekend!
#smooth-operator 2020-08-15
<mup> PR operator#376 closed: Move test_model to use Harness for resource, pod-spec tests <Created by chipaca> <Merged by chipaca> <https://github.com/canonical/operator/pull/376>
#smooth-operator 2020-08-16
<mup> PR operator#381 opened: we should call harness.cleanup in unit tests now that we use resources there :-) <Created by chipaca> <https://github.com/canonical/operator/pull/381>
<mup> PR operator#382 opened: not all operating systems let you rename over an existing file <Created by chipaca> <https://github.com/canonical/operator/pull/382>
<mup> PR operator#383 opened: ops/lib: use repr less with paths, and os.path.join more <Created by chipaca> <https://github.com/canonical/operator/pull/383>
<mup> PR operator#384 opened: make test_infra pass on windows <Created by chipaca> <https://github.com/canonical/operator/pull/384>
<mup> PR operator#385 opened: do not assume / is path separator for resource paths <Created by chipaca> <https://github.com/canonical/operator/pull/385>
<mup> PR operator#377 closed: change fake_script so it always creates python scripts <Created by chipaca> <Closed by chipaca> <https://github.com/canonical/operator/pull/377>
