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

Chipacagooooooooooooooooooooooooooooooooooood  morning!08:28
=== ChanServ changed the topic of #smooth-operator to: general discussion of the operator framework || github.com/canonical/operator || ops 0.7.0 || charmcraft 0.3.0
Chipacabrb, dog's whining about something08:35
jammorning Chipaca09:02
Chipacajam: you should now be able to ask chanserv to change the channel topic (and other fun stuff)09:02
jamChipaca, I can feel the power....09:03
Chipacajam: that heady feeling of being able to kickban people10:45
facubatista¡Muy buenos días a todos!11:03
Chipacafacubatista: 👋!12:11
facubatistahola Chipaca!12:11
jamChipaca, question about Harness. While I'm adding support for auto triggering relations. There is a question for Peer relations.12:15
jamCurrently with Harness, you have to call 'add_relation' even for peer relations that 'always exist'.12:15
jamI'd like for begin_with_hooks to do so automatically12:15
jambut should we also do so for just begin()? IMO it makes it harder to figure out when the associated hook would fire, etc.12:16
Chipacajam: that seems in line with the difference between begin and begin_with_hooks12:16
jamChipaca, chans-erv seems to have issues with facu :)12:16
Chipacajam: the first two are me being lazy with flags (it's easier to +* and then deop than figure out the right invocation to do it in one pass)12:17
facubatistajam, we're setting it up12:17
Chipacajam: i'm guessing the second is facu poking around :-)12:17
jammorning facubatista12:17
Chipacajam: by 'in line' i mean, 'begin' should continue being barebones, so you can poke at things without everything else happening12:18
jamChipaca, yeah, that's how I read it. SGTM12:18
Chipacajam: and begin_with_hooks can be the 'what does it look like in the middle of an actual run'12:18
Chipacabthomas: 👋13:34
bthomasthanks Chipaca13:36
Chipacafacubatista: there's a bug with the charmcraft release you did :-/14:01
Chipacafacubatista: and with the HOWTO i guess14:01
Chipacafacubatista: you're building locally, meaning you only build for amd6414:01
Chipacafacubatista: so charmcraft 0.3 is only out for amd64, any other arch gets 0.214:01
Chipacafacubatista: 'snapcraft remote' should probably be in there :-|14:02
Chipacaremote-build*14:02
facubatistaChipaca, let me see14:05
facubatistaChipaca, ah, yes, there's even a FIXME in the howto: # FIXME: what about other archs14:06
Chipacafacubatista: 'snapcraft remote-build' :-)14:06
Chipacafacubatista: although right now you could just promote edge to beta14:09
Chipacai've just built 0.3.0 from github master14:10
facubatistathe remote-build is currently working14:10
facubatistaChipaca, let's HO?14:11
Chipacafacubatista: in 5?14:11
facubatistadeal14:11
jamChipaca, facubatista : for 'Harness.begin_with_initial_hooks()'. Juju doesn't guarantee the order of firing hooks if you have more than 1 relation hook (I confirmed in the code that it iterates a map, which is not a stable ordering)16:21
jamfor *testing* it seems it would be easier to write assertions if you had a stable ordering16:21
jambut I don't really want code written that assumes a stable ordering16:21
jamChipaca, thoughts?16:21
jamshould Harness emit events in a stable ordering to make testing easier, or intentionally unstable to avoid code that assumes the order16:21
facubatistaeven firing in random order in the testing harness will not make that clear16:22
facubatistaif it passes, people may assume it's ordered, even if we trigger them at random16:22
Chipacajam: let them be ordered or however is easiest to implement in python for the harness, but if you have more than one relation hook issue a warning from _with_hooks?16:23
jamChipaca, but it isn't wrong to have a relation to DB and a peer relation16:24
jamJuju just doesn't guarantee whether peer-relation-created or db-relation-created will be fired first16:25
Chipacajam: the warning would just be about the order of events16:25
jamChipaca, so it is easiest in the Harness to just iterate a map, which will also be 'unordered'16:25
Chipacajam: in python maps aren't unordered though, since 3.616:26
Chipacajam: ask bthomas :-)16:26
jamChipaca, I wonder if that introduces faults vs the old mechanism to avoid poisoned data16:26
bthomas:-) yep that bit me16:26
jamChipaca, django used to have a security bug where the Query parameters were put into a dict16:26
jamand you could reverse engineer the dict ordering to make it collide.16:27
jamI guess if the hash index is still random at startup the iteration order can be stable but you can't force collisions on the hash table16:27
facubatistaChipaca, I did all the releases, and improved the text here: https://github.com/canonical/charmcraft/pull/10116:28
mupPR charmcraft#101: Release 0.3.0 <Created by facundobatista> <https://github.com/canonical/charmcraft/pull/101>16:28
* facubatista -> lunch16:28
* facubatista is back17:02
Chipacafacubatista: 👋17:07
Chipacafacubatista: can you look at https://github.com/chipaca/ops-lib-k8s/pull/2/files and tell me if the _path thing is clear and readable, or if I should add an explanatory comment, or change the approach entirely?17:08
mupPR chipaca/ops-lib-k8s#2: lots of small tweaks and cleanup <Created by chipaca> <https://github.com/chipaca/ops-lib-k8s/pull/2>17:08
facubatistawill do17:08
mupPR operator#364 opened: ops/testing.py: Harness.begin_with_initial_hooks() <Created by jameinel> <https://github.com/canonical/operator/pull/364>17:10
jamfacubatista, Chipaca : I'm definitely way past EOD, but ^^ is up. I'm happy to bikeshed on the name of the functiona17:35
jamand if we look at that test and say "no we really should give a stable order" then we can fix it17:35
jambut it does what I wanted.17:35
facubatistajam, awesome, thanks17:36
jesseleoHello facubatista I'm still running into the error of adding a resource to my test harness17:39
jesseleofacubatista https://paste.ubuntu.com/p/MJd3cDKfxG/17:39
Chipacajesseleo: what version of ops are you using?17:40
Chipacajesseleo: because the version with add_resource was added in #359 which has not been released yet17:41
mupPR #359: ops/testing.py: Harness.add_resource <Created by jameinel> <Merged by jameinel> <https://github.com/canonical/operator/pull/359>17:41
Chipacajesseleo: so unless you're runing with master, that error is expected17:41
jesseleoyeah I have this in my requirements git+https://github.com/canonical/operator.git@master17:43
Chipacajesseleo: to answer the 'what version' question, just add "raise Exception(ops.__version__)" to the top of yor test method17:43
Chipacait should give you something like 0.7.0+8.g<hex>17:44
Chipacato be more precise, master is 0.7.0+6g169794c right now17:45
Chipacajesseleo: what I imagine might be happening is that your test environment has a different ops version and you need to update/upgrade/refresh it17:48
Chipacathus my suggestion17:49
jesseleooh yes I see I did have ops installed at the system level and wasn't activating my virtual env Chipaca facubatista17:49
jesseleoeverything looks good now17:49
jesseleothanks for being so responsive17:49
Chipacajesseleo: glad we got it working!17:50
* Chipaca EODs17:51
Chipaca👋17:51
facubatistajesseleo, as a general rule, I don't ever never do "sudo pip install", as at some point always confuse things17:54
* facubatista eods20:23

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