/srv/irclogs.ubuntu.com/2019/11/06/#snappy.txt

mupPR snapd#7665 closed:  devicestate: add support for gadget->gadget remodel  <Priority πŸ‡> <Remodel πŸš‹> <Created by bboozzoo> <Merged by mvo5> <https://github.com/snapcore/snapd/pull/7665>06:09
mborzeckimorning06:13
mborzeckimvo: thanks for merging 7665, do you need help with other remodel PRs?06:14
mvomborzecki: hey, good morning!06:14
mvomborzecki: maybe, let me see what pawel wrote06:14
mborzeckimvo: ok06:14
mvomborzecki: 7720 needs a second review, should be super simple06:15
mborzeckimvo: ok, on it06:15
zygaHello06:24
zygaStarting soon06:24
mvozyga: good morning06:29
mvomborzecki: I updated 7715, there is one question about test improvements, I need to think about it but I think it's not a blocker, feel free to ponder over this, I will not attack this today (his question about testing the taskEdges)06:30
mborzeckizyga: hey06:33
mborzeckimvo: let me check that06:33
mborzeckizyga: did you dream about keyctl? :)06:36
zygain the office now06:37
zygamborzecki: no, I decided to really rest today06:37
mborzeckizyga: i went through https://www.kernel.org/doc/html/v4.13/security/keys/core.html and then ecryptfs key usage examples but feel none wiser really06:37
zygamborzecki: I'm sure there are keys here06:38
zygahttps://twitter.com/zygoon/status/119177645199509504106:38
zygabut not like you know it ;)06:38
zygamborzecki: I think given timing we need to investigate keys next week06:38
mborzeckizyga: still, it feels like a replacement for a cookie, so half of the problem could be addressed06:38
zygathis week I'd like to get the cgroup in place and adjust snapd06:38
zygamaybe get the UI proposed06:38
mupPR snapd#7687 closed: snap-bootstrap: check gadget versus disk partitions <Created by cmatsuoka> <Merged by bboozzoo> <https://github.com/snapcore/snapd/pull/7687>07:23
* zyga break, some back pain, may work from floor today07:34
=== pstolowski|afk is now known as pstolowski
pstolowskimorning08:08
mvogood morning pstolowski08:10
zygaBreakfast08:15
zygaImplemented the cgroup idea08:41
zygaRunning tests08:41
zygaSnapd side changes next08:41
mupPR snapd#7721 opened: gadget: add support for hybrid partitioning schemas <Simple πŸ˜ƒ> <Created by bboozzoo> <https://github.com/snapcore/snapd/pull/7721>08:48
mborzeckipstolowski:  hey08:48
mborzeckitrivial PR for gadget ^^08:50
pstolowskimborzecki: sure09:06
mborzeckipstolowski: thanks!09:06
zygaI really want snap set system reexec=no09:07
mupPR snapd#7720 closed: asserts: add "snapd" type to valid types in the model assertion <Needs Samuele review> <Simple πŸ˜ƒ> <Created by mvo5> <Merged by mvo5> <https://github.com/snapcore/snapd/pull/7720>09:12
zygaSome progress09:14
zygaFreezer freezing snap confine is silly09:14
mborzeckihahah09:16
mborzeckizyga: you mean s-c froze itself? :)09:16
mborzeckigoogle:ubuntu-core-18-64:tests/main/remodel-gadget failed on master :/09:23
mvoa second review for 7711 would be great, it has one already and is green. hopefully straightforward09:24
mvomborzecki: oh no! in what way?09:25
mborzecki- Remove data for snap "pc" (36) (failed to remove snap "pc" base directory: remove /var/snap/pc: directory not empty)09:25
zygamborzecki: just being silly09:25
zygamborzecki: it works now09:25
mborzeckihm probably some other test leaving stuff behind09:25
zygahttps://www.irccloud.com/pastebin/DUaJsF5k/09:25
zygamborzecki: no, I put it in the wrong spot09:25
zygamborzecki: lxd escapes us though09:25
zygamborzecki: I'll send the patch with the function in a moment09:26
zygamborzecki: need to clean up the commit tree09:26
zygamborzecki: lxd escaping all cgroups  https://www.irccloud.com/pastebin/76oMP7KO/09:28
zygamborzecki: the C diff https://paste.ubuntu.com/p/T9NmjppHrY/09:30
dot-tobiaszyga: FYI, filed https://bugs.launchpad.net/snapd/+bug/1851480 (forgot to hit β€œsubmit” yesterday …). Will ping here if I get stuck in my fix attempt09:45
mupBug #1851480: Hooks are not included in slot/plug label expressions <snapd:New> <https://launchpad.net/bugs/1851480>09:45
zygamborzecki: have a look at https://github.com/snapcore/snapd/pull/772209:51
mupPR #7722: cmd/snap-confine: add sc_join_sub_group <Created by zyga> <https://github.com/snapcore/snapd/pull/7722>09:51
zygadot-tobias: hey09:51
mupPR snapd#7722 opened: cmd/snap-confine: add sc_join_sub_group <Created by zyga> <https://github.com/snapcore/snapd/pull/7722>09:51
zygadot-tobias: thanks!09:51
zygamborzecki: on top I have the move of cgroup handling so that it affects all snap kinds09:52
dot-tobiaszyga: Welcome, hope I got half the snapd lingo right πŸ˜„09:52
zygamborzecki: and a one liner than enables this new logic09:52
zygamborzecki: my thinking is we can keep the pids thing for a while09:52
zygamborzecki: and nuke it later once I'm done with snapd-side change09:52
zygadot-tobias: yeah, the bug report looks great09:53
zygamborzecki: does this seem sensible?09:54
mborzeckizyga: the diff doesn't look too bad09:54
mborzeckizyga: it'd be nice to run the idea by jamie and mvo too before we spend too much time digging09:55
mborzeckizyga: i mean jdstrand09:55
mborzeckiuhh, the way we restore the system in tests is broken09:57
zygamvo, jdstrand: ^09:57
mvozyga: whats the high level idea? I have the C diff loaded now10:07
zygamvo: the high-level idea is that we use a sub-directory of the current unified/v2 cgroup as a tag10:07
zygamvo: and move the process there to identify it as a process belonging to a snap10:07
zygamvo: I discussed this with xnox yesterday for in the context of being systemd-safe10:08
zygamvo: it's safe to move to a deeper hierarchy10:08
zygamvo: (moving up is not)10:08
zygamvo: it uses v2 in all systems, giving us notification ability10:08
zygamvo: the new idea is from maciek really, that cgroups can act as process tags10:08
zygamvo: the idea to use v2 is because it is very much like name=snapd in v1 world (no controllers)10:09
zygamvo: and in v2 world it doesn't fall apart as we don't have to steal a process entirely10:09
zygamvo: and we can move it deper wherever systemd had originally placed it10:09
zygamvo: this is the key improvement: it works in v2 in a way that doesn't disable systemd's operation10:09
mvozyga: aha, ok10:10
zygamvo: it works in lxd as well, I confirmed this with stgraber two days ago10:10
mvozyga: that sounds promising!10:10
zygamvo: notification is implemented differently10:10
zygamvo: and enumeration is implemented differently10:10
zygamvo: and both are coming as follow-ups to snapd10:10
zygamvo: first enumeration, so that existing code can be moved over (along with all the spread tests for this)10:10
zygamvo: notification should let us salvage the UI work that is waiting now10:11
zygamvo: so maybe... just maybe... it will really work by Friday10:11
zygamvo: no rush to merge it, I'll carry on implementing it, but it would be good to review and discuss with jamie10:11
zygamvo: xnox raised a concern about security aspect of keeping an app open10:12
zygamvo: because it would prevent refreshes10:12
zygamvo: but I think this is really the feature design10:12
zygamvo: we are also looking with mborzecki at kernel keyring as a way to prevent spoofing10:12
zygamvo: where all our processes could hold something that cannot be forged10:12
zygamvo: but all it does is make the feature more security tight, it doesn't change that anyone can run a snap and prevent it from refreshing using "snap run..."10:13
zygamvo: so our existing snapd-side safeguards must suffice - that is the window of time after which we refresh anyway10:13
mvozyga: right, agreed10:14
zygamvo: there's enough priority items not to review it yet10:17
zygamvo: but we might try to review all of it by end of week10:17
zygamvo: just to be able to say "it's in master"10:17
geekgonecrazyis there a way to bypass the restriction on refreshing to a revision?10:19
geekgonecrazysome how during recent update we discovered several users skipped a revision10:19
geekgonecrazyand during some troubleshooting we really need them to refresh or revert to that revisiom10:20
geekgonecrazyrevision*10:20
zygageekgonecrazy: can you explain how skipping a revision was a problem for your users?10:20
zygageekgonecrazy: based on what you said it seems like snap epochs are the solution we had designed and implemented for this problem10:21
zygageekgonecrazy: where you can force all users to migrate through a set of revisions10:21
zygageekgonecrazy: e.g. everyone will see and run the revision that can migrate your data format from v1 to v210:21
zygageekgonecrazy: before allowing them to refresh to a revision that only has v2 support10:21
geekgonecrazywhere is this magic?  we thought it was this way out of the box10:22
zygageekgonecrazy: how did you think it operats?10:22
zygageekgonecrazy: (it doesn't but I'd like to understand)10:22
zygageekgonecrazy: let me refer to the docs on this feature, hold on10:22
zygageekgonecrazy: https://snapcraft.io/docs/snap-epochs10:23
geekgonecrazyit was exactly that.  we had to upgrade db and introduced revision and gave it a week thinking all would be updated before introducing the next revision10:23
zygageekgonecrazy: you need to use epochs to really make that a guarantee10:23
zygageekgonecrazy: as to what to do in an existing situation, I don't know the details of what you did to answer10:24
zygageekgonecrazy: perhaps you can refresh everyone to an intermediate revision that still understands old formats10:24
zygageekgonecrazy: and publish the one that doesn't in a new epoch10:24
zygageekgonecrazy: please read about this feature first10:24
geekgonecrazyso for us we were on mongo 3.4 then intermediate revision (the one some have missed) sets compatibility mode which has to be set before it csn go to 3.6.  then latest revision is 3.610:26
Chipacageekgonecrazy: epochs is meant to be used for that kind of thing10:26
Chipacageekgonecrazy: https://snapcraft.io/docs/snap-epochs10:27
Chipacaheh, i see zyga linked there already10:27
Chipacaok10:27
* zyga hugs Chipaca for implementing this magic10:27
geekgonecrazyso in theory we could release another revision requiring both of those and if they already had all would be fine?10:29
Chipacageekgonecrazy: both of which?10:29
geekgonecrazyor will we have to hack past and put this revision in another channel and have them refresh to that channel to run that revision and then back to the latest10:30
geekgonecrazyChipaca: both required revisions10:30
Chipacasorry, i don't follow10:30
geekgonecrazyok.  so problem is we have that revision some didnt hit.  now they cant refresh or revert there. so we need some way for them to get that revision10:32
geekgonecrazywe cant release new revision.  because would take those that succeeded backwards in database breaking their installs10:32
geekgonecrazyso trying to figure out if there is a way we could have them manually refresh to it10:34
geekgonecrazythen back to stable10:34
Chipacageekgonecrazy: ah10:36
Chipacageekgonecrazy: can you detect a broken install programmatically?10:37
geekgonecrazyChipaca: yes.  But... fixing requires the older database version.10:38
Chipacageekgonecrazy: it does sound like your easiest way forward is to use a branch10:38
Chipacaand then in future start using epochs so it doesn't happen again10:39
geekgonecrazyreally wish i would have known of epochs sooner :) would have been perfect10:39
Chipacageekgonecrazy: a branch is like a temporary track that goes away on ts own10:39
Chipacaso you push the snap that would fix it to latest/stable/fix-for-the-thing, and tell affected users to refresh to it10:40
geekgonecrazyoh dang.. didnt know you could do that either10:41
geekgonecrazywe still are trying to figure10:41
geekgonecrazyout the tracks :)10:41
Chipaca:)10:41
Chipacabranches are hard to explain until you need them10:41
Chipacarather like epochs actually10:42
geekgonecrazythanks Chipaca & zyga !10:46
geekgonecrazybtw Chipaca on thr forum post regarding dig it seems its another dependency and dig just wont run.  so will be digging after this fire and getting to bottom of it.10:48
Chipacageekgonecrazy: good luck!10:51
mvosil2100: I pushed a tiny PR to ubuntu-image so that we can have /boot on the system-seed partitoin, this should bring us one step closer to a botting image, hopefully a trviail review (cc xnox)11:12
mvoChipaca: do you think we should have a short catchup today on recovery.grub? I think we are getting to a point where it will be useful :)11:13
Chipacamvo: I was just trying the image created with your steps from yesterday, and something seems off11:14
mvoChipaca: i.e. we can create an image now but right now (due to a bug) it has no /boot but even when it has that we still don't have a recovery grub that will work.11:14
Chipacamvo: but maybe i'm missing something :-)11:14
Chipacaso, yeah11:14
mvoChipaca: tell me!11:14
Chipacamvo: /systems/2019yadda/ is empty, and instead things are in /snaps/ ?11:14
mvoChipaca: its fully empty?11:15
mvoChipaca: so "/snaps" has all the snaps that are shared between recoveries that is ok11:15
Chipacamvo: ah, i missed that11:16
mvoChipaca: but /systems/20191106/ should not be empty11:16
Chipacamvo: empty of snaps11:16
mvoChipaca: thats ok :) assertions and the model should be there11:16
Chipacayep that's there11:16
mvoChipaca: there will only be local unasserted snaps iirc11:16
mvoChipaca: cool11:16
mvoChipaca: once we have https://github.com/CanonicalLtd/ubuntu-image/pull/177 we should be able to get /boot too with grub.cfg and grubenv11:17
mupPR CanonicalLtd/ubuntu-image#177: System seed boot dir <Created by mvo5> <https://github.com/CanonicalLtd/ubuntu-image/pull/177>11:17
mvoChipaca: but we also need to tweak boot.MakeBootable to copy the right grub :)11:17
mvoChipaca: but I'm excited, we are relatively close I think(?)11:17
Chipacamvo: where's the bit that creates writable?11:19
mvoChipaca: we create only "ubuntu-seed" nowdays, the recovery kernel then boots and the recovery initramfs will notice it runs in "install" mode and will run "snap-bootstrap" which will create all the missing partitions11:21
Chipacahmmm, maybe i did something wrong11:22
Chipacamvo: i thought i'd kicked that off, but it hung11:22
Chipacamvo: i'll try again, paying more attention :)11:22
mvoChipaca: no worries! you kicked what off?11:22
Chipacamvo: booted the kernel, with the initramfs11:23
Chipacaand it got to the mounting step and hung11:23
mvoChipaca: oh, woah - how did that happen?11:23
Chipacamvo: the booting? or the hanging? :)11:23
mvoChipaca: I mean, how did you manage to get a booting kernel?11:23
Chipacamvo: i can walk you through that, it's not hard11:23
mvoChipaca: a pastebin with the commands would be great11:24
Chipacamvo: or i can write a workng grub.cfg for the image as it is right now11:24
mvoChipaca: but thats actually much better news than I anticipated11:24
Chipacamvo: but, basically, grub is awesome (as long as you're patient)11:24
* mvo hugs Chipaca really hard11:24
mvoChipaca: s/grub/chipaca/11:24
mvoChipaca: (and strike the patient part)11:24
Chipacanah leave that one on11:25
mvoChipaca: thats super exciting, can't wait to learn more11:25
Chipacamvo: "ubuntu-seed"'s label is actually 'Recovery', fwiw11:27
Chipacanot sure if that's a bug or not :)11:27
mvoChipaca: in the gadget.yaml ? or where is it set to Recovery?11:29
mvoChipaca: it sounds like a bug11:29
Chipacamvo: on the image11:30
Chipacahaven't looked at the yaml11:30
mborzeckiquick errand, back in 3011:31
mvoChipaca: ha! you are right11:31
mvoChipaca: its in the gadget.yaml, should be trivial to fix11:31
mvoChipaca: I have lunch now, let's sync on the grub stuff when I'm back11:32
Chipacahm, again it reached "Running /scripts/local-premount" and gets stuck there11:32
Chipacamaybe i'm being impatient?11:32
* Chipaca waits more11:33
mvoChipaca: will probably timeout eventually - alternatively the usual "break=top" or so should work. *maybe* even "systemd.debug-shell=1"11:34
mvoChipaca: this is the new stuff from xnox, we may have systemd already in initiramfs :)11:34
Chipacamvo: ah i was about t'ask11:34
Chipaca"the required kernel commandline snap_core is not set"11:35
mvoChipaca: silly thing :)11:35
Chipacathat's not a thing in 2011:35
mvoChipaca: I think we need quite a few updates to our initramfs11:35
cachioChipaca, is this conversation related to the removel-gadget test is failing on master?11:35
mvoChipaca: and the fact that we can boot a kernel now means we can actually do it (hurazzz!)11:35
Chipacacachio: no :)11:36
cachioChipaca, ok, I'll take a look to the test in that case11:36
cachiothanks!!11:36
cachio:)11:36
mvocachio: AFAICT noone has looked deeper into this one yet :/ any hints appreciated (but maybe mborzecki  has looked at the failing remodel-gadget on master, not sure)11:36
* mvo gets lunch first11:36
Chipacamvo: i'll get an editable workable grub.cfg into a pastebin so more people can play11:37
mvoChipaca: \o/11:37
mvoChipaca: or even into github.com:snpcore/pc-gadget in the 20 branch? :) ?11:37
sil2100mvo: ah! Nice catch! I forgot we're skipping that one11:38
cachiomvo, ok11:38
sil2100mvo: let's wait for at least one test run to finish and I'll merge it11:39
Chipacamvo: something else is is snapcore/pc-gadget a thing?11:46
Chipacaer11:46
Chipacamvo: sorry those were two separate things11:46
Chipacamvo: second part first: where is this snapcore/pc-gadget?11:46
Chipacamvo: first part: something else needs doing because it's not picking up grub.cfg from the obvious place11:47
Chipacamight be the old fat vs vfat names sillyness11:47
* Chipaca tries11:47
zygahmm12:04
zygaChipaca: without reading the backlog, is something failing and you are looking at pc-gadget?12:04
Chipacazyga: not really no12:13
mborzeckire12:27
zygamborzecki: making progress, some more complexity but nothing breaking12:28
mborzeckizyga: sound like you're having fun :)12:31
mborzeckimvo: cachio: yes i have, and the way we restore the system state after the test is wrong or just lacking12:32
cachiomborzecki, what I see is that the test is failing just when other test is executed before12:33
mborzeckimvo: cachio: in short what happens is that we have a tar.gz with files that existed *before* the test, and in restore the restore that state, but things that are newly added during the test stay behind, they don't get cleaned up12:33
mborzeckimvo: cachio: imo what we need is like rsync --delete or just fix the tests to do the cleanups12:33
cachiomborzecki, nice, I'll try that12:34
mborzeckicachio: i'm fixing the tests for now, but maybe i can find a sensible way of detecting when stuff is left behind12:34
mborzeckisensible, as in not invovling gruesome shell one liners12:35
=== ricab is now known as ricab|lunch
zyga- Remove data for snap "pc" (36) (failed to remove snap "pc" base directory: remove /var/snap/pc: directory not empty) <- Chipaca <- was that the topic?12:41
mupPR snapcraft#2792 closed: pluginhandler: use well-formed build package/snap lists <Created by cjp256> <Merged by sergiusens> <https://github.com/snapcore/snapcraft/pull/2792>12:51
Chipacazyga: no12:51
mvomborzecki: nice, thanks for looking into this12:57
mvoChipaca: re gadget> https://github.com/snapcore/pc-amd64-gadget/tree/2012:57
mvoChipaca: that's the current place and we can update the 20 branch12:58
Chipacamvo: where is EFI, on the resulting image?13:00
mvoChipaca: a good question, I need to look13:03
mvoChipaca: not sure if that needs special handling13:03
mvoChipaca: aha, hmmmm, I *think* we did that using the gadget.yaml13:03
mvoChipaca: maybe that needs updating13:04
Chipacamvo: I mean, gadget.yaml talks about EFI, but there is no /EFI/ in the recovery partition afaict13:04
mvoChipaca: hmm, that might need tweaks to ubuntu-image again13:04
mvoChipaca: https://github.com/snapcore/pc-amd64-gadget/blob/20/gadget.yaml#L23 should populate the partition13:05
mvoChipaca: but when I look I also see no content there13:05
Chipacamvo: also, also, i'd like to be able to load a grub module :)13:05
mvoChipaca: what does that involve?13:05
Chipacais that doable?13:05
Chipacamvo: in grub.cfg it's an insmod, and a file under EFI/13:06
Chipacanot sure how it interferes with secure boot though13:06
Chipacamaybe a question for cmatsuoka13:06
mvoChipaca: should be ok - we may hardcode it into grub though, i.e. build grub with the module built-in13:07
Chipacamvo: but insmod regexp gives me globs so i can loop over a directory and pick out stuff without having to have env vars for everything13:07
Chipacamvo: so i think we want that :)13:07
mvoChipaca: right13:10
mvoChipaca: so I think we have two options, we can built it into grub or add the module to the gadget.yaml13:10
mvoChipaca: I think the later is quicker for now13:10
Chipacamvo: only if adding it to gadget.yaml actually puts it somewhere :)13:10
mvoChipaca: but maybe xnox has an opinion on regexp module vs build-in13:11
mvoChipaca: right, that's indeed a bit of a mystery right now13:11
xnoxChipaca:  mvo: loading modules is prohibited under Secureboot13:12
xnoxand i thought regex is a built-in already anyway13:12
xnoxmvo:  also i see grub.conf in the pc-gadget, is that a bad symlink that should have been called grub.cnf?13:12
xnoxalso generated image has duplicate full copies of snaps itseems, that's quite suboptimal.13:13
xnoxnote systemd-seed is vfat thus no hardlinks / symlinks available...13:14
xnox(unless my world view is wrong about vfat)13:14
mvoxnox: grub.conf vs grub.cfg is a long story13:15
xnoxmvo:  i slowly back away. cool then.13:15
mvoxnox: I don't see duplicated snaps13:15
mupPR snapd#7723 opened: snap-bootstrap: create encrypted partition <Created by cmatsuoka> <https://github.com/snapcore/snapd/pull/7723>13:15
mvoxnox: I just see /snaps and a bunch of them there13:15
Chipacaxnox: AFACIT the regexp module is not built-in13:16
xnoxso reading source code i beleve regexp module is built-into our grub efi image at least. On bios it needs to be loaded, which is allowed there.13:16
xnoxChipaca:  hm.13:16
Chipacaso maybe this is booting via the bios one?13:16
xnoxChipaca:  how are you booting it?13:16
Chipacaseems strange, because it loads the cfg from EFI13:16
mvoChipaca: I will wrestle a bit why ubuntu-image does not include the content on the recovery partition unless sil2100 has an idea, I will probably have to do some deep dive13:16
xnoxChipaca:  we are dual-boot/hybrid by default.....13:17
Chipacaxnox: you know that email from mvo saying how to get a pc.img ?13:17
Chipacaxnox: that13:17
Chipacaxnox: how can i know if it's booting in efi or bios?13:17
mborzeckiwe shoudl really get rsync into the core snap13:18
xnoxChipaca:  are you using a VM? and have you provided OVMF firware to do bios boot and get a spash with tiano core? or do you use seabios ie. default.13:18
Chipacaxnox: ah, this is a vm but wihtout the fancy ovmf stuff13:19
sil2100mvo: I think I know the reason13:19
Chipacaso i guess it's plain ol bios13:19
xnoxChipaca:  there is nothing in the email that tells people how to boot it. qemu binary defaults to bios boot, unless one provides EFI firwmare. I use virt-manager, and use gui to specify ovmf stuff.13:19
xnoxChipaca:  which is not our primary target.  =)13:19
mvomborzecki: we have a rsync snap, no?13:19
xnoxwe are racing to boot unencrypted with UEFI =)13:19
sil2100mvo: my expectation was that what snap prepare-image generates will already have all the necessary EFI/ directories13:19
Chipacaxnox: right, i'll get that rig up (not my main rig because it still refuses to upgrade out of 1604)13:19
sil2100mvo: but if that's still required to be done by ubuntu-image, then I can do that13:19
mvosil2100: aha, interessting13:20
xnoxhar har13:20
zygamborzecki: another chunk https://github.com/snapcore/snapd/pull/772413:20
mupPR #7724: cmd/snap-confine: tracking processes with classic confinement <Created by zyga> <https://github.com/snapcore/snapd/pull/7724>13:20
mvosil2100: its a good question, in theory we have all the code to do that I think13:20
zygamborzecki: this applies the tracking (still with pids) for classic confiement13:20
Chipacaruh roh, ubuntulog fight!13:26
mborzeckimvo: right, but it's a snap, and i need to restore this on a core device13:27
mvomborzecki: could we download it to /var/tmp and unpack there?13:29
mvomborzecki: or is that too crazy13:29
mborzeckimvo: ha, this might even work! :)13:30
Chipacamborzecki: ssh + tar dude13:30
mborzeckimvo: ok, let me finish up with this simple fix i have now and i can try that later13:30
Chipacamborzecki: tar cz path/to/tar | ssh 'tar xvz'13:30
mvomborzecki: \o/13:30
mborzeckiChipaca: i'd seriously just want rsync -a in prepare, then rsync -a --delete in restore13:31
Chipacamborzecki: or, snap install rsync --devmode13:31
mborzeckiChipaca: right, but the cleanup is in restore, where we dump the mount units, the state and so on, that's why unpacking to /tmp/rsync sounds appealing13:33
mborzeckiunpacking the snap ofc13:34
Chipacamborzecki: should work as long as it's the same core13:35
mborzeckimhm13:36
mupPR snapd#7711 closed: seed: test and improve Core 20 seed handling errors <Priority πŸ‡> <Created by pedronis> <Merged by mvo5> <https://github.com/snapcore/snapd/pull/7711>13:39
Chipacabrb, reboot13:42
=== ricab|lunch is now known as ricab
mupPR snapd#7725 opened: tests/lib/state: snapshot and restore /var/snap during the tests <Simple πŸ˜ƒ> <Created by bboozzoo> <https://github.com/snapcore/snapd/pull/7725>13:50
mborzeckimvo: cachio: zyga: poor man's fix ^^13:51
zygamborzecki: classic mount namespaces13:52
zygamborzecki: is that why you picked /var/snap/* over /var/snap13:52
zyga?13:52
mvopstolowski: I updated 7715 with most of your comments14:09
sil2100mvo: ok, PR coming to you in a minute, just finishing running the unit tests14:28
mvosil2100: \o/14:28
Chipacaijohnson: do you know if mksquashfs lets you append to an existing squash using a different compression level?14:29
ijohnsonChipaca: you can set compression options like block size and dictionary size, but it doesn't significantly improve performance because those things don't 1:1 correspond to compression ratio and you the size differences are minimal between that and the default14:30
ijohnsonChipaca: I don't know I haven't looked at that14:30
ijohnsonChipaca: my gut guess is that no, you can only use a single compression level for the whole squash image because the compression options are written in exactly one place in the image for the different types (i.e. file data, file metadata, and something)14:31
Chipacaijohnson: yeah, unless an append adds a new superblock, i don't see it happening either14:36
popeyhttps://forum.snapcraft.io/t/support-for-man-pages/229914:40
popeyi saw somewhere that we might add man page support to snapd. or did I dream that?14:40
ijohnsonChipaca: yeah exactly14:40
sil2100mvo: hopefully this will do it: https://github.com/CanonicalLtd/ubuntu-image/pull/17814:40
mupPR CanonicalLtd/ubuntu-image#178: System seed boot content <trivial> <Created by sil2100> <https://github.com/CanonicalLtd/ubuntu-image/pull/178>14:40
sil2100I mean, if I didn't mix it up in my head14:41
pstolowskimvo: #7715 +1, with one final remark14:42
mupPR #7715: overlord: add base->base remodel undo tests and fixes <Priority πŸ‡> <Created by mvo5> <https://github.com/snapcore/snapd/pull/7715>14:42
zygamborzecki: snapd side now works too14:42
zygamborzecki: I need to adjust spread tests that measure exactly how refresh app awareness is implemented14:42
zygamborzecki: wanna see a quick diff14:43
zygamborzecki: I cannot propose it yet because it depends on the rest14:43
zygapopey: hey14:44
zygapopey: not a dream14:44
zygapopey: it's likely next cycle14:44
zygapopey: and based on what others said it doesn't look like a big task14:44
zygamborzecki: minimal, tests-passing, patch to snapd to support this new scheme14:45
zygahttps://paste.ubuntu.com/p/6gtpY8q4VG/14:45
Chipacapopey: its coming14:46
Chipacapopey: hoping to get it in as part of 20 work, it's above the line for now :)14:47
zygamborzecki: running spread tests, also removed all pids cgroup usage from snap-confine now14:48
popeyGreat! Thanks chaps!14:48
zygamborzecki: I'll structure the patches so that they are a linear progression14:51
mborzeckizyga: looks like we might need a helper that hides cgroup.PidsInFile and security tag14:51
Chipacahuh, tab completion for 'mount' is broken with the default awk in mate eoan14:52
mborzeckizyga: like sandbox.PidsForSnap(<tag>) ?14:52
zygamborzecki: yeah, can do14:52
zygamborzecki: it cannot take tag14:52
zygamborzecki: it can take a snap info, return a map14:52
zygamborzecki: it could take a tag but I don't see use of that, we'd need to scan the same set of files really, just ignore more, and derive the name anyway for locking14:53
zygalocking might need adjustment (will for sure)14:53
zygaonce UI is glued correctly14:53
Chipacamvo: so, once I add the missing files to the image, it boots in EFI (or is it UEFI) mode as well14:53
mvoChipaca: nice!14:53
mvosil2100: thank you, looking now14:54
mvopstolowski: thank you, I'm looking now14:54
Chipacaxnox: and I can confirm 'regexp' exists in the (U)EFI grub14:54
Chipacaso globs will work, supposedly14:54
* Chipaca tries14:54
Chipacayep! :-) winning14:55
mvoChipaca: \o/14:55
mvoChipaca: the PR from lukasz should make this all work now14:55
mvoChipaca: now we just need to expand gadget.yaml to include the extra partitions that are needed but thats not in the crticial path for booting just yet (it will be once we boot :)14:56
* sil2100 hopes his PR fixes it14:56
Chipacamvo: is the initramfs the core18 one right now?14:56
sil2100Later today I'll prepare my env to actually test this on the test model14:56
mvoChipaca: pretty much AIUI14:57
mvoChipaca: xnox told me he will use the spike one for now which is close to core1814:57
mvosil2100: should be fine, we can test for you14:57
mvosil2100: well, except $meetings :/ oh well14:57
* cachio lunch15:06
* zyga goes for lunch15:13
zygamborzecki: tests updated, let's see if they pass15:13
zygamborzecki: I used a little hacky logic to find the place where snap-confine will put things15:13
zygamborzecki: ideas welcome https://www.irccloud.com/pastebin/L1e8JZxX/15:14
zygabut first food15:14
zygacachio, mvo: I see ret tests because of 403 from the store15:15
zygasearch is 403ing15:15
zygais that expected now?15:15
mvozyga: might be worth raising with #snapstore15:16
zygak15:16
mborzeckinothing like an occasional 40315:16
xnoxChipaca:  pc-kernel is built from eoan, with initrd from eoan, whatever that contains.15:17
xnoxChipaca:  i think it's not on-par with spike-tools, but better than just bionic.15:17
xnoxmvo:  ^15:17
xnoxbah15:17
xnoxwrong15:17
xnoxunwind15:17
* Chipaca unwinds15:17
xnoxChipaca:  mvo: pc-kernel 20/* is built from FOCAL, with initrd from FOCAL, whatever that contains.15:17
* mvo is in a meeting but will read backlog15:18
xnoxwhich is not my stuff, and incomplete spike-tools version, as far as I can tell.15:18
mvoxnox: if its not yours, who should work in it?15:18
Chipacajdstrand: FWIW that weird X thing happens if you try to run snapped X apps in vncserver, per https://forum.snapcraft.io/t/gui-snaps-cant-connect-to-display-in-vnc/14028/3?u=chipaca15:28
Chipacajdstrand: but only if you don't start vncserver when in an X session15:28
Chipacajdstrand: that is: log in via the terminal, start vncserver, connect to the vncserver, try to start a snapped app and it'll fail15:30
Chipacaanyway, probably not a "you" issue15:30
sil2100mvo: thanks for the review! I'll be merging it and we can iterate a bit more in case that's not enough or something ;)15:31
zygare15:41
jdstrandChipaca: ok, thanks15:44
mupPR snapcraft#2794 opened: WIP: Add gnome 3 34 extension <Created by hellsworth> <https://github.com/snapcore/snapcraft/pull/2794>15:45
zygajdstrand: hey15:46
jdstrandzyga: so, the basic idea is that you want to use the pids cgroup and move all snap processes into it?15:47
hellsworthyeah i'm still cleaning things up, but thought i would go ahead and open it up for comments.15:47
jdstrandzyga: but don't set the max or anything?15:47
zygajdstrand: not pids15:47
jdstrandhttps://www.irccloud.com/pastebin/DUaJsF5k/15:47
jdstrandlists:15:47
jdstrandhttps://www.irccloud.com/pastebin/DUaJsF5k/15:48
jdstrandmeh15:48
jdstrand10:pids:/snap.travis.travis15:48
zygahttps://github.com/snapcore/snapd/pull/772215:48
mupPR #7722: cmd/snap-confine: add sc_join_sub_group <Created by zyga> <https://github.com/snapcore/snapd/pull/7722>15:48
zygajdstrand: tl;dr; -> if cgroup2 is mounted we use that (even in hybrid mode)15:48
zygajdstrand: if not we use cgroup name=systemd15:48
zygajdstrand: the new idea is really that we dig deeper into _whatever_ systemd has placed us already15:49
zygajdstrand: thereby not stealing the process15:49
zygajdstrand: thereby not breaking systemd in v2 mode15:49
zygajdstrand: I have two PRs and almost all the changes after that also ready15:50
* jdstrand is wondering what https://www.irccloud.com/pastebin/DUaJsF5k/ was trying to show me15:50
zyga0::/user.slice/user-1000.slice/session-2.scope/snap.travis.travis15:50
zygathis15:50
* jdstrand also wonders why 'pids' is being used, but that is a different question15:51
zygapids was used so far in the earlier iteration of the work on refresh app awareness15:51
zygait's been like that for half a year roughly15:51
zygabut it's not _enabled_ in production yet15:51
zygajdstrand: usage of pids is entirely replaced by the new idea15:51
jdstrandzyga: does that not happen with devmode? I just tried in a devmode snap and noticed that /proc/self/cgroup had this: 8:pids:/user.slice/user-1000.slice/user@1000.service15:52
zygathat's systemd15:52
zyganot us15:52
jdstrandI know that15:53
zygathe paste I shared was from my local machine15:53
zygayou won't see the changes elsewhere yet15:53
jdstrandwhy does the devmode snap use systemd, bu tyour travis paste uses snap.travis...15:53
jdstrandok. I was confused by your "it's been there half a year" comment then15:53
zygajdstrand: I don't understand, travis was strated in my desktop session so it was placed in /user.slice/user-1000.slice/session-2.scope/15:54
jdstrandok, anyway15:54
zygajdstrand: snap-confine moved it to a subdirectory15:54
zygajdstrand: which is named after the security tag15:54
zygajdstrand: hence 0::/user.slice/user-1000.slice/session-2.scope/snap.travis.travis15:54
jdstrandzyga: please look you this: https://www.irccloud.com/pastebin/DUaJsF5k/15:54
jdstrandzyga: *you* mentioned that paste in backscroll earlier today15:55
zygaright15:55
zygaare you asking about why pids= is like that?15:55
zygaor about something else?15:55
jdstrand10:pids:/snap.travis.travis15:55
jdstrandyes :)15:55
zygaah, forgive me :)15:55
zygaso, pids= implements stealing that we used for tracking15:55
zygacurrent WIP branch no longer does that15:55
zygabut15:55
zygathe stealing is like that for a good amount of time15:55
zygaand we just want to stop doing that15:55
jdstrandok15:56
jdstrandso I'll ignore that15:56
zygasorry for making this confusing, I should have highlighted what I was trying to convey15:56
jdstrandthat said, mvo and I had discussed unconditionally putting all snap processes into both a pids and a mem cgroup so that management snaps could place resource constraints on them15:57
xnoxmvo:  "not mine" as in "not the new shiny systemd stuff" I think i'm still on the hook to maintain either initramfs-tools based initrd or the systemd based initrd =)15:57
jdstrandif we did that, couldn't we just look at those cgroups to see if there are any processes currently in them?15:57
zygajdstrand: how do you want that to work in v2 world?15:58
jdstrandzyga: sorry, seeing 'pids' in that paste reminded me of this15:58
zygajdstrand: yes but this doesn't exist in v2 world15:58
zygajdstrand: this is why we're doing this15:58
zygajdstrand: in v2 world my patch set already does what you want, in a way, because now you can put constraints on snaps regardless of which session they are in15:59
zygajdstrand: or if they are system or user processes15:59
mvosil2100: yeah, thanks so much for your help with u-i!15:59
zygajdstrand: because _all_ snaps in v2 are in sub-directory of where systemd placed the workload initially15:59
zygajdstrand: in v1 mode we can do the same thing for pids/memory15:59
jdstrandI'm sorry, I'm having a hard time context switching. also, I said unconditionally into a pids cgroup, I mean cpu and mem15:59
mvoxnox: aha, excellent! yes, sorry, I just misunderstood15:59
zygaright15:59
jdstrandalso, the v2 world has cpu and mem cgroups based on https://www.kernel.org/doc/Documentation/cgroup-v2.txt16:00
jdstrandso, and this is the part I forget, the limitation in a v2 world is how systemd is using it, correct?16:00
zygajdstrand: v2 world has only one tree16:01
* jdstrand has not done much in a v2 only world yet, besides having abstract conversations about it16:01
jdstrandzyga: yes, but, as you mentioned in backscroll, you caan go deeper, just not higher, right?16:02
zygajdstrand: what you can do is to put constraints on a given point in the v2 tree16:02
zygajdstrand: yes16:02
zygajdstrand: so my patch set does that for v2 already16:02
jdstrandzyga: yes, I understand16:02
zygajdstrand: note that the 0::/... line is the only thing you will see in pure v2 world16:02
zygajdstrand: so if you already scope each snap workload to the snap security tag16:02
zygajdstrand: you can put constraints now16:02
zygajdstrand: we can expand this to v1 world as well16:03
zygajdstrand: using a similar idea16:03
zygajdstrand: and pretty much the same logic we have in my first patch16:03
jdstrandzyga: but I was then discussing, why not put snaps into a deep cpu and mem cgroup? and then use that for pid tracking?16:03
zygajdstrand: because I wanted to use just one thing, not several for pid tracking16:03
zygajdstrand: and that one thing is v2 if availalble (18.04+) or name=systemd as fallback16:03
zygajdstrand: because we can rely on that as well16:04
jdstrandzyga: sure, but you could just pick one. if they are both unconditional, then just use cpu16:04
jdstrand(for example)16:04
zygayes but it has semantics and this one does not, it's strictly for tracking and not resource allocation16:04
zygajdstrand: up until earlier today I was not considering name=systemd fallback at all, as we hoped we could avoid that16:04
jdstrandzyga: yes... and that's fine. It's just that when I saw 'pids' I was reminded of this unconditional cpu/mem thing, which we don't have, but we want. snapd doesn't do anything with cpu and mem, so lumping that in with tracking16:06
zygaI understand16:06
jdstrandzyga: but, I guess if we can do one for tracking, we can do two more for cpu/mem16:06
zygayeah, I think this is safer16:06
zyganame=systemd subdirectory is only used by systemd16:07
jdstrandanyway, it is just a thought16:07
zygasure, sorry if I feel defensive about this, I'm trying to manage making this something that's realistically available16:07
zygaI think it's a good idea to expand this to cpu/mem, not sure how people would configure that but if that's all the interface we give (guaranteed name) then I think that's okay16:07
jdstrandthat was the only idea16:08
jdstrandI mean, we could then create an interface for managing snap* cpu/mem cgroups, etc16:08
zygaan interfaces in permission or an API via snapd?16:08
jdstrandbut snapd itself wouldn't do anything cause it can't make an intelligent decision16:09
jdstrandinterfaces/builtin16:09
jdstrandbut I'm distracting us16:09
zygajdstrand: we can do it if we have a driving use case, right now that part feels easy but making sure it's what someone wants is harder16:09
jdstrandzyga: yeah, there have been customer requests to make it easier to set cpu and mem limits on snaps16:14
jdstrandanyway, again, I'm distracting16:14
zygathank you for sharing this, I will follow up with this idea soon16:14
jdstrandthanks!16:14
jdstrandzyga: is it documented anywhere in the forum or elsewhere all the cgroups stuff? like, v1 vs v2 vs unified within the context of systemd (perhaps by version) and how snapd currently fits, along with what other distros do and the recommendations?16:16
zygano, I don't believe so16:16
zygajdstrand: this idea was bounced internally between me and mborzecki for some time16:16
zygajdstrand: and after name=snapd collapsed I picked it up as the only sensible alternative16:16
jdstrandzyga: I ask, cause, I get that all into my brain so I can somewhat talk about it, then persoanlly don't play with it at all, so I lose it until the next time16:16
jdstrandzyga: I can't be the only one who is in a similar position. I mean, if one lives and breathes cgroups, that is one thing. that isn't me16:17
zygajdstrand: I will write it down on the refresh app awareness thread16:17
zygajdstrand: it's just so much happened recently I didn't manage to settle16:18
jdstrandzyga: thank you. I think it would help everyone sync up and get on the same page for future changes in this area16:18
jdstrandzyga: totally understand. I just feel like I'm slowing things down have to reconstruct everything in my head :)16:18
jdstrandhaving*16:19
jdstrandI guess there is some benefit to that. it means that the code, comments and spec need to be clear ;)16:19
jdstrandbut we can manage that *and* have things documented :)16:20
jdstrandzyga: /sys/fs/cgroup/systemd is used in a v2 only world?16:20
zygano, in v2 world there's just one directory /sys/fs/cgroup and it's always a v2 mount16:20
zygait has all the roles combined16:20
jdstrandthat's right. jeez16:21
zyga[zyga@fedora31 ~]$ mount | grep cgroup16:21
zygacgroup2 on /sys/fs/cgroup type cgroup2 (rw,nosuid,nodev,noexec,relatime,seclabel,nsdelegate)16:21
jdstrandzyga: ok, dumb question, why is /sys/fs/cgroup/systemd empty on my eoan system?16:21
zygaempty as in empty directory?16:21
zygait see plenty of stuff on eoan there16:22
jdstrandmeh, I fat fingered it. sorry16:22
zyga1K entries16:22
zygaah, ok :)16:22
zygauff :)16:22
zygaI checked with stgraber and xnox and I think this is something we can rely on16:22
zygaunified (hybrid), pure v2 or name=systemd16:23
jdstrandit is great to have checked with them :)16:23
zygaI should chop and push the rest of the changes16:25
zyganeed to add some more tests to refresh.go as well16:25
zygajdstrand: I have the entire refresh app awareness ported over to this now16:26
zygamaybe tomorrow I can glue the gui to it16:26
zygaand have the whole thing as a PR for vancouver16:26
zygathe GUI is ready in another branch but the critical element I need to think about and (re)write is how snapd notices it's safe to refresh now16:27
sil2100mvo: yw! If anything else pops up, just give me a poke16:30
ijohnsonzyga: when you have branches ready for this stuff, please request reviews from me :-)16:31
zygaijohnson: your wish is my command16:31
zygaijohnson: please review two first PRs16:31
zygahttps://github.com/snapcore/snapd/pull/772216:31
zygahttps://github.com/snapcore/snapd/pull/772416:31
mupPR #7722: cmd/snap-confine: add sc_join_sub_group <Created by zyga> <https://github.com/snapcore/snapd/pull/7722>16:31
mupPR #7724: cmd/snap-confine: tracking processes with classic confinement <Created by zyga> <https://github.com/snapcore/snapd/pull/7724>16:31
zygaijohnson: I'll add some more unit tests and commit the rest into several branches16:31
ijohnsonzyga: ack, sounds good!16:31
zygaor maybe16:31
zygaone branch and several patches16:32
zygait's better if the next stage is one PR as it's consistent this way16:32
ijohnsonzyga: still finishing up pedronis' greedy plugs PR review then I can switch to yours I think16:32
zygaperfect16:32
zygaI will have the third one that builds on this today16:33
zygacode wise it's not big16:33
zygaremoves some now-dead code16:33
zygachanges a few places, nothing huge16:33
mvosil2100: is it easy for you to trigger a new ubuntu-image build into edge? it seems like we have the code all landed now?16:47
mvoChipaca: silly question - with your grub.cfg and if we boot with qemu in UEFI mode - do we actually need anything to make the system bootable (i.e. do we need to tweak seed.go and friends at all?). it's an ESP partition and has the right binary names, so it should just work(tm), yes?16:51
mvoChipaca: which would be pretty nice, so we may get a booting recovery today afterall :)16:51
mupPR snapd#7726 opened: RFC: change how snapd tracks processes <Created by zyga> <https://github.com/snapcore/snapd/pull/7726>16:52
zygaijohnson, jdstrand: https://github.com/snapcore/snapd/pull/772616:53
mupPR #7726: RFC: change how snapd tracks processes <Created by zyga> <https://github.com/snapcore/snapd/pull/7726>16:53
zygaThis is the RFC with all the changes that are going in, I'll be splitting the "many" patch next but I need a break for coffee16:53
ijohnsonnice16:53
mupPR snapd#7715 closed: overlord: add base->base remodel undo tests and fixes <Priority πŸ‡> <Created by mvo5> <Merged by mvo5> <https://github.com/snapcore/snapd/pull/7715>16:54
mupPR snapd#7438 closed: devicestate: add support for base->base remodel <Priority πŸ‡> <Remodel πŸš‹> <Created by mvo5> <Closed by mvo5> <https://github.com/snapcore/snapd/pull/7438>16:55
zygamvo: ^ proooogress :)16:55
zygamvo: it has feature party with master but works in more places16:55
zygaI need to bring the patch that extended the LXD test to use this now16:55
zygato have sane sleep tonight16:55
zygabut first16:55
zygacoffee16:55
zygareally16:55
zygabrb16:56
mvozyga: woah, that sounds pretty great16:57
ijohnsonhmm mvo, jdstrand, or Chipaca are y'all available to discuss pedronis's greedy plugs PR with me a little bit? I'm sorta confused on what some of these tests are doing cause it feels like a test there is testing greedy _slots_ when I thought this PR was strictly about greedy _plugs_17:15
ijohnson(this is about #7652 btw)17:16
mupPR #7652: o/ifacestate,interfaces,interfaces/policy: slots-for-plug: * <Priority πŸ‡> <Created by pedronis> <https://github.com/snapcore/snapd/pull/7652>17:16
sil2100mvo: ah, crap, let me poke it17:29
=== pstolowski is now known as pstolowski|afk
sil2100mvo: it operates on a github mirror on launchpad, probably stupid thing didn't update yet17:29
sil2100I always forget there's this stupid delay17:29
popeyjdstrand: where is the bug tracker for snappy-debug?17:39
popeyhttps://launchpad.net/snappy-hub looks right, but not configured17:39
zygare17:55
* cachio breack17:57
zygadid you guys notice that travis started showing the CPU column18:00
zygainteresting18:00
zyga(the CPU architecture)18:00
=== ijohnson is now known as ijohnson|lunch
jdstrandpopey: the forum currently. snaappy-hub should have it configured, but I don't have the ability to do that18:08
Chipacazyga: for about a month now, since they started offering arm builders (runners? workers?)18:13
zygayeah, I think it makes sense given their overall direction18:13
zygajust cute with nice icon :)18:13
jdstrandpopey: probably the snapcraft category18:13
Chipacaijohnson|lunch: not today :-|18:13
Chipacafor me i mean; others may :)18:14
Chipacamvo: I'm trying to determine that. I can probably make a grub.cfg that will set the boot vars up to boot in core18 mode, which seems to be needed for now18:14
Chipacamvo: unless by "boot" you mean "reach initramfs" in which case yes, sure, done :)18:15
zygahttps://blog.quarkslab.com/analysis-of-qualcomm-secure-boot-chains.html <- interesting18:34
zygamvo: ^ share this with claduio if I  forget18:34
Chipacacmatsuoka: ^^18:36
Chipacazyga: like that?18:36
zygaoh, is my memory failing me or did claudio change his irc nick18:36
zygaman I could just be tired18:37
zygaChipaca: thank you sir :)18:37
Chipacazyga: hey, maybe i'm wrong and i've been sharing stuff with the wrong irc persona18:37
jdstrandzyga, mvo (cc xnox): I did a first pass at pr 7722. the most important comment is my Delegate= observation wrt https://systemd.io/CGROUP_DELEGATION.html in https://github.com/snapcore/snapd/pull/7722#pullrequestreview-31261317618:58
mupPR #7722: cmd/snap-confine: add sc_join_sub_group <Created by zyga> <https://github.com/snapcore/snapd/pull/7722>18:58
zygalooking18:58
mvoChipaca: "boot" means initramfs for now18:59
mvoChipaca: no need to do anything uc18 compatible18:59
zygajdstrand: we looked at scopes with mborzecki18:59
mvoChipaca: I think we will figure out there we have no partitions and no run mode so we assume install and call snap-boostrap18:59
zygajdstrand: and AFAIR we cannot use them18:59
jdstrandzyga: scopes with Delegate?18:59
zygadelegate breaks service management19:00
zygaAFAIK19:00
mvozyga: reading19:00
zygaif we carve a place and say that we are a delegate there19:00
zygasystemd doesn't handle any service ops anymore19:00
zygawe had a look at delegate earlier and it was deemed ok to run things like a container there19:00
zygabut not things that look like they are "on" the host19:00
jdstrandzyga: I'm not sure why that side-effect would be there. The Delegate as documented in that page is referring to cgroups19:00
zygawe talked to systemd upstream about it19:00
jdstrandzyga: that doesn't mean that side-effect is *not* there, just that the page didn't mention it (unless I missed it)19:01
mvosil2100: no worries, if the mirror picks it up by itself by tomorrow thats totally fine, was just curious :)19:01
zygait's late and maciek is not here so we'll pick it up first thing tomororw19:01
mvosil2100: and it looks like it got build \O/19:01
jdstrandzyga: well, there are 3 options according to that page. I just have real concerns that systemd may decide to move things, since, well, in that page it said it could19:02
mvoChipaca: so feel free to share the grub.cfg, I think we can then unblock xnox to hack on initramfs :)19:02
jdstrandzyga: if we are going against their recommendations, I think at the very least we need to document why and have some assurances that it won't just immediately break19:03
jdstrandzyga: again, I'm not saying it will break, I just have a lot of concerns based on that page19:03
jdstrand(which is why I left a comment rather than a request changes19:03
jdstrand)19:04
zygayeah, I don't blame you for it19:04
zygait's super tricky part19:04
zygaI don't think we can use delegate at all19:04
zygabecause:19:04
zygait seems to require a unit file, that's okay for services but not for hooks and apps19:04
jdstrandzyga: I guess it feels like we are trying to play nice with systemd in general, letting it do its thing, except we slide this bit in19:04
zygafor non-service things we could use the dbus API to have systemd spawn them but then we don't have the semantics we had before19:05
zyga(like having connected tty and things like that)19:05
zygaif we have a special unit for snaps then we no longer have the way to set any per-user constraints19:05
zygaso if a user has limit on some memory19:06
cmatsuokaChipaca: even for just booting in run mode, core18-style, a few changes inside the initramfs were necessary in the spike. to support installation the changes were fairly extensive19:06
zygaall they need to do is to run a snap, that would be moved to a delegated place that is not in their user tree anymore19:06
jdstrandzyga: how I thought of it, and again, this is without trying anything, is there is scope unit with Delegate= in it that is part of snapd install. that setups up a /sys/fs/cgroup/something/snapd directory. because Delegate is used, snapd will ignore that19:06
zygajdstrand: I acknowledge the fact that all three options are suboptimal and we are bending the rules slightly19:06
zyga(systemd will ignore that)19:07
jdstrandzyga: then snap-confine can create the subdirs under that19:07
zygawe tried that approach earlier19:07
Chipacamvo: sweet! will do that this pm19:07
zygajdstrand: it breaks things like you log out and things get killed19:07
Chipacacmatsuoka: that's a relief because it wasn't working :-)19:07
zygajdstrand: and resource management associated with this19:07
zygajdstrand: AFAIK, I could be wrong because layers-of-complexity, this also breaks things like systemctl stop19:07
Chipacamvo: cmatsuoka: also i'm actually washing dishes, not working on grub.cfg, at this moment19:08
zygaI'll double check with maciek tomorrow19:08
Chipacas/actually/supposedly/ :)19:08
cmatsuokacmatsuoka: the labels are different now, so at least these will need to be handled differently19:08
mvoChipaca: heh, thats fine - I try to bring the kids to bed too19:09
zygajdstrand: some of those options also require snap-confine to make dbus calls as well, meaning that snapd depends on dbus for all "snap run" commands19:09
mvoChipaca: just want something to play with in my morning ;)19:09
Chipacazyga: what's the significance of the maciej β†’ maciek change?19:09
zygajdstrand: right now what we have is a compromise upon compromise19:09
jdstrandzyga: zyga I mean, I could be wrong. *but* that page talks about Delegate and references resource controls, etc. it doesn't mention service control19:09
zygaChipaca: which change specifically?19:09
zygajdstrand: I could be wrong too but we explored this page, all three options, including discussing this with systemd developers19:10
* cachio afk19:10
* Chipaca afks too, before the dishes take over19:10
jdstrandzyga: yes, only option 2 is available then. I just don't have experience with Delegate=19:10
zygajdstrand: I honestly think that we need a 4. expand systemd to have things like "portable services" delivered by things other than systemd19:10
jdstrandzyga: upstream said to use your current approach?19:10
zygawhere there's a runtime and there are rules on how systemd and the runtime interact19:11
popeyjdstrand: ok, will start a forum thread19:11
zygajdstrand: no, they did not, we only evaluated the 1-3 options with them and it was an imperfect fit in all cases19:11
zygajdstrand: what was picked was the current proposal, after experiments and casual-check-with xnox19:11
jdstrandhttps://www.freedesktop.org/software/systemd/man/systemd.resource-control.html#Delegate= only is talking about control groups. it seems odd that service control would fall apart with it19:12
zygajdstrand: it's based on control groups19:12
jdstrandagain, not saying that there aren't side-effects, just they aren't documented in what I am seeing19:12
zygaI see19:12
zygajdstrand: btw, I replied on one comment19:13
zygahttps://github.com/snapcore/snapd/pull/7722#discussion_r34327185319:13
mupPR #7722: cmd/snap-confine: add sc_join_sub_group <Created by zyga> <https://github.com/snapcore/snapd/pull/7722>19:13
zygaI'll get to the rest later, I'll wrap up the day soon after adding some more unit tests19:13
jdstrandzyga: oh, you're saying that systemd's service management is all around how it configures the cgroups for tracking?19:13
zygayes19:13
jdstrandok, that makes sense19:13
jdstrandunfortunate, but makes sense19:13
zygaI think it requires upstream love as well19:14
zygaas in, us working upstream19:14
zygaon something that is not just a "doesn't break yet" hack19:14
zygabut something documented to work19:14
jdstrandzyga: so, in PR 7722, I was with you all the way until sc_cgroup_create_and_join(current_hierarchy_path, security_tag, pid);19:15
mupPR #7722: cmd/snap-confine: add sc_join_sub_group <Created by zyga> <https://github.com/snapcore/snapd/pull/7722>19:15
zygahmm?19:16
zygaand what happened there?19:16
zygaas in what does this do?19:16
zygaor something else?19:16
jdstrandzyga: then, since I *just* read that page, I got worried19:16
zygaah :)19:17
zygaI understand19:17
jdstrandI was going to ask a question based on that comment, but then need to think more19:17
zygaI think we could use help from foundations19:17
zygato find _a_ way of doing what we want19:17
zygaall the approaches we found so far are stretching the protocol19:17
zygaor outright don't work in v2 world19:17
zygajdstrand: oh and btw:19:18
zygajdstrand: it works in lxd :) https://www.irccloud.com/pastebin/g3GPX3Nc/19:18
zygabrb, family calling\19:18
zyga\19:18
jdstrandyes, I believe it would work, it is just, what is systemd going to do after we moved a pid in there19:19
jdstrandI read the cgroups man page and was highly optimistic19:20
jdstrandthen I read the systemd cgroups delegation page and got worried19:20
jdstrandzyga: curious, with your patch as is and moving pids into the new leaf dir, does service manage work ok?19:22
jdstrandmanagement*19:22
jdstrandzyga: like, if you move the pid, does systemd lose track of it?19:22
zygare19:22
zygajdstrand: yes19:23
zygajdstrand: because it recursively scans the tree it created19:23
jdstrandyes, as in it works I guess. and, it doesn't put it back?19:23
zygaput it back?19:24
zygano, it doesn't seem to move anything after the initial context of the starting19:24
zygaI guess it forks, sets up everything and execs19:25
zygaand the fact we move in our exec chain doesn't bother it19:25
jdstrandzyga: this is blackbox investigation, not documented/recommended/code inspected/whatever ?19:25
zygayes19:25
zygawe did some code inspections19:26
zygawe did experiments and discussed stuff as well19:26
zygabut it's not documented proper behavior19:26
jdstrandnote that https://systemd.io/CGROUP_DELEGATION.html says: "The fact that systemd keeps these hierarchies in sync means that the legacy and hybrid hierarchies are conceptually very close to the unified hierarchy. In particular this allows us to talk of one specific cgroup and actually mean the same cgroup in all available controller hierarchies. E.g. if we talk about the cgroup /foo/bar/ then we actually19:26
jdstrandmean /sys/fs/cgroup/cpu/foo/bar/ as well as /sys/fs/cgroup/memory/foo/bar/, /sys/fs/cgroup/pids/foo/bar/, and so on."19:26
jdstrandI'm conerned about /sys/fs/cgroup/unified/user.slice/user-1000.slice/user@1000.service/foo.service/snap.foo19:28
jdstrand!= /sys/fs/cgroup/unified/user.slice/user-1000.slice/user@1000.service/foo.service19:28
zygain some sense that is a problem, as you see it, but if you put constraints on /sys/fs/cgroup/unified/user.slice/user-1000.slice/user@1000.service/foo.service they apply underneath as well19:28
zygathe only difference is that cgroup.procs doesn't contain the service process there (no processes in intermediate nodes rule)19:29
jdstrandzyga: right, unless you reduce in foo.services/cgroup.subtree_control19:30
jdstrandanyway, it sounds like everyone has discussed this. I think there may be room for more investigation/confirmation that the approach should work with systemd as designed, and then document all this in code comments19:31
zygajdstrand: it's not rock solid design, it's just either this or we have no way to deliver the feature at all; it's a fallback at this stage19:31
jdstrandie, say why we can't use the recommendations in https://systemd.io/CGROUP_DELEGATION.html but why what we are doing should work19:31
zygajdstrand: it might well be that someone comes along and says "it cannot work for this-and-that-reason" and they will be right19:32
zygathat's a good remark, I'll make sure this is documented19:32
jdstrandzyga: that is what I am afraid of :( I would hate to deliver this and then have it buggy, break down the line with no recourse, etc19:32
zygajdstrand: I had one more idea that doesn't rely on cgroups19:33
zygajdstrand: but it's bad for other reasons19:33
zygajdstrand: I implemented a prototype for it19:33
zygajdstrand: but the rough idea is that snap-confine is a service manager and watches a subtree of processes as a subreaper19:33
jdstrandzyga: I'll mention that there is something that works on systems with apparmor: look at the security label. it is not atomic but you will get what you want19:33
zygajdstrand: that's true19:34
zygajdstrand: in fact any pid-tagging system works19:34
zygajdstrand: we effectively use this as pid tagging19:34
jdstrandzyga: on Ubunt uTouch the security label was key in process lifecycle19:34
zygajdstrand: let me just briefly finish the problems I found with the mini-service-manager idea19:35
zygajdstrand: to retain the feeling that snap-{run,confine,exec} chain just execs your program in the end19:35
jdstrandzyga: with pid tagging, are you talking about 'ptags'?19:35
zygaptags?19:36
zygaI meant it as anything that can associate some information with a process19:36
jdstrandI just googled pid tagging and found https://lwn.net/Articles/702639/19:36
zygaI was told there's no such thing yet19:36
zygajdstrand: (contd.) to retain the feeling that it's just a chain of exec, the service manager part forks off and forks off the application process19:37
zygawatching for deaths of all the processes in that subreaper tree19:37
jdstrandit doesn't seem committed, no. but, LSMs can do that (as mentioned, apparmor security label)19:37
zygaand relying signals and exit status to the stub process19:38
zygait's ugly and I would not want to ship it but it did the job somewhat19:38
jdstrandzyga: a fork or fork/exec?19:38
zygajdstrand: indeed though scanning proc is even worse than scanning cgroup19:39
jdstrandzyga: it is not great, no, but if cgroups are a no go...19:39
zygajdstrand: I can show you the rough idea on a piece of paper, hold on, it might be easier19:39
jdstrandI'll admit it isn't exciting thinking about snap-confine as a service19:40
zygait would be closer to lxd model19:40
zygawhere such things are used19:40
zygahttps://usercontent.irccloud-cdn.com/file/ND62Rwl7/snap-confine-service-manager.jpeg19:40
zygajdstrand: the surogate is what others will track as "main pid"19:41
zygasurrogate*19:41
jdstrandlxd could actually use the Delegate= idea since it does all its management19:41
zygaI'm sure it is doing that19:41
zygait feels like a use case for that exactly)19:41
jdstrandindeed19:42
zygajdstrand: so the diagram has the entry at the top, the surrogate waits for the real application to exit or die to relay the wait status19:42
jdstrandLXD is a full container manager, which that page is talking about19:42
zygajdstrand: the fork chain to the left reparents the service manager and application parts19:42
zygathe service manager becomes a subreaper19:42
zygaforks off to exec the app and loops on waitpid(-1, ...)19:43
jdstrandthis is PR_SET_CHILD_SUBREAPER?19:43
zygaas long as there are things to wait for it will collect19:43
zygayes19:43
zygaif it collects the app pid it relays that to the surrogate via eventfd19:43
zygaif it collects other things it just carries on19:43
zygaeventually nothing more is needed and it quits19:43
zygait could also monitor the surrogate and kill the real app (I didn't implement that)19:44
zygaon the up side it doesn't use cgroups :)19:44
jdstrandaiui, it is going to lose zombies19:44
zygain fact it doesn't touch the filesystem19:44
zygawhy?19:44
zygajdstrand: (for a moment I also considered setting timer slack nanosecond to a unique value as a cookie but that's an idea from hell)19:46
zygajdstrand: waitpid will grab dead children from things forked by the app as well19:46
jdstrandwaiting on a pid to die or exit. that pid forks off stuff and dies. the zombies get reassigned to init. but reading the man page for PR_SET_CHILD_SUBREAPER, I guess that isn't true19:46
zyga(that's what a subreaper does effectively)19:46
jdstrandright19:46
zygayeah, that's the whole idea19:46
zygaand the fact that you can wait on your children's children this way19:46
zygaand know there are no more19:46
zyga(ECHILD)19:46
zygaI'm sure there are dragons in this idea19:47
zygaI just feel I ran out of anything resembling ideas at this stage :)19:47
zygaand that was the last one19:47
jdstrandzyga: we could probably make it 'ok' from a security perspective through dropping, changing profiles, etc, etc. but it does feel heavyweight since we always have two processes per started snap command19:48
zygajdstrand: I also considered the manager to get the pid (pidfd) via socket19:48
zygaI didn't implement that19:48
zygabut I think this mode breaks subreaper19:48
zygaand waiting19:48
zygait's only good for "have a handle to kill that guy"19:48
zyganot for anything useful19:48
zyga(beyond that)19:48
zygait's really a shame that we cannot just treat processes as files all the way with the right mechanics19:49
zygabut I guess by the time I retire people will argue abut it and it will be the problem we are at today + lots of new related syscalls19:49
jdstrandwell, if snapd was the parent... but that is not desired due to design constraints19:49
zygayes19:49
zygawe're between a hard place and initial design19:49
zygaor something like that19:50
zygait's funny that in 2019, it's hard to answer "is this running" reliably because of how everything is interconnected19:50
jdstrandzyga: I'd like you to... reconsider is probably strong... but not rule out LSM labelling as a part of a potential solution. remember, on any system with any apparmor enabled, classic, devmode and strict all get it. it is possible to start snaps under selinux with a per-snap label as well19:51
zygainteresting19:52
jdstrandzyga: if the cgroup thing doesn't work out that is.19:52
zygaso are you saying that we could use selinux tags for a process that somehow map to snap security tags19:52
zyga(selinux labels, sorry)19:52
zygaI'm not ruling it out, if you had that impression19:52
jdstrandzyga: its had wavy, but I was more saying that snapd is updated to launch every snap under its own label rather than under the shared label/unconfined19:53
jdstrandit's*19:53
zygahmm19:53
zygaplease refresh my memory19:53
zygaclassic confined snaps get a label with a permissive profile, correct?19:53
jdstrandit would require work, but you can see we just define policy for each snap that is installed taht is the same as what we have now19:54
zygajdstrand: related to classic confinement: https://github.com/snapcore/snapd/pull/772419:54
mupPR #7724: cmd/snap-confine: tracking processes with classic confinement <Created by zyga> <https://github.com/snapcore/snapd/pull/7724>19:54
jdstrand(selinux there)19:54
jdstrandzyga: re classic: *yes*19:54
zygajdstrand: mm19:54
zygajdstrand: well, I'll get over the whole design with mborzecki tomorrow19:54
zygajdstrand: as long as we can answer our UI driven questions I won't complain :)19:54
zygajdstrand: this feature looked so good on paper initially19:55
zygajdstrand: it's such a maze in reality19:55
jdstrand$ ps auZ|grep test-classic19:55
jdstrandsnap.test-classic.sh (complain) jamie     5593  0.1  0.0   9604  3436 pts/16   S    13:54   0:00 /bin/bash /snap/test-classic/x1/bin/sh19:55
zygathat's good19:55
jdstrand$ snap list|grep test-classic19:55
jdstrandtest-classic                            0                                 x1     -          -                  classic19:55
jdstrandzyga: yes, that was part of the design so we'd have tracking throughout the system19:56
zygajdstrand: I wonder if 20.10 will go to v2 mode19:56
zygajdstrand: 20.04 is totally premature19:56
zygabut after, hmm19:56
jdstrandzyga: so, if cgroups works, yay, just please document. if not, bummer since that is a great way to do this, but could limit to the feature to apparmor-enabled systems initially, then expand to selinux19:57
zygajdstrand: yes, I think this is a good idea19:57
zygahave a look at the other PR19:57
zygait's much smaller in scope and risk19:57
zygaand relatively tiny in size too19:58
zygalanding it will bring me one step closer to whatever we do in the end :)19:58
jdstrandzyga: I lost it in backscroll. number?19:58
zygahttps://github.com/snapcore/snapd/pull/7724/files19:58
mupPR #7724: cmd/snap-confine: tracking processes with classic confinement <Created by zyga> <https://github.com/snapcore/snapd/pull/7724>19:58
zygatl;dr version is it makes classic confinement have pids= controller for tracking19:58
zygawith the intent of swapping out that for the one in the other branch19:59
zygaas can be seen in the WIP draft that has everything19:59
jdstrandzyga: sorry about my concerns and not having a lot of answers there. interactions between systemd, snapd (and container managers like k8s, docker, greengrass, etc, etc) is always... frustrating?20:02
=== ijohnson|lunch is now known as ijohnson
zygayes :)20:02
zygano need to be sorry20:02
jdstrandzyga: but, at the very least, perhaps we can get some assurances that the proposed idea should work20:02
jdstrandand knowing sooner if it won't is definitely better than not :)20:03
zygajdstrand: I wish I checked better earlier20:05
jdstrandwell, this is a minefield20:06
jdstrandand hey, that's what reviews are for. we caught this stuff before it went live20:07
zygaijohnson, jdstrand: I've updated https://github.com/snapcore/snapd/pull/7726 to have more tests for PidsOfSnap (in overlord/snapstate/refresh.go) and I will call it a day20:22
zygaI've spawned another test run20:22
mupPR #7726: RFC: change how snapd tracks processes <Created by zyga> <https://github.com/snapcore/snapd/pull/7726>20:22
zygaijohnson: you will see that jdstrand did a thorough review of the main PR already but please do your review if time permits20:23
zygawith that, I'm wrapping up :)20:23
zygain my free time I will write something easy, like a toy compiler maybe20:24
zygaat least that's like, rewind to 60s and read a book20:24
zygajdstrand: oh, if we decide to pick a different hierarchy at some point20:26
zygajdstrand: e.g. someone runs new systemd and it gives us unified or something20:26
zygajdstrand: that's ok too20:26
zygajdstrand: because we scan all of /sys/fs/cgroup20:27
zygabut I really need to wrap up and rest20:27
zygattyl and thank you for the focus jdstrand!20:27
ijohnsonack zyga20:30
ijohnsonHave a good night and get good rest!20:30
jdstrandzyga: heh, take care :)20:38
mupPR snapd#7725 closed: tests/lib/state: snapshot and restore /var/snap during the tests <Simple πŸ˜ƒ> <Created by bboozzoo> <Merged by bboozzoo> <https://github.com/snapcore/snapd/pull/7725>21:07
mupPR snapcraft#2793 closed: tests: enable SNAPCRAFT_BUILD_INFO for spread <Created by cjp256> <Merged by sergiusens> <https://github.com/snapcore/snapcraft/pull/2793>22:34

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