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

mborzeckimorning05:14
mardy'morning!05:51
mborzeckimardy: heya05:55
mardywhat are the dynamic plug attributes?06:14
pstolowskimorning06:16
mardyhi pstolowski!06:17
mborzeckipstolowski: hey06:31
mborzeckimardy: pstolowski will probably know better06:31
pstolowskihey, what is that?06:32
mborzeckipstolowski: mardy was asking about dynamic plug attributes06:32
mardyyep, I just don't know what they are :-) And consequently, I'm trying to figure out how I should handle them in processing the snapctl requests for the mount interface. Should I just merge the two maps (static and dynamic attributes) together?06:37
pstolowskimardy: they come from interface hooks, so may be set dynamically at runtime when plug-slot get connected when 1) snap(s) implement plug/slot interface hooks and 2) the interface actually expects and allows some attributes to bet set at runtime06:46
pstolowskimardy: here is an overview https://snapcraft.io/docs/interface-hooks06:47
pstolowskimardy: i'm missing the context of what you're doing in snapctl, but i doubt you have to do anything with dynamic attrs. can you pastebin your snapctl code?06:50
pstolowskimardy: the basic idea with dynamic attributes is that some attributes may need to be determined at runtime (they cannot be hardcoded in snap.yaml for the plug/slot), .e.g a path of some resource/device06:52
mborzeckianyone remembers why we have `any-python` as an interpreter in the retry tool?07:01
mvomborzecki: I can't say for sure but iirc it was something with fedora or so but I could be wrong. I remember looking at one of the commits that changed it and wondered about it07:09
mborzeckimvo: i'll open a quick pr dropping it, i think only 14.04 is using an older version of python3 (3.4 in fact)07:10
mborzeckiother distros have at least 3.507:10
mvomborzecki: cool07:10
mardypstolowski: thanks! Yes, I think in the case of the mount-control interface all attributes need to be static07:11
pstolowskimardy: excellent07:11
mborzeckimvo: https://github.com/snapcore/snapd/pull/10523 let's see if it gets green07:16
* pstolowski physio07:44
mvomborzecki: \o/ thank you! (sry, in a meeting)07:45
zyga-mbpgood morning08:19
mardyzyga-mbp: hi!08:29
zyga-mbphey mardy 08:29
zyga-mbpanother rainy day08:29
zyga-mbpeven air is soaking wet 08:30
pstolowskire08:55
pedronismvo: hi, I reviewed the timings PRs09:34
pstolowskipedronis: hi, i've updated https://github.com/snapcore/snapd/pull/10511 but was a bit confused when implementing TestBackstore test for pool. It seems I needed to use two revisions in the test to hit isNewer check inside pool otherwise it woudln't get added to the backstore. I didn't dig deeper into this09:43
pedronispstolowski: yes, that sounds the expected behavior09:52
pstolowskipedronis: but the old revision wasn't in the pool, that's what i don't get09:53
pedronispstolowski: we have our check based on what we requested09:54
pedronisI'll look09:54
pedronismaybe I'm misunderstanding09:54
pstolowskii'm sure it works as designed and is correct, i was just confused, maybe something in my test setup is wrong09:54
pedronispstolowski: what did you expect?09:55
pedronispstolowski: notice that you are adding an unresolved but not with the revision set to RevisionNotKnown09:57
pstolowskipedronis: i expected it to pass after s/s.rev1_3333/s.rev1_1111/  in TestBackstore09:57
pstolowskipedronis: ah09:57
pedronisthat's probably the source of your confusion09:57
pstolowskiyeah i think that's it09:58
pstolowskithanks09:58
pedroniswe should probably do that, it makes for a simpler test09:58
pstolowskisure, i'll try09:59
pedronisthere are examples of that in other tests10:00
pstolowskiindeed, they are setting atXXX "manually"10:02
pstolowskiyep, works, updated10:05
mardywhat is the systemd emulation (like in https://github.com/snapcore/snapd/blob/master/overlord/snapstate/backend/mountunit.go#L33-L38)? Do I have to do the same stuff in the mount-control interface, when creating the unit?10:06
mborzeckimeh, we can't mock time.Now() in a central way10:12
pstolowskimborzecki: oh, what's the catch?10:17
pstolowskimvo: https://github.com/snapcore/snapd/pull/10514 has +310:17
mborzeckipstolowski: nah, i'm just stating the fact that we don't have facilities to mock time centrally, maybe it's just not useful, but still annoying 🙂 i have a test that involves timestamps10:18
pstolowskimborzecki: ah ok, i thought there was some issue with that. yeah, we have timeNow() in a couple of places 10:19
pstolowskimardy: systemd emulation is used when preseeding (e.g. creating ubuntu image with snapd partially set up).10:21
pstolowskimardy: the idea is to not call real systemd because we aren't running on the real target system yet10:22
zyga-mbpmborzecki write a wrapper that runs unshare, switches to a user and time ns and exposes offset adjustment functions10:26
zyga-mbpglobal fake time10:26
zyga-mbp(per process)10:26
zyga-mbp(I'm not serious)10:27
pstolowskimardy: your interface is going to create mount units right?10:27
mborzeckizyga-mbp: even then, it would require cap_sys_admin?10:27
zyga-mbpmborzecki IIRC you could do it from a user ns10:27
mardypstolowski: yes, when it receives a "snapctl mount --persistent ..." command10:28
pstolowskimardy: ok, that's not going to happen during preseeding10:29
pstolowskimardy: so you don't have to do anything special afaiu10:29
mardypstolowski: nice! So, noemulation needed10:29
zyga-mbpmborzecki, I don't recall10:37
zyga-mbpdon't you get CAP_SYS_ADMIN that's valid inside the user ns?10:37
pedronispstolowski: I reviewed https://github.com/snapcore/snapd/pull/10511  we should talk about next steps at some point11:08
pstolowskipedronis: thanks, maybe later today/tomorrow?11:09
pedronisyes11:09
pstolowskihmm do we use gofmt 1.9 or 1.10?11:25
pedronismvo: https://github.com/snapcore/snapd/pull/10264 needs more work, the new test is not quite testing the right thing so it doesn't show the problem11:26
mvopedronis: I have a look, thank you!11:30
mardywe don't have any place in snapd where we are calling mount(8) from golang, do we?12:09
mardysorry, meant mount(2)12:09
pstolowskii need 2nd review for https://github.com/snapcore/snapd/pull/10511 from somebody who doesn't fear assertions ;)12:16
cachio_ijohnson[m], hi, same error with the new model12:18
cachio_I am debugging a test again to check that12:19
pstolowskimardy: there is something in gadget/install, not sure if that counts. you may want to grep the codebase by syscall.Mount12:22
zyga-mbpmardy: we do12:24
zyga-mbpmardy: tons of places in snap-update-ns12:24
zyga-mbpmardy: there are lots of helpers as well12:24
zyga-mbpfor all kinds of special ways to mount12:25
zyga-mbpmardy let me know if you have questions, I'd love to share 12:25
zyga-mbp(if anything I know is still useful)12:25
mardyzyga-mbp, pstolowski: looks like grepping for syscall.Mount helped, thanks :-)12:26
mardyI previously found a place when systemd-mount was invoked, but I don't see an advantage in using that12:26
zyga-mbpmardy: it depends on what you want to achieve12:28
zyga-mbpmardy: systemd does track mounts that happen in the system12:29
zyga-mbpmardy: (if it can see them from the initial mount namespace)12:29
zyga-mbpmardy: some things have systemd unit relations and going with systemd APIs may have advantages in terms of seeing how the system reacts as a whole12:30
zyga-mbpmardy: systemd still calls mount which uses libmount below the surface, so it's still the same thing regardless 12:30
zyga-mbpmardy: using system inside snap mount namespaces is most likely wrong12:31
zyga-mbpmardy: and depending on how you do it, you may be crossing the mount namespace boundary, which is relevant when you want to know what really happens in the end12:31
zyga-mbpmardy: e.g. where will the mount actually happen12:31
pstolowskimardy: nb it may make sense to have a spread test that checks snapd in lxc with your new code as this has been always a source of unexpected surprises 12:35
zyga-mbpyes12:36
zyga-mbpmardy in lxd you cannot do arbitrary mounts12:36
zyga-mbponly a subset is allowed12:36
zyga-mbpmainly you cannot mount new filesystems12:36
zyga-mbpyou may only bind mount an existing mount12:36
zyga-mbpand you may mount fuse 12:36
zyga-mbpgood point pstolowski 12:36
zyga-mbpmardy remember that lxd is not used as a generic backend for all tests, only select logic runs there 12:38
zyga-mbpand it's usually found late that "it breaks in lxd"12:38
pedronismardy: also notice that what we do when we create systemd mount units is starting them, that will also do the mount12:56
mardypedronis: right. But here I'm also supporting the case where the mount unit is not created, and the mount is only temporary12:57
mardychanging topic, anyone has seen this error before? https://github.com/snapcore/snapd/pull/10438/checks?check_run_id=305639334112:58
mardyI guess it's not related to my changes, as most other distros passed the test fine, but you never know12:58
zyga-mbphmm13:15
zyga-mbpmaybe version skew?13:15
zyga-mbpI don't recall if this test specifically is affected but around releases, all kinds of tests were getting into funny state13:15
zyga-mbpwasn't there a release recently?13:15
mardyzyga-mbp: yes, there was 2.51.2 a few days ago13:25
zyga-mbpmardy: although having said that, I don't see anything in the logs13:37
cachio_ijohnson[m], https://paste.ubuntu.com/p/w37jDPhTnZ/13:49
cachio_this is the journal log 13:50
ijohnson[m]cachio_: what is `snap changes` on that device ?13:50
cachio_user1@localhost:~$ snap changes13:51
cachio_ID   Status  Spawn               Ready               Summary13:51
cachio_1    Done    today at 12:29 UTC  today at 12:29 UTC  Initialize system state13:51
cachio_2    Done    today at 12:29 UTC  today at 12:29 UTC  Initialize device13:51
cachio_3    Done    today at 12:31 UTC  today at 12:33 UTC  Install "core" snap from file "core-from-snapd-deb.snap"13:51
ijohnson[m]cachio_: and what is `journalctl --no-pager -u snapd`? 13:51
cachio_https://paste.ubuntu.com/p/QrYvSKfsKb/13:52
ijohnson[m]cachio_: hmm which test is this from ?13:52
cachio_ijohnson[m], google-nested:ubuntu-16.04-64:tests/nested/manual/cloud-init-never-used-not-vuln:refresh13:54
ijohnson[m]cachio_: what is `cloud-init status --long` ?13:56
cachio_user1@localhost:~$ cloud-init status --long13:56
cachio_status: disabled13:56
cachio_detail:13:56
cachio_Cloud-init disabled by /etc/cloud/cloud-init.disabled13:56
ijohnson[m]cachio_: ah I know the issue, I need to work on something else right now so I can't provide you the full details of how to fix it, but essentially this test assumes it is building with an old snapd from circa 2.44, without the fix, but now it is being booted with the fix.14:07
ijohnson[m]cachio_: in the meantime, for amd64, armhf, and arm64, can you download the core snap and snapd snaps for 2.45 and upload all of those snaps to a bucket somewhere we can download them?14:08
cachio_ijohnson[m], yes14:08
ijohnson[m]that is the only way to make this test rightfully pass, is that we need to build the nested image with an old snapd, then refresh to the one we are building 14:09
ijohnson[m]thanks cachio_ 14:09
cachio_just for amd64 we need the snaps, right?14:10
cachio_ijohnson[m], 14:10
ijohnson[m]cachio_: does this test run on devices too?14:11
ijohnson[m]oh wait it's a nested test14:11
ijohnson[m]cachio_: ok yeah just amd64 then since we don't do nested tests on other arches14:11
mardyanyone knows what is the difference between /run/systemd/system/ and /run/systemd/transient/? I could find any clear info on what a system "transient" unit it14:22
mardy*is14:22
mborzeckimardy: systemd-run creates a transient unit14:25
mborzeckii'm guessing it ends up there14:25
mardymborzecki: thanks14:33
mardywhen a PR is growing big, is it OK to split it into two (a prerequisite and the main one), even if the prerequisite does not do anything useful by itself?14:58
zyga-mbpmardy https://github.com/systemd/systemd/blob/cc03890a9d76103769213da9f13d18387e17212f/man/systemd.unit.xml#L37014:58
zyga-mbpmardy I think so, it's very typical 14:59
zyga-mbpmardy the only use case I see is here: https://github.com/systemd/systemd/blob/4e95bc56dfe19b24a84b207ef369d98faa12d160/src/basic/path-lookup.c#L30114:59
mardyzyga-mbp: thanks (for both answers) :-)15:01
pstolowskimardy: yeah we often do that. sometimes you end up with a prerequisite of a prerequisite :}15:04
cachio__ijohnson[m],  still uploading the snps15:17
cachio__it is very slow15:18
ijohnson[m]cachio__: no rush, I'm in meetings still for a while15:23
pstolowskipedronis: will you have time tomorrow around 11:30 to talk about next steps?15:23
pedronispstolowski: yes, sorry, was in meetings15:25
pstolowskinp15:25
=== cachio__ is now known as cachio
* cachio afk20:45
ijohnson[m]cachio: I opened https://github.com/snapcore/snapd/pull/10527 which will address the issues on those cloud-init nested tests which were giving us issues20:56

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