[ 
https://issues.apache.org/jira/browse/SLIDER-820?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14393726#comment-14393726
 ] 

thomas liu edited comment on SLIDER-820 at 4/7/15 10:49 PM:
------------------------------------------------------------

Previously, AgentProviderService issues commands for one component like:
INSTALL -> START -> GET_STATUS... -> STOP
now with add on packages, we would like it to issue commands:
INSTALL -> INSTALL_ADDON (for add on pkg 1) -> INSTALL_ADDON (for add on pkg 2) 
... -> START -> GET_STATUS... -> STOP

Given today SliderAM doesn't issue CONFIGURE commands to SliderAgent, users can 
choose to perform CONFIGURE tasks inside INSTALL. Or they can still define 
CONFIGURE command in their python scripts of the add on package and call it 
from INSTALL command in the python scripts

In AgentProviderService, we keep ComponentInstanceState for each Component. In 
org.apache.slider.providers.agent.application.metadata.ComponentInstanceState, 
we keep a map from package name to org.apache.slider.providers.agent.State. So 
besides the component state we keep in ComponentInstanceState, we are also 
tracking the state for each add on package.

Metainfo.json for each add on package will be read into Metainfo object in 
SliderAM. We've extended the existing Metainfo, Application, Component to hold 
those fields for add on packages
We also keep a map from package name to the add on packages' Metainfo object in 
AgentProviderService

When the component(master package component is in 'installed' state, this means 
the component is installed and now we can install the add on packages for this 
component. So We modify ComponentInstanceState.getNextCommand() to check, when 
the component is in 'installed' state, we go through the pkg->State map to see 
if any package is in 'init' state. If so, it means the package is not installed 
yet, and now we issue 'INSTALL_ADDON' command for it. The next heartbeat from 
the component can also indicate the component is in 'installing in progress' 
state, which means the add on package is still in installation. The way we 
distinguish whether it is the component (master pkg) is in 'in progress' state 
or it is the add on pkg in the state is: there is a field passed from 
SliderAgent to SliderAM 'package'. If it is null, then the heartbeat is for the 
master package, if not, the value is the name of the package. In the case when 
the add on package is in 'installing in progress' state, getNextCommand() will 
issue NOP command.



was (Author: thomas_liu):
Previously, AgentProviderService issues commands for one component like:
INSTALL -> START -> GET_STATUS... -> STOP
now with add on packages, we would like it to issue commands:
INSTALL -> INSTALL_ADDON (for add on pkg 1) -> INSTALL_ADDON (for add on pkg 2) 
... -> START -> GET_STATUS... -> STOP

In AgentProviderService, we keep ComponentInstanceState for each Component. In 
org.apache.slider.providers.agent.application.metadata.ComponentInstanceState, 
we keep a map from package name to org.apache.slider.providers.agent.State. So 
besides the component state we keep in ComponentInstanceState, we are also 
tracking the state for each add on package.

Metainfo.json for each add on package will be read into Metainfo object in 
SliderAM. We've extended the existing Metainfo, Application, Component to hold 
those fields for add on packages
We also keep a map from package name to the add on packages' Metainfo object in 
AgentProviderService

When the component(master package component is in 'installed' state, this means 
the component is installed and now we can install the add on packages for this 
component. So We modify ComponentInstanceState.getNextCommand() to check, when 
the component is in 'installed' state, we go through the pkg->State map to see 
if any package is in 'init' state. If so, it means the package is not installed 
yet, and now we issue 'INSTALL_ADDON' command for it. The next heartbeat from 
the component can also indicate the component is in 'installing in progress' 
state, which means the add on package is still in installation. The way we 
distinguish whether it is the component (master pkg) is in 'in progress' state 
or it is the add on pkg in the state is: there is a field passed from 
SliderAgent to SliderAM 'package'. If it is null, then the heartbeat is for the 
master package, if not, the value is the name of the package. In the case when 
the add on package is in 'installing in progress' state, getNextCommand() will 
issue NOP command.


> Enable AgentProviderService issue INSTALL and CONFIGURE command for addon 
> packages
> ----------------------------------------------------------------------------------
>
>                 Key: SLIDER-820
>                 URL: https://issues.apache.org/jira/browse/SLIDER-820
>             Project: Slider
>          Issue Type: Sub-task
>          Components: agent-provider, core
>            Reporter: thomas liu
>             Fix For: Slider 0.80
>
>
> Enable AgentProviderService issue INSTALL and CONFIGURE command for addon 
> packages, with parameters in the commands to install and configure addon 
> packages onto master package directories, for lib, conf, bin...



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to