You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@taverna.apache.org by Nadeesh Dilanga <na...@gmail.com> on 2016/08/02 22:18:42 UTC

Re: Docker Activity Plugin Enhancements

If you are talking about a race condition to the same docker (cluster), it
does not make a difference whether plugin is in same JVM or not. Docker
server side handles container creation atomically. Also Docker will make
throws an exception if there is a container already running with the same
name/id. Which will return a error JSON from the plugin.

On Sun, Jul 31, 2016 at 3:11 PM, Alan Williams <al...@googlemail.com>
wrote:

> On 31-Jul-16 08:47, Nadeesh Dilanga wrote:
>
>> Hi,
>> Related to the validation piece, forgot to mention that Activity plugin
>> already checks those validations before it runs even now. ex: if I try to
>> start an already started container, it gives me a json response mentioning
>> the container already started.
>>
>
> I think that is reasonable. An alternative approach would be to take the
> running container. That, though, could lead to problems. What will happen
> if I try to run two instances of the activity at the same time i.e. same
> container. We will need to ensure that any conflict is prevented.
>
> Alan
>
>
>

Re: Docker Activity Plugin Enhancements

Posted by Alan Williams <al...@googlemail.com>.
On 07-Aug-16 16:10, Nadeesh Dilanga wrote:
> Shall I change the Activity plugin to read the action prams from
> JSONode(Activity Configuration) instead of hash map I am using now?

I don't think you should do that. It is sensible to keep a strong split 
between the configuration of what to run (the 
DockerContainerConfiguration) and the values to run it with (the JSONNode).

There are still things you can check with just the 
DockerContainerConfiguration, such as checking the host name.

Alan




Re: Docker Activity Plugin Enhancements

Posted by Nadeesh Dilanga <na...@gmail.com>.
Shall I change the Activity plugin to read the action prams from
JSONode(Activity Configuration) instead of hash map I am using now?

On Thu, Aug 4, 2016 at 11:29 PM, Nadeesh Dilanga <na...@gmail.com>
wrote:

> Hi,
> With the health check I hit on a road block and spent time to figure out
> how. But could not get through. Hence asking for some help.
>
> In my activity plugin, in  executeAsynch(), I am reading action parameters
> from map (Map<String, T2Reference> map). (Not from JsonNode set from
> Activity.configure()). I thought that is the correct way(correct me if I am
> wrong)
>
> ex: action=start-container  and name=myTestContainer1
> action=inspect-image and image-id=img123
>
> From HealthCheck visit() interface, how can I get hold to this input
> parameter map similar to what I get in Activity#executeAsynch() .
>
>
>
>
> On Tue, Aug 2, 2016 at 6:18 PM, Nadeesh Dilanga <na...@gmail.com>
> wrote:
>
>> If you are talking about a race condition to the same docker (cluster),
>> it does not make a difference whether plugin is in same JVM or not. Docker
>> server side handles container creation atomically. Also Docker will make
>> throws an exception if there is a container already running with the same
>> name/id. Which will return a error JSON from the plugin.
>>
>> On Sun, Jul 31, 2016 at 3:11 PM, Alan Williams <al...@googlemail.com>
>> wrote:
>>
>>> On 31-Jul-16 08:47, Nadeesh Dilanga wrote:
>>>
>>>> Hi,
>>>> Related to the validation piece, forgot to mention that Activity plugin
>>>> already checks those validations before it runs even now. ex: if I try
>>>> to
>>>> start an already started container, it gives me a json response
>>>> mentioning
>>>> the container already started.
>>>>
>>>
>>> I think that is reasonable. An alternative approach would be to take the
>>> running container. That, though, could lead to problems. What will happen
>>> if I try to run two instances of the activity at the same time i.e. same
>>> container. We will need to ensure that any conflict is prevented.
>>>
>>> Alan
>>>
>>>
>>>
>>
>

Re: Docker Activity Plugin Enhancements

Posted by Nadeesh Dilanga <na...@gmail.com>.
Hi Alan,
I have sent a new pull request. Please let me know if it needs any changes.

On Sun, Aug 14, 2016 at 6:12 PM, Nadeesh Dilanga <na...@gmail.com>
wrote:

> Sure will do. Actually it is my bad. I will change it to a proper error
> message.
>
>
> On Sat, Aug 13, 2016 at 1:04 PM, alaninmcr <al...@googlemail.com>
> wrote:
>
>> Hello again Nadeesh
>>
>> I noticed some problems with the messages in the health checker. It
>> refers to REST activity, and also does not give a helpful message if the
>> check fails. Can you fix those? Then I'll pull.
>>
>> Alan
>>
>
>

Re: Docker Activity Plugin Enhancements

Posted by Nadeesh Dilanga <na...@gmail.com>.
Sure will do. Actually it is my bad. I will change it to a proper error
message.


On Sat, Aug 13, 2016 at 1:04 PM, alaninmcr <al...@googlemail.com> wrote:

> Hello again Nadeesh
>
> I noticed some problems with the messages in the health checker. It refers
> to REST activity, and also does not give a helpful message if the check
> fails. Can you fix those? Then I'll pull.
>
> Alan
>

Re: Docker Activity Plugin Enhancements

Posted by alaninmcr <al...@googlemail.com>.
Hello again Nadeesh

I noticed some problems with the messages in the health checker. It 
refers to REST activity, and also does not give a helpful message if the 
check fails. Can you fix those? Then I'll pull.

Alan

Re: Docker Activity Plugin Enhancements

Posted by alaninmcr <al...@googlemail.com>.
On 10/08/2016 02:34, Nadeesh Dilanga wrote:
> Hi Alan, Hi Stian,
> I send a pull request with the Health Check feature for Docker Activity
> Plugin. Please review and let me know if I need to change anything.

Hello Nadeesh,

It looks good to me. I will do the pull today or tomorrow.

Have you looked at biobox and how to run a biobox?

Alan


Re: Docker Activity Plugin Enhancements

Posted by Nadeesh Dilanga <na...@gmail.com>.
Hi Alan, Hi Stian,
I send a pull request with the Health Check feature for Docker Activity
Plugin. Please review and let me know if I need to change anything.

On Tue, Aug 9, 2016 at 9:18 PM, Nadeesh Dilanga <na...@gmail.com>
wrote:

> I have updated the JIRA [1] with the user guide which has screen captures
> on understanding docker activity plugin.
> Please let me know your thoughts, so that I can improve it and update it.
>
> [1] - https://issues.apache.org/jira/browse/TAVERNA-901
>
> On Mon, Aug 8, 2016 at 10:39 PM, Nadeesh Dilanga <na...@gmail.com>
> wrote:
>
>> Ok, understood.
>> Then it appears I can do only one check. That is, "create container"
>> only(even though I have already written utilities to validate all other
>> operations). Ex: In create container we check whether there is already
>> existing container with same name. On the other hand, to start a containe
>> by name, we check whether there is a container created (and NOT running)
>> with the same name.
>>
>> So with this it is clear we can only do one check in this health check.
>> I also went through the WSDL health check implementation. Will send out a
>> pull request soon with the docker health check..
>>
>> I am also composed a doc on understand docker activity plugin with the
>> help of unit tests. I will create a PDF and attach to the gsoc docker
>> public JIRA. Hope that is ok ? Otherwise please let me know what I should
>> be doing.
>>
>>
>>
>> On Mon, Aug 8, 2016 at 11:21 AM, Alan Williams <al...@googlemail.com>
>> wrote:
>>
>>> On 08-Aug-16 03:12, Nadeesh Dilanga wrote:
>>>
>>>> Hi Alan,
>>>> Thanks for the input.
>>>> Yes you are very correct. Activity configuration has the information of
>>>> the
>>>> container. But what I meant more like is, what to do ? start/stop  etc.
>>>> For
>>>> Health check, the interface taverna already given apparently does not
>>>> expect to check those individual entities separately. But more like
>>>> check
>>>> whether create/start/inspect (all possible activities) potentially
>>>> healthy
>>>> to execute as a whole. Is that correct ?
>>>>
>>>
>>> Yes.
>>>
>>> An alternative would be to have sub-classes of DockerActivity, such as
>>> StartDockerActivity, and to have corresponding sub-classes of
>>> DockerConfiguration. I think for the GSOC work that this would be
>>> "overkill" and can be left for a future version 2 :)
>>>
>>> Alan
>>>
>>>
>>>
>>
>

Re: Docker Activity Plugin Enhancements

