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

mthaddonChipaca: yep, have added an approving review overnight (had deliberately held off til then to avoid confusion about whether it's ready to land before you guys have had a chance to review it)08:19
Chipacamthaddon: 👍08:19
bthomasChipaca: could you recommend some well made operator charm, so I can check that there is nothing wrong with my juju/microk8s setup ?09:04
Chipacahmm09:06
bthomas:)09:06
Chipacalooking for one that's public and doesn't need a whole lot of other stuff around it09:07
bthomas👍09:08
Chipacabthomas: https://code.launchpad.net/~mattermost-charmers/charm-k8s-mattermost/+git/charm-k8s-mattermost09:08
bthomasThanks Chipaca : will give it a shot09:09
Chipacabthomas: requires a custom image, instructions in the README09:09
bthomaswill read09:09
bthomasThe mattermost charm uses https://code.launchpad.net/~stub/interface-pgsql/+git/operator as a submodule . And the interface-pgsql uses opslib as a submodule. In the opslib/pgsql sub-directory of the interface-pgsql there is a link to ".." which creates a cyclic inode structure.10:11
bthomasEven though I am able to clone the mattermost charm using my launchpad credentials cloning it recursively fails10:12
bthomasEven submodule update fails.10:12
Chipacabthomas: pgsql uses opslib as a submodule?10:24
Chipacanot sure i understand what that means10:24
Chipacai guess i could check out that git repo again10:25
bthomasChipaca: interface-pgsql has a pgsql/opslib subdirectory in that subdirectory there is a link to ".."10:27
Chipacabthomas: I don't see that10:32
Chipacabthomas: maybe you updated the mod beyond what the charm specifies?10:33
bthomasWhen I tried to build the mattermost charm, even though it built the charm it gave an error saying pgsql was not found. Upon digging further I found that it used a git submodule. There is no mention of this in the readme.10:34
bthomasSo I am not sure if it is ok to use the built mattermost charm without fixing the pgsql issue.10:34
Chipacabthomas: how did you get the submodule?10:35
bthomasChipaca: even if I do git clone git+ssh://balbir-thomas@git.launchpad.net/~stub/interface-pgsql/+git/operator interface-pgsql I can see the link10:35
Chipacabthomas: right, but the charm doesn't say 'grab the dev tip'10:36
Chipacabthomas: or does it/10:38
bthomasChipaca: Not sure. But the standard way to pull git submodules fails with mattermost charm. For example if I do "git clone --recursive git+ssh://balbir-thomas@git.launchpad.net/charm-k8s-mattermost". Tis fails to clone submodules.10:39
bthomasBuilding mattermost charm without submodule produces an error, even though charm gets built.10:40
Chipacabthomas: did you try cloning with the https url?10:40
Chipacabthomas: it's possible you're missing the git-in-launchpad recommended git config; the .gitmodules file depends on that10:40
bthomasChipaca: Just did "git clone --recursive https://balbir-thomas@git.launchpad.net/charm-k8s-mattermost" with same result. I was not aware of git-in-launchpad.10:41
* bthomas googling git-in-launchpad10:42
Chipacabthomas: https://help.launchpad.net/Code/Git10:42
bthomasThanks Chipaca : will read10:42
Chipacabthomas: the 'configuring git' section10:42
bthomasChipaca: you were right. It was the git config. Thanks.11:07
Chipacabthomas: \o/11:07
gnuoyIs it expected that when I try and push a charmcraft built charm to the charmstore it'll fail with "ERROR open mycharm.charm/bundle.yaml: not a directory" ?11:34
mthaddonChipaca: do you think you'll have time to review https://code.launchpad.net/~axino/charm-k8s-gunicorn/+git/charm-k8s-gunicorn/+merge/389554 soon? Junien has another MP that he's working on that depends on that but want to make sure there's not too much rebasing needed12:03
Chipacagnuoy: pushing it using the 'charm' tool? yes that won't work (unpack to a directory and push that)12:22
gnuoyack, thanks12:23
Chipacagnuoy: 'charmcraft upload' pushes to staging using the new APIs, if that's what you want though12:24
Chipacaand that one does take the .charm (and not a directory)12:24
gnuoyThat is not what I want, but good to know, thanks.12:24
Chipacamthaddon: i've still got one from deej to review, and then one from justin, and then that one12:26
mthaddonChipaca: could i ask for this one to go above deej's? It's a day older, and there's another MP that depends on it, whereas deej's doesn't have another one depending on it12:27
Chipacamthaddon: i'll swap it with that one then12:27
mthaddonperfect, thx12:27
justinclarkbthomas, did you get Mattermost running? I quickly tried deploying yesterday based on the README and it failed for me.13:34
justinclarkhttps://git.launchpad.net/~mattermost-charmers/charm-k8s-mattermost/tree/README.md13:34
bthomasjustinclark: Yes mattermost was running. It was idle because i did not provide it a database connection. But it was not my purpose to use it. I just wanted to check if it can be deployed and the container runs.13:35
justinclarkAh okay. Thanks bthomas. It was probably the database for me too but got sucked into learning about cross model relations rather than going further with mattermost.13:37
Chipacajustinclark: where was the charm you wanted reviewed?13:55
justinclarkhttps://github.com/justinmclark/grafana-charm-base/blob/master/src/charm.py13:55
justinclarkThanks Chipaca!13:55
justinclarkJust FYI, jam suggested a change yesterday in an issue I opened. That is still WIP. Here's the issue: https://github.com/canonical/operator/issues/39213:57
justinclarkPushed some other changes I made last night Chipaca. The charm deploys to microk8s just fine by itself, but it is quite uninteresting without relating a data-source for the dashboards. That still needs to be tested14:02
Chipaca:)14:03
Chipacaok14:03
Chipacajustinclark: you're using 'charmcraft build'?14:03
justinclarkYes.14:03
Chipacajustinclark: ok. You should probably embrace it more then :)14:03
Chipacajustinclark: right now you're getting ops via a git submodule14:04
Chipacajustinclark: instead of requirements.txt i mean14:04
Chipacajustinclark: and the 'fixpath' hack is not needed14:04
justinclarkChipaca: ah yes that needs to be a more prominent TODO. I used an out of date example when first starting and just didn't bother changing it as testing was working as expected.14:08
Chipacajustinclark: the 'configured' and 'started' storedstate things were red flags but they're not used at all so that's alright (just drop them)14:09
Chipacajustinclark: you're using f-strings which don't work on python 3.5 (which you'll get in xenial) so you might want to drop those too14:09
Chipacajustinclark: and you're setting state around a pod.set_spec which _i think_ (but am waiting to hear back from juju people) doesn't make sense14:10
Chipacabecause statuses are immediate but set_spec is not14:11
ChipacaIIRC at least :)14:11
Chipacajam: if you're around already, maybe you can answer that? (haven't heard back from #juju)14:11
jammorning Chipaca. set_spec is not immediate, it doesn't happen until the hook exits14:11
jam(in 2.8)14:11
Chipacajam: right, that one i know14:12
Chipacajam: but setting status is immediate, right?14:12
jamChipaca: status = Blah is immediate, yes14:12
Chipacaso, yeah, that pattern is broken14:12
jamso you can show progress during an operation14:12
Chipacathis one: https://github.com/justinmclark/grafana-charm-base/blob/master/src/charm.py#L35014:12
Chipacajam: right but using it show progress for something you're scheduling to happen later won't dtrt14:13
Chipacain their defense, set_spec() does _sound_ immediate14:13
jamChipaca: correct. except that Juju filters Active status for the case of 'the pod hasn't actually started yet', and overrides it until the application pod has finished starting.14:13
Chipacamaybe we should've called it set_spec_sometime_in_the_future_at_your_leisure_please_no_rush14:13
Chipacajam: oh that's sneaky14:14
jamChipaca: relation-set sounds immediate, too14:14
jamChipaca: this is a case where, Mark found out that 'leader-set' was immediate, which breaks the 'transactionality' that all other relation-get/relation-set code has.14:14
jamSo we went on a hunt for other things that violated that14:15
jamand found pod-spec-set.14:15
jamSo we pushed for it to be changed14:15
jambut having worked with charmers for much longer14:15
jamI don't feel like pod-spec-set is an interaction *with other charms* it is an interaction with the charm and its application14:15
jamso I no longer feel it should be transactional14:16
jam(we don't put a transaction around 'systemctl start foo'14:16
jamhowever, we do need to deal with how it is currently, and not how it might theoretically work14:16
jamAlso, the new work gets rid of pod-spec-set for charms running as sidecars14:16
Chipacayep14:17
Chipacajam: does the 'pod hasn't actually started yet' override thing mean that the code i linked to would currently dtrt w/2.8?14:19
jamChipaca: I don't think it would stay in the "maintenance with 'setting pod spec'" but otherwise yes14:22
jam(eg, it uses Juju's 'pod not started yet' message, though I don't know the exact words)14:22
Chipacak14:22
* justinclark thanks Chipaca and jam for feedback :)14:29
* justinclark pushes python 3.5 under the rug and blows things up14:31
Chipaca:)14:31
Chipacajustinclark: one silly thing I'd also do in your charm is make the log.error call for missing fields mention exactly what was missing, instead of everything that's required15:00
justinclarkChipaca: will do. Can you elaborate on the 'fixpath hack'?15:07
justinclarkI'm not sure what that hack is.15:08
Chipacajustinclark: your charm.py does 'import fixpath'15:08
Chipacajustinclark: fixpath.py just adds lib to sys.path15:08
Chipacajustinclark: this was needed before charmcraft took on the job of setting up the environment for the charm15:08
Chipacajustinclark: it's a hack, which is why you need to tell pyflake to ignore it15:09
justinclarkI see. Thanks.15:13
ChipacaEOWing here19:13
Chipacabye all! see you tuesday19:13
jamhave a great weekend ChanServ19:41
jamdang, gone already :)19:41

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