Re: Shared content example - ubuntu-app-platform

2017-01-02 Thread Timo Jyrinki
2016-12-08 2:56 GMT+02:00 knitzsche :
> How do consumers (snap devs) know the lib/API versions contained? On touch
> we had the concept of a "framework", whose version implied a set of API
> commitments. Since this puts QT together with other (Ubuntu )  libs,
> what's the reasonable expectation?

Right now the versioning we have is the "content:" field, currently at
ubuntu-app-platform1. This was recommended to me in October.

The idea would be to increment that so that apps using
ubuntu-app-platform1 continue to fetch an older platform snap from the
store providing that version, while people can update their apps to
the newer version at their pace. This is the theory, I'm not sure
about the implementation status for things like 1) fetching older
version with matching "content:" value in case the newest snap in
store has incremented value, 2) co-installing different versions with
different "content:" value. We may need to change snap itself or
introduce a new method for the versioning if this is not the final
way.

-Timo

-- 
Snapcraft mailing list
Snapcraft@lists.snapcraft.io
Modify settings or unsubscribe at: 
https://lists.ubuntu.com/mailman/listinfo/snapcraft


Re: Shared content example - ubuntu-app-platform

2016-12-07 Thread knitzsche

Great idea!

How do consumers (snap devs) know the lib/API versions contained? On 
touch we had the concept of a "framework", whose version implied a set 
of API commitments. Since this puts QT together with other (Ubuntu ) 
 libs, what's the reasonable expectation?


On 11/11/2016 02:46 PM, Timo Jyrinki wrote:

Hi,

I hinted at this earlier but 'ubuntu-app-platform' (name bikeshedded a
few times) is now there offering a huge amount of libraries via
content interface. We're using it for some builds of for example
Calculator, Calendar and other apps, dropping the size of those from
50+MB to even under 1MB.

It's used for the use case of using a same version of Qt (5.6.1) and
certain Ubuntu libraries on disk space constrained devices for several
(sn)apps, but it might also serve you as an example of how you could
share content similarly between your own snaps.

