You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@stratos.apache.org by Isuru Haththotuwa <is...@wso2.com> on 2014/01/16 17:00:07 UTC

[DISCUSS] Handling Repository Updates to Synchronize Artifacts

Hi Devs,

This is to discuss $subject.

One approach is to use a git hook configured in the repository as an
eventing mechanism [1]. Here, when the repository receives an git push, an
event will be fired and we can use this to get notifications that there is
an update. Currently, user interaction with Stratos is done through a Rest
API. We can use the same mechanism to receive events from the repository.
However, in this approach we would need to handle how to authenticate the
event which is received from the external repository.

Another approach is to use a task in the cartridge agent itself to run
periodically and check for updates in the git repository. This approach is
much simpler.

WDYT?


[1]. http://developer.github.com/v3/repos/hooks/

-- 
Thanks and Regards,

Isuru H.
+94 716 358 048* <http://wso2.com/>*

Re: [DISCUSS] Handling Repository Updates to Synchronize Artifacts

Posted by Kishanthan Thangarajah <ks...@gmail.com>.
On Sat, Jan 18, 2014 at 11:12 PM, Isuru Haththotuwa <is...@wso2.com> wrote:
> Hi Kishanthan,
>
> Its a very valid point, and the frequency of updates can very much different
> for each use case.
>
> Adding more to Lakmal's reply, we have identified that periodic polling can
> have a negative performance in some scenarios, specially on the git server
> used. Therefore, the preferred way would be to use a event based artifact
> update mechanism. We can use a git hook, and for authentication purpose, we
> could use a custom token/key based mechanism.

Yes, sounds like a good approach.

>
>
> On Sat, Jan 18, 2014 at 11:46 AM, Lakmal Warusawithana <la...@wso2.com>
> wrote:
>>
>> Hi Krishanthan,
>>
>> We have to fix this. Here is the propose way for fixing this. We can
>> generate a key(token) when user subscribe to cartridge. (this only valid for
>> framework cartridge, which need to give artifact repository. e.g: git repo
>> url ). This key return to user after subscribe. We should have REST endpoint
>> to get artifact update notifications. User can create post commit hook from
>> their git server (e.g github ..etc), and call above REST endpoint giving
>> above mention key as token. This will verify with subscription token and
>> pass ADC to take action for artifact update. It will create depsync message
>> and send to instance notifier, which subscribe by Stratos agent, which
>> reside in instance and update the artifacts.  There is no poling, it will
>> trigger on demand.
>>
>>
>> On Sat, Jan 18, 2014 at 9:37 AM, Kishanthan Thangarajah
>> <ks...@gmail.com> wrote:
>>>
>>> On Thu, Jan 16, 2014 at 9:30 PM, Isuru Haththotuwa <is...@wso2.com>
>>> wrote:
>>> > Hi Devs,
>>> >
>>> > This is to discuss $subject.
>>> >
>>> > One approach is to use a git hook configured in the repository as an
>>> > eventing mechanism [1]. Here, when the repository receives an git push,
>>> > an
>>> > event will be fired and we can use this to get notifications that there
>>> > is
>>> > an update. Currently, user interaction with Stratos is done through a
>>> > Rest
>>> > API. We can use the same mechanism to receive events from the
>>> > repository.
>>> > However, in this approach we would need to handle how to authenticate
>>> > the
>>> > event which is received from the external repository.
>>> >
>>> > Another approach is to use a task in the cartridge agent itself to run
>>> > periodically and check for updates in the git repository. This approach
>>> > is
>>> > much simpler.
>>> >
>>> > WDYT?
>>>
>>> But the question would be how often the artifacts gets updated? If it
>>> is frequent then periodic check seems to be good. If not, considering
>>> performance, an event driven approach could be the option.
>>>
>>> How about having both the options and allow users to decide on which
>>> they want to use?
>>>
>>> >
>>> >
>>> > [1]. http://developer.github.com/v3/repos/hooks/
>>> >
>>> > --
>>> > Thanks and Regards,
>>> >
>>> > Isuru H.
>>> > +94 716 358 048
>>> >
>>> >
>>
>>
>>
>>
>> --
>> Lakmal Warusawithana
>> Software Architect; WSO2 Inc.
>> Mobile : +94714289692
>> Blog : http://lakmalsview.blogspot.com/
>>
>
>
>
> --
> Thanks and Regards,
>
> Isuru H.
> +94 716 358 048
>
>

Re: [DISCUSS] Handling Repository Updates to Synchronize Artifacts

Posted by Isuru Haththotuwa <is...@wso2.com>.
Hi Kishanthan,

Its a very valid point, and the frequency of updates can very much
different for each use case.

Adding more to Lakmal's reply, we have identified that periodic polling can
have a negative performance in some scenarios, specially on the git server
used. Therefore, the preferred way would be to use a event based artifact
update mechanism. We can use a git hook, and for authentication purpose, we
could use a custom token/key based mechanism.


On Sat, Jan 18, 2014 at 11:46 AM, Lakmal Warusawithana <la...@wso2.com>wrote:

