/srv/irclogs.ubuntu.com/2020/06/16/#smooth-operator.txt

mupPR operator#330 opened: test/test_main: move actions.yaml into the charm <Created by jameinel> <https://github.com/canonical/operator/pull/330>08:00
Chipacamorning all08:18
MarkMaglanawazaaaaaaaaaaaaaaaaaaap08:19
ChipacaMarkMaglana: snapcraft <3 charmcraft, and/or viceversa08:21
* Chipaca having fun with that08:21
MarkMaglanaheh.08:22
jammorning Chipaca and MarkMaglana08:26
jamChipaca, operator#330 is an attempt to make it possible to deploy 'test_main' as a real charm08:43
mupPR #330: test/test_main: move actions.yaml into the charm <Created by jameinel> <https://github.com/canonical/operator/pull/330>08:43
jamalso, turns out we weren't cleaning up our TMP garbage correctly.08:44
Chipacayeah i'd been meaning to look into the tmp garbage but there was always something else09:03
Chipacathank you09:03
louroto/ I was trying to create a new charm with the operator framework, inspiring myself from charm-ceph-iscsi and other tutorials, with and without charmcraft. It seems like the behavior of the Operator has changed regarding actions. I've created the most simple hello-world example I could: https://github.com/AurelienLourot/charm-ops-with-action09:31
lourotwithout charmcraft09:32
lourotwe're coming to the conclusion that I should create the actions/ folder myself to get this to work09:32
lourotbut it seems like it wasn't need for charm-ceph-iscsi in the past (I had a chat with gnuoy about that)09:32
lourotChipaca, should this work? i.e. are actions.yaml and an observe() supposed to be enough to create an action?09:33
Chipacalourot: yes09:34
Chipacalourot: in what way does this not work?09:34
lourotsee the readme09:34
lourotAttributeError: 'CharmOpsWithAction' object has no attribute 'hello_action'09:34
Chipacalourot: CharmOpsWithAction is your code09:34
Chipacalourot: in has no 'hello_action'09:35
lourotoh09:35
lourotwow09:35
Chipacalourot: it does have a 'on_hello_action'09:35
Chipacalourot: that might be the thing you want?09:35
Chipacait's just python ¯\_(ツ)_/¯ (but also :-D )09:35
lourotsorry, I misread the exception, because yesterday I had an exception that self.on was missing hello_action and I was trying to reproduce it with a super simple example09:36
lourotso -> pebkac09:36
lourotthanks a lot!09:36
Chipacalourot: no problem! i wish they were all this easy to help with :-)09:36
lourotChipaca, ok so now I managed to reproduce the exception I had in mind: https://github.com/AurelienLourot/charm-ops-with-action10:00
lourotit seems that I end up in that state only if I use charmcraft10:01
lourotgnuoy, icey, fyi ^10:01
lourotin the ops code I see that there is a loop iterating on actions and populating methods on CharmEvents10:01
lourotbut somehow there must be a bit missing in my example10:02
Chipacalourot: does charmcraft copy actions.yaml into the charm?10:02
lourotChipaca, nope indeed. I see you have a PR for copying config.yaml but none yet for actions.yaml10:03
Chipacalourot: yeah, i'll push one for actions.yaml in a bit10:03
lourotah cool10:03
lourotthanks!10:03
Chipacai've gotten as far as i'm going to get with snapcraft for now :)10:03
Chipacalourot: sorry :) this comes from not having any real-world tests for its first release into the wild :)10:03
Chipacathe charms we did test didn't have config nor actions 😲10:04
Chipacaanyhoo, will fix10:04
Chipacagrr10:04
lourotChipaca, thanks! does it help you if I create an issue and point to my example? it'll help me at least to point to it for a related change I need to do10:05
Chipacalourot: sure!10:05
lourotgnuoy, so I'll create a PR to ops-openstack with a try/catch around observe() for pause/resume - alternatively I could also not use charmcraft for now, what do you think?10:06
jamChipaca, I finally managed the magic invocation to do a bit of performance timing and see that we spend 90% of our test suite time in _simulate_event10:06
jamof the 30s it takes for me to run 'test_main': it breaks down as: https://paste.ubuntu.com/p/RmHn6gSwyS/10:10
jamso install/start is most of the time.10:10
Chipacalourot: want to try charmcraft from my branch (charmcraft#36)?10:30
mupPR charmcraft#36: 'charmcraft build' should pull in actions.yaml and config.yaml <Created by chipaca> <https://github.com/canonical/charmcraft/pull/36>10:30
Chipacajam: is that because a lot of tests just run install? or is install beig silly10:31
jamChipaca, I haven't dug past the subprocess barrier yet. My guess is that install does all the 'setup' stuff like creating all the symlinks. I'd like to adjust that with counts as well (eg, we might call install 10x more than the next one)10:32
facubatistaMuy buenos días a todos!10:35
Chipacafacubatista: buen día!10:35
facubatistahola Chipaca!10:36
Chipacafacubatista: lourot noticed we also don't ship actions.yaml in the .charm10:36
Chipacaso charmcraft#36 fixes that and config.yaml10:36
mupPR charmcraft#36: 'charmcraft build' should pull in actions.yaml and config.yaml <Created by chipaca> <https://github.com/canonical/charmcraft/pull/36>10:36
Chipacafacubatista: it feels bad enough to do a .4 tbh10:36
Chipaca.3?10:36
Chipacathat10:36
Chipaca.9¾10:37
facubatistaChipaca, what about #31 ?10:38
mupPR #31: Remove DeadRelation in favor of empty relations <Created by johnsca> <Merged by niemeyer> <https://github.com/canonical/operator/pull/31>10:38
facubatistaugh10:38
facubatistaChipaca, what about charmcraft#31 ?10:38
mupPR charmcraft#31: Include config.yaml in built charm <Created by charness> <https://github.com/canonical/charmcraft/pull/31>10:38
Chipacafacubatista: we're still waiting for the CLA10:38
Chipacafacubatista: i made a comment on it10:38
facubatistaChipaca, pr46 approved10:43
Chipacawoo, approval from the future10:43
facubatista36 I mean10:43
Chipacaaw10:44
lourotChipaca, yep, fetching coffee and I'll give it a try, thanks!11:20
Chipacacoffee sounds like a good idea11:29
Chipacaso does lunch11:29
lourotyay, it worked, thanks. commenting on the PR11:43
jamChipaca, charmcraft#36 has a comment from me, there are a couple more files to pull in11:51
mupPR charmcraft#36: 'charmcraft build' should pull in actions.yaml and config.yaml <Created by chipaca> <https://github.com/canonical/charmcraft/pull/36>11:51
jammorning facubatista11:51
facubatistahola jam11:51
jamChipaca, facubatista I'd say charmcraft#36 supersedes 31, and since it is done in a different way, doesn't have to worry too much about licensing.11:52
mupPR charmcraft#36: 'charmcraft build' should pull in actions.yaml and config.yaml <Created by chipaca> <https://github.com/canonical/charmcraft/pull/36>11:52
Chipacajam, facubatista, actually, why aren't we copying everything into the charm? (a refactor for later perhaps)12:16
jamChipaca, I don't know why we wouldn't copy something that someone felt was worthy of including12:17
facubatistaChipaca, what do you mean "everything"?12:17
jamChipaca, certainly things like 'files/' that we saw was content the *charm* expected to exist. The ones I mentioned are ones that *juju* will do something with12:17
Chipacathe current behaviour flies against what we've said all along, that the result of charmcraft build looks almost exactly like the charm it's built from12:18
facubatistaChipaca, you'd put also the .gitignore inside?12:18
Chipacafacubatista: I would not, but putting it inside breaks less things than not putting something12:19
Chipacaie our approach is backwards right now, we should be excluding things, not including them12:19
Chipacaagain, it's a bigger change12:19
facubatistaChipaca, you can always include things later; I'm worried about including by default something the user wouldn't want to leave his machine (as in a 'credentials.txt' file)12:19
Chipacaif charmcraft#36 is bad enough to trigger a point release, i'd go with that12:19
mupPR charmcraft#36: 'charmcraft build' should pull in actions.yaml and config.yaml <Created by chipaca> <https://github.com/canonical/charmcraft/pull/36>12:20
Chipacaand then later a refactor to change the approach12:20
facubatistaChipaca, what we at least need to include is a way for the dev to say "also these files, please"12:21
facubatistaa kind of... manifest12:21
Chipacajam: WRT 'revision', that one seems weird12:22
Chipacajam: revision means something else in the new APIs12:22
Chipacajam: what does it mean in juju?12:22
jamChipaca, IIRC, revision is meant to be populated by the store, and indicates an official number for the charm12:23
Chipacayeah, but not inside the charm itself12:23
jam'juju deploy mysql-22' is a specific revision of the mysql charm12:23
jamChipaca, I do believe once we get the charm on disk, it has revision with 22 in it12:24
Chipacabecause the charm's hash is used to sign it12:24
Chipacahmm12:24
Chipacai'll check with store people to see if this is true for charms in the new APIs12:24
Chipacaanyway it's not something that'd be there at build time so i'll skip it :12:24
Chipacajam: how hard would it be (and how big would it be) to build a juju that _only_ knew how to do 'juju deploy'?12:35
jamChipaca, so presuming you already had bootstrapped a controller, and you just wanted something that can interact with the API to deploy ?12:36
Chipacajam: yeah12:36
Chipacajam: (wondering if we can do a strictly confined charmcraft that shipped its own juju just for the deploy bit, if and when we get around to that)12:36
jamChipaca, I believe we've prototyped a stripped down Juju, but I don't remember the exact numbers.12:36
jamA lot of the overhead of the binary is from bootstrap, IIRC, since it needs to know all the different provider code.12:37
Chipacaotoh i hear snapd is working on snaps running snaps, so maybe that'll dtrt12:37
Chipacajam: i was surprised at how big juju-the-binary was fwiw12:38
Chipacaanyway, just some idle thoughts12:38
Chipacajam, facubatista, wdyt, should we do a charmcraft 0.1.3?12:38
facubatistaChipaca, release often, etc, etc12:39
facubatistaChipaca, iow, yes, please12:39
Chipacaikr12:39
Chipacafacubatista: you ok with my argument on the pr wrt tests?12:39
facubatistaChipaca, if you strict with checking "the wanted behaviour" you should add tests for all those files12:41
jamChipaca, yeah, juju is >100MB uncompressed, IIRC.12:41
facubatistaChipaca, what about leaving that test as it is, and adding other one that reflects that we're including (if exists) whatever is in that CHARM_OPTIONAL?12:41
jamah, only 89MB, I think it was bigger at times. (I believe 'make install' supplies the 'strip' flags to go)12:42
Chipaca$ ls -sh /snap/juju/current/bin/juju12:42
Chipaca120M /snap/juju/current/bin/juju12:42
Chipaca¯\_(ツ)_/¯12:42
jamChipaca, jujuc that only talks to the unit agent socket is only 8.5MB, so it can go down quite a bit.12:42
jamChipaca, hm.12:43
jam$ ll /snap/juju/current/bin/juju -h12:43
jam-rwxr-xr-x 1 root root 149M Apr 21 07:45 /snap/juju/current/bin/juju*12:43
mupPR #21: Persist stored state before framework commit <Created by dshcherb> <Merged by niemeyer> <https://github.com/canonical/operator/pull/21>12:43
jambut $ ll ~/dev/go/bin/juju -h12:43
jam-rwxrwxr-x 1 jameinel jameinel 89M Jun 11 12:52 /home/jameinel/dev/go/bin/juju*12:43
facubatistaChipaca, your "I don't like the 'charmcraft: error: invalid choice: thing" comment, is feedback for Lilyana, or shall we open an issue in the project about it?12:44
Chipacajam: snap info juju | yq r - tracking12:45
Chipacajam: maybe the snap is not stripping the binary?12:45
Chipacait says 'not stripped' here :-\12:46
Chipacaanyhoo12:46
Chipacacoffee12:46
Chipacathen meetings12:46
jamChipaca, https://bugs.launchpad.net/juju/+bug/188370312:52
jamChipaca, so 'go install' without the strip flags is 120MB and 'make go-install' with them is 89MB.12:54
jamso it does seem like our snap build is broken.12:54
jamI wonder if we switched to using the snap plugin to build, which doesn't run the extra magic strip flags.12:54
Chipacai wonder if snapd-the-snap could also benefit from the extra magic strip flags =)12:55
Chipacasnapd in the snap says 'stripped' though ¯\_(ツ)_/¯12:56
jamChipaca, https://github.com/juju/juju/blob/develop/snap/snapcraft.yaml looks like we have a 'juju-go' plugin because the snapcraft one doesn't allow us to do everything.12:56
Chipacafacubatista: you comng?12:59
Chipacafacubatista: i12:59
facubatistayes13:00
Chipacajam: now all you need to do is push everything onto the stack, and then treat it as a queue, right?13:06
Chipacaor was it the other way around13:06
facubatistaChipaca, jam, we could do the standup right now, and have some minutes between that and the next meeting...13:06
jamChipaca, don't you put it all on the stack and then throw the stack in the circular file?13:06
Chipacafacubatista: works for me13:06
Chipacajam: me? i put everything in the stack, and then kill the process13:07
Chipaca*cheff kiss* works every time13:07
jamChipaca, facubatista wfm13:07
facubatistagoing in...13:07
Chipacafacundo__, jam, added a test to charmcraft#36, hope it's what we agreed on :)13:52
mupPR charmcraft#36: 'charmcraft build' should pull in actions.yaml and config.yaml <Created by chipaca> <https://github.com/canonical/charmcraft/pull/36>13:52
facundo__Chipaca, I use simple 'patch' for that kind of patching, but it's fine for me13:59
Chipacajam: how do i trigger that charmdir build-a-zip code from juju?14:00
jamChipaca, IIRC, 'juju deploy ./directory' will build and upload a .zip to the controller, but I don't know of a way to just get the .zip14:00
jamChipaca, coming to prep?14:01
Chipacay14:02
=== niemeyer_ is now known as niemeyer
=== joedborg_ is now known as joedborg
Chipacafacundo__, jam, thanks15:02
Chipacafacundo__, jam, I'll be merging charmcraft#36 and releasing 0.1.3 in half an hour unles you holler to the contrary15:26
mupPR charmcraft#36: 'charmcraft build' should pull in actions.yaml and config.yaml <Created by chipaca> <https://github.com/canonical/charmcraft/pull/36>15:26
facundo__Chipaca, go, go15:28
lourotthanks for the quick reaction/implementation today! (re: #36)15:28
mupPR #36: Refactor how relation endpoint and storage events are handled <Created by johnsca> <Closed by johnsca> <https://github.com/canonical/operator/pull/36>15:28
Chipacalourot: thank you for using our stuff, and reaching out when it didn't work, *and* testing the fix :-D15:29
Chipacafacundo__: should the release now also include the code of conduct?15:37
Chipacaas in, should i add it to the manifest15:37
facundo__Chipaca, do we have it?15:47
=== facundo__ is now known as facubatista
facubatistaah, yes15:47
facubatistaChipaca, yes, any specific file must go in the MANIFEST to be included15:48
Chipacafacundo__:  i guess what i'm asking is whether to include it or not :)15:54
facundo__Chipaca, if we have other text in the README or something about "how to collaborate with the project", we should mention the CoC and include it15:55
=== facundo__ is now known as facubatista
Chipacafacubatista: we do not yet reference the one from t'other15:56
Chipacafacubatista, facundo__, i've just noticed that charmcraft is not including tests in the releases15:59
Chipacain the wheel that seems alright, but not so much in the sdist15:59
Chipacabut i'd have to check other projects to know if this is normal/right/accepted practice15:59
Chipacaanyway this one'll go out like the previous16:01
Chipacafacundo__: charmcraft#38 plz16:01
mupPR charmcraft#38: bump version for 0.1.3 <Created by chipaca> <https://github.com/canonical/charmcraft/pull/38>16:01
facundo__Chipaca, approved16:04
=== ChanServ changed the topic of #smooth-operator to: general discussion of the operator framework || github.com/canonical/operator || ops 0.6.1 || charmcraft 0.1.3
Chipacalourot: should work now16:11
* facundo__ eods20:10
Chipacayeah, eod sounds nice20:32
=== karimsye_ is now known as karimsye

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