You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@karaf.apache.org by Jean-Baptiste Onofré <jb...@nanthrax.net> on 2015/04/13 17:51:12 UTC

[DISCUSS] Remove features lifecycle in K4

Hi all,

I discussed with Christian about KARAF-3102.

The feature lifecycle doesn't actually fully work, especially around the 
stop action.

In order to avoid to perturb the users, I think we should remove the 
features lifecycle commands. Else, if they are provided, users will try 
it and may be disappointed as they won't work as expected.

WDYT ?

Regards
JB
-- 
Jean-Baptiste Onofré
jbonofre@apache.org
http://blog.nanthrax.net
Talend - http://www.talend.com

Re: [DISCUSS] Remove features lifecycle in K4

Posted by Guillaume Nodet <gn...@apache.org>.
With the new features service, these kind of options are more difficult,
because they need to be persisted.
The new resolver works on a known set of inputs and compute the end result,
then do the diffs with the current state.
So one time options are not really a good fit.

2015-04-13 18:22 GMT+02:00 Jean-Baptiste Onofré <jb...@nanthrax.net>:

> Maybe we can introduce a --force option to stop whatever the
> bundle/feature is used by another feature ?
>
> Regards
> JB
>
>
> On 04/13/2015 06:12 PM, Guillaume Nodet wrote:
>
>> We also have to take care about the started="false" flag somehow.
>> I suppose if a feature flags the bundle as started="false", it would
>> behave
>> as if this feature was stopped for the computation of that bundle state.
>>
>> I'm fine with this behaviour, we just to understand that there's no way to
>> make sure a bundle is stopped.
>>
>>
>> 2015-04-13 18:04 GMT+02:00 Jean-Baptiste Onofré <jb...@nanthrax.net>:
>>
>>  I'm with you on that: we just have to agree on the behaviour and document
>>> it accordingly.
>>>
>>> In my opinion, if a bundle is used by a feature (feature A), it should
>>> not
>>> be stopped if we stop another feature that uses it (feature B).
>>>
>>> It's the same for the transitive features.
>>> If a feature is used by a feature, it should not be stopped if we stop
>>> another feature that used it ;)
>>>
>>> Regards
>>> JB
>>>
>>>
>>> On 04/13/2015 06:01 PM, Guillaume Nodet wrote:
>>>
>>>  Yeah, I was thinking about it.
>>>> Though the obvious other solution is to fix it.
>>>>
>>>> I have actually started an email this morning to discuss but I haven't
>>>> finished it.
>>>>
>>>> Overall, I think it may not be very difficult to fix, as the bundle
>>>> state
>>>> changes are already handled correctly afaik.  The real problem is to
>>>> agree
>>>> on the semantics on the effects, so that we can compute the desired
>>>> state
>>>> of each bundle correctly.
>>>>
>>>> Problems arise when a bundle is used by several features, one of which
>>>> being started and the other resolved.
>>>>
>>>> Anyway, it's really up to you, I don't mind fixing the code as long as
>>>> we
>>>> agree on the behaviour.
>>>>
>>>> 2015-04-13 17:51 GMT+02:00 Jean-Baptiste Onofré <jb...@nanthrax.net>:
>>>>
>>>>   Hi all,
>>>>
>>>>>
>>>>> I discussed with Christian about KARAF-3102.
>>>>>
>>>>> The feature lifecycle doesn't actually fully work, especially around
>>>>> the
>>>>> stop action.
>>>>>
>>>>> In order to avoid to perturb the users, I think we should remove the
>>>>> features lifecycle commands. Else, if they are provided, users will try
>>>>> it
>>>>> and may be disappointed as they won't work as expected.
>>>>>
>>>>> WDYT ?
>>>>>
>>>>> Regards
>>>>> JB
>>>>> --
>>>>> Jean-Baptiste Onofré
>>>>> jbonofre@apache.org
>>>>> http://blog.nanthrax.net
>>>>> Talend - http://www.talend.com
>>>>>
>>>>>
>>>>>
>>>>  --
>>> Jean-Baptiste Onofré
>>> jbonofre@apache.org
>>> http://blog.nanthrax.net
>>> Talend - http://www.talend.com
>>>
>>>
>>
> --
> Jean-Baptiste Onofré
> jbonofre@apache.org
> http://blog.nanthrax.net
> Talend - http://www.talend.com
>

Re: [DISCUSS] Remove features lifecycle in K4

Posted by Jean-Baptiste Onofré <jb...@nanthrax.net>.
Maybe we can introduce a --force option to stop whatever the 
bundle/feature is used by another feature ?

Regards
JB

