/srv/irclogs.ubuntu.com/2021/09/30/#snappy.txt

=== benfrancis0 is now known as benfrancis
mborzeckimorning05:56
zyga-mbphey mborzecki 05:57
zyga-mbphow are you doing? :)05:57
zyga-mbphappy Thursday05:57
mborzeckizyga-mbp: hey, yeah finally thursday, just one more day06:08
mardygood morning mborzecki, zyga-mbp 06:09
zyga-mbpgood morning mardy :)06:10
mborzeckimardy: hey, i've pushed an update to https://github.com/snapcore/snapd/pull/10860 and it looks like i fixed the sync & buffer corruption in tests 🙂 there's still a little problem with that signal thingy being null sometimes, haven't really seen it on real dbus, so i'm guessing it's something about partial reads in the tests06:11
mupPR #10860: sandbox/cgroup: wait for start transient unit job to finish <Created by bboozzoo> <https://github.com/snapcore/snapd/pull/10860>06:11
zyga-mbpwoah, nie06:12
zyga-mbp*nice06:12
ares0128Hi, i want to create an agent which manages the snap updates. to do that i would need to connect to snapd-control slot. But how do i use it? I read that it is using javascript file. But i have no idea how to use it. Could some one help me.06:22
zyga-mbpares0128 there's some logic that makes snapd go to managed mode and disable auto-updates06:23
zyga-mbpthen you have to call the snapd APIs to issue specific requests, like update that snap or all snaps06:23
zyga-mbpwhenever your software decides06:23
zyga-mbpthere's a bit of guard-rails around that feature, it's meant for core devices only 06:23
ares0128i tried following this https://github.com/dbruno74/node-red-node-snapd and https://github.com/madintec/snapd-control06:25
ares0128but i dont know how to use these files06:25
ares0128yeah i am making a snap for ubuntu core06:25
zyga-mbpares0128 that secodn thing is just a library, if you need javascript you can use it but that's not the point06:25
ares0128how do i call snapd APIs 06:26
zyga-mbpsnapd has a socket06:26
ares0128it is through /run /snapd.socket06:26
* zyga-mbp and a Go library to talk to it06:26
* zyga-mbp the protocol is basically http over unix socket06:26
* zyga-mbp the snap command actually talks to snapd over that socket06:26
* zyga-mbp for snaps there's a second socket that lets snapctl talk to snapd 06:26
ares0128is there an example snap that i can refer to?06:26
zyga-mbpsnapctl is the thing that snaps can use internally to manage parts of themselves06:26
zyga-mbpI don't recall but I'm sure there's something in the snapd test suite06:27
zyga-mbpares0128 https://github.com/snapcore/snapd/blob/master/tests/main/interfaces-snapd-control-with-manage/task.yaml#L7106:29
zyga-mbpares0128 you get a snap with snapd-control06:29
zyga-mbpyou can set the snap set setting "system refresh.shedule" to "managed"06:29
zyga-mbpand from there on you can just use snap to tell snapd to do things06:30
zyga-mbpI think you can literally bundle the snap command as a quick test06:30
zyga-mbptypically there are management agents implemented in whatever language06:31
zyga-mbpthey talk to snapd either through the go binary06:32
zyga-mbpor through the C library 06:32
zyga-mbpor through the Go library06:32
zyga-mbpthere are official libraries to talk to snapd06:32
zyga-mbpand perhaps several unofficial ones 06:32
zyga-mbpbut the bulk of the idea is that you switch refreshes to managed and then you drive the refreshes yourself06:32
ares0128so , i make a snap using go library that talks to snapd and chage the refresh to ,managed...06:33
mardymborzecki: the Read() and Write() method of the testDBusStream, can they be invoked on the same object from two different threads?06:37
mardy(if so, you should protect that s.closed flag with a mutex)06:39
zyga-mbpand back :)06:52
pstolowskimorning07:00
mardyhi pstolowski, mvo 07:03
mvogood morning mardy and pstolowski 07:03
pstolowskihey mardy and mvo07:03
zyga-mbphey there pstolowski and mvo :)07:08
mvogood morning zyga-mbp 07:09
mupPR snapd#10844 closed: disks: add `Size(path)` helper <Created by mvo5> <Merged by mvo5> <https://github.com/snapcore/snapd/pull/10844>07:11
pstolowskihey zyga-mbp !07:15
mupPR snapd#10856 closed: osutil/disks: add Disk.KernelDevice{Node,Path} methods <Simple 😃> <Created by anonymouse64> <Merged by mvo5> <https://github.com/snapcore/snapd/pull/10856>07:16
mborzeckimardy: hm fixed that already with some refactor to Write() as the code wasn't correct, still no clue how we get that nil signal there, tbh i've been fighting with go modules at this point, modifyikg a forked library isn't exactly convenient now07:49
mborzeckimardy: can you take a look at https://github.com/snapcore/snapd/pull/10847 ?07:50
mupPR #10847: cmd/snap-confine: die when snap process is outside of snap specific cgroup <cgroupv2> <Created by bboozzoo> <https://github.com/snapcore/snapd/pull/10847>07:50
zyga-mbpmborzecki small review07:52
zyga-mbp /me is a bit afraid that tests.session is used so much in tests now07:52
zyga-mbpthat thing is a gross hack07:52
pstolowskijamesh: https://github.com/stolowski/snapd/tree/notifications/monitor-closed08:26
pstolowskijamesh: the panic is in cmd/snap tests08:26
* pstolowski dog walk, brb08:27
pstolowskire08:35
jameshpstolowski: It's not clear that tomb.Context() does what we want here08:44
jameshoh. maybe I'm wrong.  Let's see again08:44
pstolowskijamesh: fwtw just using context.Background() makes no difference as far as close panic is concerned08:46
miguelpires@mvo: can you merge https://github.com/snapcore/snapd/pull/10849 please? failures are unrelated AFAICT08:47
mupPR #10849: o/snapstate: prevent install hang if prereq install fails <Created by MiguelPires> <https://github.com/snapcore/snapd/pull/10849>08:47
mvomiguelpires: sure!08:47
miguelpiresthanks08:49
mupPR snapd#10849 closed: o/snapstate: prevent install hang if prereq install fails <Created by MiguelPires> <Merged by mvo5> <https://github.com/snapcore/snapd/pull/10849>08:51
jameshpstolowski: I think this is a bug in godbus08:53
jameshand looks to still be a bug08:53
pstolowskioh08:54
pstolowskijamesh: as I said, maybe we could just not close() as a workaround08:54
pstolowskislightly bad, but we are exiting anyway08:55
jameshIf you call Conn.RemoveSignal(ch), then it is up to you to close the channel. If the D-Bus connection is closed, it closes all the signal channels08:55
jameshI'm not sure how you could write correct code with those semantics08:56
ograare there current known bugs with snap-device-helper ? i see a ton of errors on a pi4 (and how would i debug this ?)08:58
ograhttps://paste.ubuntu.com/p/Qwr6NkD3d7/09:00
ogra(seems all related to the opengl interface)09:00
ogra(and i have to enforce SW rendering to make electron run (or use devmode))09:01
jameshpstolowski: I filed https://github.com/godbus/dbus/issues/271 about the problem09:21
jameshpstolowski: in the short term, leaving the channel unclosed with a comment pointing at that bug report is probably the best option09:21
pstolowskijamesh: awesome, thanks for digging into it and providing good explanation in the bug report!09:22
zyga-mbpjamesh nice one09:28
jameshzyga-mbp: it'd be even nicer if I could think of a fix that wouldn't break compatibility...09:29
* zyga-mbp jamesh I'm actually using that library as well; I'm in a bit of crunch mode before my release (6 weeks left) but I will think09:29
jameshzyga-mbp: the best I can think of is to have a second version of RemoveSignal that closes the connection09:30
zyga-mbpjamesh would it be possible to use WIthSignalHandler and provide a different logic for AddSignal and RemoveSignal?09:35
zyga-mbpthose seem to be dispatched with an interface09:35
zyga-mbpand ther's a way to set the signal handler per connection instance09:36
jameshthey abstracted a lot of things in godbus that they probably shouldn't have (e.g. serial number generation)09:39
jameshbut replacing the default implementation with one that implements different semantics seems like a bad idea09:39
zyga-mbpjamesh I wonder if upstream reacts quickly or not09:45
zyga-mbpthere seems to be little traction 09:46
jameshzyga-mbp: they've accepted pull requests from me, and I've helped review others. I think it is more a case of lack of time.09:47
zyga-mbpthat's good then09:47
jameshe.g. fixing the race conditions that used to exist in RemoveSignal09:48
mupPR snapd#10857 closed: osutil/disks: add Partition struct and Disks.Partitions() <Simple 😃> <Created by anonymouse64> <Merged by mvo5> <https://github.com/snapcore/snapd/pull/10857>09:51
pstolowskijamesh: i'm also now occasionally seeing [signal SIGSEGV: segmentation violation code=0x1 addr=0x28 pc=0x7ad006] on github.com/snapcore/snapd/desktop/notification.(*fdoBackend).processSignal(0xc0000c2820, 0x0, 0x0, 0x0, 0x0, 0x0) now in this code (after avoiding close), still a race somewhere09:53
pstolowskibut maybe it's related to the new test i'm adding in usesession/agent09:54
jameshpstolowski: I'm not sure. I didn't see any segfaults after removing the close() from what you'd posted earlier09:58
jameshdid it give you any more information than that?09:58
pstolowskijamesh: no, let's not worry about that right now, i may know more when I finish my test, may as well be a problem with my test code09:59
mborzeckihttps://github.com/snapcore/snapd/pull/10860 needs a 2nd review10:15
mupPR #10860: sandbox/cgroup: wait for start transient unit job to finish <Created by bboozzoo> <https://github.com/snapcore/snapd/pull/10860>10:15
mborzeckiand https://github.com/snapcore/snapd/pull/10847 too10:16
mupPR #10847: cmd/snap-confine: die when snap process is outside of snap specific cgroup <cgroupv2> <Created by bboozzoo> <https://github.com/snapcore/snapd/pull/10847>10:16
mupPR snapd#10853 closed: tests: use the latest cpu family for nested tests execution <Run nested> <Created by sergiocazzolato> <Merged by bboozzoo> <https://github.com/snapcore/snapd/pull/10853>10:51
mborzeckizyga-mbp: https://build.opensuse.org/request/show/922347 if you have a minute11:09
mupPR snapd#10783 closed: [RFC, draft] tests: report stray tasks in spread test restore <â›” Blocked> <Created by stolowski> <Closed by stolowski> <https://github.com/snapcore/snapd/pull/10783>11:31
zyga-mbpmborzecki in a minute11:42
zyga-mbpmborzecki +111:42
mborzeckithanks!11:43
zyga-mbpalways a pleasure :)11:43
mborzeckithis if fun: `c.Check(s.Stdout(), check.Matches, fmt.Sprintf(`(?sm)Usage:\s+snap %s(?: \[[^][]+\])*(?:(?: <[^<>]+>)+(?:\.\.\.)?)?$.*`, cmd), comment)`12:10
* zyga-mbp I see robot emojis12:11
mborzeckizyga-mbp that's what more regexes look like12:12
mardymiguelpires: hi! I'm just pinging you to make sure you did see my comment on https://github.com/snapcore/snapd/pull/10836 (it's fine if you prefer the current implementation, just wanted to make sure you considered the alternative :-) )12:12
mupPR #10836: many: add experimental setting to move ~/snap to ~/.snap/data <Needs security review> <Created by MiguelPires> <https://github.com/snapcore/snapd/pull/10836>12:12
mupPR snapd#10864 opened: mount-control: step 3 <â›” Blocked> <Created by mardy> <https://github.com/snapcore/snapd/pull/10864>12:22
mupPR snapd#10865 opened: cmd/snap: improve snap run help message <Simple 😃> <Created by bboozzoo> <https://github.com/snapcore/snapd/pull/10865>12:42
miguelpiresmardy: sorry, I meant to reply but then completely spaced. I replied now 12:49
mupPR snapd#10789 closed: tests: new test invariant to check no systemd user units running <Simple 😃> <Created by sergiocazzolato> <Closed by sergiocazzolato> <https://github.com/snapcore/snapd/pull/10789>13:52
mupPR snapd#10789 opened: tests: new test invariant to check no systemd user units running <Simple 😃> <Created by sergiocazzolato> <https://github.com/snapcore/snapd/pull/10789>14:22
pstolowskimvo: could you please merge https://github.com/snapcore/snapd/pull/10846 ? unrelated failures14:26
mupPR #10846: desktop: implement gtk notification backend and provide minimal notification api <Created by stolowski> <https://github.com/snapcore/snapd/pull/10846>14:26
mardyis this the recommended way to mock interface connections, or is there another way which allows injecting a ConnectionState object? https://github.com/snapcore/snapd/blob/master/overlord/hookstate/ctlcmd/is_connected_test.go#L201-L20816:00
pstolowskimardy: yes that's how we do it16:06
mupPR snapd#10846 closed: desktop: implement gtk notification backend and provide minimal notification api <Created by stolowski> <Merged by stolowski> <https://github.com/snapcore/snapd/pull/10846>16:22
=== benfrancis0 is now known as benfrancis
=== mup_ is now known as mup
=== paulw2 is now known as PaulW2U
=== benfrancis4 is now known as benfrancis
=== paulw2 is now known as PaulW2U
* cachio_ akf18:04
cachio_afk18:04
=== dbungert1 is now known as dbungert
mupPR snapd#10866 opened: many: replace state.State restart support with overlord/restart <Created by pedronis> <https://github.com/snapcore/snapd/pull/10866>19:08
mupPR snapd#10858 closed: osutil/disks: add Disk.FindMatchingPartitionWith{Fs,Part}Label <Simple 😃> <Created by anonymouse64> <Merged by mvo5> <https://github.com/snapcore/snapd/pull/10858>19:28
=== popey4 is now known as popey

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