Re: [lxc-users] [lxc-devel] Container startup hook arguments

2017-10-06 Thread Serge E. Hallyn
Quoting Andrey Repin (anrdae...@yandex.ru):
> Greetings, Christian Brauner!
> 
> >> Maybe a configuration key 'lxc.hooks.version=2' ?
> 
> > I'm fine with simply keeping the arguments until 3.0 and then removing 
> > them. I
> > really don't want to add configuration keys that conceptually are internal 
> > keys
> > but are nonetheless exposed to users. Fwiw, this is also why I didn't 
> > implement
> > a version key for the 2.1. config file format update. This is just going to 
> > bite
> > us in the long run when we have to deprecate these internal keys. TL;DR, 
> > keep
> > the args for now and kill them in 3.0.
> 
> May I propose an alternative?
> Fill in the environment gaps now.

Yes, that's what I was saying on irc.  If anyone wants to send the patch, that'd
be great.

> Add something like "lxc.hooks.legacy" key in some future 2.x version, default
> to enabled, and recommend people turning it off and see if their hooks needs
> correction.
> In some version prior to 3.0, change the default value of the key to disabled.
> In 3.0, remove the key.

Seems reasonable.

thanks,
-serge
___
lxc-users mailing list
lxc-users@lists.linuxcontainers.org
http://lists.linuxcontainers.org/listinfo/lxc-users

Re: [lxc-users] [lxc-devel] Container startup hook arguments

2017-10-06 Thread Andrey Repin
Greetings, Christian Brauner!

>> Maybe a configuration key 'lxc.hooks.version=2' ?

> I'm fine with simply keeping the arguments until 3.0 and then removing them. I
> really don't want to add configuration keys that conceptually are internal 
> keys
> but are nonetheless exposed to users. Fwiw, this is also why I didn't 
> implement
> a version key for the 2.1. config file format update. This is just going to 
> bite
> us in the long run when we have to deprecate these internal keys. TL;DR, keep
> the args for now and kill them in 3.0.

May I propose an alternative?
Fill in the environment gaps now.
Add something like "lxc.hooks.legacy" key in some future 2.x version, default
to enabled, and recommend people turning it off and see if their hooks needs
correction.
In some version prior to 3.0, change the default value of the key to disabled.
In 3.0, remove the key.


-- 
With best regards,
Andrey Repin
Friday, October 6, 2017 21:37:10

Sorry for my terrible english...

___
lxc-users mailing list
lxc-users@lists.linuxcontainers.org
http://lists.linuxcontainers.org/listinfo/lxc-users

Re: [lxc-users] [lxc-devel] Container startup hook arguments

2017-10-05 Thread Kees Bos
On do, 2017-10-05 at 10:27 +0200, Christian Brauner wrote:
> On Wed, Oct 04, 2017 at 09:35:25AM -0500, Serge Hallyn wrote:
> > 
> > Quoting Kees Bos (cornelis@gmail.com):
> > > 
> > > I'm not using it, but do expect the extra args:
> > > 
> > > while [ {{ '${#@}' }} -gt 3 ] ; do
> > >    ...
> > >    shift
> > > done
> > > 
> > > It might be that some users will need the last extra argument
> > > (stage:
> > > pre-start|start|post-stop). This is currently not available in
> > > the
> > > environment.
> > > 
> > > I can live without these extra arguments, but will have to update
> > > my
> > > scripts.
> > Ok, but this will hurt then.  I certainly was going to keep the
> > extra args, but they would be shifted now.  We can pass along an
> > environment variable saying something like LXC_SIMPLE_ARGS=1 or
> > something, but your unmodified script won't know to look for
> > that so will do the wrong thing.  Any ideas?
> > 
> > This unfortunately basically means that you are in fact a "user",
> > and that makes this seem like at best 3.0  material then, unless
> > we can find a good solution.
> > 
> > Maybe a configuration key 'lxc.hooks.version=2' ?
> I'm fine with simply keeping the arguments until 3.0 and then
> removing them. I
> really don't want to add configuration keys that conceptually are
> internal keys
> but are nonetheless exposed to users. Fwiw, this is also why I didn't
> implement
> a version key for the 2.1. config file format update. This is just
> going to bite
> us in the long run when we have to deprecate these internal keys.
> TL;DR, keep
> the args for now and kill them in 3.0.
> 
> Christian

I think that's least problematic approach :-)

On second thoughts, if we do support both ways, I don't think it should
be a setting in the container config but something that's system wide
(since it's dependent on the installed lxd and not on the container).
___
lxc-users mailing list
lxc-users@lists.linuxcontainers.org
http://lists.linuxcontainers.org/listinfo/lxc-users

Re: [lxc-users] [lxc-devel] Container startup hook arguments

2017-10-05 Thread Christian Brauner
On Wed, Oct 04, 2017 at 09:35:25AM -0500, Serge Hallyn wrote:
> Quoting Kees Bos (cornelis@gmail.com):
> > I'm not using it, but do expect the extra args:
> > 
> > while [ {{ '${#@}' }} -gt 3 ] ; do
> >    ...
> >    shift
> > done
> > 
> > It might be that some users will need the last extra argument (stage:
> > pre-start|start|post-stop). This is currently not available in the
> > environment.
> > 
> > I can live without these extra arguments, but will have to update my
> > scripts.
> 
> Ok, but this will hurt then.  I certainly was going to keep the
> extra args, but they would be shifted now.  We can pass along an
> environment variable saying something like LXC_SIMPLE_ARGS=1 or
> something, but your unmodified script won't know to look for
> that so will do the wrong thing.  Any ideas?
> 
> This unfortunately basically means that you are in fact a "user",
> and that makes this seem like at best 3.0  material then, unless
> we can find a good solution.
> 
> Maybe a configuration key 'lxc.hooks.version=2' ?

I'm fine with simply keeping the arguments until 3.0 and then removing them. I
really don't want to add configuration keys that conceptually are internal keys
but are nonetheless exposed to users. Fwiw, this is also why I didn't implement
a version key for the 2.1. config file format update. This is just going to bite
us in the long run when we have to deprecate these internal keys. TL;DR, keep
the args for now and kill them in 3.0.

Christian

> 
> Thanks for replying!
> 
> -serge
> ___
> lxc-devel mailing list
> lxc-de...@lists.linuxcontainers.org
> http://lists.linuxcontainers.org/listinfo/lxc-devel
___
lxc-users mailing list
lxc-users@lists.linuxcontainers.org
http://lists.linuxcontainers.org/listinfo/lxc-users