On 04/13/2015 06:12 PM, Guillaume Nodet wrote:
> We also have to take care about the started="false" flag somehow.
> I suppose if a feature flags the bundle as started="false", it would behave
> as if this feature was stopped for the computation of that bundle state.
>
> I'm fine with this behaviour, we just to understand that there's no way to
> make sure a bundle is stopped.
>
>
> 2015-04-13 18:04 GMT+02:00 Jean-Baptiste Onofré <jb...@nanthrax.net>:
>
>> I'm with you on that: we just have to agree on the behaviour and document
>> it accordingly.
>>
>> In my opinion, if a bundle is used by a feature (feature A), it should not
>> be stopped if we stop another feature that uses it (feature B).
>>
>> It's the same for the transitive features.
>> If a feature is used by a feature, it should not be stopped if we stop
>> another feature that used it ;)
>>
>> Regards
>> JB
>>
>>
>> On 04/13/2015 06:01 PM, Guillaume Nodet wrote:
>>
>>> Yeah, I was thinking about it.
>>> Though the obvious other solution is to fix it.
>>>
>>> I have actually started an email this morning to discuss but I haven't
>>> finished it.
>>>
>>> Overall, I think it may not be very difficult to fix, as the bundle state
>>> changes are already handled correctly afaik.  The real problem is to agree
>>> on the semantics on the effects, so that we can compute the desired state
>>> of each bundle correctly.
>>>
>>> Problems arise when a bundle is used by several features, one of which
>>> being started and the other resolved.
>>>
>>> Anyway, it's really up to you, I don't mind fixing the code as long as we
>>> agree on the behaviour.
>>>
>>> 2015-04-13 17:51 GMT+02:00 Jean-Baptiste Onofré <jb...@nanthrax.net>:
>>>
>>>   Hi all,
>>>>
>>>> I discussed with Christian about KARAF-3102.
>>>>
>>>> The feature lifecycle doesn't actually fully work, especially around the
>>>> stop action.
>>>>
>>>> In order to avoid to perturb the users, I think we should remove the
>>>> features lifecycle commands. Else, if they are provided, users will try
>>>> it
>>>> and may be disappointed as they won't work as expected.
>>>>
>>>> WDYT ?
>>>>
>>>> Regards
>>>> JB
>>>> --
>>>> Jean-Baptiste Onofré
>>>> jbonofre@apache.org
>>>> http://blog.nanthrax.net
>>>> Talend - http://www.talend.com
>>>>
>>>>
>>>
>> --
>> Jean-Baptiste Onofré
>> jbonofre@apache.org
>> http://blog.nanthrax.net
>> Talend - http://www.talend.com
>>
>

-- 
Jean-Baptiste Onofré
jbonofre@apache.org
http://blog.nanthrax.net
Talend - http://www.talend.com

Re: [DISCUSS] Remove features lifecycle in K4

Posted by Guillaume Nodet <gn...@apache.org>.
We also have to take care about the started="false" flag somehow.
I suppose if a feature flags the bundle as started="false", it would behave
as if this feature was stopped for the computation of that bundle state.

I'm fine with this behaviour, we just to understand that there's no way to
make sure a bundle is stopped.


2015-04-13 18:04 GMT+02:00 Jean-Baptiste Onofré <jb...@nanthrax.net>:

> I'm with you on that: we just have to agree on the behaviour and document
> it accordingly.
>
> In my opinion, if a bundle is used by a feature (feature A), it should not
> be stopped if we stop another feature that uses it (feature B).
>
> It's the same for the transitive features.
> If a feature is used by a feature, it should not be stopped if we stop
> another feature that used it ;)
>
> Regards
> JB
>
>
> On 04/13/2015 06:01 PM, Guillaume Nodet wrote:
>
>> Yeah, I was thinking about it.
>> Though the obvious other solution is to fix it.
>>
>> I have actually started an email this morning to discuss but I haven't
>> finished it.
>>
>> Overall, I think it may not be very difficult to fix, as the bundle state
>> changes are already handled correctly afaik.  The real problem is to agree
>> on the semantics on the effects, so that we can compute the desired state
>> of each bundle correctly.
>>
>> Problems arise when a bundle is used by several features, one of which
>> being started and the other resolved.
>>
>> Anyway, it's really up to you, I don't mind fixing the code as long as we
>> agree on the behaviour.
>>
>> 2015-04-13 17:51 GMT+02:00 Jean-Baptiste Onofré <jb...@nanthrax.net>:
>>
>>  Hi all,
>>>
>>> I discussed with Christian about KARAF-3102.
>>>
>>> The feature lifecycle doesn't actually fully work, especially around the
>>> stop action.
>>>
>>> In order to avoid to perturb the users, I think we should remove the
>>> features lifecycle commands. Else, if they are provided, users will try
>>> it
>>> and may be disappointed as they won't work as expected.
>>>
>>> WDYT ?
>>>
>>> Regards
>>> JB
>>> --
>>> Jean-Baptiste Onofré
>>> jbonofre@apache.org
>>> http://blog.nanthrax.net
>>> Talend - http://www.talend.com
>>>
>>>
>>
> --
> Jean-Baptiste Onofré
> jbonofre@apache.org
> http://blog.nanthrax.net
> Talend - http://www.talend.com
>