How it works is that there is now a snap in the store and an
associated cloud part 'desktop-ubuntu-app-platform' (see documentation
at the bottom of https://wiki.ubuntu.com/snapcraft/parts) that one can
use to easily plug into the platform offered by ubuntu-app-platform.
The extremely simple example produces 1MB snap
(https://code.launchpad.net/~timo-jyrinki/+snap/uitk-gallery/+build/9676/+files/uitk-gallery_0.1_amd64.snap)
that uses the hundreds of megabytes of shared libraries from the
platform snap.

Since this might be interesting approach to share libraries or other
content between several snap in general, I invite you to look at the
slot side maintained by the Ubuntu SDK team -
https://git.launchpad.net/ubuntu-app-platform/tree/snapcraft.yaml -
and the plug side of the simple(st) example -
http://bazaar.launchpad.net/~timo-jyrinki/+junk/uitk-gallery/view/head:/snapcraft.yaml

I hope this could help people interested in similar content sharing
use cases. Note that it's useful to define the "default-provider"
already even though the functionality of the field (automatic
downloading of the providing snap) is not yet implemented.

-Timo



--
Snapcraft mailing list
Snapcraft@lists.snapcraft.io
Modify settings or unsubscribe at: 
https://lists.ubuntu.com/mailman/listinfo/snapcraft


Re: Shared content example - ubuntu-app-platform

2016-11-30 Thread Enwei Zhang
Hi Stuart,
I never got "write" working, it always tells me "permission denied".
For your mount issue, I guess you need to create a empty folder locally
called "test-share-target".

Br
Enwei

On Wed, Nov 30, 2016 at 9:39 PM, Stuart Bishop 
wrote:

> On 29 November 2016 at 08:36, Enwei Zhang 
> wrote:
>
>> Thank you Timo.
>> I changed from "./bin" to "/bin", then it works.
>>
>
>
> Did you have any luck getting 'write' to work? I'm getting as far as
> running my app and it failing with:
>
>   cannot mount /snap/prov/x2 at /snap/cons/x1/test-share-target with
> options bind. errmsg: No such file or directory
>
> I'm unsure what paths I should be using. I need to get access to
> $SNAP_DATA, $SNAP_USER_DATA, $SNAP_COMMON etc. to install configuration
> files.
>
> Are there any user docs or design specs around, or is this feature being
> prototyped on the fly? I can't even find anything about the plugs: stanza
> in snapcraft.yaml, but that might just be a lack of Google juice.
>
> keskiviikko 23. marraskuuta 2016 Enwei Zhang 
>>> kirjoitti:
>>> > Hello,
>>> > Thanks Timo for the good example.
>>> > While I tried to write two snaps(server to share paths to client) that
>>> use content interface to share files, I found "write" slot doesn't work.
>>> > The code snippet from server side snapcraft.yaml
>>> >
>>> > slots:
>>> > test-share:
>>> > content: test-content-server
>>> > interface: content
>>> > write:
>>> > - .
>>> >
>>> > When accessing from client side snap, it shows "permission denied".
>>>
>>>
>>>
>
> --
> Stuart Bishop 
>
> --
> Snapcraft mailing list
> Snapcraft@lists.snapcraft.io
> Modify settings or unsubscribe at: https://lists.ubuntu.com/
> mailman/listinfo/snapcraft
>
>
-- 
Snapcraft mailing list
Snapcraft@lists.snapcraft.io
Modify settings or unsubscribe at: 
https://lists.ubuntu.com/mailman/listinfo/snapcraft


Re: Shared content example - ubuntu-app-platform

2016-11-30 Thread Stuart Bishop
On 29 November 2016 at 08:36, Enwei Zhang  wrote:

> Thank you Timo.
> I changed from "./bin" to "/bin", then it works.
>


Did you have any luck getting 'write' to work? I'm getting as far as
running my app and it failing with:

  cannot mount /snap/prov/x2 at /snap/cons/x1/test-share-target with
options bind. errmsg: No such file or directory

I'm unsure what paths I should be using. I need to get access to
$SNAP_DATA, $SNAP_USER_DATA, $SNAP_COMMON etc. to install configuration
files.

Are there any user docs or design specs around, or is this feature being
prototyped on the fly? I can't even find anything about the plugs: stanza
in snapcraft.yaml, but that might just be a lack of Google juice.

keskiviikko 23. marraskuuta 2016 Enwei Zhang 
>> kirjoitti:
>> > Hello,
>> > Thanks Timo for the good example.
>> > While I tried to write two snaps(server to share paths to client) that
>> use content interface to share files, I found "write" slot doesn't work.
>> > The code snippet from server side snapcraft.yaml
>> >
>> > slots:
>> > test-share:
>> > content: test-content-server
>> > interface: content
>> > write:
>> > - .
>> >
>> > When accessing from client side snap, it shows "permission denied".
>>
>>
>>

-- 
Stuart Bishop 
-- 
Snapcraft mailing list
Snapcraft@lists.snapcraft.io
Modify settings or unsubscribe at: 
https://lists.ubuntu.com/mailman/listinfo/snapcraft


Shared content example - ubuntu-app-platform

2016-11-26 Thread Timo Jyrinki
Hi Enwei,

I think you might be running into bugs, given how in this and other threads
people are bumping into bugs with the content interface.

I haven't tried write, but I did have ubuntu-app-platform using paths at
first and that did work fine, aside from the mounting bug discussed in this
thread. However there are very subtle details like you shouldn't use / at
the end - see https://bugs.launchpad.net/snappy/+bug/1635170 I filed.

I can't test now since I'm on a long leave and only using my Ubuntu Phone.

-Timo

keskiviikko 23. marraskuuta 2016 Enwei Zhang 
kirjoitti:
> Hello,
> Thanks Timo for the good example.
> While I tried to write two snaps(server to share paths to client) that
use content interface to share files, I found "write" slot doesn't work.
> The code snippet from server side snapcraft.yaml
>
> slots:
> test-share:
> content: test-content-server
> interface: content
> write:
> - .
>
> When accessing from client side snap, it shows "permission denied".
>
> Also, I found only "." path can work, other path like below "./bin"
cannot work. When you run "snap interfaces", below slot "test-share" will
not show up.
>
> slots:
> test-share:
> content: test-content-server
> interface: content
> read:
> - ./bin
>
> Are these bugs or my misunderstanding? I tested on both 2.16 and 2.17
snapd.
> Thanks for your answer.
>
> Br
> Enwei
>>
>> --
>> Snapcraft mailing list
>> Snapcraft@lists.snapcraft.io
>> Modify settings or unsubscribe at:
https://lists.ubuntu.com/mailman/listinfo/snapcraft
>
>
-- 
Snapcraft mailing list
Snapcraft@lists.snapcraft.io
Modify settings or unsubscribe at: 
https://lists.ubuntu.com/mailman/listinfo/snapcraft


Re: Shared content example - ubuntu-app-platform

2016-11-22 Thread Enwei Zhang
Hello,
Thanks Timo for the good example.
While I tried to write two snaps(server to share paths to client) that use
content interface to share files, I found "write" slot doesn't work.
The code snippet from server side snapcraft.yaml

slots:
  test-share:
content: test-content-server
interface: content
write:
  - .

When accessing from client side snap, it shows "permission denied".

Also, I found only "." path can work, other path like below "./bin" cannot
work. When you run "snap interfaces", below slot "test-share" will not show
up.

slots:
  test-share:
content: test-content-server
interface: content
read:
  - ./bin

Are these bugs or my misunderstanding? I tested on both 2.16 and 2.17 snapd.
Thanks for your answer.

Br
Enwei

>
> --
> Snapcraft mailing list
> Snapcraft@lists.snapcraft.io
> Modify settings or unsubscribe at: https://lists.ubuntu.com/
> mailman/listinfo/snapcraft
>
-- 
Snapcraft mailing list
Snapcraft@lists.snapcraft.io
Modify settings or unsubscribe at: 
https://lists.ubuntu.com/mailman/listinfo/snapcraft


Re: Shared content example - ubuntu-app-platform

2016-11-11 Thread Timo Jyrinki
2016-11-11 20:45 GMT+02:00 Marco Trevisan :
> Although it seems I've some troubles since I can't connect the gallery
> properly:

I suspect there may be a snappy bug or a couple involved, I've run
into similar problems myself. I still need to occasionally run for
example:

sudo /usr/lib/snapd/snap-discard-ns uitk-gallery

after which the behavior changes. Then sometimes after that I have a
crash on startup instead, resolved by removing either of the snaps and
installing again. I'd love someone from the snappy core team to get to
the bottom of this behavior (or maybe they are resolved in the next
release).

Regardless, I have ubuntu-app-platform installed from the store and
uitk-gallery (installed from the linked .snap) running, as indicated
in the attached screenshot^W^Wlinked screenshot here:
http://people.ubuntu.com/~timo-jyrinki/running.png

-Timo

-- 
Snapcraft mailing list
Snapcraft@lists.snapcraft.io
Modify settings or unsubscribe at: 
https://lists.ubuntu.com/mailman/listinfo/snapcraft


Re: Shared content example - ubuntu-app-platform

2016-11-11 Thread Renato Filho
2016-11-11 15:45 GMT-03:00 Marco Trevisan :
> Il 11/11/2016 15:46, Timo Jyrinki ha scritto:
>>
>> Hi,
>>
>> I hinted at this earlier but 'ubuntu-app-platform' (name bikeshedded a
>> few times) is now there offering a huge amount of libraries via
>> content interface. We're using it for some builds of for example
>> Calculator, Calendar and other apps, dropping the size of those from
>> 50+MB to even under 1MB.
>
>
> Great stuff!
>
> Although it seems I've some troubles since I can't connect the gallery
> properly:
>
> $ sudo snap connect uitk-gallery:platform ubuntu-app-platform:platform
> $ uitk-gallery
> You need to connect the ubuntu-app-platform package with your application to
> reuse shared assets, please run:
> snap install ubuntu-app-platform
> snap connect uitk-gallery:platform ubuntu-app-platform:platform
>
> I guess it would be nice to have a similar content interface for all the
> desktop-launchers we support so far.

Hi,

This is happening with me too.
Probably this is a snap bug. The solution for that is to remove the
app and install it again and make sure to connect the interface before
to run the app for the first time.

I am having this problem in two situations:

1 - If I run the app that uses the content share before connect it,
the connection command does not mount the directories anymore (I need
to remove and install the app again, and connect the interface before
run the app for the first time)

2 - If I install a new version of the app the content share directory
does not get mounted and I need to use the same solution as number 1
You can face this problem in t

-- 
Snapcraft mailing list
Snapcraft@lists.snapcraft.io
Modify settings or unsubscribe at: 
https://lists.ubuntu.com/mailman/listinfo/snapcraft


Re: Shared content example - ubuntu-app-platform

2016-11-11 Thread Marco Trevisan

Il 11/11/2016 15:46, Timo Jyrinki ha scritto:

Hi,

I hinted at this earlier but 'ubuntu-app-platform' (name bikeshedded a
few times) is now there offering a huge amount of libraries via
content interface. We're using it for some builds of for example
Calculator, Calendar and other apps, dropping the size of those from
50+MB to even under 1MB.


Great stuff!

Although it seems I've some troubles since I can't connect the gallery 
properly:


$ sudo snap connect uitk-gallery:platform ubuntu-app-platform:platform
$ uitk-gallery
You need to connect the ubuntu-app-platform package with your 
application to reuse shared assets, please run:

snap install ubuntu-app-platform
snap connect uitk-gallery:platform ubuntu-app-platform:platform

I guess it would be nice to have a similar content interface for all the 
desktop-launchers we support so far.


--
Snapcraft mailing list
Snapcraft@lists.snapcraft.io
Modify settings or unsubscribe at: 
https://lists.ubuntu.com/mailman/listinfo/snapcraft


Shared content example - ubuntu-app-platform

2016-11-11 Thread Timo Jyrinki
Hi,

I hinted at this earlier but 'ubuntu-app-platform' (name bikeshedded a
few times) is now there offering a huge amount of libraries via
content interface. We're using it for some builds of for example
Calculator, Calendar and other apps, dropping the size of those from
50+MB to even under 1MB.

It's used for the use case of using a same version of Qt (5.6.1) and
certain Ubuntu libraries on disk space constrained devices for several
(sn)apps, but it might also serve you as an example of how you could
share content similarly between your own snaps.

How it works is that there is now a snap in the store and an
associated cloud part 'desktop-ubuntu-app-platform' (see documentation
at the bottom of https://wiki.ubuntu.com/snapcraft/parts) that one can
use to easily plug into the platform offered by ubuntu-app-platform.
The extremely simple example produces 1MB snap
(https://code.launchpad.net/~timo-jyrinki/+snap/uitk-gallery/+build/9676/+files/uitk-gallery_0.1_amd64.snap)
that uses the hundreds of megabytes of shared libraries from the
platform snap.

Since this might be interesting approach to share libraries or other
content between several snap in general, I invite you to look at the
slot side maintained by the Ubuntu SDK team -
https://git.launchpad.net/ubuntu-app-platform/tree/snapcraft.yaml -
and the plug side of the simple(st) example -
http://bazaar.launchpad.net/~timo-jyrinki/+junk/uitk-gallery/view/head:/snapcraft.yaml

I hope this could help people interested in similar content sharing
use cases. Note that it's useful to define the "default-provider"
already even though the functionality of the field (automatic
downloading of the providing snap) is not yet implemented.

-Timo

-- 
Snapcraft mailing list
Snapcraft@lists.snapcraft.io
Modify settings or unsubscribe at: 
https://lists.ubuntu.com/mailman/listinfo/snapcraft