You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@stratos.apache.org by Rajkumar Rajaratnam <ra...@wso2.com> on 2015/02/18 14:41:41 UTC

[Discuss] Application Policy Validation Implementation

Hi Devs,

I am almost done with application policy validation logic and would like to
give an update on the implementation. This is the sample application policy.

{
   "networkPartition":[
      {
         "id":"network-partition-1",
         "activeByDefault":"true"
      },
      {
         "id":"network-partition-2",
         "activeByDefault":"false"
      }
   ]
}

I have now implemented the following validations.

   - application policy should contain at least one network partition
   reference
   - validating all network partition references
      - network-partition-id can't be null or empty
      - network partition should be already added/deployed
      - there should be at least one network partition reference which is
   active by default

There is one more thing needs to be validated here.

   - validating application policy against the application

Here, we need to validate whether all the cartridges are available in all
the network partitions defined in the application policy. In other words,
each cartridge should be available in each network partitions defined in
the application policy. Availability of a cartridge in a network partition
will be decided based on the deployment policy it refers.

I am currently implementing this validation.

Please let me know if I missed any other validation.

Thanks.

-- 
Rajkumar Rajaratnam
Committer & PMC Member, Apache Stratos
Software Engineer, WSO2

Mobile : +94777568639
Blog : rajkumarr.com

Re: [Discuss] Application Policy Validation Implementation

Posted by Sajith Kariyawasam <sa...@wso2.com>.
I have already implemented persisting applicationId - applicationPolicy
map, and getApplicationPolicy by application Id, in PolicyManager
May be you can expose the same via AutoscalerServiceImpl

On Wed, Feb 18, 2015 at 10:23 PM, Rajkumar Rajaratnam <ra...@wso2.com>
wrote:

>
>
> On Wed, Feb 18, 2015 at 10:17 PM, Rajkumar Rajaratnam <ra...@wso2.com>
> wrote:
>
>>
>>
>> On Wed, Feb 18, 2015 at 7:54 PM, Imesh Gunaratne <im...@apache.org>
>> wrote:
>>
>>> Great effort Raj! Validations look good!
>>>
>>> I think we could introduce a new API method to query network partition
>>> references in a given application. This would allow the UI to generate the
>>> application deployment page with a set of checkboxes to select "active by
>>> default" property in each network partition reference.
>>>
>>
>> A good suggestion Imesh. I will introduce this API in CC.
>>
>
> Sorry for the typo. This API should be in AS.
>
>>
>> Thanks
>>
>>
>>>
>>> Thanks
>>>
>>> On Wed, Feb 18, 2015 at 7:11 PM, Rajkumar Rajaratnam <rajkumarr@wso2.com
>>> > wrote:
>>>
>>>> Hi Devs,
>>>>
>>>> I am almost done with application policy validation logic and would
>>>> like to give an update on the implementation. This is the sample
>>>> application policy.
>>>>
>>>> {
>>>>    "networkPartition":[
>>>>       {
>>>>          "id":"network-partition-1",
>>>>          "activeByDefault":"true"
>>>>       },
>>>>       {
>>>>          "id":"network-partition-2",
>>>>          "activeByDefault":"false"
>>>>       }
>>>>    ]
>>>> }
>>>>
>>>> I have now implemented the following validations.
>>>>
>>>>    - application policy should contain at least one network partition
>>>>    reference
>>>>    - validating all network partition references
>>>>       - network-partition-id can't be null or empty
>>>>       - network partition should be already added/deployed
>>>>       - there should be at least one network partition reference which
>>>>    is active by default
>>>>
>>>> There is one more thing needs to be validated here.
>>>>
>>>>    - validating application policy against the application
>>>>
>>>> Here, we need to validate whether all the cartridges are available in
>>>> all the network partitions defined in the application policy. In other
>>>> words, each cartridge should be available in each network partitions
>>>> defined in the application policy. Availability of a cartridge in a network
>>>> partition will be decided based on the deployment policy it refers.
>>>>
>>>> I am currently implementing this validation.
>>>>
>>>> Please let me know if I missed any other validation.
>>>>
>>>> Thanks.
>>>>
>>>> --
>>>> Rajkumar Rajaratnam
>>>> Committer & PMC Member, Apache Stratos
>>>> Software Engineer, WSO2
>>>>
>>>> Mobile : +94777568639
>>>> Blog : rajkumarr.com
>>>>
>>>
>>>
>>>
>>> --
>>> Imesh Gunaratne
>>>
>>> Technical Lead, WSO2
>>> Committer & PMC Member, Apache Stratos
>>>
>>
>>
>>
>> --
>> Rajkumar Rajaratnam
>> Committer & PMC Member, Apache Stratos
>> Software Engineer, WSO2
>>
>> Mobile : +94777568639
>> Blog : rajkumarr.com
>>
>
>
>
> --
> Rajkumar Rajaratnam
> Committer & PMC Member, Apache Stratos
> Software Engineer, WSO2
>
> Mobile : +94777568639
> Blog : rajkumarr.com
>