Re: [DISCUSS] Remove features lifecycle in K4

Posted by Jean-Baptiste Onofré <jb...@nanthrax.net>.
I'm with you on that: we just have to agree on the behaviour and 
document it accordingly.

In my opinion, if a bundle is used by a feature (feature A), it should 
not be stopped if we stop another feature that uses it (feature B).

It's the same for the transitive features.
If a feature is used by a feature, it should not be stopped if we stop 
another feature that used it ;)

Regards
JB

On 04/13/2015 06:01 PM, Guillaume Nodet wrote:
> Yeah, I was thinking about it.
> Though the obvious other solution is to fix it.
>
> I have actually started an email this morning to discuss but I haven't
> finished it.
>
> Overall, I think it may not be very difficult to fix, as the bundle state
> changes are already handled correctly afaik.  The real problem is to agree
> on the semantics on the effects, so that we can compute the desired state
> of each bundle correctly.
>
> Problems arise when a bundle is used by several features, one of which
> being started and the other resolved.
>
> Anyway, it's really up to you, I don't mind fixing the code as long as we
> agree on the behaviour.
>
> 2015-04-13 17:51 GMT+02:00 Jean-Baptiste Onofré <jb...@nanthrax.net>:
>
>> Hi all,
>>
>> I discussed with Christian about KARAF-3102.
>>
>> The feature lifecycle doesn't actually fully work, especially around the
>> stop action.
>>
>> In order to avoid to perturb the users, I think we should remove the
>> features lifecycle commands. Else, if they are provided, users will try it
>> and may be disappointed as they won't work as expected.
>>
>> WDYT ?
>>
>> Regards
>> JB
>> --
>> Jean-Baptiste Onofré
>> jbonofre@apache.org
>> http://blog.nanthrax.net
>> Talend - http://www.talend.com
>>
>

-- 
Jean-Baptiste Onofré
jbonofre@apache.org
http://blog.nanthrax.net
Talend - http://www.talend.com

Re: [DISCUSS] Remove features lifecycle in K4

Posted by Guillaume Nodet <gn...@apache.org>.
2015-04-14 9:39 GMT+02:00 Christian Schneider <ch...@die-schneider.net>:

> On 14.04.2015 09:32, Guillaume Nodet wrote:
>
>> 2015-04-14 8:52 GMT+02:00 Christian Schneider <ch...@die-schneider.net>:
>>
>>  I was not aware we have this information in the wires. I will try to
>>> implement it using these.
>>>
>>> So what I would do is this:
>>> I start with the features to be stopped / started.
>>> I then propagate down to the subfeatures / bundles.
>>> For each feature processed I compute the state as the highest state of
>>> all
>>> features that depend on it and the requested state.
>>>
>>> Does that make sense?
>>>
>>>  I think that's exactly what is currently done.
>>
> I don't think so. The state to be set is computed from the highest of
> request state and current state of a feature / bundle.
> It does not take into account the states of the resources that depend on
> the resource.


The propagateState method is  recursive, so if a feature is started, a
feature that depends on it will be started, and bundles required by this
feature will be started too.



>
> Christian
>
>
>
> --
> Christian Schneider
> http://www.liquid-reality.de
>
> Open Source Architect
> http://www.talend.com
>
>

Re: [DISCUSS] Remove features lifecycle in K4

Posted by Christian Schneider <ch...@die-schneider.net>.
On 14.04.2015 09:32, Guillaume Nodet wrote:
> 2015-04-14 8:52 GMT+02:00 Christian Schneider <ch...@die-schneider.net>:
>
>> I was not aware we have this information in the wires. I will try to
>> implement it using these.
>>
>> So what I would do is this:
>> I start with the features to be stopped / started.
>> I then propagate down to the subfeatures / bundles.
>> For each feature processed I compute the state as the highest state of all
>> features that depend on it and the requested state.
>>
>> Does that make sense?
>>
> I think that's exactly what is currently done.
I don't think so. The state to be set is computed from the highest of 
request state and current state of a feature / bundle.
It does not take into account the states of the resources that depend on 
the resource.

Christian


-- 
Christian Schneider
http://www.liquid-reality.de

Open Source Architect
http://www.talend.com


Re: [DISCUSS] Remove features lifecycle in K4

