/srv/irclogs.ubuntu.com/2021/07/08/#snappy.txt

ijohnson[m]cachio: thanks01:00
mardy'morning!04:43
mborzeckimorning05:24
mborzeckimardy: heya05:24
pstolowskimorning06:01
mardypstolowski: hi!06:07
pstolowskimardy: hey, a few minor suggestions to start services PR06:46
mborzeckipstolowski: hey06:51
zyga-mbpgood morning07:14
pstolowskihey zyga-mbp 07:14
mborzeckimvo: one step closer https://github.com/snapcore/snapd/pull/1051007:23
mvomborzecki: \o/ thanks. let me look07:24
mvomborzecki: this looks very good07:36
mborzeckimvo: as it says in the descritpion, the bit to restore the old model of final reseal fails is missing still07:37
mborzeckiwe didn't really have to do it until now, as remodelCtx.Finish() was end of the road for this change and could not fail, but now we have one more step which can actually fail07:38
mborzeckiwell, unlikely but still07:38
mvomborzecki: *nod*07:39
pedronishello, https://github.com/snapcore/snapd/pull/10376 needs a 2nd review, it's simple-ish07:44
mardypedronis: +107:47
pedronisthx07:48
pstolowskii'm still looking at it07:48
pstolowski1 minor comment so far07:49
pedronispstolowski: could you do a 2nd review of https://github.com/snapcore/snapd/pull/10437 when you have a bit of time as you are a bit familiar with quotas07:49
pstolowskipedronis: will do07:49
pedronisthx07:50
* pstolowski physio07:52
mardymvo: the microk8s user/group did not make it in time for 2.51.2, did it?08:24
mvomardy: it did not08:24
mvomardy: was it marked 2.51?08:24
mvo(also in a meeting)08:24
mvo(sry!)08:24
mardymvo: I didn't mark it in any way, at least. I'm unfamiliar with the release process. But no worries! I'll just let the microk8s people that the thing is in the master branch08:25
mvomardy: yeah, edge should be fine08:25
mvomardy: we can chat after my meeting08:25
pstolowskire09:00
mardypstolowski: re. Too bad that the domain phys.io is already taken09:07
pstolowskiheh09:07
pstolowskipedronis: re validation sets asserts refresh, i think we need to refresh monitored and enforced ones separately because conflicts should prevent commit only for enforced ones, right?09:13
pedronispstolowski: correct09:16
pstolowskity09:16
mardyI'm exploring the idea of having snapd retrieve the credentials (=name, I guess) of the snap which is making a request via snapctl, and then execute a program under the snap's own confinement. Any suggestions on where in the code to look at, in case we have already something similar?09:26
pedronismardy: the context ctlcmd.Run receives has that information09:35
pedronismvo: I reviewed https://github.com/snapcore/snapd/pull/10264 again09:35
pstolowskipedronis: i proposed a draft https://github.com/snapcore/snapd/pull/10511, it is obviously missing tests. a quick look and high level feedback would be helpful09:50
pedronispstolowski: thx, I'll try to look after lunch09:54
pstolowskithx09:54
mvopedronis: thank you, excellent points09:56
mborzeckihmm did we land something for nested? `/bin/bash: line 109: /home/gopath/src/github.com/snapcore/snapd/tests/lib/tools/nested-state: No such file or directory`11:14
ijohnson[m]morning folks11:33
ijohnson[m]bboozzoo: I know I saw some PR's from cachio about nested stuff, not sure if they landed or not11:33
pstolowskihey ijohnson[m] 11:33
ijohnson[m]o/11:34
pstolowskiijohnson[m], mborzecki : https://github.com/snapcore/snapd/pull/10419 not landed yet11:34
ijohnson[m]pstolowski: I thought there were smaller ones too11:35
ijohnson[m]like this one https://github.com/snapcore/snapd/pull/1050011:35
ijohnson[m]that one landed11:35
pedronismvo: either I'm confused or we are getting again delta failures11:43
ijohnson[m]fun11:44
pedronismvo: https://github.com/snapcore/snapd/pull/10376/checks?check_run_id=301785628611:44
mvopedronis: oh no, looking11:45
mvopedronis: I will raise this with the store again11:46
pstolowskiijohnson[m]: hmm indeed11:48
pedronispstolowski: I looked at https://github.com/snapcore/snapd/pull/10511, thx11:58
pstolowskipedronis: thank you!11:58
mardydo we have any place in snapd where we are calling a process via snap-confine?12:00
ijohnson[m]mardy: there are other "helper" tools that snap-confine calls12:00
zyga-mbpmardy: directly?12:00
ijohnson[m]like snap-update-ns iirc12:00
zyga-mbpmardy IIRC we only call it via snap-run12:00
zyga-mbp(except in some tests perhaps)12:00
mardyzyga-mbp: I mean like the hooks: AFAIU they are run under the snap confinment and are triggered by snapd12:02
pstolowskimardy: hooks also run via snap-run -> snap-confine12:03
zyga-mbpmardy: hooks execute through snap run12:04
zyga-mbpsnap run --hook IIRC12:04
pedronismardy: if you want to add a new variant of running things as the snap it probably needs to be added as a feature of "snap run"12:06
zyga-mbpmardy what are you thinking about?12:06
pedronismardy: calling snap-confine from snapd directly is not something I would do12:06
pedronismardy: you might need to be careful not to call something that the snap can modify or influence though, or reason that is not a problem12:07
pedronismborzecki: I did a quick first pass on https://github.com/snapcore/snapd/pull/1051012:08
zyga-mbpmardy: snap run provides the right input (environment) to snap-confine12:09
mardyzyga-mbp, pedronis: I was investigating the idea of having the mount operation (for the mount-control interface) being executed in a separate process running under the snap's own confinement. So, if the mount succeeds, we know that the client had the right permissions, and we can create the mount unit (if the mount is persistent)12:15
zyga-mbpmardy: hmmm12:15
pedronismardy: this is complex because you need to think whether the snap can manipulate its mount namespace to cheat and make that binary return happy even when it shouldn't12:16
zyga-mbpmardy: that is tricky, for once, we define the confinement so it could be that we are measuring ourselves12:16
zyga-mbpmardy: on some systems all mount calls are allowed, so that would also be confusing as the snap would have different behavior (as in what snapd does) based on that12:16
pedronismardy: I suppose you could look/have to look at the mount table after instead of trusting the return of the invocation12:17
zyga-mbpmardy: if anything I would do it as a function of the apparmor profile (which is an opaque text) and extend it to carry information about allowed mount calls12:17
mardyzyga-mbp: ah, you mean if apparmor is disabled? that's a good point12:17
zyga-mbpmardy: or doesn't mediate mount12:17
zyga-mbpmardy: then you could explicitly allow that in mount snippets and reliably test for that without doing so in the running system12:18
pedronisbut yes, also what zyga said, on some systems we don't have apparmor, but especialyl for persistent mounts we want to follow our own constraints12:18
mardypedronis: sure, that's what I meant; but now zyga-mbp raised another issue, where apparmor is either disabled or not mediating mount. I guess we would still want snapd to block the operation?12:18
pedronisyes, if snapd is mediating and it's about generate persistent host mounts, we don't want to allow it even on those systems12:19
zyga-mbpmardy: yes, then you could do that regardless of the actual sandbox being able to do that effectively12:19
pedronisalso because the difference of behavior is too big12:19
zyga-mbpI agree with pedronis 12:19
pedronison top of the security concern12:19
mardyand I agree with both of you, then :-)12:20
mardyit's a pity, though :-)12:20
zyga-mbpmardy: it's a bit more complex since apparmor profile has many items inside12:20
zyga-mbpincluding sup profiles and hats12:20
zyga-mbpand it is unclear how to test against that as a whole12:20
zyga-mbpbut you could do something like this12:21
zyga-mbpchange the apparmor spec to model allowed mount operations 12:21
zyga-mbpvalidate against _that_ in your logic12:21
zyga-mbpand replace the literal text in apparmor snippets, that describe mount calls, with generated snippets based on the allowed mount operations12:21
zyga-mbpthis way you have the _effective_ same text of the apparmor snippet 12:22
zyga-mbpbut you can ask questions against the apparmor.Spec object12:22
zyga-mbpnot sure if this is something you considered or if pedronis agrees, this is just my suggestion12:22
mborzeckipedronis: thanks12:22
mardyzyga-mbp: I'm afraid I don't understand your suggestion :-( What I currently have is this: https://github.com/mardy/snapd/blob/mount-control/interfaces/builtin/mount_control.go#L25912:24
zyga-mbpmardy: look at interfaces/apparmor.Spec 12:25
zyga-mbpgo doc it12:25
zyga-mbpwhat if it had a Spec.IsMountAllowed(...) 12:25
zyga-mbpthat's what I'm describing12:25
zyga-mbpright now snapd generates the apparmor profile but the information is lost in untyped strings 12:26
zyga-mbpI'm suggesting to change that, so for the specific case of mount rules, snapd would understand that part12:26
zyga-mbpdo you see where this is going?12:26
mardyzyga-mbp: yes. OTOH, I wonder if we really want to tie it to apparmor, or have it as part of a more MAC-agnostic logic12:29
zyga-mbpmardy: that's a good question12:29
zyga-mbpmardy: it could be a separate new type of backend that really is used as input to other backends (e.g. apparmor and seccomp)12:30
mardyyes, that would make sense12:30
zyga-mbpmardy and at some point, it's all going to be landlock and eBPF :-)12:32
mardyijohnson[m]: do we need to make a PR to snapcraft? I get this error if I declare the new microk8s user: "Issues while validating snapcraft.yaml: The 'system-usernames' property does not match the required schema: 'snap_microk8s' is not a valid system-username."12:49
mardyor maybe my declaration is wrong...12:53
mardyah, I guess I need to add it here: https://github.com/snapcore/snapcraft/blob/405c576553d22be9727f681f8cda88b220b39f30/schema/snapcraft.json#L52212:54
ijohnson[m]mardy yes12:54
mardyijohnson[m]: I guess I can create the branch and submit a PR already - or do we need to a new snapd release carrying this change?12:55
ijohnson[m]mardy let's chat in the SU12:59
mardyijohnson[m], pedronis: do you prefer adding the microk8s user to the snapcraft pattern, or use snap_*?13:38
ijohnson[m]mardy for now just following snap_daemon makes sense 13:40
ijohnson[m]When we need to add a 3rd user then we should do something different I think 13:41
pedronisthat sounds fine to me, just wanted to clarify the principle13:43
futuretim_is spread _only_ available as a snap?14:15
om26erHi! How can I make my python based snap to use python 3.9 ?14:15
ijohnson[m]futuretim_: either as a snap, or as a binary you download or build from source14:16
futuretim_ijohnson[m]: of course from source :P14:16
om26erThe software I am trying to update, recently added the Python 3.9 requirement, so now I need to figure that out14:16
futuretim_om26er: there's a forum thread about something similar I believe, also hello :)14:18
om26erfuturetim_ Hey Tim14:19
om26erfuturetim_ I haven't found any useful thread regarding that. One option I could think of is to NOT use the python plugin and install my package using `override-build` stanza and also adding python3.9 to stage-packages14:20
om26erhowever I was wondering if there is a way to tell the Python plugin to use a different version of Python instead of the default that it picks from the relevant core snap14:21
futuretim_om26er: it doesn't seem like it: https://forum.snapcraft.io/t/proposal-extensive-python-version-support-for-python-plugin/1914014:23
futuretim_That's a thread about a plan to do that?14:23
mardyit's "funny" how the HACKING.md document of snapcraft does not say how to actually build and run snapcraft :-)14:29
futuretim_mardy: i've done it a little bit from source, it's not too bad14:38
futuretim_I'm trying to run the spread smoke test and have gotten to this point: "Cannot allocate qemu:ubuntu-core-20-64: cannot launch qemu qemu:ubuntu-core-20-64: exec: "kvm": executable file not found in $PATH"14:40
futuretim_i'm using the snap based spread, qemu-kvm is installed14:40
futuretim_oh, and I just tried kvm directly and it works.. so it's a snap based problem?14:41
ijohnson[m]futuretim_: do you need to run uc20 spread tests specifically ?14:41
pedronisironically the spread snap is not regularly updated and has known quirks/limitations14:42
futuretim_ijohnson[m]: oh actually, not necessarily. Just "playing" at the moment. Want to familiarize myself with spread's capabilities.14:42
futuretim_is there something about those that wouldn't work?14:43
ijohnson[m]futuretim_: for now I would recommend running non-uc20 spread tests, you need to tweak spread in confusing ways to be able to use uc20, since it requires uefi which is different from all the others systems which just use plain ol bios14:44
futuretim_ijohnson[m]: ok, thanks for the note.. but that doesn't really explain my specific issue, does it?14:44
ijohnson[m]futuretim_: ah sorry you're right, yeah the spread snap runs in strict and so it doesn't have kvm inside the snap, usually the spread snap is just used to run tests in the cloud, for now I would recommend using the binary directly14:45
ijohnson[m]futuretim_: updating the spread snap to be more usable is on our (long) todo list14:45
futuretim_ijohnson[m]: ok, can do. thanks!14:45
mardyI'm getting a "Cannot find snapcraft's data files." error when running a locally build copy of snapcraft (./setup.py install from within the LXC container)14:47
ijohnson[m]@mardy probably have better luck asking in #snapcraft14:51
futuretim_mardy: check setup_dirs though14:52
futuretim_I get access denied on this path from the snapd HACKING markdown:  curl https://niemeyer.s3.amazonaws.com/spread-amd64.tar.gz 14:55
mardyijohnson[m]: ah, didn't know there was a specific channel14:59
mardyfuturetim_: thanks, looking...14:59
zyga-mbpfuturetim_ spread snap seems to be unmaintained 15:10
zyga-mbpfuturetim snap based spread cannot use some backends (kvm/lxd)15:10
zyga-mbpfuturetim you are much better off building your own15:10
* cachio lunch16:12
pedronisijohnson[m]: does https://github.com/snapcore/snapd/pull/10165 need more reviews? (I can't quite review it myself as I started it)17:19
ijohnson[m]pedronis no I don't think so17:44
ijohnson[m]It should be good to go17:44
ijohnson[m]I think I was just waiting for tests to be green 17:44
ijohnson[m]pedronis: yeah I checked and the tests are all happy there, since I added the fix to the reboots variant, I haven't seen those tests fail once in CI out of maybe 3 runs (triggered by new commits I pushed)18:00
* ijohnson[m] afk for a few hours, back in PM18:14
pedronisijohnson[m]: is this also unneeded https://github.com/snapcore/snapd/pull/10165/files#diff-62e70d55d61af70f84fe10b18afbdc094bc67bc9ee884f9f522b91e09335b1d7R20 ?18:15
ijohnson[m]pedronis: ah hmm probably but it would be good to do that in a followup18:16
futuretim_anybody try RustPython in a snap as their Python runtime? :)18:37
futuretim_what about making the Python a WASM WASI module and using that instead... that sounds appealing18:38
cachioijohnson[m], I already updated the pr for the nested retry tool19:15
cachiothanks for the review19:15
futuretimI don't suppose there's a way to learn more about the Snap store outside of existing API docs?22:43
futuretimanybody interested and didn't already see the forum posts, hacking on an open source store implemtnation over at #freetocompute23:55

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