Re: [Discuss] Application Policy Validation Implementation

Posted by Rajkumar Rajaratnam <ra...@wso2.com>.
On Wed, Feb 18, 2015 at 10:17 PM, Rajkumar Rajaratnam <ra...@wso2.com>
wrote:

>
>
> On Wed, Feb 18, 2015 at 7:54 PM, Imesh Gunaratne <im...@apache.org> wrote:
>
>> Great effort Raj! Validations look good!
>>
>> I think we could introduce a new API method to query network partition
>> references in a given application. This would allow the UI to generate the
>> application deployment page with a set of checkboxes to select "active by
>> default" property in each network partition reference.
>>
>
> A good suggestion Imesh. I will introduce this API in CC.
>

Sorry for the typo. This API should be in AS.

>
> Thanks
>
>
>>
>> Thanks
>>
>> On Wed, Feb 18, 2015 at 7:11 PM, Rajkumar Rajaratnam <ra...@wso2.com>
>> wrote:
>>
>>> Hi Devs,
>>>
>>> I am almost done with application policy validation logic and would like
>>> to give an update on the implementation. This is the sample application
>>> policy.
>>>
>>> {
>>>    "networkPartition":[
>>>       {
>>>          "id":"network-partition-1",
>>>          "activeByDefault":"true"
>>>       },
>>>       {
>>>          "id":"network-partition-2",
>>>          "activeByDefault":"false"
>>>       }
>>>    ]
>>> }
>>>
>>> I have now implemented the following validations.
>>>
>>>    - application policy should contain at least one network partition
>>>    reference
>>>    - validating all network partition references
>>>       - network-partition-id can't be null or empty
>>>       - network partition should be already added/deployed
>>>       - there should be at least one network partition reference which
>>>    is active by default
>>>
>>> There is one more thing needs to be validated here.
>>>
>>>    - validating application policy against the application
>>>
>>> Here, we need to validate whether all the cartridges are available in
>>> all the network partitions defined in the application policy. In other
>>> words, each cartridge should be available in each network partitions
>>> defined in the application policy. Availability of a cartridge in a network
>>> partition will be decided based on the deployment policy it refers.
>>>
>>> I am currently implementing this validation.
>>>
>>> Please let me know if I missed any other validation.
>>>
>>> Thanks.
>>>
>>> --
>>> Rajkumar Rajaratnam
>>> Committer & PMC Member, Apache Stratos
>>> Software Engineer, WSO2
>>>
>>> Mobile : +94777568639
>>> Blog : rajkumarr.com
>>>
>>
>>
>>
>> --
>> Imesh Gunaratne
>>
>> Technical Lead, WSO2
>> Committer & PMC Member, Apache Stratos
>>
>
>
>
> --
> Rajkumar Rajaratnam
> Committer & PMC Member, Apache Stratos
> Software Engineer, WSO2
>
> Mobile : +94777568639
> Blog : rajkumarr.com
>



-- 
Rajkumar Rajaratnam
Committer & PMC Member, Apache Stratos
Software Engineer, WSO2

Mobile : +94777568639
Blog : rajkumarr.com

Re: [Discuss] Application Policy Validation Implementation

Posted by Rajkumar Rajaratnam <ra...@wso2.com>.
On Wed, Feb 18, 2015 at 7:54 PM, Imesh Gunaratne <im...@apache.org> wrote:

> Great effort Raj! Validations look good!
>
> I think we could introduce a new API method to query network partition
> references in a given application. This would allow the UI to generate the
> application deployment page with a set of checkboxes to select "active by
> default" property in each network partition reference.
>

A good suggestion Imesh. I will introduce this API in CC.

Thanks


>
> Thanks
>
> On Wed, Feb 18, 2015 at 7:11 PM, Rajkumar Rajaratnam <ra...@wso2.com>
> wrote:
>
>> Hi Devs,
>>
>> I am almost done with application policy validation logic and would like
>> to give an update on the implementation. This is the sample application
>> policy.
>>
>> {
>>    "networkPartition":[
>>       {
>>          "id":"network-partition-1",
>>          "activeByDefault":"true"
>>       },
>>       {
>>          "id":"network-partition-2",
>>          "activeByDefault":"false"
>>       }
>>    ]
>> }
>>
>> I have now implemented the following validations.
>>
>>    - application policy should contain at least one network partition
>>    reference
>>    - validating all network partition references
>>       - network-partition-id can't be null or empty
>>       - network partition should be already added/deployed
>>       - there should be at least one network partition reference which
>>    is active by default
>>
>> There is one more thing needs to be validated here.
>>
>>    - validating application policy against the application
>>
>> Here, we need to validate whether all the cartridges are available in all
>> the network partitions defined in the application policy. In other words,
>> each cartridge should be available in each network partitions defined in
>> the application policy. Availability of a cartridge in a network partition
>> will be decided based on the deployment policy it refers.
>>
>> I am currently implementing this validation.
>>
>> Please let me know if I missed any other validation.
>>
>> Thanks.
>>
>> --
>> Rajkumar Rajaratnam
>> Committer & PMC Member, Apache Stratos
>> Software Engineer, WSO2
>>
>> Mobile : +94777568639
>> Blog : rajkumarr.com
>>
>
>
>
> --
> Imesh Gunaratne
>
> Technical Lead, WSO2
> Committer & PMC Member, Apache Stratos
>



-- 
Rajkumar Rajaratnam
Committer & PMC Member, Apache Stratos
Software Engineer, WSO2

Mobile : +94777568639
Blog : rajkumarr.com

Re: [Discuss] Application Policy Validation Implementation

Posted by Imesh Gunaratne <im...@apache.org>.
Great effort Raj! Validations look good!

I think we could introduce a new API method to query network partition
references in a given application. This would allow the UI to generate the
application deployment page with a set of checkboxes to select "active by
default" property in each network partition reference.

Thanks

On Wed, Feb 18, 2015 at 7:11 PM, Rajkumar Rajaratnam <ra...@wso2.com>
wrote:

> Hi Devs,
>
> I am almost done with application policy validation logic and would like
> to give an update on the implementation. This is the sample application
> policy.
>
> {
>    "networkPartition":[
>       {
>          "id":"network-partition-1",
>          "activeByDefault":"true"
>       },
>       {
>          "id":"network-partition-2",
>          "activeByDefault":"false"
>       }
>    ]
> }
>
> I have now implemented the following validations.
>
>    - application policy should contain at least one network partition
>    reference
>    - validating all network partition references
>       - network-partition-id can't be null or empty
>       - network partition should be already added/deployed
>       - there should be at least one network partition reference which is
>    active by default
>
> There is one more thing needs to be validated here.
>
>    - validating application policy against the application
>
> Here, we need to validate whether all the cartridges are available in all
> the network partitions defined in the application policy. In other words,
> each cartridge should be available in each network partitions defined in
> the application policy. Availability of a cartridge in a network partition
> will be decided based on the deployment policy it refers.
>
> I am currently implementing this validation.
>
> Please let me know if I missed any other validation.
>
> Thanks.
>
> --
> Rajkumar Rajaratnam
> Committer & PMC Member, Apache Stratos
> Software Engineer, WSO2
>
> Mobile : +94777568639
> Blog : rajkumarr.com
>



-- 
Imesh Gunaratne

Technical Lead, WSO2
Committer & PMC Member, Apache Stratos