Posted by Guillaume Nodet <gn...@apache.org>.
2015-04-14 8:52 GMT+02:00 Christian Schneider <ch...@die-schneider.net>:

> I was not aware we have this information in the wires. I will try to
> implement it using these.
>
> So what I would do is this:
> I start with the features to be stopped / started.
> I then propagate down to the subfeatures / bundles.
> For each feature processed I compute the state as the highest state of all
> features that depend on it and the requested state.
>
> Does that make sense?
>

I think that's exactly what is currently done.

>
> The problem in this algorithm is that in many cases we will not be able to
> stop features / bundles as they are needed by other features.
> So probably we will need some reporting to explain why some features /
> bundles could not achieve the request state. To really stop a feature the
> user would then
> have to stop all top level features. Only then would it really change its
> state.
>
> We could also have kind of a force mode where we change the state first to
> the top and then down again. So this would guarantee that a feature changes
> its state but it could shut down half of karaf unintendedly. Which would be
> especially dangerous if we hit some core features like the feature service.
> So I tend to rather not support this.
>




>
> Christian
>
>
> On 13.04.2015 18:01, Guillaume Nodet wrote:
>
>> Yeah, I was thinking about it.
>> Though the obvious other solution is to fix it.
>>
>> I have actually started an email this morning to discuss but I haven't
>> finished it.
>>
>> Overall, I think it may not be very difficult to fix, as the bundle state
>> changes are already handled correctly afaik.  The real problem is to agree
>> on the semantics on the effects, so that we can compute the desired state
>> of each bundle correctly.
>>
>> Problems arise when a bundle is used by several features, one of which
>> being started and the other resolved.
>>
>> Anyway, it's really up to you, I don't mind fixing the code as long as we
>> agree on the behaviour.
>>
>> 2015-04-13 17:51 GMT+02:00 Jean-Baptiste Onofré <jb...@nanthrax.net>:
>>
>>  Hi all,
>>>
>>> I discussed with Christian about KARAF-3102.
>>>
>>> The feature lifecycle doesn't actually fully work, especially around the
>>> stop action.
>>>
>>> In order to avoid to perturb the users, I think we should remove the
>>> features lifecycle commands. Else, if they are provided, users will try
>>> it
>>> and may be disappointed as they won't work as expected.
>>>
>>> WDYT ?
>>>
>>> Regards
>>> JB
>>> --
>>> Jean-Baptiste Onofré
>>> jbonofre@apache.org
>>> http://blog.nanthrax.net
>>> Talend - http://www.talend.com
>>>
>>>
>
> --
> Christian Schneider
> http://www.liquid-reality.de
>
> Open Source Architect
> http://www.talend.com
>
>

Re: [DISCUSS] Remove features lifecycle in K4

Posted by Jean-Baptiste Onofré <jb...@nanthrax.net>.
Hi Milen,

up to K3, a feature has just two states: installed or uninstalled.

In K4, we introduced a full lifecycle where in addition of installed and 
uninstalled states, a feature can be started or stopped.

Here, we are talking about start/stop commands.

Regards
JB

