Merge lp:~mvo/snappy/snappy-snapfs-mount into lp:~snappy-dev/snappy/snappy-moved-to-github
| Status: | Needs review |
|---|---|
| Proposed branch: | lp:~mvo/snappy/snappy-snapfs-mount |
| Merge into: | lp:~snappy-dev/snappy/snappy-moved-to-github |
| Prerequisite: | lp:~mvo/snappy/snappy-snapfs-install-via-unpack |
| Diff against target: |
948 lines (+411/-134) 11 files modified
debian/ubuntu-snappy-cli.dirs (+1/-0) dirs/dirs.go (+2/-0) pkg/clickdeb/deb.go (+29/-23) pkg/file.go (+81/-0) pkg/snapfs/snapfs.go (+47/-22) pkg/snapfs/snapfs_test.go (+0/-9) snappy/pkgformat.go (+0/-64) snappy/snapp.go (+73/-5) snappy/snapp_snapfs_test.go (+93/-11) systemd/systemd.go (+46/-0) systemd/systemd_test.go (+39/-0) |
| To merge this branch: | bzr merge lp:~mvo/snappy/snappy-snapfs-mount |
| Related bugs: |
| Reviewer | Review Type | Date Requested | Status |
|---|---|---|---|
| Gustavo Niemeyer | Approve on 2015-10-20 | ||
| John Lenton | 2015-10-08 | Approve on 2015-10-19 | |
|
Review via email:
|
|||
Description of the Change
Add support to (auto)mount the snapfs based snaps. It will unpack the meta-data to disk (to speedup snappy list etc) but keep the rest in the squashfs blob and (auto)mount at runtime.
This is a bit of a RFC branch, I'm not yet super happy about it. It will put the blob into
/apps/
and will mount that to:
/apps/
The downside of this approach is of course that the binary/service paths of the deb backend and the squashfs backend are no longer identical which makes the code that writes that a bit ugly.
I think we have three option and would love to get feedback which one is best:
1. keep it like its done in this branch given and cleanup once the clickdeb backend is killed
2. change deb backend to write the actual (non-meta) data to "run/" as well
3. put the blob.snap as "/apps/
(which complicates the removal a bit because its no longer enough to just rm -rf the /apps/$pkg/$version dir)
| John Lenton (chipaca) wrote : | # |
| John Lenton (chipaca) wrote : | # |
*/var/lib/
A small complication of remove and purge, but other than that it'd work, right?
| Michael Vogt (mvo) wrote : | # |
Thanks John! So with /var/lib/
| John Lenton (chipaca) wrote : | # |
I think it might be. Let me tinker with list a bit tomorrow -- i think it can be made to work without loading package.yaml's.
| John Lenton (chipaca) wrote : | # |
Tinkered now instead.
To make list not load package.yaml's, you'd need to
* move it to husks, or to the rest api. Latter needs doing anyway; former would be short-term quick if needed.
* add a concreter that knew about squashfs:
- `IsInstalled` checks for presence of blob instead of package.yaml
- `Load` loaded a RemoteSnapPart from the locally-stored remote manifest. Would be missing InstalledSize, which list doesn't output. Would probably mean moving RemoteSnapPart to its own package (\o/)
If doing it via the REST API, /1.0/packages would need to recover the ?sources=local option, and an additional flag to tell it to do things this way. Piece of cake.
So, I'd suggest do it the clean way, mounting to /$type/$name/$ver (i think we agree it's the clean way?). Then we benchmark and decide whether to do the above now, or later.
HTH,
- 754. By Michael Vogt on 2015-10-16
-
merged lp:snappy
- 755. By Michael Vogt on 2015-10-16
-
refactor and get rid of runPrefix
| Michael Vogt (mvo) wrote : | # |
Thanks, I pondered over this too and I like the approach of /var/lib/
- 756. By Michael Vogt on 2015-10-16
-
ensure removal removes the snapfs and refactor
- 757. By Michael Vogt on 2015-10-16
-
update comments
- 758. By Michael Vogt on 2015-10-16
-
unmount after deactivate
| Michael Vogt (mvo) wrote : | # |
A new look would be welcome :)
- 759. By Michael Vogt on 2015-10-16
-
improve comments
| John Lenton (chipaca) wrote : | # |
Some comments.
Need to iterate the review a little.
| Sergio Schvezov (sergiusens) wrote : | # |
I can't beat Chipaca on reviews but I did manage to add a bite of a comment that is not a problem today but will avoid headaches later. It is an 'if you want to do this' type of comment.
Good work
- 760. By Michael Vogt on 2015-10-16
-
address review comments
- 761. By Michael Vogt on 2015-10-16
-
refactor and ove MountUnit handling to systemd package
- 762. By Michael Vogt on 2015-10-16
-
add more tests
- 763. By Michael Vogt on 2015-10-16
-
add comment about little endian squashfs
| Michael Vogt (mvo) wrote : | # |
Thanks for the review! I addressed the comemnts, please let me know if its sufficient.
- 764. By Michael Vogt on 2015-10-16
-
pkg/snapfs/
snapfs. go: use filepath.Clean() in BlobPath
| Michael Vogt (mvo) wrote : | # |
Thanks! Adressing more stuff.
| Gustavo Niemeyer (niemeyer) wrote : | # |
I'm adding a few comments below. Please feel free to merge this once you're personally happy about it.
- 765. By Michael Vogt on 2015-10-20
-
merged lp:snappy
- 766. By Michael Vogt on 2015-10-20
-
use properly terminated sentences (thanks gustavo)
- 767. By Michael Vogt on 2015-10-20
-
more documenation and improve error reporting (thanks Gustavo)
| Michael Vogt (mvo) wrote : | # |
Thanks Gustavo for this excellent review. I started fixing some of the outlined issues and it looks like I'm running out of time. I will continue later but be assured that I will address every point in the review :)
Unmerged revisions
- 767. By Michael Vogt on 2015-10-20
-
more documenation and improve error reporting (thanks Gustavo)
- 766. By Michael Vogt on 2015-10-20
-
use properly terminated sentences (thanks gustavo)
- 765. By Michael Vogt on 2015-10-20
-
merged lp:snappy
- 764. By Michael Vogt on 2015-10-16
-
pkg/snapfs/
snapfs. go: use filepath.Clean() in BlobPath - 763. By Michael Vogt on 2015-10-16
-
add comment about little endian squashfs
- 762. By Michael Vogt on 2015-10-16
-
add more tests
- 761. By Michael Vogt on 2015-10-16
-
refactor and ove MountUnit handling to systemd package
- 760. By Michael Vogt on 2015-10-16
-
address review comments
- 759. By Michael Vogt on 2015-10-16
-
improve comments
- 758. By Michael Vogt on 2015-10-16
-
unmount after deactivate


4. put the .snap in /var/snappy/blobs?