Posted by Nadeesh Dilanga <na...@gmail.com>.
I have updated the JIRA [1] with the user guide which has screen captures
on understanding docker activity plugin.
Please let me know your thoughts, so that I can improve it and update it.

[1] - https://issues.apache.org/jira/browse/TAVERNA-901

On Mon, Aug 8, 2016 at 10:39 PM, Nadeesh Dilanga <na...@gmail.com>
wrote:

> Ok, understood.
> Then it appears I can do only one check. That is, "create container"
> only(even though I have already written utilities to validate all other
> operations). Ex: In create container we check whether there is already
> existing container with same name. On the other hand, to start a containe
> by name, we check whether there is a container created (and NOT running)
> with the same name.
>
> So with this it is clear we can only do one check in this health check.  I
> also went through the WSDL health check implementation. Will send out a
> pull request soon with the docker health check..
>
> I am also composed a doc on understand docker activity plugin with the
> help of unit tests. I will create a PDF and attach to the gsoc docker
> public JIRA. Hope that is ok ? Otherwise please let me know what I should
> be doing.
>
>
>
> On Mon, Aug 8, 2016 at 11:21 AM, Alan Williams <al...@googlemail.com>
> wrote:
>
>> On 08-Aug-16 03:12, Nadeesh Dilanga wrote:
>>
>>> Hi Alan,
>>> Thanks for the input.
>>> Yes you are very correct. Activity configuration has the information of
>>> the
>>> container. But what I meant more like is, what to do ? start/stop  etc.
>>> For
>>> Health check, the interface taverna already given apparently does not
>>> expect to check those individual entities separately. But more like check
>>> whether create/start/inspect (all possible activities) potentially
>>> healthy
>>> to execute as a whole. Is that correct ?
>>>
>>
>> Yes.
>>
>> An alternative would be to have sub-classes of DockerActivity, such as
>> StartDockerActivity, and to have corresponding sub-classes of
>> DockerConfiguration. I think for the GSOC work that this would be
>> "overkill" and can be left for a future version 2 :)
>>
>> Alan
>>
>>
>>
>

Re: Docker Activity Plugin Enhancements

Posted by Nadeesh Dilanga <na...@gmail.com>.
Ok, understood.
Then it appears I can do only one check. That is, "create container"
only(even though I have already written utilities to validate all other
operations). Ex: In create container we check whether there is already
existing container with same name. On the other hand, to start a containe
by name, we check whether there is a container created (and NOT running)
with the same name.

So with this it is clear we can only do one check in this health check.  I
also went through the WSDL health check implementation. Will send out a
pull request soon with the docker health check..

I am also composed a doc on understand docker activity plugin with the help
of unit tests. I will create a PDF and attach to the gsoc docker public
JIRA. Hope that is ok ? Otherwise please let me know what I should be doing.



On Mon, Aug 8, 2016 at 11:21 AM, Alan Williams <al...@googlemail.com>
wrote:

> On 08-Aug-16 03:12, Nadeesh Dilanga wrote:
>
>> Hi Alan,
>> Thanks for the input.
>> Yes you are very correct. Activity configuration has the information of
>> the
>> container. But what I meant more like is, what to do ? start/stop  etc.
>> For
>> Health check, the interface taverna already given apparently does not
>> expect to check those individual entities separately. But more like check
>> whether create/start/inspect (all possible activities) potentially healthy
>> to execute as a whole. Is that correct ?
>>
>
> Yes.
>
> An alternative would be to have sub-classes of DockerActivity, such as
> StartDockerActivity, and to have corresponding sub-classes of
> DockerConfiguration. I think for the GSOC work that this would be
> "overkill" and can be left for a future version 2 :)
>
> Alan
>
>
>

Re: Docker Activity Plugin Enhancements

Posted by Alan Williams <al...@googlemail.com>.
On 08-Aug-16 03:12, Nadeesh Dilanga wrote:
> Hi Alan,
> Thanks for the input.
> Yes you are very correct. Activity configuration has the information of the
> container. But what I meant more like is, what to do ? start/stop  etc. For
> Health check, the interface taverna already given apparently does not
> expect to check those individual entities separately. But more like check
> whether create/start/inspect (all possible activities) potentially healthy
> to execute as a whole. Is that correct ?

Yes.