On 04/14/2015 11:35 AM, Milen Dyankov wrote:
> Hi Jean-Baptiste,
>
> perhaps I don't understand what is discussed here and what you meant by "remove
> the features lifecycle commands".
>
> Just wanted to share my point of view regarding features. That is, I see
> features as deployment option (get needed bundles in place) and not as
> bundle lifecycle batch management option. Or to follow up with my linux
> example, one will do "apt-get install mysql" which will install also a
> bunch of other things apart form mysql itself. But one does not do "apt-get
> start/stop mysql" because that does not make sense. So if those are the
> commands you think of removing then that's fine with me (although a bundle
> start/stop batch job based on feature as grouping option is nice to have in
> some cases)
> But what is more important for me personally is to be able to tell how a
> bundle was installed (stand alone or via feature). AFAIK this is not
> something provided in K3
>
> Best,
> Milen
>
>
>
>
> On Tue, Apr 14, 2015 at 11:14 AM, Jean-Baptiste Onofré <jb...@nanthrax.net>
> wrote:
>
>> Hi Milen,
>>
>> we already have the Jira about what you propose, and it's not K4 related:
>> it's already for K3.
>>
>> Regards
>> JB
>>
>>
>> On 04/14/2015 11:12 AM, Milen Dyankov wrote:
>>
>>> I was thing about something like 3 base functionalities (with respect to
>>> configured repositories):
>>>
>>> feature:install  - installs a feature, all sub-featirues, bundles, ... (I
>>> guess nothing needs to change here)
>>> feature:remove - removes the feature only. All sub-features, bundles, are
>>> not touched! Perhaps there could be "-r" option to remove sub-features as
>>> well but bundles will always remain unchanged
>>> feature:list - shows bundles installed by a feature * even if the feature
>>> is not installed *
>>> bundle:provided-by - shows features that install that bundle (even if
>>> those
>>> are not currently installed)
>>>
>>> Given those above one could then script / develop all kind of helper
>>> command / tools. Like for example :
>>>
>>> autoclean - removes all bundles that were (1) installed as part of a
>>> feature which was removed and (2) no other feature point to them
>>> forced-remove - removes all bundles that were installed by given feature
>>> even if in use
>>> ....
>>>
>>> Does it make sense?
>>>
>>>
>>>
>>>
>>>
>>> On Tue, Apr 14, 2015 at 9:11 AM, Christian Schneider <
>>> chris@die-schneider.net> wrote:
>>>
>>>   Very well possible. What is the algorithm in Linux?
>>>>
>>>> Christian
>>>>
>>>> On 14.04.2015 09:06, Milen Dyankov wrote:
>>>>
>>>>   Please correct me if I'm wrong but aren't we talking about a problem
>>>>> that
>>>>> (at least conceptually) has been solved? Package management has been
>>>>> around
>>>>> in Linux for quite some time. Can't features just mimic the same
>>>>> behavior?
>>>>>    From my perspective features are quite similar to virtual packages in
>>>>> Debian based linux distributions.
>>>>>
>>>>> Best,
>>>>> Milen
>>>>> 14 kwi 2015 08:54 "Christian Schneider" <ch...@die-schneider.net>
>>>>> napisał(a):
>>>>>
>>>>>
>>>>>   --
>>>> Christian Schneider
>>>> http://www.liquid-reality.de
>>>>
>>>> Open Source Architect
>>>> http://www.talend.com
>>>>
>>>>
>>>>
>>>
>>>
>> --
>> Jean-Baptiste Onofré
>> jbonofre@apache.org
>> http://blog.nanthrax.net
>> Talend - http://www.talend.com
>>
>
>
>

-- 
Jean-Baptiste Onofré
jbonofre@apache.org
http://blog.nanthrax.net
Talend - http://www.talend.com

Re: [DISCUSS] Remove features lifecycle in K4

Posted by Milen Dyankov <mi...@gmail.com>.
Hi Jean-Baptiste,

perhaps I don't understand what is discussed here and what you meant by "remove
the features lifecycle commands".

Just wanted to share my point of view regarding features. That is, I see
features as deployment option (get needed bundles in place) and not as
bundle lifecycle batch management option. Or to follow up with my linux
example, one will do "apt-get install mysql" which will install also a
bunch of other things apart form mysql itself. But one does not do "apt-get
start/stop mysql" because that does not make sense. So if those are the
commands you think of removing then that's fine with me (although a bundle
start/stop batch job based on feature as grouping option is nice to have in
some cases)
But what is more important for me personally is to be able to tell how a
bundle was installed (stand alone or via feature). AFAIK this is not
something provided in K3

Best,
Milen




On Tue, Apr 14, 2015 at 11:14 AM, Jean-Baptiste Onofré <jb...@nanthrax.net>
wrote:

> Hi Milen,
>
> we already have the Jira about what you propose, and it's not K4 related:
> it's already for K3.
>
> Regards
> JB
>
>
> On 04/14/2015 11:12 AM, Milen Dyankov wrote:
>
>> I was thing about something like 3 base functionalities (with respect to
>> configured repositories):
>>
>> feature:install  - installs a feature, all sub-featirues, bundles, ... (I
>> guess nothing needs to change here)
>> feature:remove - removes the feature only. All sub-features, bundles, are
>> not touched! Perhaps there could be "-r" option to remove sub-features as
>> well but bundles will always remain unchanged
>> feature:list - shows bundles installed by a feature * even if the feature
>> is not installed *
>> bundle:provided-by - shows features that install that bundle (even if
>> those
>> are not currently installed)
>>
>> Given those above one could then script / develop all kind of helper
>> command / tools. Like for example :
>>
>> autoclean - removes all bundles that were (1) installed as part of a
>> feature which was removed and (2) no other feature point to them
>> forced-remove - removes all bundles that were installed by given feature
>> even if in use
>> ....
>>
>> Does it make sense?
>>
>>
>>
>>
>>
>> On Tue, Apr 14, 2015 at 9:11 AM, Christian Schneider <
>> chris@die-schneider.net> wrote:
>>
>>  Very well possible. What is the algorithm in Linux?
>>>
>>> Christian
>>>
>>> On 14.04.2015 09:06, Milen Dyankov wrote:
>>>
>>>  Please correct me if I'm wrong but aren't we talking about a problem
>>>> that
>>>> (at least conceptually) has been solved? Package management has been
>>>> around
>>>> in Linux for quite some time. Can't features just mimic the same
>>>> behavior?
>>>>   From my perspective features are quite similar to virtual packages in
>>>> Debian based linux distributions.
>>>>
>>>> Best,
>>>> Milen
>>>> 14 kwi 2015 08:54 "Christian Schneider" <ch...@die-schneider.net>
>>>> napisał(a):
>>>>
>>>>
>>>>  --
>>> Christian Schneider
>>> http://www.liquid-reality.de
>>>
>>> Open Source Architect
>>> http://www.talend.com
>>>
>>>
>>>
>>
>>
> --
> Jean-Baptiste Onofré
> jbonofre@apache.org
> http://blog.nanthrax.net
> Talend - http://www.talend.com
>



