/srv/irclogs.ubuntu.com/2020/08/12/#smooth-operator.txt

narinderguptafacubatista, I am using juju deploy .04:25
mupIssue operator#371 opened: Use controller storage if no local storage exists <Created by stub42> <https://github.com/canonical/operator/issues/371>05:22
Chipacamoin moin moin09:17
Chipaca(my previous good morning went to the wrong channel)09:17
jammorning @Chipaca09:18
Chipacaheh, the mattermost effect09:18
bthomas🌅 Good Morning 🌅09:20
Chipaca🏜09:21
bthomas:) only missing a rattle snake09:25
ChipacaI think I'm going to make the tests of a 'charmcraft init' charm fail09:38
Chipacauntil the author does the XXXs :)09:38
bthomasHow about a message saying what XXX is along with the failed message ?09:43
Chipacayup09:43
Chipaca(that's already there)09:43
Chipacayou see the messages when you charmcraft init already09:44
ballotHello !09:51
ballotChipaca: 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 nothing09:52
ballotsame goes for any juju run really ...09:52
ballotI realize I never tried a juju run on a k8s charm09:52
Chipacajam: that works, right?09:53
jamChipaca, I had just been trying to say good morning in mattermost, and immediately decided to say hello here instead09:54
jamballot, 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 ssh09:54
jamI think they are working on that for 2.9, though I would be surprised that it just hangs.09:55
Chipacaballot: ^ :-/09:56
ballotinteresting09:56
ballotAs a workaround, what would be the right move to use pod-spec-set with the right context then ?09:56
ballot(lacking juju knowledge)09:57
jamballot, hack it into your charm and test that way?09:57
jamkubectl exec ?09:57
jambut kubectl wouldn't have the context09:57
balloti'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 set10:00
ballotyeah, that's the issue, I'm trying to see if Chipaca's branch fixes https://bugs.launchpad.net/juju/+bug/188063710:01
ballotwhat is strange is that pjdc could do it ...10:01
ballotoh well I can try a more recent juju10:01
Chipacaballot: maybe he wasn't using a k8s charm10:04
ballotnevermind I'll just hack through my charm and separate kubernetesResources from the pod_spec and test this way10:04
ballotChipaca: I doubt it, but I'll make it work somehow :). But after lunch. Never stand between a frenchman and his lunch !10:05
* Chipaca would never10:05
Chipacareminds me i need to go to the shops to set fire to some baguettes10:06
* Chipaca runs10:06
Chipacajk i need to buy some hydration … pills? the fizzy kind10:07
* Chipaca bbiab10:38
facubatista¡Muy buenos días a todos!10:45
bthomasMorning10:51
facubatistahola bthomas11:26
bthomasyep11:31
bthomashow can I be for service facubatista11:31
bthomasjust watched the testing.Harness video by Paul Goins you gave me last week11:32
facubatistaawesome11:36
ballotChipaca: I confirm your fix works12:34
Chipacaballot: \\\\\oooo/////12:34
ballotChipaca: 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/38915612:35
ballotThe pastebin showing the fix : https://pastebin.ubuntu.com/p/VPpRGpr9D8/12:38
ballotUpdating the github PR12:38
mupIssue 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>12:40
mupPR 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>12:40
Chipacaballot: ^^^ :)12:40
ballotah ! too fast for me :)12:40
ballotJust updated the PR with my findings12:40
ballotwell, all good, I'll check for secrets and configmaps later on to have a real "k8s friendly" configuration pattern then, thanks for the help Chipaca12:41
Chipacathanks for testing!12:41
bthomasI 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.12:57
Chipacabthomas: "tese"?13:01
bthomasoops test_13:01
bthomastest files are named charm_test.py instead of test_charm.py13:02
* bthomas goes to get coffee before standup13:05
Chipacajam: facubatista: what's a good value of foo in juju_version.has_foo() to know if the juju has state-set/state-get?13:22
Chipacahas_state()? has_state_get()? has_controller_state()?13:22
facubatistahas_state_setting_capability()13:22
Chipacahas_embalmed_ones()13:23
Chipacahas_trained_ones()13:23
Chipacahas_suckling_pigs()13:23
facubatistacan_set_state()13:23
Chipacahas_mermaids()13:23
Chipacafacubatista: can_haz_state()13:25
jamChipaca, supports_controller_storage is the one I like13:26
Chipacahas_controller_storage? :)13:26
jamChipaca, if you want your has you can have it13:27
* Chipaca can has it13:27
Chipacajam: facubatista: poke13:31
facubatistaoops13:31
jamsorry, just finishing standup13:31
Chipacafacubatista: https://grammarist.com/idiom/lay-of-the-land-or-lie-of-the-land/13:45
crodriguezgood 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/13:49
Chipacacrodriguez: hi! at what point do you get that? doing what, i mean13:52
crodriguezChipaca, 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 this13:54
crodriguezI'll go back a few commits and compare if I'm hitting that still13:55
Chipacacrodriguez: 0.8 looks at JUJU_VERSION for some things, more than 0.713:55
Chipacaso it might be us13:55
Chipacabut it's supposed to always be set, jam checked all the way back to 2.6 or sth13:55
crodriguezI'm using juju 2.8.113:55
crodriguezit's just checking for the JUJU_VERSION environment variable, right?13:56
Chipacayep13:56
facubatistacrodriguez, good day!13:58
crodriguezhttps://paste.ubuntu.com/p/V75wy85pq7/ humm maybe something changed in juju ?13:58
Chipacathere's no JUJU env vars13:59
jamcrodriguez, "juju run --unit ubuntu/0 env"14:00
jamThat should create a hook environment, where env vars like JUJU_VERSION would be set.14:01
jamthey *aren't* set inside of an SSH session.14:01
narinderguptaChipaca, I am still getting this error ERROR cannot repackage charm: symlink "config.yaml" is absolute: "/home/ubuntu/narinder/charm-k8s-cassandra/config.yaml"14:01
Chipacanarindergupta: what are you trying to do?14:01
jamnarindergupta, Chipaca : If you are using charmcraft to build the charm, you need to do "charmcraft build; juju deploy ./CHARMNAME.charm"14:02
narinderguptaChipaca, I build the charms using charmcraft and now trying to deploy14:02
jamyou can't deploy from the directory itself.14:02
narinderguptajam, oh ok let me try tht14:02
crodriguezah thanks jam. So doing this, https://paste.ubuntu.com/p/rk8337KpJf/ , looks like the env is set correctly14:03
jamcrodriguez, for your initial pastebin, do you have a bit more context?14:03
jamI wonder if we are failing to set JUJU_VERSION for something like "during collect-metrics hook"14:03
narinderguptajam, ok I can confirm that your method is orking14:03
jamnarindergupta, great14:03
jamnarindergupta, I saw that when you were talking last night, but you weren't around for me to mention it :)14:04
crodriguezjam I can get you a complete pastebin of the charm execution14:04
narinderguptajam, no worries and thanks;14:04
jamJUJU_VERSION in hook environments hasn't been around forever, but the line existed in 2017-0914:05
jamso it definitely should be in ~2.4+14:05
narinderguptajam, Chipaca I got an install hook error just wondering why we need install in k8s?14:05
jamnarindergupta, 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.14:06
crodriguezjam: https://paste.ubuntu.com/p/WZfMRkvgyn/ that's all there is in /var/log/juju/unit-iscsi-connector-014:06
narinderguptajam, 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 114:07
jamcrodriguez, 2020-08-12 13:39:05 ERROR juju.worker.meterstatus runner.go:77 error running "meter-status-changed": exit status 114:07
jamso it is one of the metrics hooks14:07
narinderguptaAnd I am not aware about the dispatch script14:07
jamnarindergupta, 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.14:08
jamso its less about 'install' and more just we had a problem executing your charm14:08
jamif you remove 'install' then we'll hit the same thing in whatever other hook we call.14:08
narinderguptajam, ok let me read my  code once more time then14:08
jamcrodriguez, 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.14:09
crodriguezmmh.. what is the metrics.yaml file for ? :)14:09
bthomasThank 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/edit14:10
jamcrodriguez, hm. I don't see a metrics.yaml in your code, so I could be off base.14:10
jamChipaca, ^^ it looks like JUJU_VERSION isn't set in the metrics hooks, one more reason they should be normalized.14:10
crodrigueznarindergupta, 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 ?14:11
jamcrodriguez, narindergupta : juju model-config logging-config="<root>=DEBUG" would certainly do it.14:11
jamthat will give a lot more logging information generally14:11
jambthomas, don't forget to ping here as well, in case we miss stuff getting added to the doc.14:11
bthomasjam: will do14:12
jambthomas, also, you'll want to share the document with at least Comment rights14:12
narinderguptajam, ok14:12
jambthomas, I'm only able to read that doc right now14:12
jam(my standard is Everyone At Canonical can Comment)14:12
bthomasjam: ofcourse. Let me fix that14:12
narinderguptajam, in Kafka charm there was no install hook as it does not make sense for k8s charm14:12
bthomasjam: anyone should be able to edit now. Let me know if that does not work14:14
jamnarindergupta, 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 regular14:14
narinderguptajam, gotchu you14:15
narinderguptajam, thanks14:15
mupIssue operator#372 opened: JUJU_VERSION not set during metrics hooks <Created by jameinel> <https://github.com/canonical/operator/issues/372>14:22
jamfacubatista, I've pushed an update to charmcraft#9914:23
mupPR charmcraft#99: charmcraft/jujuignore.py: Allow extending the list of patterns <Created by jameinel> <https://github.com/canonical/charmcraft/pull/99>14:23
facubatistajam, is there any particular reason for the relative import from parent? and not using absolute as we do with the rest for that?14:31
crodriguezjam 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 issue14:33
narinderguptaChipaca, I am getting this error k8s = ops.lib.use("k8s", 0, "chipaca@canonical.com")14:40
narinderguptaNameError: name 'ops' is not defined14:40
Chipacanarindergupta: you need to import ops.lib14:40
narinderguptaChipaca, ok14:40
Chipacajam: metric hooks don't work with controller state, right?14:53
narinderguptaChipaca, I am getting this error now ImportError: cannot find library "k8s" from "chipaca@canonical.com"14:56
Chipacanarindergupta: did you add the requirements.txt line?14:57
narinderguptaYes I have those two entries14:57
narinderguptaops14:57
narinderguptagit+https://github.com/chipaca/ops-lib-k8s.git14:57
Chipacanarindergupta: and where do you get that error?14:58
narinderguptaChipaca, while executing k8s = ops.lib.use("k8s", 0, "chipaca@canonical.com")14:58
narinderguptaIn the charm class code14:59
Chipacanarindergupta: in a charm built with charmcraft?14:59
narinderguptaYes it was build with charmcode14:59
narinderguptacharmcraft14:59
Chipacanarindergupta: can i see the debug logs that lead up to that error please?14:59
narinderguptaAnd I can see k8s under venv14:59
narinderguptaChipaca, http://paste.ubuntu.com/p/kzJrVyBzTR/15:01
narinderguptaHere is the http://paste.ubuntu.com/p/28hR8mTTmD src/charm.py15:02
Chipacawhy are there no debug logs from the framework there?15:02
Chipacanarindergupta: can you look in venv/k8s to see if there's an 'opslib' directory there?15:05
narinderguptaChipaca, I am not seeing any directly there named opslib15:06
narinderguptaChipaca, 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  yaml15:07
Chipacavery strange15:07
narinderguptaAnd in ops/lib/ there is no k8s...15:07
narinderguptaYeah15:08
Chipacagive me a bit15:08
narinderguptaSure no problem let me know in case need any info15:08
Chipacaoh i know15:08
* Chipaca fixes15:08
narindergupta:)15:08
Chipacanarindergupta: try now15:10
narinderguptaDo I need to build again?15:11
narinderguptaYes I can see opslib now15:12
narinderguptaLet me kill my controller and retry15:12
Chipacapoor controller15:13
narinderguptaChipaca, I know in microk8s that's the challenge15:13
jamChipaca, 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.15:16
jamChipaca, an update for 'is_restricted_context'15:16
Chipacaright15:16
Chipacafacubatista: i'm having an issue with my tests and logassert, where the tests pass on their own but fail when run in the whole suite17:44
Chipacafacubatista: anything in particular i should look out for?17:44
Chipacafacubatista: https://github.com/canonical/operator/compare/master...chipaca:more-heuristics-for-storage17:47
Chipacaideas welcome17:47
Chipacait might be something silly, looking at it for too long17:47
Chipacai'm going to take a break, get dinner, etc17:47
Chipacattfn17:47
facubatistaChipaca, will check17:48
facubatistaChipaca, which logassert version do you have?17:49
Chipacafacubatista: 517:53
facubatistalet's see if I introduced a bug there :)17:55
Chipacaunpossible17:57
facubatistaChipaca, which is the specific test?18:12
Chipacafacubatista: all of TestStorageHeuristics18:13
facubatistaChipaca, 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 that18:18
facubatista    self.assertRegex(calls.pop(0), 'Using local storage: not a kubernetes charm')18:18
facubatistaAssertionError: 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'18:18
Chipacafacubatista: that means you haven't run the tests in quite a while :-)18:19
Chipacaand it also means we probably should fix that18:19
facubatistaChipaca, yes and yes18:20
Chipacafacubatista: 'apt build-dep python3-yaml' should get you the bits you need18:20
Chipacafacubatista: in any case commenting out that log line should get you places18:28
facubatistaChipaca, shall I rebuild the VM?18:29
facubatistas/VM/venv/18:29
Chipacafacubatista: i don't know what you're doing :)18:30
facubatistaChipaca, I just apt build-dep as you suggested, error still happening18:30
facubatistaChipaca, so, the difference I'm finding so far between running them all or running just a bunch is NOT logassert related18:41
facubatistaChipaca, when running just test.test_main.TestStorageHeuristics, all is fine18:42
facubatistaChipaca, but when running test.test_main, the test I'm supervising (test_fallback_to_current_juju_version__too_old) fails because18:43
facubatistaFileNotFoundError: [Errno 2] No such file or directory: 'juju-log'18:43
Chipacafacubatista: huh18:43
Chipacafacubatista: so probably it's our log setup code18:44
Chipacathat's not getting reset18:44
Chipacafacubatista: nice pointer. i'll follow it after dinner :)18:44
facubatistaChipaca, the logger has all these handlers: [<JujuLogHandler (DEBUG)>, <JujuLogHandler (DEBUG)>, <JujuLogHandler (DEBUG)>, <JujuLogHandler (DEBUG)>, <JujuLogHandler (DEBUG)>, <JujuLogHandler (DEBUG)>]18:44
facubatistaChipaca, ack, let me know if you need something else18:45
Chipacafacubatista: where do you see those handlers?19:46
facubatistaChipaca, I printed the handlers when logassert is hook19:47
facubatistaadded this in l.38 of env/lib/python3.8/site-packages/logassert/logassert.py :19:47
facubatista        print("========= prv", logger.handlers)19:47
Chipacafacubatista: i get those errors if i remove the reset_logging from test_log19:55
Chipacaanyway, i give up19:55
ChipacaEOD for me19:55
Chipacatomorrow shall bring new joys19:56
* facubatista eods22:55

Generated by irclog2html.py 2.7 by Marius Gedminas - find it at mg.pov.lt!