> Hi Krishanthan,
>
> We have to fix this. Here is the propose way for fixing this. We can
> generate a key(token) when user subscribe to cartridge. (this only valid
> for framework cartridge, which need to give artifact repository. e.g: git
> repo url ). This key return to user after subscribe. We should have REST
> endpoint to get artifact update notifications. User can create post commit
> hook from their git server (e.g github ..etc), and call above REST endpoint
> giving above mention key as token. This will verify with subscription token
> and pass ADC to take action for artifact update. It will create depsync
> message and send to instance notifier, which subscribe by Stratos agent,
> which reside in instance and update the artifacts.  There is no poling, it
> will trigger on demand.
>
>
> On Sat, Jan 18, 2014 at 9:37 AM, Kishanthan Thangarajah <
> kshanth2101@gmail.com> wrote:
>
>> On Thu, Jan 16, 2014 at 9:30 PM, Isuru Haththotuwa <is...@wso2.com>
>> wrote:
>> > Hi Devs,
>> >
>> > This is to discuss $subject.
>> >
>> > One approach is to use a git hook configured in the repository as an
>> > eventing mechanism [1]. Here, when the repository receives an git push,
>> an
>> > event will be fired and we can use this to get notifications that there
>> is
>> > an update. Currently, user interaction with Stratos is done through a
>> Rest
>> > API. We can use the same mechanism to receive events from the
>> repository.
>> > However, in this approach we would need to handle how to authenticate
>> the
>> > event which is received from the external repository.
>> >
>> > Another approach is to use a task in the cartridge agent itself to run
>> > periodically and check for updates in the git repository. This approach
>> is
>> > much simpler.
>> >
>> > WDYT?
>>
>> But the question would be how often the artifacts gets updated? If it
>> is frequent then periodic check seems to be good. If not, considering
>> performance, an event driven approach could be the option.
>>
>> How about having both the options and allow users to decide on which
>> they want to use?
>>
>> >
>> >
>> > [1]. http://developer.github.com/v3/repos/hooks/
>> >
>> > --
>> > Thanks and Regards,
>> >
>> > Isuru H.
>> > +94 716 358 048
>> >
>> >
>>
>
>
>
> --
> Lakmal Warusawithana
> Software Architect; WSO2 Inc.
> Mobile : +94714289692
> Blog : http://lakmalsview.blogspot.com/
>
>


-- 
Thanks and Regards,

Isuru H.
+94 716 358 048* <http://wso2.com/>*

Re: [DISCUSS] Handling Repository Updates to Synchronize Artifacts

Posted by Lakmal Warusawithana <la...@wso2.com>.
Hi Krishanthan,

We have to fix this. Here is the propose way for fixing this. We can
generate a key(token) when user subscribe to cartridge. (this only valid
for framework cartridge, which need to give artifact repository. e.g: git
repo url ). This key return to user after subscribe. We should have REST
endpoint to get artifact update notifications. User can create post commit
hook from their git server (e.g github ..etc), and call above REST endpoint
giving above mention key as token. This will verify with subscription token
and pass ADC to take action for artifact update. It will create depsync
message and send to instance notifier, which subscribe by Stratos agent,
which reside in instance and update the artifacts.  There is no poling, it
will trigger on demand.


On Sat, Jan 18, 2014 at 9:37 AM, Kishanthan Thangarajah <
kshanth2101@gmail.com> wrote:

> On Thu, Jan 16, 2014 at 9:30 PM, Isuru Haththotuwa <is...@wso2.com>
> wrote:
> > Hi Devs,
> >
> > This is to discuss $subject.
> >
> > One approach is to use a git hook configured in the repository as an
> > eventing mechanism [1]. Here, when the repository receives an git push,
> an
> > event will be fired and we can use this to get notifications that there
> is
> > an update. Currently, user interaction with Stratos is done through a
> Rest
> > API. We can use the same mechanism to receive events from the repository.
> > However, in this approach we would need to handle how to authenticate the
> > event which is received from the external repository.
> >
> > Another approach is to use a task in the cartridge agent itself to run
> > periodically and check for updates in the git repository. This approach
> is
> > much simpler.
> >
> > WDYT?
>
> But the question would be how often the artifacts gets updated? If it
> is frequent then periodic check seems to be good. If not, considering
> performance, an event driven approach could be the option.
>
> How about having both the options and allow users to decide on which
> they want to use?
>
> >
> >
> > [1]. http://developer.github.com/v3/repos/hooks/
> >
> > --
> > Thanks and Regards,
> >
> > Isuru H.
> > +94 716 358 048
> >
> >
>



-- 
Lakmal Warusawithana
Software Architect; WSO2 Inc.
Mobile : +94714289692
Blog : http://lakmalsview.blogspot.com/

Re: [DISCUSS] Handling Repository Updates to Synchronize Artifacts

Posted by Kishanthan Thangarajah <ks...@gmail.com>.
On Thu, Jan 16, 2014 at 9:30 PM, Isuru Haththotuwa <is...@wso2.com> wrote:
> Hi Devs,
>
> This is to discuss $subject.
>
> One approach is to use a git hook configured in the repository as an
> eventing mechanism [1]. Here, when the repository receives an git push, an
> event will be fired and we can use this to get notifications that there is
> an update. Currently, user interaction with Stratos is done through a Rest
> API. We can use the same mechanism to receive events from the repository.
> However, in this approach we would need to handle how to authenticate the
> event which is received from the external repository.
>
> Another approach is to use a task in the cartridge agent itself to run
> periodically and check for updates in the git repository. This approach is
> much simpler.
>
> WDYT?

But the question would be how often the artifacts gets updated? If it
is frequent then periodic check seems to be good. If not, considering
performance, an event driven approach could be the option.

How about having both the options and allow users to decide on which
they want to use?

>
>
> [1]. http://developer.github.com/v3/repos/hooks/
>
> --
> Thanks and Regards,
>
> Isuru H.
> +94 716 358 048
>
>