-- 
http://about.me/milen

Re: [DISCUSS] Remove features lifecycle in K4

Posted by Jean-Baptiste Onofré <jb...@nanthrax.net>.
Hi Milen,

we already have the Jira about what you propose, and it's not K4 
related: it's already for K3.

Regards
JB

On 04/14/2015 11:12 AM, Milen Dyankov wrote:
> I was thing about something like 3 base functionalities (with respect to
> configured repositories):
>
> feature:install  - installs a feature, all sub-featirues, bundles, ... (I
> guess nothing needs to change here)
> feature:remove - removes the feature only. All sub-features, bundles, are
> not touched! Perhaps there could be "-r" option to remove sub-features as
> well but bundles will always remain unchanged
> feature:list - shows bundles installed by a feature * even if the feature
> is not installed *
> bundle:provided-by - shows features that install that bundle (even if those
> are not currently installed)
>
> Given those above one could then script / develop all kind of helper
> command / tools. Like for example :
>
> autoclean - removes all bundles that were (1) installed as part of a
> feature which was removed and (2) no other feature point to them
> forced-remove - removes all bundles that were installed by given feature
> even if in use
> ....
>
> Does it make sense?
>
>
>
>
>
> On Tue, Apr 14, 2015 at 9:11 AM, Christian Schneider <
> chris@die-schneider.net> wrote:
>
>> Very well possible. What is the algorithm in Linux?
>>
>> Christian
>>
>> On 14.04.2015 09:06, Milen Dyankov wrote:
>>
>>> Please correct me if I'm wrong but aren't we talking about a problem that
>>> (at least conceptually) has been solved? Package management has been
>>> around
>>> in Linux for quite some time. Can't features just mimic the same behavior?
>>>   From my perspective features are quite similar to virtual packages in
>>> Debian based linux distributions.
>>>
>>> Best,
>>> Milen
>>> 14 kwi 2015 08:54 "Christian Schneider" <ch...@die-schneider.net>
>>> napisał(a):
>>>
>>>
>> --
>> Christian Schneider
>> http://www.liquid-reality.de
>>
>> Open Source Architect
>> http://www.talend.com
>>
>>
>
>

-- 
Jean-Baptiste Onofré
jbonofre@apache.org
http://blog.nanthrax.net
Talend - http://www.talend.com

Re: [DISCUSS] Remove features lifecycle in K4

Posted by Milen Dyankov <mi...@gmail.com>.
I was thing about something like 3 base functionalities (with respect to
configured repositories):

feature:install  - installs a feature, all sub-featirues, bundles, ... (I
guess nothing needs to change here)
feature:remove - removes the feature only. All sub-features, bundles, are
not touched! Perhaps there could be "-r" option to remove sub-features as
well but bundles will always remain unchanged
feature:list - shows bundles installed by a feature * even if the feature
is not installed *
bundle:provided-by - shows features that install that bundle (even if those
are not currently installed)

Given those above one could then script / develop all kind of helper
command / tools. Like for example :

autoclean - removes all bundles that were (1) installed as part of a
feature which was removed and (2) no other feature point to them
forced-remove - removes all bundles that were installed by given feature
even if in use
....

Does it make sense?





On Tue, Apr 14, 2015 at 9:11 AM, Christian Schneider <
chris@die-schneider.net> wrote:

> Very well possible. What is the algorithm in Linux?
>
> Christian
>
> On 14.04.2015 09:06, Milen Dyankov wrote:
>
>> Please correct me if I'm wrong but aren't we talking about a problem that
>> (at least conceptually) has been solved? Package management has been
>> around
>> in Linux for quite some time. Can't features just mimic the same behavior?
>>  From my perspective features are quite similar to virtual packages in
>> Debian based linux distributions.
>>
>> Best,
>> Milen
>> 14 kwi 2015 08:54 "Christian Schneider" <ch...@die-schneider.net>
>> napisał(a):
>>
>>
> --
> Christian Schneider
> http://www.liquid-reality.de
>
> Open Source Architect
> http://www.talend.com
>
>


