/srv/irclogs.ubuntu.com/2021/05/26/#snappy.txt

mupPR snapd#10306 opened: snap/quota: add CurrentMemoryUsage for current memory usage of a quota group <Simple 😃> <Skip spread> <quota> <Created by anonymouse64> <https://github.com/snapcore/snapd/pull/10306>02:29
=== freenodecom changed the topic of #snappy to: This channel has moved to ##snappy. The topic is in violation of freenode policy: https://freenode.net/policies
freenodecomThis channel has been reopened with respect to the communities and new users. The topic is in violation of freenode policy: https://freenode.net/policies03:03
freenodecomThe new channel is ##snappy03:03
=== drizztbsd is now known as timothy
=== dob1_ is now known as dob1
pstolowskipedronis: i just saw you comment re debug api access while i was updating the PR to restrict it with rootAccess for stacktrace only (with a separate endpoint). shall I instead make it rootOnly for all debug api?11:23
pstolowskis/rootOnly/rootAccess/11:24
pstolowskibiab, lunch11:24
mardyso, I need some advice :-)11:38
mardythe microk8s snap ships a profile for containerd: https://github.com/ubuntu/microk8s/blob/master/microk8s-resources/containerd-profile11:39
mardyI don't think we want snaps to ship their own profiles, but I'm also not sure what is the best way forward11:40
=== Mirv__ is now known as Mirv
mardyone possibility would be to enhance the kubernetes-support interface, and add a sub-profile for containerd in there11:40
mardyanother option is to add a containerd-support interface, and have the containerd-daemon use that11:41
mardyanything else?11:41
zygamardy it's hard to pull permissions11:47
zygamardy if it ships a profile it can load it11:47
zygaso you cannot revoke that without some extra new optional parameter that says it has an interface but wants a more limited version because it expects snapd to do stuff11:48
zyganote that the profile it ships is not in the snap.* namespace either11:48
zygaso it's really a case of a snap having permissions to define custom sandbox for something it manages11:48
mardyzyga: I'm not sure if I'm misunderstanding you, but in this case pulling permissions would be easier, because the microk8s snap is also developed by Canonical11:52
mardyit's "just" a matter of deciding where to put this profile, and how to load it11:52
zygamardy I suspect that a snap interface _could_ load a profile from outside of the snap.* namespace but that is indeed new11:53
zygamardy do you know if microk8s leaves its apparmor profile explicitly?11:53
zygaand sets up things to be in cri-containerd.apparmor.d profile?11:53
zygaI also wonder what you gain by moving that profile somewhere else11:53
zygaupdates now would require updating snapd 11:54
zygaarguably this is easier now11:54
mardyzyga: yes, a script reexecutes itself with aa-exec as unconfined, then loads the cri-containerd profile with apparmor_parser :-)11:54
zygaokay11:54
mardyzyga: but I see that here we have a subprofile, for example: https://github.com/snapcore/snapd/blob/master/interfaces/builtin/kubernetes_support.go#L66-L6811:54
zygaI think as unfortunate as that is, it's cleaner if it's not in the snapd profile11:54
mardyand I wonder if we shouldn't do the same for containerd11:55
zygahmmm11:55
zygathat's a profile for a specific binary though11:56
zygahow would you transition?11:56
* ogra wonders what "cri-" stands for11:56
zyga(here microk8s must manually run things in that profile)11:56
zygacontainer runtime icannotmakeupmymind11:56
ograhaha11:56
ograi like the last bit11:56
mardyzyga: AFAIU, containerd then would create specific apparmor profiles for its containers: https://docs.docker.com/engine/security/apparmor/11:57
zygamardy I guess with enough coordination it is possible11:59
zygawhat do microk8s folks say?11:59
mardyzyga: I will ask them next :-)12:04
zygamardy one thing being problematic here is that it may require a new assumes: snapdXYZ in the microk8s snap12:12
=== pedronis_ is now known as pedronis
mardykubernetes-support     microk8s:k8s-journald           -                    -12:36
mardykubernetes-support     microk8s:k8s-kubelet            -                    -12:36
mardykubernetes-support     microk8s:k8s-kubeproxy          -                    -12:36
mardykubernetes-support     microk8s:kubernetes-support     :kubernetes-support  -12:36
mardyany idea why the last one is autoconnected, while the previous three are not?12:37
pstolowskimardy: the previous one is a new interface you're working on right?12:40
mardypstolowski: no, I'm innocent here :-)12:43
mardypstolowski: all those microk8s:k8s-* plugs are different flavors of the kubernetes-support interface12:43
zygamardy I have a guess12:45
zygaactually12:45
zygamaybe not12:45
zygacan you share the slot and plug info?12:45
zygaI thought it's something but I'm not sure anymore12:45
zygathat info should help12:45
mardyzyga: https://github.com/ubuntu/microk8s/blob/feature/jdb/strict/snap/snapcraft.yaml#L26-L3412:47
mardyor did you mean from snapd?12:47
zygaand can you share the snap decl assertion12:47
zygano that's fine12:47
zygasnap known snap-declaration # I forget what you have to say here12:48
mardyzyga: you mean this? https://paste.ubuntu.com/p/tMZ3W9RQBV/12:51
zygayes12:52
zygait has auto-connection on kubernetes-support12:52
zygaI wonder how the interface name matters in auto-connection rules12:52
zygaI think pedronis would know but I recall there was some language to constrain interface names as well12:53
mardyzyga: when you enable autoconnection on one interface, does that apply to all flavors? or do you need to list them explicitly?12:53
zygaflavour is just an attribute12:54
zygait's not special in the system AFAIK12:54
zygahave a look at interfaces/policy as well12:54
pedronismardy: it applies to all unless there are extra constraint on it12:54
zygaI don't recall12:54
zygahey ijohnson 12:54
ijohnsonhey zyga 12:54
pedronismardy: for example on attributes or plug names12:54
mardymmm.. here it looks like it's doing something special based on the flavor: https://github.com/snapcore/snapd/blob/master/interfaces/builtin/kubernetes_support.go#L306-L32312:54
zygamardy it could be that the core policy has something about it12:54
ijohnsonzyga: how are things with you these days ?12:54
zygamardy the core policy together witih snap decl on microk8s should have all the input to the engine that decides12:55
zygaijohnson oh good, a bit over worked as usual but it's still fun12:55
zygasetting up CI lab for zephyr and linux boards12:55
ijohnsonyeah I've heard about all the adventures in testing real metal boards with spread12:55
zygalooking into projects that do zephyr updates12:55
zygalooking into some linux updates for a gateway as well12:56
zygaijohnson yeah, we're working with Linaro to extend spread to support using lava12:56
zygaor to be precise, to emit lava jobs12:56
zygaso that CI like gitlab or github can schedule lava jobs and collect results back12:56
ijohnsonnice12:56
zygayeah, though it took some convincing :D12:57
ijohnson:-D12:57
zygaI wish we could merge some of that back12:58
zygathat's always an option, I know everyone is busy12:58
ijohnsonyeah I wish spread was more actively maintained as well12:58
ijohnsonI mean everybody wishes everything was more actively maintained though haha12:58
zygaI think we can all collectively fork it if we're happy with that12:59
zygaI hope it's not needed12:59
ijohnsontrue always an option12:59
ijohnsonanyways /me -> SU12:59
zygao/12:59
pedronisijohnson: this is probably something simple you can review https://github.com/snapcore/snapd/pull/10310 as you were in the discussions13:34
mardyis there any way for a snap to know if this is its first execution after boot?13:34
ijohnsonpedronis: sure13:35
mardythe mikrok8s needs this, but their current way of getting this information requires access to /proc/1/environ: https://github.com/ubuntu/microk8s/blob/master/microk8s-resources/actions/common/utils.sh#L684-L68613:38
mardyso I was wondering that, unless we have something like this already, maybe we could provide this information via a snapctl action?13:38
ijohnsonmardy: that feels a bit broken, can they not just write a file to /tmp the first time they start and if that file exists it's not the first start ?13:58
pedronismardy: we try not to provide things via snapctl unless it's really snap specific or there's no other way to mediate the access14:07
pstolowskimvo: can you land https://github.com/snapcore/snapd/pull/10284 ? unrelated failures..14:25
pedronismborzecki: ijohnson: I created https://github.com/snapcore/snapd/pull/10311 related to the SU discussion and 1025514:25
mvopstolowski: done14:25
pstolowskity!14:26
=== luisp is now known as luisp_
=== luisp_ is now known as luisp__
=== luisp__ is now known as luisp
ijohnsonpedronis: ack thanks for this14:35
ijohnsonpedronis: related, how do you feel about making post to quotas related things authenticated? it currently is root only and it's ever so slightly annoying to me that I need to use sudo14:36
mardyijohnson: uh, why didn't I think of that... :-)14:38
ijohnsonmardy: haha no worries I'm sure this code works fine outside of confinement and wasn't written expecting to be confined at all14:39
mardyijohnson: don't we set TMPDIR to something else, when running a snap? Or can confined snaps write to /tmp?14:42
ijohnsonmardy: confined snaps have a different /tmp mounted for them, from the host system, a snap's /tmp is something like /tmp/snap_foobar/14:43
mardyat least we don't, according to https://snapcraft.io/docs/environment-variables14:43
mardyah, nice14:43
ijohnsonmardy: so we don't set the TMPDIR value to something else, it still points to /tmp by default, but /tmp is not /tmp on the host 14:43
ijohnsonhey roadmr 14:43
mardyijohnson: nice14:43
pedronisijohnson: I think it's a bit premature to do that change, my current impression is that root still seems correct14:45
ijohnsonpedronis: ack, as I said it's just slightly annoying for me to remember during development14:46
roadmro/14:48
ijohnsonpedronis: do you know the status of #8919 ? claudio marked it blocked waiting for some better API from Chris, but it's not clear to me better API was ever implemented15:15
om26erO Hi!15:33
om26erI need my cloak back15:33
om26er;-)15:33
ograom26er, #ubuntu-irc hands them out 15:34
ogra(and the libera ones are much nicer too ... if you modify them a bit they turn into superhero capes 😉 )15:35
pedronisijohnson: we need to resync with chris15:41
ijohnsonpedronis: ack, I will leave the pr be then16:05
pedronisijohnson: btw, did you see I commented on https://github.com/snapcore/snapd/pull/9965 a while ago?16:38
ijohnsonoh sorry yes I did see you commented on that, but forgot to respond / address your points16:39
ijohnsonI will respond today16:39
ijohnsonthanks16:39
ijohnsonpedronis: what do you think of my proposal for https://github.com/snapcore/snapd/pull/10304#discussion_r639795752 ?16:39
pedronisijohnson: I commented making a suggestion16:52
* ijohnson thanks16:52
ijohnsonerr 16:52
ijohnsonthanks pedronis 16:52
pedronisheh16:52
ijohnsonpedronis: related to the default-providers question, is there also a possibly similar question for super-privileged snaps like lxd or docker being pulled in automatically that the user didn't consent to? I mean those snaps are strictly confined so probably it's fine?17:02
pedronisijohnson: no, that's different, also we would likely control which snaps can pull them in17:32
ijohnsonok makes sense17:33

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