/srv/irclogs.ubuntu.com/2016/01/06/#snappy.txt

=== shuduo-afk is now known as shuduo
=== chihchun_afk is now known as chihchun
dholbachgood morning07:49
stevebiscuitChipaca, mvo: if I build the snapd binary, is there an easy way of getting it running on a snappy VM?08:26
mvostevebiscuit: yes, for some definition of "easy". Chipaca has the details, it should be a matter of just building and scp to the snappy system $HOME and starting it here. However I have not done this yet, I can give it a quick try. you could even do the development on snappy itself from the classic environment. let me quickly try if my suggestion actually works08:29
stevebiscuitmvo: I've tried killing off the running snapd and then running the scp'd one but it gives me "error: daemon does not handle 0 listeners right now, just one" which is do with systemd from my reading of the code08:35
mvostevebiscuit: ok, this is actually slightly more complicated, I get the same. here is what you need to do:08:35
mvostevebiscuit: sudo systemctl stop ubuntu-snappy.snapd.service ubuntu-snappy.snapd.socket08:36
mvostevebiscuit: sudo /lib/systemd/systemd-activate -l /run/snapd.socket ./snapd08:36
stevebiscuitmvo: that works a treat, cheers!08:41
mvostevebiscuit: great! https://github.com/ubuntu-core/snappy/pull/291 so that this is easier to find in the future08:46
liuxgChipaca, ping09:01
asacsergiusens: is it right that its odd that if i have a typo in snapcraft python code like referencing an non existing var09:58
asacthat it just bails with the error but no indication of line number etc.?09:58
asacor is that normal for python?09:59
* asac feels like being in debugging stoneage when hacking on snapcraft etc.09:59
sergiusensasac, it is not normal, just user friendly, for devel I recommend you change one thing10:00
sergiusensasac, either remove try/except here or change sys.exit to raise e10:01
sergiusensasac, I'll add an envvar there so you can devel easier10:02
sergiusensChipaca, hey, mind doing a review?10:25
Chipacasergiusens: REVIEWS FOR THE REVIEW GOD10:26
Chipacasergiusens: but she's busy, so I guess I'll do them instead10:26
sergiusensChipaca, https://github.com/ubuntu-core/snapcraft/pull/20110:26
sergiusensChipaca, just the semantics for license keywords if you don't want to check code10:27
Chipacasergiusens: reviewed10:28
Chipacasergiusens: you dun good10:29
asacsergiusens: user friendly?10:31
sergiusensasac, end user; someone not introducing new code but using the tool10:36
sergiusensChipaca, thanks10:36
asacsergiusens: ok, just couldnt see how not printing line number faults on error could help someone10:40
asaci would think best case someone using tool wont see errors10:40
asacbut if he does he probably would want to have something useful to bug report10:40
asacbut maybe i am missing some error cases where this would help10:41
=== chihchun is now known as chihchun_afk
asacsergiusens: anyway, env paired with entry in hacking.md etc. would be good (not that i read hacking.md, but at least i would have done that next i think)10:52
asacsergiusens: thoughts on https://gist.github.com/asac/d66ecdbb286e4a60269e11:01
asacthanks11:01
asac(note its not complete=11:01
asacnot sure about run_raw... but i couldnt figure better way11:02
asacmvo: are there changes to snappy config protocol coming on master branch or do we stick to current approach for now?11:10
breiwhen I build a snap with snapcraft, not every file from the stage is copied to the snap folder. What are the filter criterias?11:39
=== chihchun_afk is now known as chihchun
asackickinz1: so downloading i386 vs. amd64 docker-latest from https://docs.docker.com/engine/installation/binaries/ ... i see that the i386 is 7.X M and the amd64 is like 30M+ ?11:58
asacdoes that make sense?11:58
kickinz1asac: for me seems like i386 is only client side docker.11:58
asackickinz1: like http://paste.ubuntu.com/14419442/11:58
asac1.6 is 15M... latest is 30M11:59
asaceven for 6411:59
* asac scratches head11:59
kickinz1asac, there has been a lot of changes between 1.6 and 1.8-1.9 series (with arch support breakage).12:00
asackickinz1: how do you check if a docker binary has just client?12:00
kickinz1You can try running it as a daemon, 'docker daemon' or 'docker -d' for prev 1.812:01
kickinz1asac ^12:01
sergiusensasac, looks good, just not so sure about raw_config12:02
asackickinz1: i moved to a different machien... do you have the link again :)?12:07
asacerr12:07
asacsergiusens: ^12:07
asacsorry kickinz112:07
asacthank kickinz1 ... seems that latest is busted i guess upstream12:07
kickinz1asac:  https://docs.docker.com/engine/installation/binaries/12:09
asacright wrong ping :)12:09
kickinz1asac: docker just support amd64 arch, so all other arches are client only iirc12:09
asacsergiusens: nevermind... found that github has history for me12:10
asacsergiusens: there is no raw_config ... just run_raw12:10
asacsergiusens: what i need to run is "yes" "" | make oldconfig12:10
sergiusensasac, good, because I have no idea what you were talking about wrt docker12:10
kickinz1asac, there are patches and an un-upstream way to build it that allow other arches to work.12:10
asaci couldnt figure how to do that with existing run methods12:11
asacsergiusens: ignore docker :)12:11
asacsergiusens: just the gist12:11
sergiusensasac, yeah, run_raw is what I meant, sorry12:11
asacsergiusens: yeah. so no ideas how to do it different?  e.g. good?12:12
* asac finishes the patch and then thinks about tests12:13
sergiusensasac, I'm mostly sure you can implement run with what you have in run_raw12:16
sergiusensasac, btw https://gist.github.com/asac/d66ecdbb286e4a60269e#file-kbuild-diff-L56 your assert message is wrong here12:16
sergiusensasac, but I don't mind either way, this whole run thing is waiting for a refactor since forever12:17
sergiusensasac, the only thing missing in your diff are unit tests ;-)12:18
asacright. have to add one more featuure to allow starting with the kconfigfile instead of defconfig12:19
asacthen will think about tests12:19
asacbut i am very illeterate onthat,, so might need hand holding12:19
asacsergiusens: you think using an argument raw=False for run in __init__.py (avoiding a dupe in that file) would be good?12:22
asacoir should i rather just leave it to the refactor master?12:22
kyrofaGood morning12:24
asachey kyrofa12:25
kyrofaGood morning again now that my internet is working12:35
sergiusensasac, I mean, the `exec $*` in regular run might as well be what you have in raw12:40
sergiusenskyrofa, ah, that explains the absence :-P12:40
sergiusensgood morning12:40
kyrofasergiusens, hey :P12:41
kyrofaGahhh sergiusens the yaml tests sent me for a loop this morning13:27
kyrofapatcher = unittest.mock.patch('os.path.exists')13:27
kyrofa        mock_wrap_exe = patcher.start()13:27
kyrofa        mock_wrap_exe.return_value = True13:27
kyrofa^^ didn't see that13:27
kyrofasergiusens, I was starting to add debug prints to /usr/lib/python3.4/os.py :P13:28
sergiusenskyrofa, yeah, patching can do this sometimes13:50
asacsergiusens: right. i kind of sensed there is something in here... guess having exec nicely takes over the process and hides the parent shell hack for env14:02
asacsergiusens: on that, do you know why the initial code does not set the env through the python call_14:02
asac?14:02
asacnot complaining for my case, just wondered if python doesnt have easy way to just pump env to the command it runs14:02
asacbah... out of all the skills i have, i seem to be not smart enough to login to my local all snaps kvm using ssh -p XXXX ubuntu@localhost14:04
sergiusensasac, I inherited like this; I don't know14:04
asaclet me reboot to latest .... maybe the dev 17 image is buggy on this, but i thought i managed to log in at some point14:05
sergiusensasac, all the env management still needs some work so actually use keys instead of a list14:05
asacsergiusens: does ssh to all snap kvm work for you?14:07
asacinterestingly all host keys are 0 size... guess i know what might have happened ... i killed the first boot when it generated stuff14:11
* asac redoes image14:12
asacdo we crewate those keys using cloud-init still?14:13
* asac wonders where to file bug in case this is the prob14:13
sergiusensasac, yes, still with cloud-init14:14
asacjdstrand: * adjust program to not use 'setgid' until per-snap user/groups are supported14:17
asacjdstrand: could we reference a tracking bug for that feature in the comment (though very nice guidance here)14:18
asacthats with snappy-debug.security scanlog14:18
jdstrandasac: sure14:19
sergiusenselopio, bumper https://github.com/ubuntu-core/snapcraft/pull/20114:23
asacjdstrand: do you remember why busybox did use setgid on everything?14:24
enoch85kyrofa, hey! shall we continue? :)14:24
asaci remember we looked at the code a while back14:24
asacfor the hello-world.sh thingy14:24
kyrofaHey enoch85 :) . I have a meeting here in a minute, let me ping you14:24
enoch85kyrofa, okay! :)14:25
* asac tries to disable SUID14:28
kyrofasergiusens, elopio sorry guys... internet is flaking14:32
sergiusenskyrofa, we can wait14:33
asacjdstrand: nevermind... i fixed a config in build system to not support suid of bb and now it works \o/14:33
jdstrandasac: I don't, however bash can be used for hello-world.sh these days14:33
jdstrand(just fyi)14:34
asacyeah14:38
asacseems bizbox has a feature called CONFIG_FEATURE_SUID... i disabled it and now its fun14:38
asacsergiusens: is stage a no-op these days? seems that stage happens for each part during build?14:39
asacsergiusens: is there a wildcard feature for binaries? i would like to add all that is in stage/bin/ as binaries without having to keep them in sync14:59
sergiusensasac, you can use directories in your 'snap' directive15:02
sergiusensasac, stage is more complex in 2.x; it takes into account the dependencies (1.x is broken in this regard)15:03
sergiusensjdstrand, hey; is there a reason why I can't have spaces in my start keyword?15:07
sergiusensjdstrand, without allowing that I have to resort to things like this https://github.com/ubuntu-core/snapcraft/blob/master/examples/shout/snapcraft.yaml#L915:07
sergiusensjdstrand, with a wrapper script that only does https://github.com/ubuntu-core/snapcraft/blob/master/examples/shout/shout.sh15:07
jdstrandsergiusens: are you saying you want to put the contents of the shout.sh script in 'start' in the yaml?15:09
sergiusensjdstrand, I want to be able to write 'start: shout --home $SNAP_APP_DATA_PATH'15:10
jdstrandright15:10
sergiusensjdstrand, ah, '$' is also not allowed15:10
jdstrandso, 'start' is not used with the APP_ID since in this example the app id is shout_server_0.52.015:11
jdstrandso, I think this is to make sure that the systemd file is sane15:12
sergiusensjdstrand, I don't follow15:12
jdstrandwhat is in 'start' ends up in ExecStart in the systemd service15:13
sergiusensjdstrand, correct, and I'm using SNAP_APP_DATA_PATH, no APP_ID15:14
sergiusensnot*15:14
jdstrandwe need to be careful with ExecStart, since a crafted 'start' could run commands outside of confinement15:15
sergiusensjdstrand, so basically if I need switches or envvars I need to resort to wrapper scripts?15:16
jdstrandif we make the review tools and snappy not allow ';', perhaps we could allow arguments to start15:16
jdstrandI wasn't talking about env vars15:17
sergiusensjdstrand, that sounds reasonable15:17
jdstrandI would assume that if the unit properly set SNAP_APP_DATA_PATH then whatever was in ExecStart would see it15:17
sergiusensjdstrand, just asking since it is not allowed, spaces either iirc15:18
sergiusensif it is just because of a ; then I hope we can just block offenders15:19
sergiusensjdstrand, no rush though15:19
jdstrandif someone were to expand this in the manner you would like, we would have to proceed very carefully, because that would be an avenue of attack for a malicious app developer15:19
sergiusensjdstrand, yeah, that's why I say no rush :-)15:19
jdstrandhistorically, I feel like 'start' was used as part of the app id. ie, if 'name' was not specified or something15:20
jdstrandif start is not part of the app id ever any more, then allowing arguments would seem to make sense (if done carefully)15:21
sergiusensjdstrand, so appids are now uuids, right?15:22
sergiusensChipaca, ? ^15:22
sergiusenswell """now""" (many air quotes)15:22
jdstrandsergiusens: no, not in my current understanding. the app id is today as always. what we are moving to is uuid_appname_revision15:23
jdstrandsergiusens: where appname the 'name' in the yaml15:24
jdstrandfor a service/binary15:24
jdstrandso pkgname goes to uuid and version goes to revision15:24
jdstrandbut appname stays the same15:24
sergiusensjdstrand, right, pkgname is snap-id basically which is a uuid15:25
* jdstrand nods15:26
sergiusensjdstrand, another thought is that the only envvars that can be used in a service are those exported in the service itself and we control that (snappy)15:27
jdstrandsergiusens: I thought that is more or less what systemd is doing with Environment15:36
elopioping stgraber: I was trying to get a xenial lxc in travis to run the snapcraft tests, but it doesn't have network access:15:41
elopiohttps://travis-ci.org/ubuntu-core/snapcraft/builds/10052300015:41
elopiocan you help me here?15:41
kyrofaenoch85, today may not work very well... I seem to be having some internet connectivity issues15:46
stgraberelopio: it may just be a timing thing, that is, your container doesn't have an IP address yet15:46
elopiostgraber: mmm, I'll add a sleep to check.15:46
kyrofaenoch85, but I do plan on working on that .snap today15:47
enoch85kyrofa, ok, feel free to work on the apache snap whenever you want. It's above my skill set anyway, so I feel I can't contribute.15:47
stgraberelopio: I'm also very surprised that you're able to install and run lxd in what looks like Travis' docker based environment. I thought they restricted what package and repositories you could install to prevent getting their whole infrastructure to be taken over15:47
enoch85kyrofa, I'm available all day. Just ping me. :)15:47
kyrofaenoch85, very good. I'll make sure to walk you through wha tI've done :)15:47
elopiostgraber: this is not a docker container. This is a trusty machine in google compute.15:47
stgraberelopio: oh, interesting, I didn't know they supported that15:48
elopiostgraber: it's been working for a couple of months. It's nice, but now we need xenial.15:49
enoch85kyrofa, sounds good :)15:49
kyrofaenoch85, sorry about that. I just keep dropping today :(15:50
enoch85kyrofa, np mate. get a better line :) ;)15:51
kyrofaI wish15:51
enoch85kyrofa, anyway, no stress.15:51
enoch85kyrofa, need to be done by the 20:th, so there is plenty of time15:52
kyrofaenoch85, alright sounds good :)15:52
=== chihchun is now known as chihchun_afk
elopiostgraber: no luck. After the sleep it still can't ping anything.16:33
stgraberelopio: might be worth running ifconfig inside the container and outside of it, just to check if things look sane16:38
elopiostgraber: ok, it'll take some minutes. Travis is slow today...16:39
sergiusenskyrofa, elopio I'll bbl in case someone pings me16:39
kyrofasergiusens, alrighty16:40
kyrofaelopio, mind taking a look at https://github.com/ubuntu-core/snapcraft/pull/204 ?17:04
elopiostgraber: the host shows lxcbr0. The container shows nothing:17:23
elopiohttp://pastebin.ubuntu.com/14422058/17:23
elopiokyrofa: let me see.17:23
elopiokyrofa: what about an example test for this change?17:24
kyrofaelopio, what does that mean in snapcraft? Something that exercises this in snapcraft/examples?17:28
stgraberelopio: what's your travis.yml?17:30
elopiokyrofa: yes. Like a real world example that uses the new code.17:30
stgraberelopio: the behavior you're getting would be consistent with having an older version of lxc, or lack of lxcfs or systemd being unhappy in the container17:30
elopiostgraber: https://github.com/elopio/snapcraft/blob/lxd/.travis.yml17:31
elopiostgraber: I'm getting it from the lxd-stable ppa.17:31
kyrofaelopio, alright I'll throw something together :)17:31
elopiokyrofa: thank you.17:31
stgraberelopio: ok, add a "sudo apt-get dist-upgrade -y" after the apt-get update and add "lxcfs" on the apt-get install line, just in case travis runs with recommends disabled by default.17:32
* elopio tries.17:32
stgraberelopio: and add a "lxc exec xenial -- ps faux" too so we can see what's running in the container17:32
kyrofaelopio, do I also add the new example to TestSnapcraftExamples ?17:36
elopiokyrofa: to build it, yes. I'm guessing that it will require manual inspection to check that it works ok, am I right?17:36
kyrofaelopio, ah, yeah this is a runtime fix, not build17:37
elopiowe might need to add a manual_tests dir, like in snappy.17:37
kyrofaelopio, and we're not running runtime tests, right?17:37
elopiokyrofa: we can from xenial, so just let me finish this PR and there will be automated runtime tests.17:38
elopiokyrofa: but I'm wondering is how to confirm that your example works ok automatically. Well, I better wait to see the example.17:39
kyrofaelopio, yeah, basically without this fix it fails to run since it can't link up with libgl. But it builds fine. With the fix it links and runs successfully17:40
elopiokyrofa: ok, so we can at least check that it doesn't return an error. For now leave it with the build test, and soon we'll start adding runtime tests for the examples.17:41
kyrofaelopio, good deal, adding now17:41
kyrofaelopio, alright, take another look at that PR for the example18:07
elopiostgraber: it pinged!18:09
elopiokyrofa: are you in a hurry, or can I go and get something to eat first?18:09
stgrabercool, so it was either an old pre-installed lxc or missing lxcfs18:09
kyrofaelopio, I'd like to get this merged today just so I can prepare the release, but my EOD is a few hours away yet18:09
kyrofaelopio, I'd never stand between you and food ;)18:10
elopiokyrofa: let me better review it first. Otherwise I'll keep thinking of you during lunch :p18:11
kyrofaelopio, hahaha18:11
kyrofaelopio, fortunately I don't think it could be simpler18:12
elopioyes, looks good. I like that we now have an opencv example!18:13
kyrofaelopio, awesome!18:13
elopiostgraber: is there a fancy way to wait for the ip? The sleep is making my nice script ugly.18:54
stgraberelopio: not a very nice one, but there is nicer than just a big sleep, yeah18:55
stgraberwhile ! lxc info tryit | grep -q eth0.*IPV4; do18:55
stgraber    sleep 5s18:55
stgraberdone18:55
stgraberreplace tryit by your container name18:55
elopiothanks!18:56
elopio-18:56
kyrofasergiusens, is the fix to bug #1530995 to chmod before running, or run with sh?20:32
ubottubug 1530995 in Snapcraft "Snapcraft requires autogen.sh to be executable" [Medium,Triaged] https://launchpad.net/bugs/153099520:32
kyrofasergiusens, which is the safer assumption-- we have permission to chmod, or it's actually using sh and not bash or something?20:33
=== joachim is now known as Guest60026
asacsergiusens: by default all files from stage/ go to snap/ right?20:51
* asac about to hit send on answer on ML20:51
asacdamage done :=20:57
=== cprov_ is now known as cprov
sergiusensasac, answer is yes22:08

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