-- 
http://about.me/milen

Re: [DISCUSS] Remove features lifecycle in K4

Posted by Christian Schneider <ch...@die-schneider.net>.
Very well possible. What is the algorithm in Linux?

Christian

On 14.04.2015 09:06, Milen Dyankov wrote:
> Please correct me if I'm wrong but aren't we talking about a problem that
> (at least conceptually) has been solved? Package management has been around
> in Linux for quite some time. Can't features just mimic the same behavior?
>  From my perspective features are quite similar to virtual packages in
> Debian based linux distributions.
>
> Best,
> Milen
> 14 kwi 2015 08:54 "Christian Schneider" <ch...@die-schneider.net>
> napisał(a):
>

-- 
Christian Schneider
http://www.liquid-reality.de

Open Source Architect
http://www.talend.com


Re: [DISCUSS] Remove features lifecycle in K4

Posted by Milen Dyankov <mi...@gmail.com>.
Please correct me if I'm wrong but aren't we talking about a problem that
(at least conceptually) has been solved? Package management has been around
in Linux for quite some time. Can't features just mimic the same behavior?
>From my perspective features are quite similar to virtual packages in
Debian based linux distributions.

Best,
Milen
14 kwi 2015 08:54 "Christian Schneider" <ch...@die-schneider.net>
napisał(a):

> I was not aware we have this information in the wires. I will try to
> implement it using these.
>
> So what I would do is this:
> I start with the features to be stopped / started.
> I then propagate down to the subfeatures / bundles.
> For each feature processed I compute the state as the highest state of all
> features that depend on it and the requested state.
>
> Does that make sense?
>
> The problem in this algorithm is that in many cases we will not be able to
> stop features / bundles as they are needed by other features.
> So probably we will need some reporting to explain why some features /
> bundles could not achieve the request state. To really stop a feature the
> user would then
> have to stop all top level features. Only then would it really change its
> state.
>
> We could also have kind of a force mode where we change the state first to
> the top and then down again. So this would guarantee that a feature changes
> its state but it could shut down half of karaf unintendedly. Which would be
> especially dangerous if we hit some core features like the feature service.
> So I tend to rather not support this.
>
> Christian
>
> On 13.04.2015 18:01, Guillaume Nodet wrote:
>
>> Yeah, I was thinking about it.
>> Though the obvious other solution is to fix it.
>>
>> I have actually started an email this morning to discuss but I haven't
>> finished it.
>>
>> Overall, I think it may not be very difficult to fix, as the bundle state
>> changes are already handled correctly afaik.  The real problem is to agree
>> on the semantics on the effects, so that we can compute the desired state
>> of each bundle correctly.
>>
>> Problems arise when a bundle is used by several features, one of which
>> being started and the other resolved.
>>
>> Anyway, it's really up to you, I don't mind fixing the code as long as we
>> agree on the behaviour.
>>
>> 2015-04-13 17:51 GMT+02:00 Jean-Baptiste Onofré <jb...@nanthrax.net>:
>>
>>  Hi all,
>>>
>>> I discussed with Christian about KARAF-3102.
>>>
>>> The feature lifecycle doesn't actually fully work, especially around the
>>> stop action.
>>>
>>> In order to avoid to perturb the users, I think we should remove the
>>> features lifecycle commands. Else, if they are provided, users will try
>>> it
>>> and may be disappointed as they won't work as expected.
>>>
>>> WDYT ?
>>>
>>> Regards
>>> JB
>>> --
>>> Jean-Baptiste Onofré
>>> jbonofre@apache.org
>>> http://blog.nanthrax.net
>>> Talend - http://www.talend.com
>>>
>>>
>
> --
> Christian Schneider
> http://www.liquid-reality.de
>
> Open Source Architect
> http://www.talend.com
>
>

Re: [DISCUSS] Remove features lifecycle in K4

Posted by Christian Schneider <ch...@die-schneider.net>.
I was not aware we have this information in the wires. I will try to 
implement it using these.

So what I would do is this:
I start with the features to be stopped / started.
I then propagate down to the subfeatures / bundles.
For each feature processed I compute the state as the highest state of 
all features that depend on it and the requested state.

Does that make sense?

The problem in this algorithm is that in many cases we will not be able 
to stop features / bundles as they are needed by other features.
So probably we will need some reporting to explain why some features / 
bundles could not achieve the request state. To really stop a feature 
the user would then
have to stop all top level features. Only then would it really change 
its state.

We could also have kind of a force mode where we change the state first 
to the top and then down again. So this would guarantee that a feature 
changes its state but it could shut down half of karaf unintendedly. 
Which would be especially dangerous if we hit some core features like 
the feature service. So I tend to rather not support this.

