Ubuntu Testing Day, tomorrow

2016-12-01 Thread Leo Arias
Hello,

Last week we started hosting the Ubuntu Testing Days. The idea is to
show a cool free software project, and some tools to test it. We are
trying not to assume any previous knowledge, to make it a good place
for new contributors to join our community.

Tomorrow, Friday December 2nd, at 19:00 UTC we will host the second in
https://ubuntuonair.com

We will have Aaron Ogle with us, talking about Rocket Chat.

If you are curious about how this event looks like, you can see the
summary of the first session at
http://elopio.net/blog/ubuntu-testing-day-wrap-up-20161125/

pura vida.
-- 
¡paz y baile!
http://www.ubuntu.com

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


Re: configure hook

2016-12-01 Thread Boris Rybalkin
Sorry still more questions on hooks.

As I understand configure hooks are executed after services startup:
https://github.com/snapcore/snapd/blob/3dc67f49c4b6fe3acd5add647ac35a42fbb395d5/overlord/snapstate/snapstate.go#L184

If this is correct (and that is what I see) it completely breaks the idea
of generating service configs (many tools want absolute paths in their
configs) with configure hook as it has to be done before the start.

This explains all my issues with keeping generated configs in SNAP_COMMON
and every time I enable services and they fail I actually see configs from
previous install :)

Could anyone confirm this?

On Fri, Nov 18, 2016 at 12:25 AM, Boris Rybalkin  wrote:

> After reinstalling snapd (2.17.1) and cleaning /var/lib/snapd/ issue seems
> to go away.
> Thank you very much!
>
> On Wed, Nov 16, 2016 at 7:20 PM, Boris Rybalkin 
> wrote:
>
>> After upgrading snapd on desktop 16.04 from xenial-proposed now I have
>> this wired message on install:
>>
>> Run configure hook of "syncloud-platform"
>> error: cannot perform the following tasks:
>> - Run configure hook of "syncloud-platform" snap if present (cannot
>> snap-exec: cannot find hook "configure" in "syncloud-platform")
>>
>> snap --version
>> snap2.17.1
>> snapd   2.17.1
>> series  16
>> ubuntu  16.04
>>
>> Has this changed since 2.17?
>>
>> On 14 Nov 2016 22:44, "Sergio Schvezov" 
>> wrote:
>>
>>> El 14/11/16 a las 18:35, Boris Rybalkin escribió:
>>>
 VM has snapd v2.17, is it possible to install this version on desktop
 16.04/16.10 so I can have it for integration tests?

>>>
>>> It is in xenial-proposed https://launchpad.net/ubuntu/+source/snapd
>>> If you want the latest and greatest at all times (non production). If
>>> you do this, follow the pinning process in
>>> https://wiki.ubuntu.com/Testing/EnableProposed to pin snapd to
>>> xenial-proposed only and not risk getting more (potentially unstable)
>>> -proposed software.
>>>
>>> Also is there any documentation on how to install snapd on a linux?

>>>
>>> These are the installation instructions available for the variety of
>>> distros around:
>>> http://snapcraft.io/docs/core/install, in case you wonder where I got
>>> that link from, it is available as a link on the web front of
>>> http://snapcraft.io
>>>
>>> --
>>> Snapcraft mailing list
>>> Snapcraft@lists.snapcraft.io
>>> Modify settings or unsubscribe at: https://lists.ubuntu.com/mailm
>>> an/listinfo/snapcraft
>>>
>>
>
>
> --
> Boris Rybalkin
> ribal...@gmail.com
>



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


Re: Interface connection and hooks

2016-12-01 Thread Alberto Mardegan
Thanks Zygmund for the timely reply! :-)

  Alberto


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


Re: Interface connection and hooks

2016-12-01 Thread Pawel Stolowski

Yep, Zygmunt is correct about all these aspects.

Cheers,
Pawel


On 01.12.2016 12:32, Zygmunt Krynicki wrote:

Wiadomość napisana przez Alberto Mardegan  w 
dniu 01.12.2016, o godz. 12:29:

Hi all!
  I've got a few questions about the upcoming interface hooks, to make
sure that everything is ready in my project (Unity8's Online Accounts)
to migrate our "click hooks" into the interface hooks.

So, what follows is my understanding of the situation, and some
questions; please comment if I got something wrong. :-)

I’ll defer corrections to pstolowski who is implementing this feature, but:


As I understand it, interface hooks will be run when the interface gets
connected. Does this mean that for auto-connect interfaces, interface
hooks will effectively be run at install time?

Yes, they will run when the connection is attempted, even if that is an 
automatic connection.


I've read that hooks are run with the same confinement as the rest of
the commands included in the snap; but what about the environment? Will
the XDG_* variables be properly set?

All the environment will be consistent but see below.


Will the hook be run as the UNIX user who connected the interface? And
if the interface is autoconnected, will the hook be run multiple times
under each different user?

No, they will run as root AFAIK.


I guess that's enough questions for now :-)


Best regards
ZK




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


Interface connection and hooks

2016-12-01 Thread Alberto Mardegan
Hi all!
  I've got a few questions about the upcoming interface hooks, to make
sure that everything is ready in my project (Unity8's Online Accounts)
to migrate our "click hooks" into the interface hooks.

So, what follows is my understanding of the situation, and some
questions; please comment if I got something wrong. :-)

As I understand it, interface hooks will be run when the interface gets
connected. Does this mean that for auto-connect interfaces, interface
hooks will effectively be run at install time?

