/srv/irclogs.ubuntu.com/2015/10/12/#snappy.txt

=== chihchun_afk is now known as chihchun
=== fginther is now known as fginther`
=== chihchun is now known as chihchun_afk
=== chihchun_afk is now known as chihchun
dholbachgood morning06:58
clobranogood morning07:12
Chipacagoood morning people!08:09
mvohey Chipaca, good morning!08:38
Chipacamvo: how's things?08:38
mvoChipaca: busy, but good otherwise, how are you?08:39
Chipacamvo: considering breakfast08:39
Chipaca:)08:39
mvoChipaca: do it!08:39
Chipacamvo: i need to fix the way we're using husks, i learned08:39
Chipacaum08:40
Chipacanot husks08:40
Chipacathe other thing08:40
Chipacatombs08:40
mvoChipaca: oh? how so?08:40
mvoChipaca: the way you used them looked super nice08:40
Chipacamvo: the function you give to tomb.Go is supposed to check whether the tomb.Kill has been called08:41
Chipacamvo: http.Serve does not do that :)08:41
Chipacai learned this in trying to make the server auto-go away after a bit ;)08:41
mvoChipaca: heh, ok08:42
Chipacaso there'll be a branch about that sometime today, maybe :)08:42
mvoChipaca: cool08:44
Chipacawe're also not doing that in tasks' tomb, but that's ok because there aren't cancelable tasks just yet08:44
JamesTaitGood morning all; happy Monday, and happy World Arthritis Day! 😃09:01
ogra_ouch09:13
Chipacawah, http.Server's Serve() calls out to private methods; i can't reimplement it tomb-friendly without reimplementing the guts of http :-(09:33
Chipacapitti: o/10:29
Chipacapitti: how much do you know about systemd's socket activation? :)10:30
Chipacapitti: looking for a way to tell systemd to shut it down after inactivity10:30
Chipacapitti: or lacking that, looking for a way to tell systemd it's shutting down due to inactivity10:30
Chipacapitti: i've tried doing sd_notify(0, "STOPPING=1") but that still seems to get clients connecting after10:31
pittiChipaca: not much, I'm afraid; sd_notify(3) looks like STOPPING=1, but do you actually shut down the service afterwards?10:40
Chipacayep10:40
pittiChipaca: you can't tell if a service is inactive from teh outside, the process itself needs to do that10:40
Chipacasd_notify doesn't seem to make any difference10:40
pittiChipaca: maybe it gets restarted immediately due to new clietns connecting?10:41
Chipacayes10:41
pittiChipaca: i. e. you might have stopped the .service, but not the corresponding .socket10:41
Chipacaand then it starts starting10:41
Chipacapitti: i'm testing exactly that10:41
Chipacathat is: i'm trying to make sure that if the server decides to go away *just* as a new client connects, things still work10:41
=== rcj` is now known as rcj
gberginccan anyone help me get my demo snappy app that depends on a small shared library run?10:57
gbergincshared lib only has one function and my main app only calls that function10:58
gbergincall is packed into a snap10:58
gbergincthe contents of the package can be seen at http://pastebin.com/4MA60S6r11:04
gberginc(well, the structure, that is)11:04
biezpalgberginc, you should define "LD_LIBRARY_PATH" variable to make library "shared" :)11:10
gbergincsorry, biezpal, I am completely new to Snappy - where should I add this? on my host I have specified LD_LIBRARY_PATH before building the app11:12
biezpalI mean, run "export LD_LIBRARY_PATH=/apps/heyho/current/lib/x86_64-linux-gnu" in Snappy with your app installed on11:14
biezpaland try to run your app after this, this should help11:14
ogra_you shouldnt need that11:14
ogra_the wrapper that executes the snap binary will set it automatically11:15
ogra_you just need to put your lib in the right place in your snap11:15
biezpalogra_, is it already implemented?11:16
ogra_lib/x86_64-linux-gnu/ for amd64 and lib/arm-linux-gnueabihf/ for arm11:17
ogra_biezpal, since forever :)11:17
=== chihchun is now known as chihchun_afk
biezpalogra_, few month ago we requested this feature)11:18
biezpalbtw, where can we get changelogs?11:18
gbergincI have the lib in that folder but it doesn't seem to work11:19
gbergincI may have some other problems though :)11:19
gbergincbecause even after setting LD_LIBRARY_PATH it doesn't work; I'll look into11:20
Chipacaogra_: um... you sure the LD_LIBRARY_PATH thing is done?11:31
Chipacaogra_: it's not done by ubuntu-core-launcher, and it's not done by snappy11:31
Chipacaogra_: i think it used to be done by the precursor of snapcraft, but i'm not sure11:32
biezpal:D11:33
Chipacaso AFAIK you still have to do it yourself11:33
Chipacagberginc: if you share the snap itself, i can help, probably11:34
gbergincafter setting LD_LIBRARY_PATH I see this in ldd11:35
gberginc(amd64)ubuntu@localhost:/apps/heyho.sideload/current$ ldd bin/main11:35
gberginc        linux-vdso.so.1 =>  (0x00007ffdf3fda000)11:35
gberginc        libmylib.so => /apps/heyho.sideload/current/lib/x86_64-linux-gnu/libmylib.so (0x00007fa3a3019000)11:35
gberginc        libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007fa3a2c4f000)11:35
gberginc        /lib64/ld-linux-x86-64.so.2 (0x00007fa3a321b000)11:35
gbergincbut it still fails to start11:35
gberginclet me create a repo with the app11:35
gberginc^ Chipaca11:35
Chipacagberginc: how are you starting it, and what error do you get11:35
ogra_Chipaca, hmm ? ubuntu-core-launcher should do it since quite a while11:37
Chipacaogra_: set LD_LIBRARY_PATH? nope11:37
ogra_yes11:37
Chipacajohn@fogey:~/canonical/ubuntu-core-launcher$ grep -r LD_LIBRAR11:37
Chipacajohn@fogey:~/canonical/ubuntu-core-launcher$11:37
ogra_now thats weird, i definitely remember apparmor chnges after this landed11:38
ogra_well, but then yes, you need a wrapper11:38
Chipacagberginc: fwiw just the .snap would probably be enough to point you in the right direction, don't need to see the source itself11:39
gbergincChipaca: ok, I'll share the snap11:39
gbergincChipaca: http://k00.fr/2w2gp11:41
biezpal(amd64)ubuntu@management:~$ /apps/heyho.sideload/current/bin/main11:48
biezpalHello from librarycos(0) = 1.00000011:48
biezpal(amd64)ubuntu@management:~$ /apps/heyho.sideload/current/bin/hoho11:48
biezpalHeyhohoho!11:48
Chipaca$ heyho.main11:49
ChipacaHello from librarycos(0) = 1.00000011:49
Chipacabiezpal: don't call it directly, that's not contained!11:49
Chipacabiezpal: use the /apps/bin/* wrappers11:49
Chipacagberginc: so11:50
Chipacagberginc: move main to main.real11:50
Chipacagberginc: and make "main" a script that does: #!/bin/sh11:50
ChipacaLD_LIBRARY_PATH=$SNAP_APP_PATH/lib/x86_64-linux-gnu $SNAP_APP_PATH/bin/main.real11:50
Chipaca(if you're packaging more than one architecture, $SNAPP_ARCH can help)11:51
* Chipaca wonders, not for the first time, why there isn't a SNAP_ variable for the multiarch string thing11:51
gbergincgreat, thanks Chipaca!11:59
gbergincChipaca: it works!12:10
Chipaca*shocking*12:10
gbergincfor me, yes :D12:10
gbergincI'll now try openfoam to see how easy it would be to make a framework/app out of it12:11
olligm12:49
=== chihchun_afk is now known as chihchun
=== utlemmin` is now known as utlemming_sprint
jdstrandogra_: hey, I'm not working right now, but I was wondering how to force a module load with snappy config. I know about the 'modprobe' option, but that edits a file in /etc/modprobe.d. I think I need a file in /etc/modules-load.d to be edited, unless there is something I can put in modprobe.d13:15
jdstrandbut I can't seem to find it13:15
jdstrandwhat I specifically need it iptable_filter and ip6table_filter to be loaded, since they don't autload from within a snap13:16
ogra_heh, i didnt even know abouot /etc/modules-load.d ... is that the same as /etc/modules ?13:16
ogra_(just broken down into single files)13:16
jdstrandyes13:16
ogra_Chipaca, ^^^ can we add that to snappy config for ubuntu-core ?13:16
jdstrandotherwise firewall snaps aren't going to work :)13:17
ogra_jdstrand, same game as always ... needs adding to writable paths in ubuntu-core-config and a function in snappy for snappy config13:17
Chipacawhat's the difference between modprobe.d and modules-load.d?13:17
jdstrandboth have man pages13:18
ogra_modprobe.d definest module parameters13:18
jdstrandthe first adjusts options when loading13:18
jdstrandthe second forces load on boot13:18
Chipacaoooh, haven't been told to rtfm in ages13:18
* Chipaca rtfm's13:18
jdstrandthis is trying to deal with this bug: https://bugs.launchpad.net/snappy/+bug/149641913:19
ubottuLaunchpad bug 1496419 in Snappy "iptable_filter and ip6table_filter do not auto load" [Undecided,New]13:19
* ogra_ adds an ubuntu-core-config task13:19
jdstrandcool, thanks13:20
jdstrandone of these days, I'll have a ufw snap in the store13:20
ogra_yay13:20
ogra_then i could actually snappify my firewall !13:21
* ogra_ already has a ufw firewall in use here ... but deb based 13:21
jdstrandyeah, me too13:21
* davmor2 pictures ogra_'s home slowly turning into rasp pi2's 13:22
jdstrandI really want to create a little 'router snap' for my soekris13:22
Chipacaogra_: where does ubuntu-core-config come into the picture, btw?13:22
ogra_Chipaca, it defines the writable paths on the image13:23
Chipacaah13:23
ogra_davmor2, nah, for real stuff i dont use RPis :)13:23
davmor2ogra_: oh sorry Beagle Board blacks is it ;)13:24
ogra_http://www.amazon.de/gp/product/B00JR6X0ZK13:24
ogra_plain x8613:24
davmor2ogra_: nice13:26
jdstrandogra_, Chipaca: so we need that writable path but also a 'modules-load' option in snappy config ubuntu-core. guessing that would just be a list that create a file in /etc/modules-load.d/ubuntu-core.conf that has one module per line13:26
ogra_jdstrand, yeah, that sounds correct13:27
ogra_by default just an empty file13:27
* jdstrand nods13:27
Chipacahow many modules would it be, worst case?13:28
Chipacabecause making it a bunch of files would be easier :)13:28
jdstrandin my case, 213:28
jdstrand:)13:28
jdstrandor any firewall snap13:28
Chipacai mean, /etc/modules-load.d/ubuntu-core-$module for every module you want13:29
jdstrandI don't know what other modules don't autoload when under confinement13:29
ogra_well13:29
ogra_might not only be an autoload thing but simply some adjustment to the default image13:29
jdstrandthat seems weird when comparing it to modprobe13:29
jdstrandChipaca: ^13:30
jdstrandmodprobe creates one file13:30
ogra_i can imagine that you might want to force load modules that wouldnt autoload when doing a certain oem project13:30
jdstrandogra_: I had that feeling too, but I couldn't come up with an example13:30
davmor2jdstrand, ogra_: actually I'm surprised that ufw isn't in the base image it is way more pleasant to use that iptable :)13:30
ogra_davmor2, bot not everyone needs a firewall builtin into his drone :)13:31
jdstrandit wasn't considered minimal enough13:31
davmor2ogra_: but iptables is which is the actual firewall, ufw just makes your eyes bleed less using it :P13:32
ogra_well, a snappy install should essentially only be systemd, the snappy binary, a shell and the glue to make these three boot a system13:33
ogra_as minimal as possible13:33
ogra_sadly we're kind of moving away from that a little recently13:33
Chipacawe are?13:34
ogra_yeah, definitely13:34
Chipacaaww13:34
ogra_so many seed additions recently :/13:34
davmor2ogra_: but iptable is part of the kernel right so if you have the kernel installed it's there isn't it?13:34
Chipacai'm still wanting to nuke python out of there13:34
ogra_davmor2, not the userspace13:34
Chipacaiptables the userspace things are quite large, even13:34
davmor2ogra_: grrrr ogra2 keeps getting priority over ogra_   fair enough wasn't sure if it was a separate thing or not nice to know though :)13:35
Chipacaogra2 isn't an async ogra_ ?13:36
ogra_Chipaca, nah, its my snappy test setup for the bip snap in longterm testing :)13:45
* Chipaca reads "yes, yes it is"13:46
ogra_haha13:46
longsleepChipaca: nuke python2 or python3 - but please keep a python there so snaps do not have to ship python for simple scripts and stuff13:48
Chipacalongsleep: https://github.com/micropython/micropython :D13:49
longsleepmhm - i am not sure i like that13:49
* longsleep prefers to have /usr/bin/python 13:50
ogra_we will definitely get rid of python at some point13:50
ogra_thats like saying "we need nodejs in the image so snaps dont need to ship it"13:50
longsleepwell, python has been standard on linuxes for centuries - i am not sure if node qualifies as comparison13:51
Chipacaogra_: not node! v8, clearly13:51
davmor2Chipaca: isn't the system-image-cli stuff written in py3?13:51
Chipacalongsleep: so has X13:51
Chipacadavmor2: yes. But that's already on the chopping block.13:51
longsleepbut whatever, in my case i would need a python framework to avoid having 30 snaps each shipping python for scripting13:52
Chipacadavmor2: apparmor-click is also py313:52
longsleepto me, removing python is the same as removing /bin/sh13:52
longsleepor /bin/bash for that matter13:52
Chipacaoh, i agree. bash should also go >:D13:53
jdstrandI'm not saying python shouldn't go, but fyi, it adds something in the neighborhood of 40M to a snap13:54
jdstrand(if using it with snapcraft, for example)13:54
Chipacahere's the thing13:54
Chipacaright now, it's in a weird state13:54
longsleepyes - i mean that would be fine if there is a framework13:54
Chipacawhere we don't *promise* it'll be there13:54
Chipacabut people still depend on it13:55
longsleeptrue, but this is the same as with sed, awk, sh, grep13:55
Chipacaso, i think we should do two things, in order, if/when we have infinite engineering resources13:55
davmor2Chipaca: Python Roulette13:55
Chipacaor what you say13:55
ogra_bash needs to die on the snappy image :)13:56
Chipacabasically, handwavy make it possible to use a "python framework" (which isn't possible right now)13:56
Chipacaand then remove everything not *strictly* essential from the core13:56
longsleepthat sounds good to me13:56
jdstrandI don't think python should be a framework13:56
Chipacaframework is wrong, hence the handwavy bit13:57
jdstrandthat isn't what frameworks are for. that are explicitly not for a substitute for libraries13:57
Chipacaframeworks can't depend on things, and are for controlling access to shared resources, nothing else13:57
longsleepisnt a framework something snaps can share or rely on?13:57
Chipacalongsleep: no13:57
longsleepah13:57
jdstrandwith this sorta is, cause the interpreter is versioned13:57
Chipacalongsleep: also, frameworks can't depend on things13:57
* jdstrand nods to handwavy bit13:57
Chipacalongsleep: so you couldn't make a framework that depended on the "pthon" "framework" ""13:58
* Chipaca adds more ""s in there13:58
beunoalso, you don't need all of python13:58
* Chipaca also adds an y13:58
beunoso surely snapcraft can improve13:58
longsleepChipaca: i see, so how to solve that?13:58
beunoand only bring in the bits you need13:58
Chipacalongsleep: today, carry on as you were13:58
Chipacalater, we'll see13:58
Chipacalongsleep: this is long-term after-lunch-break-chat stuff13:59
Chipacabeuno: hola :)13:59
beunoo/ Chipaca13:59
longsleepChipaca: i see :) but is later also to remove one of the pythons? Right now there is 2 and 3 isn't it?13:59
Chipacalongsleep: no, only 314:00
Chipacawait14:00
longsleepChipaca: oh 2 went away then already?14:00
Chipaca2 is also on there!14:00
Chipacawhat?14:00
Chipacai thought we'd got rid of 214:00
longsleepthats what i mean :)14:00
Chipaca:-(((14:00
longsleepwell i did not check for a while14:00
longsleepmaybe it is gone now14:00
beunoChipaca, it used to be there because of cloud-init14:00
Chipacaahhhh14:01
Chipaca15.04 still has it14:01
Chipacawily does not14:01
Chipacaphewww14:01
beunoright14:01
longsleepah ok14:01
Chipacalongsleep: rolling --> awesomeness14:01
longsleepbut 15.04 is what anyone should use now right?14:01
Chipacaalso, much breakage, all the time14:01
Chipacalongsleep: only if you like things that don't break all the time14:01
* longsleep did not check on rolling since June or something14:02
beunolongsleep, rolling is slowly becoming 16.0414:02
beunosometimes, not slowly and not backwards compatible14:02
longsleepChipaca: so you would agree saying that python3 will be in 16.04 - or is 16.04 after lunch break stuff?14:03
beunoif you want to stay close to the LTS and can tolerate some breakage, I'd follow rolling14:03
beunolongsleep, we don't know14:03
beunoif we can, I think we'll try and release 16.04 without Python14:03
Chipaca16.04 is 3× too far into the future for humble little me to guess at14:03
beunoeveryone benefits from a smaller image14:03
longsleepbeuno: Ok fair enough, but i suggest you think about sharing python with multiple snaps before removing it14:03
beunolongsleep, absolutely14:03
Chipacalongsleep: yeh, in what i said above there was an ordering14:03
beunowe need the same for node, java, etc14:03
Chipacaqt14:04
beunoso it's a general problem to solve14:04
Chipaca/o\ qt14:04
longsleepOk sounds good to me, as long as i can avoid adding python to all of my snaps14:04
Chipacahah!14:04
Chipacawe've got python3.4 and 3.5 in wily14:04
Chipacainstead14:05
longsleephehe14:05
beunowhat's 40mb among friends?14:05
Chipacaprobably a bug tho, i guess in the transition to 3.5 we forgot to update something14:05
Chipacaogra_: ^?14:05
* Chipaca puts it on the floor and runs14:05
longsleepbut can you agree in saying "python2 is dead" - use python3 or is there still some movement to resurrect python 2?14:05
ogra_i'm pretty sure we only seed one14:05
ogra_must be some dep that pulls in the other14:06
beunolongsleep, no chance py2 is coming back14:06
longsleepbeuno: ok good thats what i wanted to hear :)14:06
Chipacalongsleep: python2 is dead. Long live python3.14:06
longsleepbtw, python3 does still not support ipv6 listeners in the standard library .. totally sucks14:07
ogra_heh14:07
ogra_we dont seed any python14:07
beunoogra_, python seeds us?14:08
ogra_some package deps seem to pul both of them in14:08
ogra_ah, wait14:08
ogra_we do seed python3-pycurl14:08
ogra_booo14:08
Chipacalongsleep: python3 does support ipv6 in the standard library, afaik, fwiw, etc14:10
longsleepChipaca: yes but only for clients, the socketserver implementations do not14:13
Chipacalongsleep: http://pastebin.ubuntu.com/12763435/14:13
Chipacalongsleep: lies14:13
Chipacayou just need to set address_family to ipv614:13
longsleepthen ipv4 does not work14:13
Chipacaah, yes it sucks you can't easily do both14:14
Chipacamore subclassing is needed14:14
longsleepyes that is what i mean sorry14:14
longsleepmy rant was not precise enough :)14:14
Chipacalongsleep: but, http://code.activestate.com/recipes/578504-server-supporting-ipv4-and-ipv6/14:15
Chipacathat is a lot longer than it needs to be, also :)14:15
longsleepsure custom class is always possible14:15
longsleepi nowadays just use a simple go server instead14:15
Chipacayes... yes... embrace that feeling of compiled speed14:16
longsleepChipaca: i noticed that when implementing a workaround for bug #148040414:17
ubottubug 1480404 in webdm "Webdm open/manage links cannot handle https" [Critical,Confirmed] https://launchpad.net/bugs/148040414:17
longsleepthe snap now runs a redirecting web server to https, just a simple python script but that cannot do dual stack14:18
* ogra_ always uses a 50 line shell script for webservers :P14:34
ogra_just some bi-directional nc wrapping is enough for everyone !14:35
longsleepmhm that includes argument parsing with GET and HEAD support?14:36
ogra_sure14:36
longsleepi mean the python script i have currently has 74 lines14:36
ogra_http://paste.ubuntu.com/12763576/14:37
longsleepogra_: ok nice, here is what i use http://paste.ubuntu.com/12763590/14:38
ogra_misses curly brackets evereywhere :P14:38
longsleepyeah14:39
* ogra_ grins evil14:39
longsleepwe could do it with node - plenty curly there14:39
ogra_haha, yeah14:39
Chipacaogra_: what're the []'s around \r\n for?14:44
Chipacaogra_: in tr -d '[\r\n]'14:45
ogra_it removes linefeeds and returns14:45
Chipacayes14:45
Chipacabut what are the []s for14:45
Chipacaworks without 'em14:46
Chipacaafaict14:46
ogra_i think thats how it arrives in encoded stings14:46
ogra_(that code is like 2 years old ... i dont remember anymore)14:46
jdstrandogra_: hey, fyi, lp:~jdstrand/+junk/ufw-snap. see the readme.md file. to create a snap: make clean ; make snap. you'll need to adjust /etc/modules-load.d/something.conf to include iptable_filter and ip6table_filter until the feature is implemented in snappy config14:51
jdstrandogra_: it is only very lightly tested and I'm heading out for the rest of the day (US holiday), but it is there if you want to play with it14:52
ogra_jdstrand, no snapcraft ?14:52
jdstrandno, snapcraft doesn't handle --root with setup.py right yet14:53
jdstrandserguisens knows about it14:53
ogra_ah, python14:53
jdstrandit is nice having ufw on my snappy system though :)14:53
* jdstrand heads out14:54
jdstrandogra_: oh, if you are interested in trying it out and find a bug and feel like filing it, feel free to file it at lp:ufw15:07
=== bschaefer_ is now known as bschaefer
=== chihchun is now known as chihchun_afk
=== fginther is now known as fginther`
=== fginther` is now known as fginther

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