Christian

On 13.04.2015 18:01, Guillaume Nodet wrote:
> Yeah, I was thinking about it.
> Though the obvious other solution is to fix it.
>
> I have actually started an email this morning to discuss but I haven't
> finished it.
>
> Overall, I think it may not be very difficult to fix, as the bundle state
> changes are already handled correctly afaik.  The real problem is to agree
> on the semantics on the effects, so that we can compute the desired state
> of each bundle correctly.
>
> Problems arise when a bundle is used by several features, one of which
> being started and the other resolved.
>
> Anyway, it's really up to you, I don't mind fixing the code as long as we
> agree on the behaviour.
>
> 2015-04-13 17:51 GMT+02:00 Jean-Baptiste Onofré <jb...@nanthrax.net>:
>
>> Hi all,
>>
>> I discussed with Christian about KARAF-3102.
>>
>> The feature lifecycle doesn't actually fully work, especially around the
>> stop action.
>>
>> In order to avoid to perturb the users, I think we should remove the
>> features lifecycle commands. Else, if they are provided, users will try it
>> and may be disappointed as they won't work as expected.
>>
>> WDYT ?
>>
>> Regards
>> JB
>> --
>> Jean-Baptiste Onofré
>> jbonofre@apache.org
>> http://blog.nanthrax.net
>> Talend - http://www.talend.com
>>


-- 
Christian Schneider
http://www.liquid-reality.de

Open Source Architect
http://www.talend.com


Re: [DISCUSS] Remove features lifecycle in K4

Posted by Guillaume Nodet <gn...@apache.org>.
Yeah, I was thinking about it.
Though the obvious other solution is to fix it.

I have actually started an email this morning to discuss but I haven't
finished it.

Overall, I think it may not be very difficult to fix, as the bundle state
changes are already handled correctly afaik.  The real problem is to agree
on the semantics on the effects, so that we can compute the desired state
of each bundle correctly.

Problems arise when a bundle is used by several features, one of which
being started and the other resolved.

Anyway, it's really up to you, I don't mind fixing the code as long as we
agree on the behaviour.

2015-04-13 17:51 GMT+02:00 Jean-Baptiste Onofré <jb...@nanthrax.net>:

> Hi all,
>
> I discussed with Christian about KARAF-3102.
>
> The feature lifecycle doesn't actually fully work, especially around the
> stop action.
>
> In order to avoid to perturb the users, I think we should remove the
> features lifecycle commands. Else, if they are provided, users will try it
> and may be disappointed as they won't work as expected.
>
> WDYT ?
>
> Regards
> JB
> --
> Jean-Baptiste Onofré
> jbonofre@apache.org
> http://blog.nanthrax.net
> Talend - http://www.talend.com
>

Re: [DISCUSS] Remove features lifecycle in K4

Posted by Jean-Baptiste Onofré <jb...@nanthrax.net>.
THX !!
I gonna take a look.

Regards
JB

On 04/16/2015 12:58 PM, Guillaume Nodet wrote:
> The feature lifecycle and bundle state should now be fixed btw.
>
> 2015-04-13 17:51 GMT+02:00 Jean-Baptiste Onofré <jb...@nanthrax.net>:
>
>> Hi all,
>>
>> I discussed with Christian about KARAF-3102.
>>
>> The feature lifecycle doesn't actually fully work, especially around the
>> stop action.
>>
>> In order to avoid to perturb the users, I think we should remove the
>> features lifecycle commands. Else, if they are provided, users will try it
>> and may be disappointed as they won't work as expected.
>>
>> WDYT ?
>>
>> Regards
>> JB
>> --
>> Jean-Baptiste Onofré
>> jbonofre@apache.org
>> http://blog.nanthrax.net
>> Talend - http://www.talend.com
>>
>

-- 
Jean-Baptiste Onofré
jbonofre@apache.org
http://blog.nanthrax.net
Talend - http://www.talend.com

Re: [DISCUSS] Remove features lifecycle in K4

Posted by Guillaume Nodet <gn...@apache.org>.
The feature lifecycle and bundle state should now be fixed btw.

2015-04-13 17:51 GMT+02:00 Jean-Baptiste Onofré <jb...@nanthrax.net>:

> Hi all,
>
> I discussed with Christian about KARAF-3102.
>
> The feature lifecycle doesn't actually fully work, especially around the
> stop action.
>
> In order to avoid to perturb the users, I think we should remove the
> features lifecycle commands. Else, if they are provided, users will try it
> and may be disappointed as they won't work as expected.
>
> WDYT ?
>
> Regards
> JB
> --
> Jean-Baptiste Onofré
> jbonofre@apache.org
> http://blog.nanthrax.net
> Talend - http://www.talend.com
>