I've read that hooks are run with the same confinement as the rest of
the commands included in the snap; but what about the environment? Will
the XDG_* variables be properly set?

Will the hook be run as the UNIX user who connected the interface? And
if the interface is autoconnected, will the hook be run multiple times
under each different user?

I guess that's enough questions for now :-)

Ciao,
  Alberto

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


Re: Interface connection and hooks

2016-12-01 Thread Zygmunt Krynicki

> Wiadomość napisana przez Alberto Mardegan  w 
> dniu 01.12.2016, o godz. 12:29:
> 
> Hi all!
>  I've got a few questions about the upcoming interface hooks, to make
> sure that everything is ready in my project (Unity8's Online Accounts)
> to migrate our "click hooks" into the interface hooks.
> 
> So, what follows is my understanding of the situation, and some
> questions; please comment if I got something wrong. :-)

I’ll defer corrections to pstolowski who is implementing this feature, but:

> As I understand it, interface hooks will be run when the interface gets
> connected. Does this mean that for auto-connect interfaces, interface
> hooks will effectively be run at install time?

Yes, they will run when the connection is attempted, even if that is an 
automatic connection.

> I've read that hooks are run with the same confinement as the rest of
> the commands included in the snap; but what about the environment? Will
> the XDG_* variables be properly set?

All the environment will be consistent but see below.

> Will the hook be run as the UNIX user who connected the interface? And
> if the interface is autoconnected, will the hook be run multiple times
> under each different user?

No, they will run as root AFAIK.

> I guess that's enough questions for now :-)
> 

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


Re: configure hook

2016-12-01 Thread Didier Roche
Le 02/12/2016 à 02:53, Boris Rybalkin a écrit :
> Sorry still more questions on hooks.
>
> As I understand configure hooks are executed after services startup:
> https://github.com/snapcore/snapd/blob/3dc67f49c4b6fe3acd5add647ac35a42fbb395d5/overlord/snapstate/snapstate.go#L184
>
> If this is correct (and that is what I see) it completely breaks the
> idea of generating service configs (many tools want absolute paths in
> their configs) with configure hook as it has to be done before the start.
>
> This explains all my issues with keeping generated configs in
> SNAP_COMMON and every time I enable services and they fail I actually
> see configs from previous install :)
>
> Could anyone confirm this?

Hey Boris,

This is correct.

However, I think this forces some best practices on daemons. Remember
that configure hooks can as well be executed while your process is
running. Your process should be able to pick any configuration change
and adapt accordingly.
So, the idea is to choose sane default, not rely on a configure file
until the user chooses so, and diverge from their default (no config
file or no key in the config file means default).

That enables you to easily migrate defaults if you change them, as still
enable people to choose their own configuration without being impacted
by future default (note that ON (default) -> OFF -> ON switch, isn't a
default anymore, it's a user choice.

To illustrate that, I wrote a snap (codelab coming early next year)
where a nodejs app have a default port and title. However, you can via
"snap set" configure another port or title, and those changes are picked
immediatly by the daemon without restarting. Note that I tried to have a
generic configure hook, generating a key=value store, where setting ""
value revert to default and keeping comments, ordering and other
artefacts in your config
https://github.com/ubuntu/snow-on-me-snap/blob/master/meta/hooks/configure
for the config hook
https://github.com/ubuntu/snow-on-me-snap/blob/master/main.js#L71 for
the nodejs webserver picking up new config on the fly.

Hope that helps outlining why this behaviour shouldn't be a problem and
why organizing your code that way is an advantage in the end (hoping you
can act on the tools that requires this).
Didier


>
> On Fri, Nov 18, 2016 at 12:25 AM, Boris Rybalkin  > wrote:
>
> After reinstalling snapd (2.17.1) and cleaning /var/lib/snapd/
> issue seems to go away.
> Thank you very much!
>
> On Wed, Nov 16, 2016 at 7:20 PM, Boris Rybalkin
> > wrote:
>
> After upgrading snapd on desktop 16.04 from xenial-proposed
> now I have this wired message on install:
>
> Run configure hook of "syncloud-platform"
> error: cannot perform the following tasks:
> - Run configure hook of "syncloud-platform" snap if present
> (cannot snap-exec: cannot find hook "configure" in
> "syncloud-platform")
>
> snap --version
> snap2.17.1
> snapd   2.17.1
> series  16
> ubuntu  16.04
>
> Has this changed since 2.17?
>
>
> On 14 Nov 2016 22:44, "Sergio Schvezov"
>  > wrote:
>
> El 14/11/16 a las 18:35, Boris Rybalkin escribió:
>
> VM has snapd v2.17, is it possible to install this
> version on desktop 16.04/16.10 so I can have it for
> integration tests?
>
>
> It is in xenial-proposed
> https://launchpad.net/ubuntu/+source/snapd
> 
> If you want the latest and greatest at all times (non
> production). If you do this, follow the pinning process in
> https://wiki.ubuntu.com/Testing/EnableProposed
>  to pin
> snapd to xenial-proposed only and not risk getting more
> (potentially unstable) -proposed software.
>
> Also is there any documentation on how to install
> snapd on a linux?
>
>
> These are the installation instructions available for the
> variety of distros around:
> http://snapcraft.io/docs/core/install
> , in case you
> wonder where I got that link from, it is available as a
> link on the web front of http://snapcraft.io
>
> -- 
> Snapcraft mailing list
> Snapcraft@lists.snapcraft.io
> 
> Modify settings or unsubscribe at:
> https://lists.ubuntu.com/mailman/listinfo/snapcraft
> 
>
>
>
>
> -- 
>