/srv/irclogs.ubuntu.com/2016/02/23/#snappy.txt

jtamHi, recently I am playing with snappy on raspberry pi, I want to use docker to run my application. while running the command 'docker run -d --device=/dev/ttyAMA0:/dev/ttyAMA0 --device=/dev/mem:/dev/mem --privileged -ti <name>', I got this error 'open /dev/bus: permission denied ', any ideas how to solve it?03:27
shuduoogra_: ping07:54
shuduoogra_: hi, i have asked you regarding OEM snap few days ago. Now I'm generating an oem snap and snappy image on xenial environment. I refer snappy-systems code and built out oem snap but u-d-f refused to generate snappy image with msg "kylin-oem/canonical-rockchip-kylin_1.0_all.snap failed to install: open /tmp/read-file931124659/unpack/DEBIAN/manifest: no such file or directory".07:58
shuduoand u-d-f refused eailer oem snap due to package.yaml can't be found. seems 15.04 use meta/package.yaml but 16.04 use meta/snap.yaml08:01
shuduoi copied snap.yaml to package.yaml to make u-d-f satisfied but stuck at DEBIAN/manifest. anything wrong I made?08:02
shuduoanyone help me for above issue?08:06
zygagood morning08:10
zygashuduo: OEM snaps are gone right? we have kernel (or platform really as it's more than the kernel), os snap (shared among all core devices) and gadget snap08:12
zygashuduo: OEM is the old name for what 16.04 calls the kernel snap08:12
shuduozyga: morning08:13
shuduozyga: is there a doc for how to port snappy 16.04 to a new platform I can read?08:13
zygashuduo: maybe, but I don't know of one, I'd start with raspberry pi as a learning device (to see how it's made) and then try to transplant bits and pieces to a different hardware08:14
zygashuduo: so get 16.04 gadget and kernel for pi208:15
zygashuduo: and see what's inside08:15
zygashuduo: make sure you can rebuild them08:15
zygashuduo: and iterate08:15
zyganoizer: hey08:16
zyganoizer: I wasn't around yesterday08:16
zyganoizer: I can help you out, I'd just prefer to do it in public here, as others can benefit, ok?08:16
noizerok08:18
shuduozyga: thanks. could you pls point me where I can download gadget and kernel snap of PI2?08:18
zygashuduo: I wish I can remember, gimme a sec08:19
shuduoand u-d-f command line parameters for 16.0408:19
shuduothanks08:19
zygashuduo: http://bazaar.launchpad.net/~snappy-dev/snappy-hub/snappy-systems/files08:19
zygashuduo: have a look at this, I haven't tried in a while but I think this is the right version08:20
zygashuduo: http://bazaar.launchpad.net/~snappy-dev/snappy-hub/snappy-systems/view/head:/pi2/meta/snap.yaml08:20
zygashuduo: this is the gadget snap08:20
zygashuduo: now the kernel... hmm08:21
noizerzyga how can i check that I did everything correct from the core?08:21
shuduozyga: yes, i read it and thought it's OEM snap08:21
zyganoizer: so what did you do so far?08:21
zygashuduo: this is a bad week to try this because of MWC and EW trade shows both allocating lots of people away from their normal work08:22
zygashuduo: but I'll try to find where the kernel lives08:22
zygadholbach: hey, do you know where the source for kernel snaps live? (pi2)08:22
dholbachgood morning08:22
dholbachhey zyga08:22
dholbachno idea - ppisati should probably know08:22
dholbachor ogra_08:23
zygadholbach: we should put this into the topic of the channel08:23
zygadholbach: a small wiki page with essential snapy hacker links08:23
zygadholbach: +1/-1?08:23
noizerI've done everything to the point of building08:23
zygadholbach: ogra is on EW, won't respond for a week08:23
noizerzyga that was the last thing I've done08:23
zyganoizer: ok cd $GOPATH/src/github.com/ubuntu-core/snappy/cmd/snap08:23
zyganoizer: go build08:23
zyganoizer: if that works you're 99% there08:23
noizerok done that08:24
zyganoizer: built fine?08:24
zyganoizer: you can try ./snap --help08:24
zyganoizer: just as a sanity check08:25
shuduozyga: or i can iterate 15.04 ... but make a few sense. :)08:25
zygashuduo: no, use 16.0408:25
noizerzyga that works fine08:25
zyganoizer: clone my devscripts somewhere please (github.com/zyga/devscripts)08:25
zygaer08:25
zygadevtools08:25
zygasorry08:25
zygahttp://github.com/zyga/devtools08:25
dholbachzyga, sounds good - feel free to add it to https://wiki.ubuntu.com/Snappy/08:26
zygadholbach: thanks, will do08:26
dholbachzyga, maybe on http://people.canonical.com/~ppisati/ somewhere?08:27
* dholbach shrugs08:27
zygadholbach: well, _maybe_ :D08:27
zygain that pile over there ;)08:27
zyganoizer: then make sure you have a compatible ssh config (look at the README.md file) -- you must be able to login to your device with ssh snappy-pi208:28
noizerzyga i've downloaded it08:28
zyganoizer: if not, tweak your ssh config08:28
zyganoizer: if you have to, build a new image (you can use the ubuntu-image script from the same repo to get one)08:28
zyganoizer: (just make sure to build a developer image with your ssh keys inside)08:28
zyganoizer: run the ubuntu-image script without arguments to do that08:28
noizerzyga ow does i need to build it on my rpi2 the snappy image?08:29
zyganoizer: nope08:29
noizerokey :D08:29
zyganoizer: on your usual computer08:29
noizerwhere does i need to set the config for my ssh then?08:29
zyganoizer: ~/.ssh/config08:30
zyganoizer: you have to be able to run 'ssh snappy-pi2' and login to your device without any prompts08:30
zyganoizer: https://github.com/zyga/devtools#ssh-configuration08:31
noizerthe ssh does need to changed on my rpi2 but what does needs to run on my rpi2?08:33
=== shuduo is now known as shuduo-afk
noizerzyga I don't understand it completely08:38
noizerWhere exactly does i need to change the ssh config file?08:40
noizeron my own device?08:40
zyganoizer: yes08:42
zyganoizer: everything I said so far happens on your host device08:42
noizerzyga ok busy with it08:43
zygakk08:43
zygappisati: hey, do you happen to know where the sources for kernel snap for pi2 are?08:44
ppisatizyga: i know where the source for the kernel are08:44
zygappisati: how are they built to a kernel snap?08:45
zygappisati: with snapcraft or manuall?08:45
zygamanually?08:45
ppisatizyga: i think still manually08:45
zygappisati: can you share that, I'm collecting the knowledge and I could use the links and simple instruction08:45
zygappisati: plus it will help me with my skills work08:45
ppisatizyga: ask mvo or sergiuns they are building these snaps08:46
zygaah, cool, will do, thanks08:46
noizerssh: Could not resolve hostname pi2-1.lan: Name or service not known08:46
zyganoizer: have you read what I wrote in the readme file?08:47
zyga"Put something similar to your ~/.ssh/config file. Do change bbb-1.lan and pi2-1.lan to an appropriate hostname (or IP address) that is valid in your setup."08:47
zygato quote ^^08:47
noizerauwtch lol08:47
noizerjust read it xD08:47
noizerdoes it need to be a raspberry pi with an os on it?08:48
zyganoizer: yes, build the OS with the ubuntu-image script first08:50
zyganoizer: copy it to an SD card (dd the whole image)08:50
zyganoizer: and boot your pi08:50
zyganoizer: make sure you can log in first08:50
zyganoizer: (1) flash (2) setup ssh and login (3) use refresh-bits.sh script to do other stuff08:50
noizerI need to make the devel image?08:52
zygayep08:52
zygato be able to log in without a password08:52
zygait just puts your public ssh key in ~ubuntu/.ssh/authorized_keys08:53
noizerzyga wait a minute just need to install some deps first08:55
noizerwtf i did make image and got very strange thing with my VM09:01
noizerzyga http://imgur.com/lKrYoEK09:16
zyganoizer: I have no idea what that is, maybe your machine is broken somehow09:22
noizerrebooted it and try again zyga :p09:24
noizerdammed the .ssh file not found09:26
zyganoizer: it is a directory, just create it09:27
noizerok09:27
zyganoizer: and make an ssh key09:28
zyganoizer: ssh-keygen -t rsa09:28
zygamvo: hey, can you please point me to the source of pi2 kernel snap09:30
zygamvo: and perhaps instructions on how to rebuild it09:30
zygadholbach: I've added a link to https://wiki.ubuntu.com/Snappy09:43
dholbachawesome :)09:43
mvozyga: here is the script that builds the kernel snap http://bazaar.launchpad.net/~mvo/snappy/mksnap-os-kernel/view/head:/mk-kernel-rpi2.sh - note that it get the actual kernelfrom  http://cdimage.ubuntu.com/ubuntu-core/daily-preinstalled/curren09:46
zygawoot, thanks mvo09:48
mvozyga: could you please re-merge your two pending branches with master? this should fix the integration test failures10:12
mvozyga: ups, three10:13
zygamvo: sure10:16
zygamvo: done, pushed now10:40
noizerzyga sorry for the delay but know i can ssh to my rpi2 with ssh snappy-pi211:06
noizerzyga what should i need to do now?11:06
noizeri did now ./refresh-bits.sh on my host computer11:07
zyganoizer: cool, so now you can do two things:11:11
zyganoizer: you can use refresh-bits.sh to push new snap, snappy and snapd11:12
zyganoizer: you can use setup and run-snapd to run snapd that you've built on the board11:12
zyganoizer: now what you want to do is to go to $GOPATH/src/github.com/ubuntu-core/snappy11:12
zyganoizer: and do this:11:12
zygagit remote add zyga https://github.com/zyga/snappy.git11:13
zyganoizer: git fetch zyga11:13
zyganoizer: git checkout zyga/skills-demo-i2c11:13
zyganoizer: with that you will have my development branch11:13
zyganoizer: then re-run refresh-bits with all arguments (setup snap snappy snapd run-snapd)11:13
zyganoizer: then ssh into the board and run sudo ./snap experimental11:14
zygaNOTE: ./snap not snap11:14
zyganoizer: then you should be good to go for the next step11:14
zyganoizer: you should see a bunch of extra commands for working with skills11:15
noizersomething goes wrong :s will send you what I done11:16
noizerhttp://pastebin.com/mWdaGdAx11:17
noizerzyga11:17
zyganoizer: refresh-bits.sh --pi211:19
zyganoizer: use --pi2 to work against a raspberry pi11:20
zyganoizer: by default it tries to talk to a VM running localy11:20
zygalocally11:20
noizerok that worked11:20
=== joc|away is now known as joc_
zyganoizer: now you can add an i2c skill using:11:21
noizerthe snap file where is it on my rpi2?11:22
zyganoizer: in ~/11:22
noizerbecause you said I need to do sudo ./snap11:22
zyganoizer: in the home directory of the ubuntu user11:22
noizerooh ok xD11:22
zyganoizer: refresh bits copies it11:22
noizerist need to be in /home/ubuntu?11:23
zyganoizer: ?11:23
noizerthe snap file to execute ./snap11:24
noizeron my rpi211:24
zyganoizer: if it's not then refresh-bits didn't work11:24
zyganoizer: read the code of refresh bits11:24
zyganoizer: it just copies it there11:24
zygasudo ./snap experimental add-skill ubuntu-core i2c i2c --label="I2C controller" -a device=i2c-111:25
zyganoizer: ^^ this should add the i2c skill to the ubuntu-core snap11:26
zyganoizer: now you need something that wants to use this skill11:26
zyganoizer: ping me with more details once you have that11:26
noizerzyga just it wont copy it http://pastebin.com/Fus2JEH011:26
zyganoizer: you have to use --pi2 with other arguments11:28
zyganoizer: ./refresh-bits.sh --pi2 snap snappy snapd setup run-snapd11:29
zyganoizer: :)11:29
noizerhaha fail fromme xD11:29
noizerweird he does not find go11:32
zygamvo, fgimenez: do you think that https://github.com/ubuntu-core/snappy/pull/478 failure is related to the change in the branch or is that some kind of fluke11:32
fgimenezzyga, mvo it seems to be the same as http://pastebin.ubuntu.com/15126149/, not related to the changes in the branch IMO11:33
zygafgimenez: thanks11:34
mvofgimenez: aha, thanks11:34
fgimenezmvo, zyga i'll try to check if the sync call before installing the snaps mitigates it, otherwise i'm totally lost with this one, no idea where can it come from11:36
zygafgimenez: I wonder how two other branches I refreshed at the same time made it11:38
zygafgimenez: maybe one of the jenkins slaves is just odd11:39
zygafgimenez: integration tests passed elsewhere11:39
noizerzyga got the following error :s http://pastebin.com/W5QyLwru11:39
fgimenezzyga, yes it's random, in fact the tests are executed in pristine cloud instances, they should be the same for all the executions, the slaves are not involved in the results once the testbeds are up11:40
zygafgimenez: then I have no idea what might be the cause11:40
zyganoizer: you need to install cross toolchain: https://github.com/ubuntu-core/snappy/blob/master/docs/cross-build.md11:41
zyganoizer: just the sudo parts there, the rest is handled by the script11:41
fgimenezzyga, we have also this one http://paste.ubuntu.com/15169442/ which is randomly failing too, maybe they are related, both fail trying to install a snap from the filesystem, one of them doesn't find snap.yaml and the other find it full of '\x00'11:41
zygammmm11:43
zygamaybe a race that's unfortunate somewhere11:43
zygafgimenez: how long have you been seeing those?11:43
fgimenezzyga, since last thursday i think11:44
beunojdstrand, ack, will do11:57
pindongajdstrand, hi there.. I'll do the deploy today12:28
noizerzyga ok everything is done xD12:30
noizerSo now I can acces and read the value of my gpio?12:30
noizerzyga can i use snapcraft then again for building my snap with you skill?12:58
zyganoizer: you can build a snap but don't use the skills syntax yet, it's not allowed for now, you can just add the skill (and skill slot) after the snap is installed13:09
zyganoizer: please look at the bool-file skill13:09
zyganoizer: snap experimental add-skill13:09
zygathe skill can live on the ubuntu-core snap, it's not important13:10
zyganoizer: the skill slot (the thing that actually uses it) needs to be on your snap13:10
zyganoizer: that's snap experimental add-skill-slot13:10
zyganoizer: bool-file needs the "path" attribute -a path=/sys/class/gpio/gpio123/value13:11
zyganoizer: then you need to grant the skill (snap grant)13:11
zyganoizer: and then snap experimental apply-skill-security13:11
zyganoizer: then you can inspect the state of the system13:11
zyganoizer: more in a moment13:11
ysionneauhttp://pastebin.com/yPELZ2Bi < any idea why I get an error on this package.yaml?14:22
ysionneau(I'm using snapcraft 1.0.2, snappy 15.04)14:22
zygaysionneau: looks like last line needs to change14:49
zygaI don't remember the 15.04 syntax though14:50
zygalook at some examples from snapcraft sources14:50
ysionneauyes that's what I did14:51
ysionneauhttp://bazaar.launchpad.net/~snappy-dev/snappy-hub/snappy-examples/view/83/hello-world/meta/package.yaml14:51
ysionneaubut, I kind of get it now14:52
ysionneauthose file need to exist before building?14:52
ysionneauhow can I do the same for binaries generated by the build?14:52
zygano, they don't have to exist, I think14:53
zygaysionneau: notice that there "binaries" is a list of objects14:54
zygaysionneau: so try "- hello:\n\tname: hello"14:55
zygaysionneau: so that "hello" is the binary14:55
ysionneauhummm :o14:59
ysionneauyou mean14:59
ysionneaubinaries:\n\tname: hello15:00
ysionneau?15:00
zygano15:01
zygatry what I said15:01
zygabiaries:15:01
zyga  - hello:15:01
zyga    name: hello15:02
zyga(perhaps more indent)15:02
ysionneauIssues while validating snapcraft.yaml: [{'hello': None, 'name': 'hello'}] is not of type 'object'15:02
zygathe error you got was essentially that your binary was not a python dict, you have to make the yaml look right, so that each binary is a python dict/javascript/json object15:02
ysionneauoh15:02
zygacan you pastebin the snapcraft yaml again15:03
ysionneauyes15:03
ysionneauhttp://pastebin.com/mkU1nFXc15:03
zygahmmm15:06
zygamaybe the syntax changed again, ask sergio when he's around15:06
ysionneauack15:06
ysionneauthanks! :)15:06
zygaI know how it works in 16.0415:06
zygaI don't remember 15.0415:06
ysionneauno problem15:06
zyga(BTW: Try 16.04 instead if you can)15:06
ysionneaufor now I prefer to stay on 15.0415:06
noizerzyga I've build my snap again. but now how can i add the skill to it?15:08
zyganoizer: currently only at runtime, I'm working on reading those from the snap.yaml file15:09
zyganoizer: have a look at some of my notes for a quick idea:15:09
zyga# Add skills, grant and apply15:09
zygasudo ./snap experimental add-skill ubuntu-core i2c i2c --label="I2C controller" -a device=i2c-115:09
zygasudo ./snap experimental add-skill-slot pi2-piglow i2c i2c --label="I2C controller connected to piglow" --app=foreground --app=background15:10
zygasudo ./snap grant ubuntu-core:i2c pi2-piglow:i2c15:10
zygasudo ./snap experimental apply-skill-security pi2-piglow15:10
zyganoizer: this works with this snap: http://github.com/zyga/snappy-pi2-piglow15:10
noizerok thx15:10
zyganoizer: explore each of those commands with --help to understand what's going on15:10
noizerok15:11
zyganoizer: you can also fetch the code of that snap I just linked to, enable classic mode on your pi, install git and snapcraft and build it there15:11
zyganoizer: the snap is specific to piglow but the parts that deal with i2c are generic15:11
zyganoizer: and you should be able to see what's going on15:11
zyganoizer: note that in my branch, skills are not persistent yet so after you reboot the device they are gone15:12
zyganoizer: but apply-skill-security is persistent15:12
zyganoizer: though this will all change to just work as soon as some prerequisites land in 16.0415:12
zyganoizer: so all the hackery won't be needed15:12
noizerok first i will try it with my snap ist just checking the value's from the gpio's15:13
=== morphis_ is now known as morphis
jdstrandsergiusens: hi! I was going to attach a suggested diff to bug #1546821, but see you may be working on it already. here is what I was thinking: http://paste.ubuntu.com/15182501/19:00
ubottubug 1546821 in Snapcraft "please add -all-root and -no-xattrs to mksquashfs options" [Wishlist,Triaged] https://launchpad.net/bugs/154682119:00
jdstrandsergiusens: adjust as necessary and thanks for working on it19:00
jdstrandsergiusens: I've got a review tools update that will require squashes be created in this manner that I'll what on until there is a new snapcraft19:01
jdstrands/what/wait/19:01
sergiusensjdstrand, thanks! the -all-root I have been procastinating on, you just pushed me to get it done ;-)19:13
jdstrand:)19:13
sergiusensjdstrand, https://github.com/ubuntu-core/snapcraft/pull/33419:26
jdstrandthanks19:32
jdstrandpindonga: hey, so, fyi, r594 and below is ok to pull. r595 you can pull, but the tools will add a 'warn'ing until the machine running the tools has a squashfs-tools that supports -fstime19:51
pindongajdstrand, I bumped to 592 today19:51
jdstrandok that's fine19:51
pindongabut deploy didn'th appen yet19:51
pindongabc no webops coverage19:52
pindongaso might happen tomorrow19:52
pindongaI can bump to 594/5 if you like19:52
jdstrandpindonga: but that brings up the question-- how do we get an updated squashfs-tools on the system running review tools?19:52
jdstrandpindonga: (593 and 594 aren't worth an update, they can come with 595+)19:53
pindongait should be picked up automatically during the next rollout I believe, bc afaict we don't have it pinned19:53
pindongabut follow whatever's there in the distro19:53
jdstrandpindonga: what is that machine running? 14.04?19:53
pindongayep19:53
pindongaand will do so for the foreseeable future19:53
jdstrandsure19:53
pindonga:)19:54
jdstrandpindonga: does it pull from any other sources?19:54
pindongadeb source?19:54
sergiusenselopio, you might need to rebase https://github.com/ubuntu-core/snapcraft/pull/32619:54
jdstrandtrying to decide if I need to do an SRU or if this can be an internal thing19:54
pindongajdstrand, I think we can have some cat19:54
pindongarepo19:54
jdstrandpindonga: no, like internal IS archives19:54
pindongajdstrand, right, so a trusty-cat should work right?19:55
pindongajdstrand, let's get 592 out of the way first (bc the changeset is quite big already)19:55
jdstrandpindonga: that is what I was thinking, but I've not done this sort of thing19:55
=== blr_ is now known as blr
jdstrandpindonga: yes, please push 592 outside of this19:55
pindongaand then we'll see how to get squashfs-tools updated + newer revnos19:55
pindongabut I think trusty-cat should work19:55
jdstrandok, let me talk to some folks19:56
jdstrandand I'll see how I can get a trusty-cat going19:56
pindongajdstrand, ok, yes, we got trusty-cat available20:00
pindongaso if you can land there, it should be "easy" to get it installed20:01
jdstrandok, thanks. talking to IS20:01
pindongajdstrand, which version do we need?20:08
sergiusensjdstrand, I can swear I saw a comment from you here https://github.com/ubuntu-core/snapcraft/pull/33420:47
sergiusenscamako, https://bugs.launchpad.net/snapcraft/+bug/1541620/comments/421:57
ubottuLaunchpad bug 1541620 in Snapcraft "snapcraft can't find modules installed under 'stage' dir" [Medium,Triaged]21:57
sergiusenscamako, sorry for taking so long; but it seems you are just missing a stage-package in there21:57
sergiusenscamako, also, this may mean the server needs a dep against the client-dev21:58
jdstrandsergiusens: I did make one :)22:17
jdstrandI don't know where it went...22:18
jdstrandI re-acked it just now22:19
jdstrandpindonga: ok, based on conversations with is, I'm pursuing an SRU. I'd probably want to anyway so this seems fastest overall.22:19
jdstrandpindonga: fyi, bug #154898822:20
ubottubug 1548988 in squashfs-tools (Ubuntu Trusty) "please add -fstime patch for snap v2 checks in review tools" [Undecided,In progress] https://launchpad.net/bugs/154898822:20
=== Abhishek_ is now known as Abhishek
=== Abhishek is now known as Abhishek_
=== heath_ is now known as heath

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