An alternative would be to have sub-classes of DockerActivity, such as 
StartDockerActivity, and to have corresponding sub-classes of 
DockerConfiguration. I think for the GSOC work that this would be 
"overkill" and can be left for a future version 2 :)

Alan



Re: Docker Activity Plugin Enhancements

Posted by Nadeesh Dilanga <na...@gmail.com>.
Hi Alan,
Thanks for the input.
Yes you are very correct. Activity configuration has the information of the
container. But what I meant more like is, what to do ? start/stop  etc. For
Health check, the interface taverna already given apparently does not
expect to check those individual entities separately. But more like check
whether create/start/inspect (all possible activities) potentially healthy
to execute as a whole. Is that correct ?

On Sun, Aug 7, 2016 at 3:39 PM, Alan Williams <al...@googlemail.com>
wrote:

> On 05-Aug-16 04:29, Nadeesh Dilanga wrote:
>
>> Hi,
>> With the health check I hit on a road block and spent time to figure out
>> how. But could not get through. Hence asking for some help.
>>
>> In my activity plugin, in  executeAsynch(), I am reading action parameters
>> from map (Map<String, T2Reference> map). (Not from JsonNode set from
>> Activity.configure()). I thought that is the correct way(correct me if I
>> am
>> wrong)
>>
>
> No. I think that is the right thing to do, at least for the first version
> of the activity.
>
> ex: action=start-container  and name=myTestContainer1
>> action=inspect-image and image-id=img123
>>
>
> From HealthCheck visit() interface, how can I get hold to this input
>> parameter map similar to what I get in Activity#executeAsynch() .
>>
>
> You cannot. There is enough information in the DockerConfiguration to so
> some checks.
>
> Alan
>
>

Re: Docker Activity Plugin Enhancements

Posted by Alan Williams <al...@googlemail.com>.
On 05-Aug-16 04:29, Nadeesh Dilanga wrote:
> Hi,
> With the health check I hit on a road block and spent time to figure out
> how. But could not get through. Hence asking for some help.
>
> In my activity plugin, in  executeAsynch(), I am reading action parameters
> from map (Map<String, T2Reference> map). (Not from JsonNode set from
> Activity.configure()). I thought that is the correct way(correct me if I am
> wrong)

No. I think that is the right thing to do, at least for the first 
version of the activity.

> ex: action=start-container  and name=myTestContainer1
> action=inspect-image and image-id=img123

> From HealthCheck visit() interface, how can I get hold to this input
> parameter map similar to what I get in Activity#executeAsynch() .

You cannot. There is enough information in the DockerConfiguration to so 
some checks.

Alan


Re: Docker Activity Plugin Enhancements

Posted by Nadeesh Dilanga <na...@gmail.com>.
Hi,
With the health check I hit on a road block and spent time to figure out
how. But could not get through. Hence asking for some help.

In my activity plugin, in  executeAsynch(), I am reading action parameters
from map (Map<String, T2Reference> map). (Not from JsonNode set from
Activity.configure()). I thought that is the correct way(correct me if I am
wrong)

ex: action=start-container  and name=myTestContainer1
action=inspect-image and image-id=img123

From HealthCheck visit() interface, how can I get hold to this input
parameter map similar to what I get in Activity#executeAsynch() .




On Tue, Aug 2, 2016 at 6:18 PM, Nadeesh Dilanga <na...@gmail.com>
wrote:

> If you are talking about a race condition to the same docker (cluster), it
> does not make a difference whether plugin is in same JVM or not. Docker
> server side handles container creation atomically. Also Docker will make
> throws an exception if there is a container already running with the same
> name/id. Which will return a error JSON from the plugin.
>
> On Sun, Jul 31, 2016 at 3:11 PM, Alan Williams <al...@googlemail.com>
> wrote:
>
>> On 31-Jul-16 08:47, Nadeesh Dilanga wrote:
>>
>>> Hi,
>>> Related to the validation piece, forgot to mention that Activity plugin
>>> already checks those validations before it runs even now. ex: if I try to
>>> start an already started container, it gives me a json response
>>> mentioning
>>> the container already started.
>>>
>>
>> I think that is reasonable. An alternative approach would be to take the
>> running container. That, though, could lead to problems. What will happen
>> if I try to run two instances of the activity at the same time i.e. same
>> container. We will need to ensure that any conflict is prevented.
>>
>> Alan
>>
>>
>>
>