All of lore.kernel.org
 help / color / mirror / Atom feed
* Build cancellation from toaster
@ 2015-12-17 16:56 sujith h
  2015-12-18 12:24 ` Michael Wood
  2015-12-18 13:46 ` Ed Bartosh
  0 siblings, 2 replies; 27+ messages in thread
From: sujith h @ 2015-12-17 16:56 UTC (permalink / raw)
  To: toaster

[-- Attachment #1: Type: text/plain, Size: 490 bytes --]

Hi,

I have posted my changes in:
http://git.yoctoproject.org/cgit/cgit.cgi/poky-contrib/log/?h=sujith/toaster-build-cancel

Kindly review my changes and let me know if I have to make changes. I would
be happy to do so.

Thanks for all helping hand from RP, Ed, Michael, Belen and Paul.

Thanks,
Sujith H

-- 
സുജിത് ഹരിദാസന്
Bangalore
<Project>Contributor to KDE project
http://fci.wikia.com/wiki/Anti-DRM-Campaign
<Blog> http://sujithh.info

[-- Attachment #2: Type: text/html, Size: 966 bytes --]

^ permalink raw reply	[flat|nested] 27+ messages in thread

* Re: Build cancellation from toaster
  2015-12-17 16:56 Build cancellation from toaster sujith h
@ 2015-12-18 12:24 ` Michael Wood
  2015-12-18 13:46 ` Ed Bartosh
  1 sibling, 0 replies; 27+ messages in thread
From: Michael Wood @ 2015-12-18 12:24 UTC (permalink / raw)
  To: toaster

Thanks Sujith

I wonder if there is a way to simplify this by using the 
getBuildEnvironmentController method from bldcontrol.bbcontroller?

and in views.py doing

buildctrl = getBuildEnvironmentController...
buildctrl._runCommand(["stateForceShutdown"])

(or add a convenience function to bbcontroller.py after the triggerEvent 
one)

Michael

On 17/12/15 16:56, sujith h wrote:
> Hi,
>
> I have posted my changes in: 
> http://git.yoctoproject.org/cgit/cgit.cgi/poky-contrib/log/?h=sujith/toaster-build-cancel
>
> Kindly review my changes and let me know if I have to make changes. I 
> would be happy to do so.
>
> Thanks for all helping hand from RP, Ed, Michael, Belen and Paul.
>
> Thanks,
> Sujith H
>
> -- 
> സുജിത് ഹരിദാസന്
> Bangalore
> <Project>Contributor to KDE project
> http://fci.wikia.com/wiki/Anti-DRM-Campaign
> <Blog> http://sujithh.info
>
>



^ permalink raw reply	[flat|nested] 27+ messages in thread

* Re: Build cancellation from toaster
  2015-12-17 16:56 Build cancellation from toaster sujith h
  2015-12-18 12:24 ` Michael Wood
@ 2015-12-18 13:46 ` Ed Bartosh
  2015-12-19 15:27   ` sujith h
  1 sibling, 1 reply; 27+ messages in thread
From: Ed Bartosh @ 2015-12-18 13:46 UTC (permalink / raw)
  To: sujith h; +Cc: toaster

Hi Sujith,

Can you split your changes please?
I'd suggest to at least separate backend changes from frontend ones.

Having uihelper.py changes in a separate commit would be nice too.
It looks like you've spotted correctly that findServerDetails is not
used anywhere in bitbake code. You can remove it in a separate commit as
it looks unrelated to the rest of the patch.

+1 for Michael's suggestion to use build controller.

On Thu, Dec 17, 2015 at 10:26:11PM +0530, sujith h wrote:
> Hi,
> 
> I have posted my changes in:
> http://git.yoctoproject.org/cgit/cgit.cgi/poky-contrib/log/?h=sujith/toaster-build-cancel
> 
> Kindly review my changes and let me know if I have to make changes. I would
> be happy to do so.
> 
> Thanks for all helping hand from RP, Ed, Michael, Belen and Paul.
> 
> Thanks,
> Sujith H

--
Regards,
Ed


^ permalink raw reply	[flat|nested] 27+ messages in thread

* Re: Build cancellation from toaster
  2015-12-18 13:46 ` Ed Bartosh
@ 2015-12-19 15:27   ` sujith h
  2015-12-21  8:07     ` sujith h
  0 siblings, 1 reply; 27+ messages in thread
From: sujith h @ 2015-12-19 15:27 UTC (permalink / raw)
  To: Ed Bartosh; +Cc: toaster

[-- Attachment #1: Type: text/plain, Size: 2807 bytes --]

Hi,

On Fri, Dec 18, 2015 at 7:16 PM, Ed Bartosh <ed.bartosh@linux.intel.com>
wrote:

> Hi Sujith,
>
> Can you split your changes please?
> I'd suggest to at least separate backend changes from frontend ones.
>
> Having uihelper.py changes in a separate commit would be nice too.
> It looks like you've spotted correctly that findServerDetails is not
> used anywhere in bitbake code. You can remove it in a separate commit as
> it looks unrelated to the rest of the patch.
>
> +1 for Michael's suggestion to use build controller.
>

 The problem I see using build controller is:

I have tried with the build controller approach earlier and below are my
findings:
Lets say if I try to use getBuildEnvironmentController function as:

localhostbctrl = localhostbecontroller.LocalhostBEController(be) # in
toastergui/views.py
localhostbctrl.getBBController()

Then the failure starts when the control reaches function startBBServer
and the initial assert fails.

Even if I try to add a wrapper function known as cancelBuild in
bbcontroller.py:

    def conncetToServer(self):
        server = bb.server.xmlrpc.BitBakeXMLRPCClient()
        server.initServer()
        server.saveConnectionDetails("%s:%s" % (self.be.bbaddress,
self.be.bbport))
        self.connection = server.establishConnection([])

        self.be.bbtoken = self.connection.transport.connection_token
        self.be.save()

        return BitbakeController(self.connection)

This would fail in server.establishConnection line. Because internally it
does call connect function in xmlrpc.py which does call
uievent.BBUIEventQueue. This call causes exception, because in
registerEventHandler function  there is a line:

 if (self.cooker.state in [bb.cooker.state.parsing,
bb.cooker.state.running]):

I couldn't tackle this situation and that is the reason why I opted for
another approach from uihelper's function findServerDetails.
Is there any other way using which I can tackle this situation from
bbcontroller.py? As per my investigation the problem bubbles around with
registerEventHandler function with this approach.

Thanks,
Sujith H


> On Thu, Dec 17, 2015 at 10:26:11PM +0530, sujith h wrote:
> > Hi,
> >
> > I have posted my changes in:
> >
> http://git.yoctoproject.org/cgit/cgit.cgi/poky-contrib/log/?h=sujith/toaster-build-cancel
> >
> > Kindly review my changes and let me know if I have to make changes. I
> would
> > be happy to do so.
> >
> > Thanks for all helping hand from RP, Ed, Michael, Belen and Paul.
> >
> > Thanks,
> > Sujith H
>
> --
> Regards,
> Ed
>



-- 
സുജിത് ഹരിദാസന്
Bangalore
<Project>Contributor to KDE project
http://fci.wikia.com/wiki/Anti-DRM-Campaign
<Blog> http://sujithh.info

[-- Attachment #2: Type: text/html, Size: 3981 bytes --]

^ permalink raw reply	[flat|nested] 27+ messages in thread

* Re: Build cancellation from toaster
  2015-12-19 15:27   ` sujith h
@ 2015-12-21  8:07     ` sujith h
  2015-12-21 13:12       ` sujith h
  0 siblings, 1 reply; 27+ messages in thread
From: sujith h @ 2015-12-21  8:07 UTC (permalink / raw)
  To: Ed Bartosh; +Cc: toaster

[-- Attachment #1: Type: text/plain, Size: 4637 bytes --]

Hi,


On Sat, Dec 19, 2015 at 8:57 PM, sujith h <sujith.h@gmail.com> wrote:

> Hi,
>
> On Fri, Dec 18, 2015 at 7:16 PM, Ed Bartosh <ed.bartosh@linux.intel.com>
> wrote:
>
>> Hi Sujith,
>>
>> Can you split your changes please?
>> I'd suggest to at least separate backend changes from frontend ones.
>>
>> Having uihelper.py changes in a separate commit would be nice too.
>> It looks like you've spotted correctly that findServerDetails is not
>> used anywhere in bitbake code. You can remove it in a separate commit as
>> it looks unrelated to the rest of the patch.
>>
>> +1 for Michael's suggestion to use build controller.
>>
>
>  The problem I see using build controller is:
>
> I have tried with the build controller approach earlier and below are my
> findings:
> Lets say if I try to use getBuildEnvironmentController function as:
>
> localhostbctrl = localhostbecontroller.LocalhostBEController(be) # in
> toastergui/views.py
> localhostbctrl.getBBController()
>
> Then the failure starts when the control reaches function startBBServer
> and the initial assert fails.
>
> Even if I try to add a wrapper function known as cancelBuild in
> bbcontroller.py:
>
>     def conncetToServer(self):
>         server = bb.server.xmlrpc.BitBakeXMLRPCClient()
>         server.initServer()
>         server.saveConnectionDetails("%s:%s" % (self.be.bbaddress,
> self.be.bbport))
>         self.connection = server.establishConnection([])
>
>         self.be.bbtoken = self.connection.transport.connection_token
>         self.be.save()
>
>         return BitbakeController(self.connection)
>
> This would fail in server.establishConnection line. Because internally it
> does call connect function in xmlrpc.py which does call
> uievent.BBUIEventQueue. This call causes exception, because in
> registerEventHandler function  there is a line:
>
>  if (self.cooker.state in [bb.cooker.state.parsing,
> bb.cooker.state.running]):
>
> I couldn't tackle this situation and that is the reason why I opted for
> another approach from uihelper's function findServerDetails.
> Is there any other way using which I can tackle this situation from
> bbcontroller.py? As per my investigation the problem bubbles around with
> registerEventHandler function with this approach.
>

Another approach which I followed was ( using bbcontroller.py ) by writing
a new function getBBServer:

    def getBBServer(self, host, port):
        """ returns a connection from running server. This helps in
cancellation of bitbake from
            toaster UI.
        """
        server, transport = bb.server.xmlrpc._create_server(host, port)
        return server

And then call this function from toastergui/views.py file:

                        br =
BuildRequest.objects.select_for_update().get(project = prj, pk = i,
state__lte = BuildRequest.REQ_INPROGRESS)
                        bbctrl =
bbcontroller.BuildEnvironmentController(br.environment)
                        server =
bbctrl.getBBServer(br.environment.bbaddress, br.environment.bbport)
                        logger.warning(br.environment.LOCK_STATE)
                        server.runCommand(["stateForceShutdown"])
                        while True:
                            if len(BuildRequest.objects.get(pk = i
).build.errors) > 0:
                                br.state = BuildRequest.REQ_DELETED
                                br.save()
                                build = BuildRequest.objects.get(pk = i
).build
                                build.outcome = 0
                                build.save()
                                break


Nothing else is coming into my mind. Any pointers?

>
> Thanks,
> Sujith H
>
>
>> On Thu, Dec 17, 2015 at 10:26:11PM +0530, sujith h wrote:
>> > Hi,
>> >
>> > I have posted my changes in:
>> >
>> http://git.yoctoproject.org/cgit/cgit.cgi/poky-contrib/log/?h=sujith/toaster-build-cancel
>> >
>> > Kindly review my changes and let me know if I have to make changes. I
>> would
>> > be happy to do so.
>> >
>> > Thanks for all helping hand from RP, Ed, Michael, Belen and Paul.
>> >
>> > Thanks,
>> > Sujith H
>>
>> --
>> Regards,
>> Ed
>>
>
>
>
> --
> സുജിത് ഹരിദാസന്
> Bangalore
> <Project>Contributor to KDE project
> http://fci.wikia.com/wiki/Anti-DRM-Campaign
> <Blog> http://sujithh.info
>



-- 
സുജിത് ഹരിദാസന്
Bangalore
<Project>Contributor to KDE project
http://fci.wikia.com/wiki/Anti-DRM-Campaign
<Blog> http://sujithh.info

[-- Attachment #2: Type: text/html, Size: 7038 bytes --]

^ permalink raw reply	[flat|nested] 27+ messages in thread

* Re: Build cancellation from toaster
  2015-12-21  8:07     ` sujith h
@ 2015-12-21 13:12       ` sujith h
  2015-12-22 10:49         ` sujith h
  0 siblings, 1 reply; 27+ messages in thread
From: sujith h @ 2015-12-21 13:12 UTC (permalink / raw)
  To: toaster

[-- Attachment #1: Type: text/plain, Size: 5281 bytes --]

Hi,

I have updated patch :
http://git.yoctoproject.org/cgit/cgit.cgi/poky-contrib/log/?h=sujith/toaster-build-cancel2

Let me know if this looks ok or needs more enhancement(s)?

Thanks,
Sujith H

On Mon, Dec 21, 2015 at 1:37 PM, sujith h <sujith.h@gmail.com> wrote:

> Hi,
>
>
> On Sat, Dec 19, 2015 at 8:57 PM, sujith h <sujith.h@gmail.com> wrote:
>
>> Hi,
>>
>> On Fri, Dec 18, 2015 at 7:16 PM, Ed Bartosh <ed.bartosh@linux.intel.com>
>> wrote:
>>
>>> Hi Sujith,
>>>
>>> Can you split your changes please?
>>> I'd suggest to at least separate backend changes from frontend ones.
>>>
>>> Having uihelper.py changes in a separate commit would be nice too.
>>> It looks like you've spotted correctly that findServerDetails is not
>>> used anywhere in bitbake code. You can remove it in a separate commit as
>>> it looks unrelated to the rest of the patch.
>>>
>>> +1 for Michael's suggestion to use build controller.
>>>
>>
>>  The problem I see using build controller is:
>>
>> I have tried with the build controller approach earlier and below are my
>> findings:
>> Lets say if I try to use getBuildEnvironmentController function as:
>>
>> localhostbctrl = localhostbecontroller.LocalhostBEController(be) # in
>> toastergui/views.py
>> localhostbctrl.getBBController()
>>
>> Then the failure starts when the control reaches function startBBServer
>> and the initial assert fails.
>>
>> Even if I try to add a wrapper function known as cancelBuild in
>> bbcontroller.py:
>>
>>     def conncetToServer(self):
>>         server = bb.server.xmlrpc.BitBakeXMLRPCClient()
>>         server.initServer()
>>         server.saveConnectionDetails("%s:%s" % (self.be.bbaddress,
>> self.be.bbport))
>>         self.connection = server.establishConnection([])
>>
>>         self.be.bbtoken = self.connection.transport.connection_token
>>         self.be.save()
>>
>>         return BitbakeController(self.connection)
>>
>> This would fail in server.establishConnection line. Because internally it
>> does call connect function in xmlrpc.py which does call
>> uievent.BBUIEventQueue. This call causes exception, because in
>> registerEventHandler function  there is a line:
>>
>>  if (self.cooker.state in [bb.cooker.state.parsing,
>> bb.cooker.state.running]):
>>
>> I couldn't tackle this situation and that is the reason why I opted for
>> another approach from uihelper's function findServerDetails.
>> Is there any other way using which I can tackle this situation from
>> bbcontroller.py? As per my investigation the problem bubbles around with
>> registerEventHandler function with this approach.
>>
>
> Another approach which I followed was ( using bbcontroller.py ) by writing
> a new function getBBServer:
>
>     def getBBServer(self, host, port):
>         """ returns a connection from running server. This helps in
> cancellation of bitbake from
>             toaster UI.
>         """
>         server, transport = bb.server.xmlrpc._create_server(host, port)
>         return server
>
> And then call this function from toastergui/views.py file:
>
>                         br =
> BuildRequest.objects.select_for_update().get(project = prj, pk = i,
> state__lte = BuildRequest.REQ_INPROGRESS)
>                         bbctrl =
> bbcontroller.BuildEnvironmentController(br.environment)
>                         server =
> bbctrl.getBBServer(br.environment.bbaddress, br.environment.bbport)
>                         logger.warning(br.environment.LOCK_STATE)
>                         server.runCommand(["stateForceShutdown"])
>                         while True:
>                             if len(BuildRequest.objects.get(pk = i
> ).build.errors) > 0:
>                                 br.state = BuildRequest.REQ_DELETED
>                                 br.save()
>                                 build = BuildRequest.objects.get(pk = i
> ).build
>                                 build.outcome = 0
>                                 build.save()
>                                 break
>
>
> Nothing else is coming into my mind. Any pointers?
>
>>
>> Thanks,
>> Sujith H
>>
>>
>>> On Thu, Dec 17, 2015 at 10:26:11PM +0530, sujith h wrote:
>>> > Hi,
>>> >
>>> > I have posted my changes in:
>>> >
>>> http://git.yoctoproject.org/cgit/cgit.cgi/poky-contrib/log/?h=sujith/toaster-build-cancel
>>> >
>>> > Kindly review my changes and let me know if I have to make changes. I
>>> would
>>> > be happy to do so.
>>> >
>>> > Thanks for all helping hand from RP, Ed, Michael, Belen and Paul.
>>> >
>>> > Thanks,
>>> > Sujith H
>>>
>>> --
>>> Regards,
>>> Ed
>>>
>>
>>
>>
>> --
>> സുജിത് ഹരിദാസന്
>> Bangalore
>> <Project>Contributor to KDE project
>> http://fci.wikia.com/wiki/Anti-DRM-Campaign
>> <Blog> http://sujithh.info
>>
>
>
>
> --
> സുജിത് ഹരിദാസന്
> Bangalore
> <Project>Contributor to KDE project
> http://fci.wikia.com/wiki/Anti-DRM-Campaign
> <Blog> http://sujithh.info
>



-- 
സുജിത് ഹരിദാസന്
Bangalore
<Project>Contributor to KDE project
http://fci.wikia.com/wiki/Anti-DRM-Campaign
<Blog> http://sujithh.info

[-- Attachment #2: Type: text/html, Size: 8198 bytes --]

^ permalink raw reply	[flat|nested] 27+ messages in thread

* Re: Build cancellation from toaster
  2015-12-21 13:12       ` sujith h
@ 2015-12-22 10:49         ` sujith h
  2016-01-04 13:16           ` sujith h
  0 siblings, 1 reply; 27+ messages in thread
From: sujith h @ 2015-12-22 10:49 UTC (permalink / raw)
  To: toaster

[-- Attachment #1: Type: text/plain, Size: 6687 bytes --]

Hi,

Made small modification compared to my earlier branch
sujith/toaster-build-cancel2 in :
http://git.yoctoproject.org/cgit/cgit.cgi/poky-contrib/log/?h=sujith/toaster-build-cancel3
I have tried to split my work into 3 patches
a) One for UI ( html + js)
b) One for API
c) One for toastergui/views.py

The only reason why I couldn't remove the line : self.connection =
server.establishConnection([]) from toaster/bldcontrol/bbcontroller.py file
is due to the fact that self.connection is an instance of
bb.server.xmlrpc.BitBakeXMLRPCServerConnection
and the server returned from
bb.server.xmlrpc._create_server(self.be.bbaddress, int(self.be.bbport)) ,
is an instance of ServerProxy.
So I am not sure if I completely remove self.connection =
server.establishConnection([]) and use
bb.server.xmlrpc._create_server(self.be.bbaddress, int(self.be.bbport))[0],
would cause breakage of code.

Any pointers here would be helpful.

Thanks,

Sujith H

On Mon, Dec 21, 2015 at 6:42 PM, sujith h <sujith.h@gmail.com> wrote:

> Hi,
>
> I have updated patch :
> http://git.yoctoproject.org/cgit/cgit.cgi/poky-contrib/log/?h=sujith/toaster-build-cancel2
>
> Let me know if this looks ok or needs more enhancement(s)?
>
> Thanks,
> Sujith H
>
> On Mon, Dec 21, 2015 at 1:37 PM, sujith h <sujith.h@gmail.com> wrote:
>
>> Hi,
>>
>>
>> On Sat, Dec 19, 2015 at 8:57 PM, sujith h <sujith.h@gmail.com> wrote:
>>
>>> Hi,
>>>
>>> On Fri, Dec 18, 2015 at 7:16 PM, Ed Bartosh <ed.bartosh@linux.intel.com>
>>> wrote:
>>>
>>>> Hi Sujith,
>>>>
>>>> Can you split your changes please?
>>>> I'd suggest to at least separate backend changes from frontend ones.
>>>>
>>>> Having uihelper.py changes in a separate commit would be nice too.
>>>> It looks like you've spotted correctly that findServerDetails is not
>>>> used anywhere in bitbake code. You can remove it in a separate commit as
>>>> it looks unrelated to the rest of the patch.
>>>>
>>>> +1 for Michael's suggestion to use build controller.
>>>>
>>>
>>>  The problem I see using build controller is:
>>>
>>> I have tried with the build controller approach earlier and below are my
>>> findings:
>>> Lets say if I try to use getBuildEnvironmentController function as:
>>>
>>> localhostbctrl = localhostbecontroller.LocalhostBEController(be) # in
>>> toastergui/views.py
>>> localhostbctrl.getBBController()
>>>
>>> Then the failure starts when the control reaches function startBBServer
>>> and the initial assert fails.
>>>
>>> Even if I try to add a wrapper function known as cancelBuild in
>>> bbcontroller.py:
>>>
>>>     def conncetToServer(self):
>>>         server = bb.server.xmlrpc.BitBakeXMLRPCClient()
>>>         server.initServer()
>>>         server.saveConnectionDetails("%s:%s" % (self.be.bbaddress,
>>> self.be.bbport))
>>>         self.connection = server.establishConnection([])
>>>
>>>         self.be.bbtoken = self.connection.transport.connection_token
>>>         self.be.save()
>>>
>>>         return BitbakeController(self.connection)
>>>
>>> This would fail in server.establishConnection line. Because internally
>>> it does call connect function in xmlrpc.py which does call
>>> uievent.BBUIEventQueue. This call causes exception, because in
>>> registerEventHandler function  there is a line:
>>>
>>>  if (self.cooker.state in [bb.cooker.state.parsing,
>>> bb.cooker.state.running]):
>>>
>>> I couldn't tackle this situation and that is the reason why I opted for
>>> another approach from uihelper's function findServerDetails.
>>> Is there any other way using which I can tackle this situation from
>>> bbcontroller.py? As per my investigation the problem bubbles around with
>>> registerEventHandler function with this approach.
>>>
>>
>> Another approach which I followed was ( using bbcontroller.py ) by
>> writing a new function getBBServer:
>>
>>     def getBBServer(self, host, port):
>>         """ returns a connection from running server. This helps in
>> cancellation of bitbake from
>>             toaster UI.
>>         """
>>         server, transport = bb.server.xmlrpc._create_server(host, port)
>>         return server
>>
>> And then call this function from toastergui/views.py file:
>>
>>                         br =
>> BuildRequest.objects.select_for_update().get(project = prj, pk = i,
>> state__lte = BuildRequest.REQ_INPROGRESS)
>>                         bbctrl =
>> bbcontroller.BuildEnvironmentController(br.environment)
>>                         server =
>> bbctrl.getBBServer(br.environment.bbaddress, br.environment.bbport)
>>                         logger.warning(br.environment.LOCK_STATE)
>>                         server.runCommand(["stateForceShutdown"])
>>                         while True:
>>                             if len(BuildRequest.objects.get(pk = i
>> ).build.errors) > 0:
>>                                 br.state = BuildRequest.REQ_DELETED
>>                                 br.save()
>>                                 build = BuildRequest.objects.get(pk = i
>> ).build
>>                                 build.outcome = 0
>>                                 build.save()
>>                                 break
>>
>>
>> Nothing else is coming into my mind. Any pointers?
>>
>>>
>>> Thanks,
>>> Sujith H
>>>
>>>
>>>> On Thu, Dec 17, 2015 at 10:26:11PM +0530, sujith h wrote:
>>>> > Hi,
>>>> >
>>>> > I have posted my changes in:
>>>> >
>>>> http://git.yoctoproject.org/cgit/cgit.cgi/poky-contrib/log/?h=sujith/toaster-build-cancel
>>>> >
>>>> > Kindly review my changes and let me know if I have to make changes. I
>>>> would
>>>> > be happy to do so.
>>>> >
>>>> > Thanks for all helping hand from RP, Ed, Michael, Belen and Paul.
>>>> >
>>>> > Thanks,
>>>> > Sujith H
>>>>
>>>> --
>>>> Regards,
>>>> Ed
>>>>
>>>
>>>
>>>
>>> --
>>> സുജിത് ഹരിദാസന്
>>> Bangalore
>>> <Project>Contributor to KDE project
>>> http://fci.wikia.com/wiki/Anti-DRM-Campaign
>>> <Blog> http://sujithh.info
>>>
>>
>>
>>
>> --
>> സുജിത് ഹരിദാസന്
>> Bangalore
>> <Project>Contributor to KDE project
>> http://fci.wikia.com/wiki/Anti-DRM-Campaign
>> <Blog> http://sujithh.info
>>
>
>
>
> --
> സുജിത് ഹരിദാസന്
> Bangalore
> <Project>Contributor to KDE project
> http://fci.wikia.com/wiki/Anti-DRM-Campaign
> <Blog> http://sujithh.info
>



-- 
സുജിത് ഹരിദാസന്
Bangalore
<Project>Contributor to KDE project
http://fci.wikia.com/wiki/Anti-DRM-Campaign
<Blog> http://sujithh.info

[-- Attachment #2: Type: text/html, Size: 10384 bytes --]

^ permalink raw reply	[flat|nested] 27+ messages in thread

* Re: Build cancellation from toaster
  2015-12-22 10:49         ` sujith h
@ 2016-01-04 13:16           ` sujith h
  2016-01-05 13:44             ` Barros Pena, Belen
  0 siblings, 1 reply; 27+ messages in thread
From: sujith h @ 2016-01-04 13:16 UTC (permalink / raw)
  To: toaster

[-- Attachment #1: Type: text/plain, Size: 7859 bytes --]

Hi,

Finally I arrived at :
http://git.yoctoproject.org/cgit/cgit.cgi/poky-contrib/log/?h=sujith/toaster-build-cancel9
This patch set would help user to cancel build from toaster.

How to test it:
a) Start toaster
b) Create Project
c) Select the image to build ( I have tested with core-image-sato or
core-image-weston).
d) Once the image/recipe is triggered to build, a cancel button can be
visible on the right side of the progress bar.
e) If you wish to cancel the build once the build is triggered click the
cancel button.
f) Once the cancel is done, the page gets reloaded and user can see in the
toaster build is stopped.

Thanks,
Sujith H

On Tue, Dec 22, 2015 at 4:19 PM, sujith h <sujith.h@gmail.com> wrote:

> Hi,
>
> Made small modification compared to my earlier branch
> sujith/toaster-build-cancel2 in :
>
> http://git.yoctoproject.org/cgit/cgit.cgi/poky-contrib/log/?h=sujith/toaster-build-cancel3
> I have tried to split my work into 3 patches
> a) One for UI ( html + js)
> b) One for API
> c) One for toastergui/views.py
>
> The only reason why I couldn't remove the line : self.connection =
> server.establishConnection([]) from toaster/bldcontrol/bbcontroller.py file
> is due to the fact that self.connection is an instance of
> bb.server.xmlrpc.BitBakeXMLRPCServerConnection
> and the server returned from
> bb.server.xmlrpc._create_server(self.be.bbaddress, int(self.be.bbport)) ,
> is an instance of ServerProxy.
> So I am not sure if I completely remove self.connection =
> server.establishConnection([]) and use
> bb.server.xmlrpc._create_server(self.be.bbaddress, int(self.be.bbport))[0],
> would cause breakage of code.
>
> Any pointers here would be helpful.
>
> Thanks,
>
> Sujith H
>
>
> On Mon, Dec 21, 2015 at 6:42 PM, sujith h <sujith.h@gmail.com> wrote:
>
>> Hi,
>>
>> I have updated patch :
>> http://git.yoctoproject.org/cgit/cgit.cgi/poky-contrib/log/?h=sujith/toaster-build-cancel2
>>
>> Let me know if this looks ok or needs more enhancement(s)?
>>
>> Thanks,
>> Sujith H
>>
>> On Mon, Dec 21, 2015 at 1:37 PM, sujith h <sujith.h@gmail.com> wrote:
>>
>>> Hi,
>>>
>>>
>>> On Sat, Dec 19, 2015 at 8:57 PM, sujith h <sujith.h@gmail.com> wrote:
>>>
>>>> Hi,
>>>>
>>>> On Fri, Dec 18, 2015 at 7:16 PM, Ed Bartosh <ed.bartosh@linux.intel.com
>>>> > wrote:
>>>>
>>>>> Hi Sujith,
>>>>>
>>>>> Can you split your changes please?
>>>>> I'd suggest to at least separate backend changes from frontend ones.
>>>>>
>>>>> Having uihelper.py changes in a separate commit would be nice too.
>>>>> It looks like you've spotted correctly that findServerDetails is not
>>>>> used anywhere in bitbake code. You can remove it in a separate commit
>>>>> as
>>>>> it looks unrelated to the rest of the patch.
>>>>>
>>>>> +1 for Michael's suggestion to use build controller.
>>>>>
>>>>
>>>>  The problem I see using build controller is:
>>>>
>>>> I have tried with the build controller approach earlier and below are
>>>> my findings:
>>>> Lets say if I try to use getBuildEnvironmentController function as:
>>>>
>>>> localhostbctrl = localhostbecontroller.LocalhostBEController(be) # in
>>>> toastergui/views.py
>>>> localhostbctrl.getBBController()
>>>>
>>>> Then the failure starts when the control reaches function
>>>> startBBServer  and the initial assert fails.
>>>>
>>>> Even if I try to add a wrapper function known as cancelBuild in
>>>> bbcontroller.py:
>>>>
>>>>     def conncetToServer(self):
>>>>         server = bb.server.xmlrpc.BitBakeXMLRPCClient()
>>>>         server.initServer()
>>>>         server.saveConnectionDetails("%s:%s" % (self.be.bbaddress,
>>>> self.be.bbport))
>>>>         self.connection = server.establishConnection([])
>>>>
>>>>         self.be.bbtoken = self.connection.transport.connection_token
>>>>         self.be.save()
>>>>
>>>>         return BitbakeController(self.connection)
>>>>
>>>> This would fail in server.establishConnection line. Because internally
>>>> it does call connect function in xmlrpc.py which does call
>>>> uievent.BBUIEventQueue. This call causes exception, because in
>>>> registerEventHandler function  there is a line:
>>>>
>>>>  if (self.cooker.state in [bb.cooker.state.parsing,
>>>> bb.cooker.state.running]):
>>>>
>>>> I couldn't tackle this situation and that is the reason why I opted for
>>>> another approach from uihelper's function findServerDetails.
>>>> Is there any other way using which I can tackle this situation from
>>>> bbcontroller.py? As per my investigation the problem bubbles around with
>>>> registerEventHandler function with this approach.
>>>>
>>>
>>> Another approach which I followed was ( using bbcontroller.py ) by
>>> writing a new function getBBServer:
>>>
>>>     def getBBServer(self, host, port):
>>>         """ returns a connection from running server. This helps in
>>> cancellation of bitbake from
>>>             toaster UI.
>>>         """
>>>         server, transport = bb.server.xmlrpc._create_server(host, port)
>>>         return server
>>>
>>> And then call this function from toastergui/views.py file:
>>>
>>>                         br =
>>> BuildRequest.objects.select_for_update().get(project = prj, pk = i,
>>> state__lte = BuildRequest.REQ_INPROGRESS)
>>>                         bbctrl =
>>> bbcontroller.BuildEnvironmentController(br.environment)
>>>                         server =
>>> bbctrl.getBBServer(br.environment.bbaddress, br.environment.bbport)
>>>                         logger.warning(br.environment.LOCK_STATE)
>>>                         server.runCommand(["stateForceShutdown"])
>>>                         while True:
>>>                             if len(BuildRequest.objects.get(pk = i
>>> ).build.errors) > 0:
>>>                                 br.state = BuildRequest.REQ_DELETED
>>>                                 br.save()
>>>                                 build = BuildRequest.objects.get(pk = i
>>> ).build
>>>                                 build.outcome = 0
>>>                                 build.save()
>>>                                 break
>>>
>>>
>>> Nothing else is coming into my mind. Any pointers?
>>>
>>>>
>>>> Thanks,
>>>> Sujith H
>>>>
>>>>
>>>>> On Thu, Dec 17, 2015 at 10:26:11PM +0530, sujith h wrote:
>>>>> > Hi,
>>>>> >
>>>>> > I have posted my changes in:
>>>>> >
>>>>> http://git.yoctoproject.org/cgit/cgit.cgi/poky-contrib/log/?h=sujith/toaster-build-cancel
>>>>> >
>>>>> > Kindly review my changes and let me know if I have to make changes.
>>>>> I would
>>>>> > be happy to do so.
>>>>> >
>>>>> > Thanks for all helping hand from RP, Ed, Michael, Belen and Paul.
>>>>> >
>>>>> > Thanks,
>>>>> > Sujith H
>>>>>
>>>>> --
>>>>> Regards,
>>>>> Ed
>>>>>
>>>>
>>>>
>>>>
>>>> --
>>>> സുജിത് ഹരിദാസന്
>>>> Bangalore
>>>> <Project>Contributor to KDE project
>>>> http://fci.wikia.com/wiki/Anti-DRM-Campaign
>>>> <Blog> http://sujithh.info
>>>>
>>>
>>>
>>>
>>> --
>>> സുജിത് ഹരിദാസന്
>>> Bangalore
>>> <Project>Contributor to KDE project
>>> http://fci.wikia.com/wiki/Anti-DRM-Campaign
>>> <Blog> http://sujithh.info
>>>
>>
>>
>>
>> --
>> സുജിത് ഹരിദാസന്
>> Bangalore
>> <Project>Contributor to KDE project
>> http://fci.wikia.com/wiki/Anti-DRM-Campaign
>> <Blog> http://sujithh.info
>>
>
>
>
> --
> സുജിത് ഹരിദാസന്
> Bangalore
> <Project>Contributor to KDE project
> http://fci.wikia.com/wiki/Anti-DRM-Campaign
> <Blog> http://sujithh.info
>



-- 
സുജിത് ഹരിദാസന്
Bangalore
<Project>Contributor to KDE project
http://fci.wikia.com/wiki/Anti-DRM-Campaign
<Blog> http://sujithh.info

[-- Attachment #2: Type: text/html, Size: 12211 bytes --]

^ permalink raw reply	[flat|nested] 27+ messages in thread

* Re: Build cancellation from toaster
  2016-01-04 13:16           ` sujith h
@ 2016-01-05 13:44             ` Barros Pena, Belen
  2016-01-05 14:13               ` sujith h
  0 siblings, 1 reply; 27+ messages in thread
From: Barros Pena, Belen @ 2016-01-05 13:44 UTC (permalink / raw)
  To: sujith h, toaster



On 04/01/2016 13:16, "toaster-bounces@yoctoproject.org on behalf of sujith
h" <toaster-bounces@yoctoproject.org on behalf of sujith.h@gmail.com>
wrote:

>Hi,
>
>
>Finally I arrived at :
>http://git.yoctoproject.org/cgit/cgit.cgi/poky-contrib/log/?h=sujith/toast
>er-build-cancel9 
><http://git.yoctoproject.org/cgit/cgit.cgi/poky-contrib/log/?h=sujith/toas
>ter-build-cancel9>

I am not sure this is working for me. When I click the 'cancel' button, I
get the loading spinner. The spinner never goes away and the build status
never updates by itself. If you reload the page after a while though, the
build shows as failed.

I guess step one should be making sure that the build state updates
without me having to reload the page. Once that's done, there will be some
UI refinements needed. To see how the cancellation should behave on the UI
side of things you can visit:

http://www.yoctoproject.org/toaster/project-builds.html

Type 'core' in the build text field on the top right hand corner of the
page, select one of the suggestions then click build. Once the build
appears, click the 'cancel' button.

Cheers

Belén

>
>This patch set would help user to cancel build from toaster.
>
>
>How to test it:
>
>a) Start toaster
>
>b) Create Project
>
>c) Select the image to build ( I have tested with core-image-sato or
>core-image-weston).
>
>d) Once the image/recipe is triggered to build, a cancel button can be
>visible on the right side of the progress bar.
>
>e) If you wish to cancel the build once the build is triggered click the
>cancel button.
>
>f) Once the cancel is done, the page gets reloaded and user can see in
>the toaster build is stopped.
>
>
>Thanks,
>
>Sujith H
>
>On Tue, Dec 22, 2015 at 4:19 PM, sujith h
><sujith.h@gmail.com> wrote:
>
>Hi,
>
>
>Made small modification compared to my earlier branch
>sujith/toaster-build-cancel2 in :
>http://git.yoctoproject.org/cgit/cgit.cgi/poky-contrib/log/?h=sujith/toast
>er-build-cancel3
>
>I have tried to split my work into 3 patches
>
>a) One for UI ( html + js)
>
>b) One for API
>
>c) One for toastergui/views.py
>
>
>The only reason why I couldn't remove the line : self.connection =
>server.establishConnection([]) from toaster/bldcontrol/bbcontroller.py
>file is due to the fact that self.connection is an instance of
>bb.server.xmlrpc.BitBakeXMLRPCServerConnection
>
>and the server returned from
>bb.server.xmlrpc._create_server(self.be.bbaddress, int(self.be.bbport)) ,
>is an instance of ServerProxy.
>
>So I am not sure if I completely remove self.connection =
>server.establishConnection([]) and use
>bb.server.xmlrpc._create_server(self.be.bbaddress,
>int(self.be.bbport))[0], would cause breakage of code.
>
>
>
>Any pointers here would be helpful.
>
>
>Thanks,
>
>
>Sujith H
>
>
>On Mon, Dec 21, 2015 at 6:42 PM, sujith h
><sujith.h@gmail.com> wrote:
>
>Hi,
>
>
>I have updated patch :
>http://git.yoctoproject.org/cgit/cgit.cgi/poky-contrib/log/?h=sujith/toast
>er-build-cancel2 
><http://git.yoctoproject.org/cgit/cgit.cgi/poky-contrib/log/?h=sujith/toas
>ter-build-cancel2>
>
>
>Let me know if this looks ok or needs more enhancement(s)?
>
>
>Thanks,
>
>Sujith H
>
>
>On Mon, Dec 21, 2015 at 1:37 PM, sujith h
><sujith.h@gmail.com> wrote:
>
>Hi,
>
>
>
>On Sat, Dec 19, 2015 at 8:57 PM, sujith h <sujith.h@gmail.com> wrote:
>
>Hi,
>
>On Fri, Dec 18, 2015 at 7:16 PM, Ed Bartosh
><ed.bartosh@linux.intel.com> wrote:
>
>Hi Sujith,
>
>Can you split your changes please?
>I'd suggest to at least separate backend changes from frontend ones.
>
>Having uihelper.py changes in a separate commit would be nice too.
>It looks like you've spotted correctly that findServerDetails is not
>used anywhere in bitbake code. You can remove it in a separate commit as
>it looks unrelated to the rest of the patch.
>
>+1 for Michael's suggestion to use build controller.
>
>
>
>
> The problem I see using build controller is:
>
>
>I have tried with the build controller approach earlier and below are my
>findings:
>
>Lets say if I try to use getBuildEnvironmentController function as:
>
>
>localhostbctrl = localhostbecontroller.LocalhostBEController(be) # in
>toastergui/views.py
>
>localhostbctrl.getBBController()
>
>
>Then the failure starts when the control reaches function startBBServer
>and the initial assert fails.
>
>
>Even if I try to add a wrapper function known as cancelBuild in
>bbcontroller.py:
>
>    def conncetToServer(self):
>        server = bb.server.xmlrpc.BitBakeXMLRPCClient()
>        server.initServer()
>        server.saveConnectionDetails("%s:%s" % (self.be.bbaddress,
>self.be.bbport))
>        self.connection = server.establishConnection([])
>
>        self.be.bbtoken = self.connection.transport.connection_token
>        self.be.save()
>
>        return BitbakeController(self.connection)
>
>
>This would fail in server.establishConnection line. Because internally it
>does call connect function in xmlrpc.py which does call
>uievent.BBUIEventQueue. This call causes exception, because in
>registerEventHandler function  there is a line:
>
> if (self.cooker.state in [bb.cooker.state.parsing,
>bb.cooker.state.running]):
>
>
>I couldn't tackle this situation and that is the reason why I opted for
>another approach from uihelper's function findServerDetails.
>
>Is there any other way using which I can tackle this situation from
>bbcontroller.py? As per my investigation the problem bubbles around with
>registerEventHandler function with this approach.
>
>
>
>
>
>
>
>
>
>
>
>Another approach which I followed was ( using bbcontroller.py ) by
>writing a new function getBBServer:
>
>    def getBBServer(self, host, port):
>        """ returns a connection from running server. This helps in
>cancellation of bitbake from
>            toaster UI.
>        """
>        server, transport = bb.server.xmlrpc._create_server(host, port)
>        return server
>
>
>And then call this function from toastergui/views.py file:
>
>                        br =
>BuildRequest.objects.select_for_update().get(project = prj, pk = i,
>state__lte = BuildRequest.REQ_INPROGRESS)
>                        bbctrl =
>bbcontroller.BuildEnvironmentController(br.environment)
>                        server =
>bbctrl.getBBServer(br.environment.bbaddress, br.environment.bbport)
>                        logger.warning(br.environment.LOCK_STATE)
>                        server.runCommand(["stateForceShutdown"])
>                        while True:
>                            if len(BuildRequest.objects.get(pk = i
>).build.errors) > 0:
>                                br.state = BuildRequest.REQ_DELETED
>                                br.save()
>                                build = BuildRequest.objects.get(pk = i
>).build
>                                build.outcome = 0
>                                build.save()
>                                break
>
>
>
>
>Nothing else is coming into my mind. Any pointers?
>
>
>
>
>Thanks,
>
>Sujith H
>
>
>
>
>
>On Thu, Dec 17, 2015 at 10:26:11PM +0530, sujith h wrote:
>> Hi,
>>
>> I have posted my changes in:
>> 
>http://git.yoctoproject.org/cgit/cgit.cgi/poky-contrib/log/?h=sujith/toast
>er-build-cancel 
><http://git.yoctoproject.org/cgit/cgit.cgi/poky-contrib/log/?h=sujith/toas
>ter-build-cancel>
>>
>> Kindly review my changes and let me know if I have to make changes. I
>>would
>> be happy to do so.
>>
>> Thanks for all helping hand from RP, Ed, Michael, Belen and Paul.
>>
>> Thanks,
>> Sujith H
>
>--
>Regards,
>Ed
>
>
>
>
>
>
>-- 
>സുജിത് ഹരിദാസന്
>Bangalore
><Project>Contributor to KDE project
>http://fci.wikia.com/wiki/Anti-DRM-Campaign
><Blog> http://sujithh.info
>
>
>
>
>
>
>
>
>
>
>
>
>-- 
>സുജിത് ഹരിദാസന്
>Bangalore
><Project>Contributor to KDE project
>http://fci.wikia.com/wiki/Anti-DRM-Campaign
><Blog> http://sujithh.info
>
>
>
>
>
>
>
>
>
>
>
>-- 
>സുജിത് ഹരിദാസന്
>Bangalore
><Project>Contributor to KDE project
>http://fci.wikia.com/wiki/Anti-DRM-Campaign
><Blog> http://sujithh.info
>
>
>
>
>
>
>
>
>
>
>-- 
>സുജിത് ഹരിദാസന്
>Bangalore
><Project>Contributor to KDE project
>http://fci.wikia.com/wiki/Anti-DRM-Campaign
><Blog> http://sujithh.info
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>-- 
>സുജിത് ഹരിദാസന്
>Bangalore
><Project>Contributor to KDE project
>http://fci.wikia.com/wiki/Anti-DRM-Campaign
><Blog> http://sujithh.info
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>


^ permalink raw reply	[flat|nested] 27+ messages in thread

* Re: Build cancellation from toaster
  2016-01-05 13:44             ` Barros Pena, Belen
@ 2016-01-05 14:13               ` sujith h
  2016-01-06 13:38                 ` sujith h
  0 siblings, 1 reply; 27+ messages in thread
From: sujith h @ 2016-01-05 14:13 UTC (permalink / raw)
  To: Barros Pena, Belen; +Cc: toaster

[-- Attachment #1: Type: text/plain, Size: 10292 bytes --]

On Tue, Jan 5, 2016 at 7:14 PM, Barros Pena, Belen <
belen.barros.pena@intel.com> wrote:

>
>
> On 04/01/2016 13:16, "toaster-bounces@yoctoproject.org on behalf of sujith
> h" <toaster-bounces@yoctoproject.org on behalf of sujith.h@gmail.com>
> wrote:
>
> >Hi,
> >
> >
> >Finally I arrived at :
> >
> http://git.yoctoproject.org/cgit/cgit.cgi/poky-contrib/log/?h=sujith/toast
> >er-build-cancel9
> ><
> http://git.yoctoproject.org/cgit/cgit.cgi/poky-contrib/log/?h=sujith/toas
> >ter-build-cancel9>
>
> I am not sure this is working for me. When I click the 'cancel' button, I
> get the loading spinner. The spinner never goes away and the build status
> never updates by itself. If you reload the page after a while though, the
> build shows as failed.
>

One thing I missed out is that, I track toaster_ui.log file. So when the
build progresses there
I click the cancel button. Before that I haven't tried to cancel the build.

>
> I guess step one should be making sure that the build state updates
> without me having to reload the page. Once that's done, there will be some
> UI refinements needed. To see how the cancellation should behave on the UI
> side of things you can visit:
>
> http://www.yoctoproject.org/toaster/project-builds.html


Sure we can make the refinement to UI.


>
> Type 'core' in the build text field on the top right hand corner of the
> page, select one of the suggestions then click build. Once the build
> appears, click the 'cancel' button.
>
>
Belen, Immediately clicking 'cancel' button, I haven't tried that option.

Cheers
>
> Belén
>
> >
> >This patch set would help user to cancel build from toaster.
> >
> >
> >How to test it:
> >
> >a) Start toaster
> >
> >b) Create Project
> >
> >c) Select the image to build ( I have tested with core-image-sato or
> >core-image-weston).
> >
> >d) Once the image/recipe is triggered to build, a cancel button can be
> >visible on the right side of the progress bar.
> >
> >e) If you wish to cancel the build once the build is triggered click the
> >cancel button.
> >
> >f) Once the cancel is done, the page gets reloaded and user can see in
> >the toaster build is stopped.
> >
> >
> >Thanks,
> >
> >Sujith H
> >
> >On Tue, Dec 22, 2015 at 4:19 PM, sujith h
> ><sujith.h@gmail.com> wrote:
> >
> >Hi,
> >
> >
> >Made small modification compared to my earlier branch
> >sujith/toaster-build-cancel2 in :
> >
> http://git.yoctoproject.org/cgit/cgit.cgi/poky-contrib/log/?h=sujith/toast
> >er-build-cancel3
> >
> >I have tried to split my work into 3 patches
> >
> >a) One for UI ( html + js)
> >
> >b) One for API
> >
> >c) One for toastergui/views.py
> >
> >
> >The only reason why I couldn't remove the line : self.connection =
> >server.establishConnection([]) from toaster/bldcontrol/bbcontroller.py
> >file is due to the fact that self.connection is an instance of
> >bb.server.xmlrpc.BitBakeXMLRPCServerConnection
> >
> >and the server returned from
> >bb.server.xmlrpc._create_server(self.be.bbaddress, int(self.be.bbport)) ,
> >is an instance of ServerProxy.
> >
> >So I am not sure if I completely remove self.connection =
> >server.establishConnection([]) and use
> >bb.server.xmlrpc._create_server(self.be.bbaddress,
> >int(self.be.bbport))[0], would cause breakage of code.
> >
> >
> >
> >Any pointers here would be helpful.
> >
> >
> >Thanks,
> >
> >
> >Sujith H
> >
> >
> >On Mon, Dec 21, 2015 at 6:42 PM, sujith h
> ><sujith.h@gmail.com> wrote:
> >
> >Hi,
> >
> >
> >I have updated patch :
> >
> http://git.yoctoproject.org/cgit/cgit.cgi/poky-contrib/log/?h=sujith/toast
> >er-build-cancel2
> ><
> http://git.yoctoproject.org/cgit/cgit.cgi/poky-contrib/log/?h=sujith/toas
> >ter-build-cancel2>
> >
> >
> >Let me know if this looks ok or needs more enhancement(s)?
> >
> >
> >Thanks,
> >
> >Sujith H
> >
> >
> >On Mon, Dec 21, 2015 at 1:37 PM, sujith h
> ><sujith.h@gmail.com> wrote:
> >
> >Hi,
> >
> >
> >
> >On Sat, Dec 19, 2015 at 8:57 PM, sujith h <sujith.h@gmail.com> wrote:
> >
> >Hi,
> >
> >On Fri, Dec 18, 2015 at 7:16 PM, Ed Bartosh
> ><ed.bartosh@linux.intel.com> wrote:
> >
> >Hi Sujith,
> >
> >Can you split your changes please?
> >I'd suggest to at least separate backend changes from frontend ones.
> >
> >Having uihelper.py changes in a separate commit would be nice too.
> >It looks like you've spotted correctly that findServerDetails is not
> >used anywhere in bitbake code. You can remove it in a separate commit as
> >it looks unrelated to the rest of the patch.
> >
> >+1 for Michael's suggestion to use build controller.
> >
> >
> >
> >
> > The problem I see using build controller is:
> >
> >
> >I have tried with the build controller approach earlier and below are my
> >findings:
> >
> >Lets say if I try to use getBuildEnvironmentController function as:
> >
> >
> >localhostbctrl = localhostbecontroller.LocalhostBEController(be) # in
> >toastergui/views.py
> >
> >localhostbctrl.getBBController()
> >
> >
> >Then the failure starts when the control reaches function startBBServer
> >and the initial assert fails.
> >
> >
> >Even if I try to add a wrapper function known as cancelBuild in
> >bbcontroller.py:
> >
> >    def conncetToServer(self):
> >        server = bb.server.xmlrpc.BitBakeXMLRPCClient()
> >        server.initServer()
> >        server.saveConnectionDetails("%s:%s" % (self.be.bbaddress,
> >self.be.bbport))
> >        self.connection = server.establishConnection([])
> >
> >        self.be.bbtoken = self.connection.transport.connection_token
> >        self.be.save()
> >
> >        return BitbakeController(self.connection)
> >
> >
> >This would fail in server.establishConnection line. Because internally it
> >does call connect function in xmlrpc.py which does call
> >uievent.BBUIEventQueue. This call causes exception, because in
> >registerEventHandler function  there is a line:
> >
> > if (self.cooker.state in [bb.cooker.state.parsing,
> >bb.cooker.state.running]):
> >
> >
> >I couldn't tackle this situation and that is the reason why I opted for
> >another approach from uihelper's function findServerDetails.
> >
> >Is there any other way using which I can tackle this situation from
> >bbcontroller.py? As per my investigation the problem bubbles around with
> >registerEventHandler function with this approach.
> >
> >
> >
> >
> >
> >
> >
> >
> >
> >
> >
> >Another approach which I followed was ( using bbcontroller.py ) by
> >writing a new function getBBServer:
> >
> >    def getBBServer(self, host, port):
> >        """ returns a connection from running server. This helps in
> >cancellation of bitbake from
> >            toaster UI.
> >        """
> >        server, transport = bb.server.xmlrpc._create_server(host, port)
> >        return server
> >
> >
> >And then call this function from toastergui/views.py file:
> >
> >                        br =
> >BuildRequest.objects.select_for_update().get(project = prj, pk = i,
> >state__lte = BuildRequest.REQ_INPROGRESS)
> >                        bbctrl =
> >bbcontroller.BuildEnvironmentController(br.environment)
> >                        server =
> >bbctrl.getBBServer(br.environment.bbaddress, br.environment.bbport)
> >                        logger.warning(br.environment.LOCK_STATE)
> >                        server.runCommand(["stateForceShutdown"])
> >                        while True:
> >                            if len(BuildRequest.objects.get(pk = i
> >).build.errors) > 0:
> >                                br.state = BuildRequest.REQ_DELETED
> >                                br.save()
> >                                build = BuildRequest.objects.get(pk = i
> >).build
> >                                build.outcome = 0
> >                                build.save()
> >                                break
> >
> >
> >
> >
> >Nothing else is coming into my mind. Any pointers?
> >
> >
> >
> >
> >Thanks,
> >
> >Sujith H
> >
> >
> >
> >
> >
> >On Thu, Dec 17, 2015 at 10:26:11PM +0530, sujith h wrote:
> >> Hi,
> >>
> >> I have posted my changes in:
> >>
> >
> http://git.yoctoproject.org/cgit/cgit.cgi/poky-contrib/log/?h=sujith/toast
> >er-build-cancel
> ><
> http://git.yoctoproject.org/cgit/cgit.cgi/poky-contrib/log/?h=sujith/toas
> >ter-build-cancel>
> >>
> >> Kindly review my changes and let me know if I have to make changes. I
> >>would
> >> be happy to do so.
> >>
> >> Thanks for all helping hand from RP, Ed, Michael, Belen and Paul.
> >>
> >> Thanks,
> >> Sujith H
> >
> >--
> >Regards,
> >Ed
> >
> >
> >
> >
> >
> >
> >--
> >സുജിത് ഹരിദാസന്
> >Bangalore
> ><Project>Contributor to KDE project
> >http://fci.wikia.com/wiki/Anti-DRM-Campaign
> ><Blog> http://sujithh.info
> >
> >
> >
> >
> >
> >
> >
> >
> >
> >
> >
> >
> >--
> >സുജിത് ഹരിദാസന്
> >Bangalore
> ><Project>Contributor to KDE project
> >http://fci.wikia.com/wiki/Anti-DRM-Campaign
> ><Blog> http://sujithh.info
> >
> >
> >
> >
> >
> >
> >
> >
> >
> >
> >
> >--
> >സുജിത് ഹരിദാസന്
> >Bangalore
> ><Project>Contributor to KDE project
> >http://fci.wikia.com/wiki/Anti-DRM-Campaign
> ><Blog> http://sujithh.info
> >
> >
> >
> >
> >
> >
> >
> >
> >
> >
> >--
> >സുജിത് ഹരിദാസന്
> >Bangalore
> ><Project>Contributor to KDE project
> >http://fci.wikia.com/wiki/Anti-DRM-Campaign
> ><Blog> http://sujithh.info
> >
> >
> >
> >
> >
> >
> >
> >
> >
> >
> >
> >
> >
> >
> >
> >
> >
> >
> >
> >
> >
> >
> >
> >
> >
> >
> >
> >--
> >സുജിത് ഹരിദാസന്
> >Bangalore
> ><Project>Contributor to KDE project
> >http://fci.wikia.com/wiki/Anti-DRM-Campaign
> ><Blog> http://sujithh.info
> >
> >
> >
> >
> >
> >
> >
> >
> >
> >
> >
> >
> >
> >
> >
> >
>
>


-- 
സുജിത് ഹരിദാസന്
Bangalore
<Project>Contributor to KDE project
http://fci.wikia.com/wiki/Anti-DRM-Campaign
<Blog> http://sujithh.info

[-- Attachment #2: Type: text/html, Size: 15909 bytes --]

^ permalink raw reply	[flat|nested] 27+ messages in thread

* Re: Build cancellation from toaster
  2016-01-05 14:13               ` sujith h
@ 2016-01-06 13:38                 ` sujith h
  2016-01-09 16:53                   ` sujith h
  0 siblings, 1 reply; 27+ messages in thread
From: sujith h @ 2016-01-06 13:38 UTC (permalink / raw)
  To: Barros Pena, Belen; +Cc: toaster

[-- Attachment #1: Type: text/plain, Size: 11271 bytes --]

On Tue, Jan 5, 2016 at 7:43 PM, sujith h <sujith.h@gmail.com> wrote:

>
>
> On Tue, Jan 5, 2016 at 7:14 PM, Barros Pena, Belen <
> belen.barros.pena@intel.com> wrote:
>
>>
>>
>> On 04/01/2016 13:16, "toaster-bounces@yoctoproject.org on behalf of
>> sujith
>> h" <toaster-bounces@yoctoproject.org on behalf of sujith.h@gmail.com>
>> wrote:
>>
>> >Hi,
>> >
>> >
>> >Finally I arrived at :
>> >
>> http://git.yoctoproject.org/cgit/cgit.cgi/poky-contrib/log/?h=sujith/toast
>> >er-build-cancel9
>> ><
>> http://git.yoctoproject.org/cgit/cgit.cgi/poky-contrib/log/?h=sujith/toas
>> >ter-build-cancel9>
>>
>> I am not sure this is working for me. When I click the 'cancel' button, I
>> get the loading spinner. The spinner never goes away and the build status
>> never updates by itself. If you reload the page after a while though, the
>> build shows as failed.
>>
>
> One thing I missed out is that, I track toaster_ui.log file. So when the
> build progresses there
> I click the cancel button. Before that I haven't tried to cancel the
> build.
>
>>
>> I guess step one should be making sure that the build state updates
>> without me having to reload the page. Once that's done, there will be some
>> UI refinements needed. To see how the cancellation should behave on the UI
>> side of things you can visit:
>>
>> http://www.yoctoproject.org/toaster/project-builds.html
>
>
> Sure we can make the refinement to UI.
>
>
>>
>> Type 'core' in the build text field on the top right hand corner of the
>> page, select one of the suggestions then click build. Once the build
>> appears, click the 'cancel' button.
>>
>>
> Belen, Immediately clicking 'cancel' button, I haven't tried that option.
>

I have pushed my changes to
http://git.yoctoproject.org/cgit/cgit.cgi/poky-contrib/log/?h=sujith/toaster-build-cancel10
With this change user would see the cancel button only after the actual
tasks start executing. So then user can click
cancel button.

>
> Cheers
>>
>> Belén
>>
>> >
>> >This patch set would help user to cancel build from toaster.
>> >
>> >
>> >How to test it:
>> >
>> >a) Start toaster
>> >
>> >b) Create Project
>> >
>> >c) Select the image to build ( I have tested with core-image-sato or
>> >core-image-weston).
>> >
>> >d) Once the image/recipe is triggered to build, a cancel button can be
>> >visible on the right side of the progress bar.
>> >
>> >e) If you wish to cancel the build once the build is triggered click the
>> >cancel button.
>> >
>> >f) Once the cancel is done, the page gets reloaded and user can see in
>> >the toaster build is stopped.
>> >
>> >
>> >Thanks,
>> >
>> >Sujith H
>> >
>> >On Tue, Dec 22, 2015 at 4:19 PM, sujith h
>> ><sujith.h@gmail.com> wrote:
>> >
>> >Hi,
>> >
>> >
>> >Made small modification compared to my earlier branch
>> >sujith/toaster-build-cancel2 in :
>> >
>> http://git.yoctoproject.org/cgit/cgit.cgi/poky-contrib/log/?h=sujith/toast
>> >er-build-cancel3
>> >
>> >I have tried to split my work into 3 patches
>> >
>> >a) One for UI ( html + js)
>> >
>> >b) One for API
>> >
>> >c) One for toastergui/views.py
>> >
>> >
>> >The only reason why I couldn't remove the line : self.connection =
>> >server.establishConnection([]) from toaster/bldcontrol/bbcontroller.py
>> >file is due to the fact that self.connection is an instance of
>> >bb.server.xmlrpc.BitBakeXMLRPCServerConnection
>> >
>> >and the server returned from
>> >bb.server.xmlrpc._create_server(self.be.bbaddress, int(self.be.bbport)) ,
>> >is an instance of ServerProxy.
>> >
>> >So I am not sure if I completely remove self.connection =
>> >server.establishConnection([]) and use
>> >bb.server.xmlrpc._create_server(self.be.bbaddress,
>> >int(self.be.bbport))[0], would cause breakage of code.
>> >
>> >
>> >
>> >Any pointers here would be helpful.
>> >
>> >
>> >Thanks,
>> >
>> >
>> >Sujith H
>> >
>> >
>> >On Mon, Dec 21, 2015 at 6:42 PM, sujith h
>> ><sujith.h@gmail.com> wrote:
>> >
>> >Hi,
>> >
>> >
>> >I have updated patch :
>> >
>> http://git.yoctoproject.org/cgit/cgit.cgi/poky-contrib/log/?h=sujith/toast
>> >er-build-cancel2
>> ><
>> http://git.yoctoproject.org/cgit/cgit.cgi/poky-contrib/log/?h=sujith/toas
>> >ter-build-cancel2>
>> >
>> >
>> >Let me know if this looks ok or needs more enhancement(s)?
>> >
>> >
>> >Thanks,
>> >
>> >Sujith H
>> >
>> >
>> >On Mon, Dec 21, 2015 at 1:37 PM, sujith h
>> ><sujith.h@gmail.com> wrote:
>> >
>> >Hi,
>> >
>> >
>> >
>> >On Sat, Dec 19, 2015 at 8:57 PM, sujith h <sujith.h@gmail.com> wrote:
>> >
>> >Hi,
>> >
>> >On Fri, Dec 18, 2015 at 7:16 PM, Ed Bartosh
>> ><ed.bartosh@linux.intel.com> wrote:
>> >
>> >Hi Sujith,
>> >
>> >Can you split your changes please?
>> >I'd suggest to at least separate backend changes from frontend ones.
>> >
>> >Having uihelper.py changes in a separate commit would be nice too.
>> >It looks like you've spotted correctly that findServerDetails is not
>> >used anywhere in bitbake code. You can remove it in a separate commit as
>> >it looks unrelated to the rest of the patch.
>> >
>> >+1 for Michael's suggestion to use build controller.
>> >
>> >
>> >
>> >
>> > The problem I see using build controller is:
>> >
>> >
>> >I have tried with the build controller approach earlier and below are my
>> >findings:
>> >
>> >Lets say if I try to use getBuildEnvironmentController function as:
>> >
>> >
>> >localhostbctrl = localhostbecontroller.LocalhostBEController(be) # in
>> >toastergui/views.py
>> >
>> >localhostbctrl.getBBController()
>> >
>> >
>> >Then the failure starts when the control reaches function startBBServer
>> >and the initial assert fails.
>> >
>> >
>> >Even if I try to add a wrapper function known as cancelBuild in
>> >bbcontroller.py:
>> >
>> >    def conncetToServer(self):
>> >        server = bb.server.xmlrpc.BitBakeXMLRPCClient()
>> >        server.initServer()
>> >        server.saveConnectionDetails("%s:%s" % (self.be.bbaddress,
>> >self.be.bbport))
>> >        self.connection = server.establishConnection([])
>> >
>> >        self.be.bbtoken = self.connection.transport.connection_token
>> >        self.be.save()
>> >
>> >        return BitbakeController(self.connection)
>> >
>> >
>> >This would fail in server.establishConnection line. Because internally it
>> >does call connect function in xmlrpc.py which does call
>> >uievent.BBUIEventQueue. This call causes exception, because in
>> >registerEventHandler function  there is a line:
>> >
>> > if (self.cooker.state in [bb.cooker.state.parsing,
>> >bb.cooker.state.running]):
>> >
>> >
>> >I couldn't tackle this situation and that is the reason why I opted for
>> >another approach from uihelper's function findServerDetails.
>> >
>> >Is there any other way using which I can tackle this situation from
>> >bbcontroller.py? As per my investigation the problem bubbles around with
>> >registerEventHandler function with this approach.
>> >
>> >
>> >
>> >
>> >
>> >
>> >
>> >
>> >
>> >
>> >
>> >Another approach which I followed was ( using bbcontroller.py ) by
>> >writing a new function getBBServer:
>> >
>> >    def getBBServer(self, host, port):
>> >        """ returns a connection from running server. This helps in
>> >cancellation of bitbake from
>> >            toaster UI.
>> >        """
>> >        server, transport = bb.server.xmlrpc._create_server(host, port)
>> >        return server
>> >
>> >
>> >And then call this function from toastergui/views.py file:
>> >
>> >                        br =
>> >BuildRequest.objects.select_for_update().get(project = prj, pk = i,
>> >state__lte = BuildRequest.REQ_INPROGRESS)
>> >                        bbctrl =
>> >bbcontroller.BuildEnvironmentController(br.environment)
>> >                        server =
>> >bbctrl.getBBServer(br.environment.bbaddress, br.environment.bbport)
>> >                        logger.warning(br.environment.LOCK_STATE)
>> >                        server.runCommand(["stateForceShutdown"])
>> >                        while True:
>> >                            if len(BuildRequest.objects.get(pk = i
>> >).build.errors) > 0:
>> >                                br.state = BuildRequest.REQ_DELETED
>> >                                br.save()
>> >                                build = BuildRequest.objects.get(pk = i
>> >).build
>> >                                build.outcome = 0
>> >                                build.save()
>> >                                break
>> >
>> >
>> >
>> >
>> >Nothing else is coming into my mind. Any pointers?
>> >
>> >
>> >
>> >
>> >Thanks,
>> >
>> >Sujith H
>> >
>> >
>> >
>> >
>> >
>> >On Thu, Dec 17, 2015 at 10:26:11PM +0530, sujith h wrote:
>> >> Hi,
>> >>
>> >> I have posted my changes in:
>> >>
>> >
>> http://git.yoctoproject.org/cgit/cgit.cgi/poky-contrib/log/?h=sujith/toast
>> >er-build-cancel
>> ><
>> http://git.yoctoproject.org/cgit/cgit.cgi/poky-contrib/log/?h=sujith/toas
>> >ter-build-cancel>
>> >>
>> >> Kindly review my changes and let me know if I have to make changes. I
>> >>would
>> >> be happy to do so.
>> >>
>> >> Thanks for all helping hand from RP, Ed, Michael, Belen and Paul.
>> >>
>> >> Thanks,
>> >> Sujith H
>> >
>> >--
>> >Regards,
>> >Ed
>> >
>> >
>> >
>> >
>> >
>> >
>> >--
>> >സുജിത് ഹരിദാസന്
>> >Bangalore
>> ><Project>Contributor to KDE project
>> >http://fci.wikia.com/wiki/Anti-DRM-Campaign
>> ><Blog> http://sujithh.info
>> >
>> >
>> >
>> >
>> >
>> >
>> >
>> >
>> >
>> >
>> >
>> >
>> >--
>> >സുജിത് ഹരിദാസന്
>> >Bangalore
>> ><Project>Contributor to KDE project
>> >http://fci.wikia.com/wiki/Anti-DRM-Campaign
>> ><Blog> http://sujithh.info
>> >
>> >
>> >
>> >
>> >
>> >
>> >
>> >
>> >
>> >
>> >
>> >--
>> >സുജിത് ഹരിദാസന്
>> >Bangalore
>> ><Project>Contributor to KDE project
>> >http://fci.wikia.com/wiki/Anti-DRM-Campaign
>> ><Blog> http://sujithh.info
>> >
>> >
>> >
>> >
>> >
>> >
>> >
>> >
>> >
>> >
>> >--
>> >സുജിത് ഹരിദാസന്
>> >Bangalore
>> ><Project>Contributor to KDE project
>> >http://fci.wikia.com/wiki/Anti-DRM-Campaign
>> ><Blog> http://sujithh.info
>> >
>> >
>> >
>> >
>> >
>> >
>> >
>> >
>> >
>> >
>> >
>> >
>> >
>> >
>> >
>> >
>> >
>> >
>> >
>> >
>> >
>> >
>> >
>> >
>> >
>> >
>> >
>> >--
>> >സുജിത് ഹരിദാസന്
>> >Bangalore
>> ><Project>Contributor to KDE project
>> >http://fci.wikia.com/wiki/Anti-DRM-Campaign
>> ><Blog> http://sujithh.info
>> >
>> >
>> >
>> >
>> >
>> >
>> >
>> >
>> >
>> >
>> >
>> >
>> >
>> >
>> >
>> >
>>
>>
>
>
> --
> സുജിത് ഹരിദാസന്
> Bangalore
> <Project>Contributor to KDE project
> http://fci.wikia.com/wiki/Anti-DRM-Campaign
> <Blog> http://sujithh.info
>



-- 
സുജിത് ഹരിദാസന്
Bangalore
<Project>Contributor to KDE project
http://fci.wikia.com/wiki/Anti-DRM-Campaign
<Blog> http://sujithh.info

[-- Attachment #2: Type: text/html, Size: 17573 bytes --]

^ permalink raw reply	[flat|nested] 27+ messages in thread

* Re: Build cancellation from toaster
  2016-01-06 13:38                 ` sujith h
@ 2016-01-09 16:53                   ` sujith h
  2016-01-11 11:25                     ` Barros Pena, Belen
  0 siblings, 1 reply; 27+ messages in thread
From: sujith h @ 2016-01-09 16:53 UTC (permalink / raw)
  To: Barros Pena, Belen; +Cc: toaster

[-- Attachment #1: Type: text/plain, Size: 12183 bytes --]

On Wed, Jan 6, 2016 at 7:08 PM, sujith h <sujith.h@gmail.com> wrote:

>
>
> On Tue, Jan 5, 2016 at 7:43 PM, sujith h <sujith.h@gmail.com> wrote:
>
>>
>>
>> On Tue, Jan 5, 2016 at 7:14 PM, Barros Pena, Belen <
>> belen.barros.pena@intel.com> wrote:
>>
>>>
>>>
>>> On 04/01/2016 13:16, "toaster-bounces@yoctoproject.org on behalf of
>>> sujith
>>> h" <toaster-bounces@yoctoproject.org on behalf of sujith.h@gmail.com>
>>> wrote:
>>>
>>> >Hi,
>>> >
>>> >
>>> >Finally I arrived at :
>>> >
>>> http://git.yoctoproject.org/cgit/cgit.cgi/poky-contrib/log/?h=sujith/toast
>>> >er-build-cancel9
>>> ><
>>> http://git.yoctoproject.org/cgit/cgit.cgi/poky-contrib/log/?h=sujith/toas
>>> >ter-build-cancel9>
>>>
>>> I am not sure this is working for me. When I click the 'cancel' button, I
>>> get the loading spinner. The spinner never goes away and the build status
>>> never updates by itself. If you reload the page after a while though, the
>>> build shows as failed.
>>>
>>
>> One thing I missed out is that, I track toaster_ui.log file. So when the
>> build progresses there
>> I click the cancel button. Before that I haven't tried to cancel the
>> build.
>>
>>>
>>> I guess step one should be making sure that the build state updates
>>> without me having to reload the page. Once that's done, there will be
>>> some
>>> UI refinements needed. To see how the cancellation should behave on the
>>> UI
>>> side of things you can visit:
>>>
>>> http://www.yoctoproject.org/toaster/project-builds.html
>>
>>
>> Sure we can make the refinement to UI.
>>
>>
>>>
>>> Type 'core' in the build text field on the top right hand corner of the
>>> page, select one of the suggestions then click build. Once the build
>>> appears, click the 'cancel' button.
>>>
>>>
>> Belen, Immediately clicking 'cancel' button, I haven't tried that option.
>>
>
> I have pushed my changes to
> http://git.yoctoproject.org/cgit/cgit.cgi/poky-contrib/log/?h=sujith/toaster-build-cancel10
> With this change user would see the cancel button only after the actual
> tasks start executing. So then user can click
> cancel button.
>

I have updated comments and also updated api in orm/models.py :
http://git.yoctoproject.org/cgit/cgit.cgi/poky-contrib/log/?h=sujith/toaster-build-cancel11


>
>> Cheers
>>>
>>> Belén
>>>
>>> >
>>> >This patch set would help user to cancel build from toaster.
>>> >
>>> >
>>> >How to test it:
>>> >
>>> >a) Start toaster
>>> >
>>> >b) Create Project
>>> >
>>> >c) Select the image to build ( I have tested with core-image-sato or
>>> >core-image-weston).
>>> >
>>> >d) Once the image/recipe is triggered to build, a cancel button can be
>>> >visible on the right side of the progress bar.
>>> >
>>> >e) If you wish to cancel the build once the build is triggered click the
>>> >cancel button.
>>> >
>>> >f) Once the cancel is done, the page gets reloaded and user can see in
>>> >the toaster build is stopped.
>>> >
>>> >
>>> >Thanks,
>>> >
>>> >Sujith H
>>> >
>>> >On Tue, Dec 22, 2015 at 4:19 PM, sujith h
>>> ><sujith.h@gmail.com> wrote:
>>> >
>>> >Hi,
>>> >
>>> >
>>> >Made small modification compared to my earlier branch
>>> >sujith/toaster-build-cancel2 in :
>>> >
>>> http://git.yoctoproject.org/cgit/cgit.cgi/poky-contrib/log/?h=sujith/toast
>>> >er-build-cancel3
>>> >
>>> >I have tried to split my work into 3 patches
>>> >
>>> >a) One for UI ( html + js)
>>> >
>>> >b) One for API
>>> >
>>> >c) One for toastergui/views.py
>>> >
>>> >
>>> >The only reason why I couldn't remove the line : self.connection =
>>> >server.establishConnection([]) from toaster/bldcontrol/bbcontroller.py
>>> >file is due to the fact that self.connection is an instance of
>>> >bb.server.xmlrpc.BitBakeXMLRPCServerConnection
>>> >
>>> >and the server returned from
>>> >bb.server.xmlrpc._create_server(self.be.bbaddress, int(self.be.bbport))
>>> ,
>>> >is an instance of ServerProxy.
>>> >
>>> >So I am not sure if I completely remove self.connection =
>>> >server.establishConnection([]) and use
>>> >bb.server.xmlrpc._create_server(self.be.bbaddress,
>>> >int(self.be.bbport))[0], would cause breakage of code.
>>> >
>>> >
>>> >
>>> >Any pointers here would be helpful.
>>> >
>>> >
>>> >Thanks,
>>> >
>>> >
>>> >Sujith H
>>> >
>>> >
>>> >On Mon, Dec 21, 2015 at 6:42 PM, sujith h
>>> ><sujith.h@gmail.com> wrote:
>>> >
>>> >Hi,
>>> >
>>> >
>>> >I have updated patch :
>>> >
>>> http://git.yoctoproject.org/cgit/cgit.cgi/poky-contrib/log/?h=sujith/toast
>>> >er-build-cancel2
>>> ><
>>> http://git.yoctoproject.org/cgit/cgit.cgi/poky-contrib/log/?h=sujith/toas
>>> >ter-build-cancel2>
>>> >
>>> >
>>> >Let me know if this looks ok or needs more enhancement(s)?
>>> >
>>> >
>>> >Thanks,
>>> >
>>> >Sujith H
>>> >
>>> >
>>> >On Mon, Dec 21, 2015 at 1:37 PM, sujith h
>>> ><sujith.h@gmail.com> wrote:
>>> >
>>> >Hi,
>>> >
>>> >
>>> >
>>> >On Sat, Dec 19, 2015 at 8:57 PM, sujith h <sujith.h@gmail.com> wrote:
>>> >
>>> >Hi,
>>> >
>>> >On Fri, Dec 18, 2015 at 7:16 PM, Ed Bartosh
>>> ><ed.bartosh@linux.intel.com> wrote:
>>> >
>>> >Hi Sujith,
>>> >
>>> >Can you split your changes please?
>>> >I'd suggest to at least separate backend changes from frontend ones.
>>> >
>>> >Having uihelper.py changes in a separate commit would be nice too.
>>> >It looks like you've spotted correctly that findServerDetails is not
>>> >used anywhere in bitbake code. You can remove it in a separate commit as
>>> >it looks unrelated to the rest of the patch.
>>> >
>>> >+1 for Michael's suggestion to use build controller.
>>> >
>>> >
>>> >
>>> >
>>> > The problem I see using build controller is:
>>> >
>>> >
>>> >I have tried with the build controller approach earlier and below are my
>>> >findings:
>>> >
>>> >Lets say if I try to use getBuildEnvironmentController function as:
>>> >
>>> >
>>> >localhostbctrl = localhostbecontroller.LocalhostBEController(be) # in
>>> >toastergui/views.py
>>> >
>>> >localhostbctrl.getBBController()
>>> >
>>> >
>>> >Then the failure starts when the control reaches function startBBServer
>>> >and the initial assert fails.
>>> >
>>> >
>>> >Even if I try to add a wrapper function known as cancelBuild in
>>> >bbcontroller.py:
>>> >
>>> >    def conncetToServer(self):
>>> >        server = bb.server.xmlrpc.BitBakeXMLRPCClient()
>>> >        server.initServer()
>>> >        server.saveConnectionDetails("%s:%s" % (self.be.bbaddress,
>>> >self.be.bbport))
>>> >        self.connection = server.establishConnection([])
>>> >
>>> >        self.be.bbtoken = self.connection.transport.connection_token
>>> >        self.be.save()
>>> >
>>> >        return BitbakeController(self.connection)
>>> >
>>> >
>>> >This would fail in server.establishConnection line. Because internally
>>> it
>>> >does call connect function in xmlrpc.py which does call
>>> >uievent.BBUIEventQueue. This call causes exception, because in
>>> >registerEventHandler function  there is a line:
>>> >
>>> > if (self.cooker.state in [bb.cooker.state.parsing,
>>> >bb.cooker.state.running]):
>>> >
>>> >
>>> >I couldn't tackle this situation and that is the reason why I opted for
>>> >another approach from uihelper's function findServerDetails.
>>> >
>>> >Is there any other way using which I can tackle this situation from
>>> >bbcontroller.py? As per my investigation the problem bubbles around with
>>> >registerEventHandler function with this approach.
>>> >
>>> >
>>> >
>>> >
>>> >
>>> >
>>> >
>>> >
>>> >
>>> >
>>> >
>>> >Another approach which I followed was ( using bbcontroller.py ) by
>>> >writing a new function getBBServer:
>>> >
>>> >    def getBBServer(self, host, port):
>>> >        """ returns a connection from running server. This helps in
>>> >cancellation of bitbake from
>>> >            toaster UI.
>>> >        """
>>> >        server, transport = bb.server.xmlrpc._create_server(host, port)
>>> >        return server
>>> >
>>> >
>>> >And then call this function from toastergui/views.py file:
>>> >
>>> >                        br =
>>> >BuildRequest.objects.select_for_update().get(project = prj, pk = i,
>>> >state__lte = BuildRequest.REQ_INPROGRESS)
>>> >                        bbctrl =
>>> >bbcontroller.BuildEnvironmentController(br.environment)
>>> >                        server =
>>> >bbctrl.getBBServer(br.environment.bbaddress, br.environment.bbport)
>>> >                        logger.warning(br.environment.LOCK_STATE)
>>> >                        server.runCommand(["stateForceShutdown"])
>>> >                        while True:
>>> >                            if len(BuildRequest.objects.get(pk = i
>>> >).build.errors) > 0:
>>> >                                br.state = BuildRequest.REQ_DELETED
>>> >                                br.save()
>>> >                                build = BuildRequest.objects.get(pk = i
>>> >).build
>>> >                                build.outcome = 0
>>> >                                build.save()
>>> >                                break
>>> >
>>> >
>>> >
>>> >
>>> >Nothing else is coming into my mind. Any pointers?
>>> >
>>> >
>>> >
>>> >
>>> >Thanks,
>>> >
>>> >Sujith H
>>> >
>>> >
>>> >
>>> >
>>> >
>>> >On Thu, Dec 17, 2015 at 10:26:11PM +0530, sujith h wrote:
>>> >> Hi,
>>> >>
>>> >> I have posted my changes in:
>>> >>
>>> >
>>> http://git.yoctoproject.org/cgit/cgit.cgi/poky-contrib/log/?h=sujith/toast
>>> >er-build-cancel
>>> ><
>>> http://git.yoctoproject.org/cgit/cgit.cgi/poky-contrib/log/?h=sujith/toas
>>> >ter-build-cancel>
>>> >>
>>> >> Kindly review my changes and let me know if I have to make changes. I
>>> >>would
>>> >> be happy to do so.
>>> >>
>>> >> Thanks for all helping hand from RP, Ed, Michael, Belen and Paul.
>>> >>
>>> >> Thanks,
>>> >> Sujith H
>>> >
>>> >--
>>> >Regards,
>>> >Ed
>>> >
>>> >
>>> >
>>> >
>>> >
>>> >
>>> >--
>>> >സുജിത് ഹരിദാസന്
>>> >Bangalore
>>> ><Project>Contributor to KDE project
>>> >http://fci.wikia.com/wiki/Anti-DRM-Campaign
>>> ><Blog> http://sujithh.info
>>> >
>>> >
>>> >
>>> >
>>> >
>>> >
>>> >
>>> >
>>> >
>>> >
>>> >
>>> >
>>> >--
>>> >സുജിത് ഹരിദാസന്
>>> >Bangalore
>>> ><Project>Contributor to KDE project
>>> >http://fci.wikia.com/wiki/Anti-DRM-Campaign
>>> ><Blog> http://sujithh.info
>>> >
>>> >
>>> >
>>> >
>>> >
>>> >
>>> >
>>> >
>>> >
>>> >
>>> >
>>> >--
>>> >സുജിത് ഹരിദാസന്
>>> >Bangalore
>>> ><Project>Contributor to KDE project
>>> >http://fci.wikia.com/wiki/Anti-DRM-Campaign
>>> ><Blog> http://sujithh.info
>>> >
>>> >
>>> >
>>> >
>>> >
>>> >
>>> >
>>> >
>>> >
>>> >
>>> >--
>>> >സുജിത് ഹരിദാസന്
>>> >Bangalore
>>> ><Project>Contributor to KDE project
>>> >http://fci.wikia.com/wiki/Anti-DRM-Campaign
>>> ><Blog> http://sujithh.info
>>> >
>>> >
>>> >
>>> >
>>> >
>>> >
>>> >
>>> >
>>> >
>>> >
>>> >
>>> >
>>> >
>>> >
>>> >
>>> >
>>> >
>>> >
>>> >
>>> >
>>> >
>>> >
>>> >
>>> >
>>> >
>>> >
>>> >
>>> >--
>>> >സുജിത് ഹരിദാസന്
>>> >Bangalore
>>> ><Project>Contributor to KDE project
>>> >http://fci.wikia.com/wiki/Anti-DRM-Campaign
>>> ><Blog> http://sujithh.info
>>> >
>>> >
>>> >
>>> >
>>> >
>>> >
>>> >
>>> >
>>> >
>>> >
>>> >
>>> >
>>> >
>>> >
>>> >
>>> >
>>>
>>>
>>
>>
>> --
>> സുജിത് ഹരിദാസന്
>> Bangalore
>> <Project>Contributor to KDE project
>> http://fci.wikia.com/wiki/Anti-DRM-Campaign
>> <Blog> http://sujithh.info
>>
>
>
>
> --
> സുജിത് ഹരിദാസന്
> Bangalore
> <Project>Contributor to KDE project
> http://fci.wikia.com/wiki/Anti-DRM-Campaign
> <Blog> http://sujithh.info
>



-- 
സുജിത് ഹരിദാസന്
Bangalore
<Project>Contributor to KDE project
http://fci.wikia.com/wiki/Anti-DRM-Campaign
<Blog> http://sujithh.info

[-- Attachment #2: Type: text/html, Size: 18904 bytes --]

^ permalink raw reply	[flat|nested] 27+ messages in thread

* Re: Build cancellation from toaster
  2016-01-09 16:53                   ` sujith h
@ 2016-01-11 11:25                     ` Barros Pena, Belen
  2016-01-12 10:34                       ` Barros Pena, Belen
  0 siblings, 1 reply; 27+ messages in thread
From: Barros Pena, Belen @ 2016-01-11 11:25 UTC (permalink / raw)
  To: sujith h; +Cc: toaster



On 09/01/2016 16:53, "sujith h" <sujith.h@gmail.com> wrote:

>
>I have pushed my changes to
>http://git.yoctoproject.org/cgit/cgit.cgi/poky-contrib/log/?h=sujith/toast
>er-build-cancel10
>
>With this change user would see the cancel button only after the actual
>tasks start executing. So then user can click cancel button.
>

Hi Sujith,

Now I can see that the 'cancel' button only appears when the build has
started, which is great. However, when I click the button, nothing
happens. The page seems to refresh, but I get no message telling me the
build is being cancelled, and the build just continues.

Cheers

Belén 

>
>I have updated comments and also updated api in orm/models.py :
>http://git.yoctoproject.org/cgit/cgit.cgi/poky-contrib/log/?h=sujith/toast
>er-build-cancel11



^ permalink raw reply	[flat|nested] 27+ messages in thread

* Re: Build cancellation from toaster
  2016-01-11 11:25                     ` Barros Pena, Belen
@ 2016-01-12 10:34                       ` Barros Pena, Belen
  2016-01-13 16:47                         ` sujith h
  0 siblings, 1 reply; 27+ messages in thread
From: Barros Pena, Belen @ 2016-01-12 10:34 UTC (permalink / raw)
  To: Barros Pena, Belen, sujith h; +Cc: toaster



On 11/01/2016 11:25, "toaster-bounces@yoctoproject.org on behalf of Barros
Pena, Belen" <toaster-bounces@yoctoproject.org on behalf of
belen.barros.pena@intel.com> wrote:

>
>
>On 09/01/2016 16:53, "sujith h" <sujith.h@gmail.com> wrote:
>
>>
>>I have pushed my changes to
>>http://git.yoctoproject.org/cgit/cgit.cgi/poky-contrib/log/?h=sujith/toas
>>t
>>er-build-cancel10
>>
>>With this change user would see the cancel button only after the actual
>>tasks start executing. So then user can click cancel button.
>>
>
>Hi Sujith,
>
>Now I can see that the 'cancel' button only appears when the build has
>started, which is great. However, when I click the button, nothing
>happens. The page seems to refresh, but I get no message telling me the
>build is being cancelled, and the build just continues.

Tested this again with a clean build directory. The 'cancel' button shows
when the build has started proper (and can therefore be cancelled). When
you click the 'cancel' button, you get the loading spinner and quite
quickly the build stops. I can then start another build without problems.

This is what the build log of the cancelled build says:

NOTE: Sending SIGTERM to remaining 40 tasks
NOTE: Logfile for task
/home/yocto/master/build/tmp/work/i586-poky-linux/libxml2/2.9.3-r0/temp/log
.do_fetch.40114
NOTE: Logfile for task
/home/yocto/master/build/tmp/work/i586-poky-linux/libxcb/1.11.1-r0/temp/log
.do_patch.40146
NOTE: Tasks Summary: Attempted 199 tasks of which 0 didn't need to be
rerun and all succeeded.
ERROR: u'core-image-minimal'
Traceback (most recent call last):
  File "/home/yocto/master/bitbake/lib/bb/ui/toasterui.py", line 357, in
main
    buildinfohelper.store_target_package_data(event)
  File "/home/yocto/master/bitbake/lib/bb/ui/buildinfohelper.py", line
1166, in store_target_package_data
    imgdata = 
BuildInfoHelper._get_data_from_event(event)['imgdata'][target.target]
KeyError: u'core-image-minimal'

ERROR: Error data dump ['  File
"/home/yocto/master/bitbake/lib/bb/ui/toasterui.py", line 357, in main\n
 buildinfohelper.store_target_package_data(event)\n']
{'_': KeyError(u'core-image-minimal',),
 'build_history_enabled': True,
 'build_log': <logging.FileHandler object at 0x7f2c4e05dcd0>,
 'build_log_file_path':
'/home/yocto/master/build/tmp/log/cooker/qemux86/build_20160111_114819.89.l
og',
 'buildinfohelper': <bb.ui.buildinfohelper.BuildInfoHelper object at
0x7f2c4e05db50>,
 'console': <logging.StreamHandler object at 0x7f2c4e05da10>,
 'consolelogfile': 
'/home/yocto/master/build/tmp/log/cooker/qemux86/20160111114813.log',
 'curr': <traceback object at 0x7f2c4e047488>,
 'debug_domains': {},
 'e': KeyError(u'core-image-minimal',),
 'errors': 0,
 'event': <bb.event.MetadataEvent object at 0x7f2c4cc36dd0>,
 'eventHandler': <bb.ui.uievent.BBUIEventQueue instance at 0x7f2c4e060bd8>,
 'exception_data': 'Traceback (most recent call last):\n  File
"/home/yocto/master/bitbake/lib/bb/ui/toasterui.py", line 357, in main\n
 buildinfohelper.store_target_package_data(event)\n  File
"/home/yocto/master/bitbake/lib/bb/ui/buildinfohelper.py", line 1166, in
store_target_package_data\n    imgdata =
BuildInfoHelper._get_data_from_event(event)[\'imgdata\'][target.target]\nKe
yError: u\'core-image-minimal\'\n',
 'first': False,
 'format_str': '%(levelname)s: %(message)s',
 'formatter': <bb.msg.BBLogFormatter object at 0x7f2c4e05da90>,
 'helper': <bb.ui.uihelper.BBUIHelper instance at 0x7f2c4e069710>,
 'inheritlist': ' poky-sanity package_rpm buildstats image-mklibs
image-prelink debian devshell sstate license blacklist sanity toaster
buildhistory',
 'interrupted': False,
 'llevel': 20,
 'log_dir': '/home/yocto/master/build/tmp/log/cooker/qemux86',
 'params': <bb.main.BitBakeConfigParameters object at 0x7f2c4f65cb50>,
 'pformat': <function pformat at 0x7f2c4ed65050>,
 'return_value': 0,
 'server': <ServerProxy for 0.0.0.0:43328/>,
 'taskfailures': [],
 'tb': <traceback object at 0x7f2c4e047488>,
 'traceback': <module 'traceback' from '/usr/lib/python2.7/traceback.pyc'>,
 'warnings': 0}

ERROR: Error data dump ['  File
"/home/yocto/master/bitbake/lib/bb/ui/buildinfohelper.py", line 1166, in
store_target_package_data\n    imgdata =
BuildInfoHelper._get_data_from_event(event)[\'imgdata\'][target.target]\n']
{'event': <bb.event.MetadataEvent object at 0x7f2c4cc36dd0>,
 'pkgdata': {},
 'self': <bb.ui.buildinfohelper.BuildInfoHelper object at 0x7f2c4e05db50>,
 'target': <Target: core-image-minimal>}

NOTE: Build exited with errorcode 0
NOTE: ToasterUI build done 1, brbe: 1:1
NOTE: ToasterUI build done 2
ERROR: Command execution failed: Forced shutdown
NOTE: Build exited with errorcode 1
NOTE: ToasterUI build done 1, brbe: 1:1
NOTE: ToasterUI build done 2

However, if I then stop Toaster and start again, the 'cancel' button no
longer works. Nothing happens when I click it: the build proceeds till the
end. 

Thanks!!

Belén




>
>Cheers
>
>Belén 
>
>>
>>I have updated comments and also updated api in orm/models.py :
>>http://git.yoctoproject.org/cgit/cgit.cgi/poky-contrib/log/?h=sujith/toas
>>t
>>er-build-cancel11
>
>-- 
>_______________________________________________
>toaster mailing list
>toaster@yoctoproject.org
>https://lists.yoctoproject.org/listinfo/toaster



^ permalink raw reply	[flat|nested] 27+ messages in thread

* Re: Build cancellation from toaster
  2016-01-12 10:34                       ` Barros Pena, Belen
@ 2016-01-13 16:47                         ` sujith h
  2016-01-17 19:43                           ` Barros Pena, Belen
  0 siblings, 1 reply; 27+ messages in thread
From: sujith h @ 2016-01-13 16:47 UTC (permalink / raw)
  To: Barros Pena, Belen; +Cc: toaster

[-- Attachment #1: Type: text/plain, Size: 6243 bytes --]

On Tue, Jan 12, 2016 at 4:04 PM, Barros Pena, Belen <
belen.barros.pena@intel.com> wrote:

>
>
> On 11/01/2016 11:25, "toaster-bounces@yoctoproject.org on behalf of Barros
> Pena, Belen" <toaster-bounces@yoctoproject.org on behalf of
> belen.barros.pena@intel.com> wrote:
>
> >
> >
> >On 09/01/2016 16:53, "sujith h" <sujith.h@gmail.com> wrote:
> >
> >>
> >>I have pushed my changes to
> >>
> http://git.yoctoproject.org/cgit/cgit.cgi/poky-contrib/log/?h=sujith/toas
> >>t
> >>er-build-cancel10
> >>
> >>With this change user would see the cancel button only after the actual
> >>tasks start executing. So then user can click cancel button.
> >>
> >
> >Hi Sujith,
> >
> >Now I can see that the 'cancel' button only appears when the build has
> >started, which is great. However, when I click the button, nothing
> >happens. The page seems to refresh, but I get no message telling me the
> >build is being cancelled, and the build just continues.
>
> Tested this again with a clean build directory. The 'cancel' button shows
> when the build has started proper (and can therefore be cancelled). When
> you click the 'cancel' button, you get the loading spinner and quite
> quickly the build stops. I can then start another build without problems.
>
> This is what the build log of the cancelled build says:
>
> NOTE: Sending SIGTERM to remaining 40 tasks
> NOTE: Logfile for task
> /home/yocto/master/build/tmp/work/i586-poky-linux/libxml2/2.9.3-r0/temp/log
> .do_fetch.40114
> NOTE: Logfile for task
> /home/yocto/master/build/tmp/work/i586-poky-linux/libxcb/1.11.1-r0/temp/log
> .do_patch.40146
> NOTE: Tasks Summary: Attempted 199 tasks of which 0 didn't need to be
> rerun and all succeeded.
> ERROR: u'core-image-minimal'
> Traceback (most recent call last):
>   File "/home/yocto/master/bitbake/lib/bb/ui/toasterui.py", line 357, in
> main
>     buildinfohelper.store_target_package_data(event)
>   File "/home/yocto/master/bitbake/lib/bb/ui/buildinfohelper.py", line
> 1166, in store_target_package_data
>     imgdata =
> BuildInfoHelper._get_data_from_event(event)['imgdata'][target.target]
> KeyError: u'core-image-minimal'
>
> ERROR: Error data dump ['  File
> "/home/yocto/master/bitbake/lib/bb/ui/toasterui.py", line 357, in main\n
>  buildinfohelper.store_target_package_data(event)\n']
> {'_': KeyError(u'core-image-minimal',),
>  'build_history_enabled': True,
>  'build_log': <logging.FileHandler object at 0x7f2c4e05dcd0>,
>  'build_log_file_path':
> '/home/yocto/master/build/tmp/log/cooker/qemux86/build_20160111_114819.89.l
> og',
>  'buildinfohelper': <bb.ui.buildinfohelper.BuildInfoHelper object at
> 0x7f2c4e05db50>,
>  'console': <logging.StreamHandler object at 0x7f2c4e05da10>,
>  'consolelogfile':
> '/home/yocto/master/build/tmp/log/cooker/qemux86/20160111114813.log',
>  'curr': <traceback object at 0x7f2c4e047488>,
>  'debug_domains': {},
>  'e': KeyError(u'core-image-minimal',),
>  'errors': 0,
>  'event': <bb.event.MetadataEvent object at 0x7f2c4cc36dd0>,
>  'eventHandler': <bb.ui.uievent.BBUIEventQueue instance at 0x7f2c4e060bd8>,
>  'exception_data': 'Traceback (most recent call last):\n  File
> "/home/yocto/master/bitbake/lib/bb/ui/toasterui.py", line 357, in main\n
>  buildinfohelper.store_target_package_data(event)\n  File
> "/home/yocto/master/bitbake/lib/bb/ui/buildinfohelper.py", line 1166, in
> store_target_package_data\n    imgdata =
> BuildInfoHelper._get_data_from_event(event)[\'imgdata\'][target.target]\nKe
> yError: u\'core-image-minimal\'\n',
>  'first': False,
>  'format_str': '%(levelname)s: %(message)s',
>  'formatter': <bb.msg.BBLogFormatter object at 0x7f2c4e05da90>,
>  'helper': <bb.ui.uihelper.BBUIHelper instance at 0x7f2c4e069710>,
>  'inheritlist': ' poky-sanity package_rpm buildstats image-mklibs
> image-prelink debian devshell sstate license blacklist sanity toaster
> buildhistory',
>  'interrupted': False,
>  'llevel': 20,
>  'log_dir': '/home/yocto/master/build/tmp/log/cooker/qemux86',
>  'params': <bb.main.BitBakeConfigParameters object at 0x7f2c4f65cb50>,
>  'pformat': <function pformat at 0x7f2c4ed65050>,
>  'return_value': 0,
>  'server': <ServerProxy for 0.0.0.0:43328/>,
>  'taskfailures': [],
>  'tb': <traceback object at 0x7f2c4e047488>,
>  'traceback': <module 'traceback' from '/usr/lib/python2.7/traceback.pyc'>,
>  'warnings': 0}
>
> ERROR: Error data dump ['  File
> "/home/yocto/master/bitbake/lib/bb/ui/buildinfohelper.py", line 1166, in
> store_target_package_data\n    imgdata =
> BuildInfoHelper._get_data_from_event(event)[\'imgdata\'][target.target]\n']
> {'event': <bb.event.MetadataEvent object at 0x7f2c4cc36dd0>,
>  'pkgdata': {},
>  'self': <bb.ui.buildinfohelper.BuildInfoHelper object at 0x7f2c4e05db50>,
>  'target': <Target: core-image-minimal>}
>
> NOTE: Build exited with errorcode 0
> NOTE: ToasterUI build done 1, brbe: 1:1
> NOTE: ToasterUI build done 2
> ERROR: Command execution failed: Forced shutdown
> NOTE: Build exited with errorcode 1
> NOTE: ToasterUI build done 1, brbe: 1:1
> NOTE: ToasterUI build done 2
>
> However, if I then stop Toaster and start again, the 'cancel' button no
> longer works. Nothing happens when I click it: the build proceeds till the
> end.
>
>

I have updated another patch set with which I have verified with:
a) cancellation of a normal build
b) run again and cancel the build
c) stop toaster + start toaster + run again   and cancel the build

http://git.yoctoproject.org/cgit/cgit.cgi/poky-contrib/log/?h=sujith/toaster-build-cancel12


Thanks!!
>
> Belén
>
>
>
>
> >
> >Cheers
> >
> >Belén
> >
> >>
> >>I have updated comments and also updated api in orm/models.py :
> >>
> http://git.yoctoproject.org/cgit/cgit.cgi/poky-contrib/log/?h=sujith/toas
> >>t
> >>er-build-cancel11
> >
> >--
> >_______________________________________________
> >toaster mailing list
> >toaster@yoctoproject.org
> >https://lists.yoctoproject.org/listinfo/toaster
>
>


-- 
സുജിത് ഹരിദാസന്
Bangalore
<Project>Contributor to KDE project
http://fci.wikia.com/wiki/Anti-DRM-Campaign
<Blog> http://sujithh.info

[-- Attachment #2: Type: text/html, Size: 8956 bytes --]

^ permalink raw reply	[flat|nested] 27+ messages in thread

* Re: Build cancellation from toaster
  2016-01-13 16:47                         ` sujith h
@ 2016-01-17 19:43                           ` Barros Pena, Belen
  2016-01-18 16:12                             ` sujith h
  0 siblings, 1 reply; 27+ messages in thread
From: Barros Pena, Belen @ 2016-01-17 19:43 UTC (permalink / raw)
  To: sujith h; +Cc: toaster



On 13/01/2016 16:47, "sujith h" <sujith.h@gmail.com> wrote:

>
>I have updated another patch set with which I have verified with:
>
>a) cancellation of a normal build
>
>b) run again and cancel the build
>
>c) stop toaster + start toaster + run again   and cancel the build
>
>http://git.yoctoproject.org/cgit/cgit.cgi/poky-contrib/log/?h=sujith/toast
>er-build-cancel12

Sorry for the delay in looking into this. Cancellation seems to be working
well for me for any builds I start from Toaster. However, it doesn't seem
to work for builds I start from the command line and I track through
Toaster. For those builds, a 'cancel' button appears, but when I click it,
nothing happens: the build proceeds until it completes.

I am not even sure if the 'cancel' functionality can work for builds
started from the command line, although it would be great if it did. If it
is not possible to make it work, then the cancel button should not display
for those builds. We can provide a message instead, as we do in the case
of the 'run again' button, explaining that builds started from the command
line can only be cancelled from the command line.

Thanks!

Belén 



^ permalink raw reply	[flat|nested] 27+ messages in thread

* Re: Build cancellation from toaster
  2016-01-17 19:43                           ` Barros Pena, Belen
@ 2016-01-18 16:12                             ` sujith h
  2016-01-20 16:56                               ` Brian Avery
  2016-01-21 15:16                               ` [Toaster] " sujith h
  0 siblings, 2 replies; 27+ messages in thread
From: sujith h @ 2016-01-18 16:12 UTC (permalink / raw)
  To: Barros Pena, Belen; +Cc: toaster

[-- Attachment #1: Type: text/plain, Size: 5172 bytes --]

On Mon, Jan 18, 2016 at 1:13 AM, Barros Pena, Belen <
belen.barros.pena@intel.com> wrote:

>
>
> On 13/01/2016 16:47, "sujith h" <sujith.h@gmail.com> wrote:
>
> >
> >I have updated another patch set with which I have verified with:
> >
> >a) cancellation of a normal build
> >
> >b) run again and cancel the build
> >
> >c) stop toaster + start toaster + run again   and cancel the build
> >
> >
> http://git.yoctoproject.org/cgit/cgit.cgi/poky-contrib/log/?h=sujith/toast
> >er-build-cancel12
>
> Sorry for the delay in looking into this. Cancellation seems to be working
> well for me for any builds I start from Toaster. However, it doesn't seem
> to work for builds I start from the command line and I track through
> Toaster. For those builds, a 'cancel' button appears, but when I click it,
> nothing happens: the build proceeds until it completes.
>
> I am not even sure if the 'cancel' functionality can work for builds
> started from the command line, although it would be great if it did. If it
> is not possible to make it work, then the cancel button should not display
> for those builds. We can provide a message instead, as we do in the case
> of the 'run again' button, explaining that builds started from the command
> line can only be cancelled from the command line.
>

Somehow when i try to use the same logic to cancel the build triggered from
command line ( with small modification in the code though), I am getting
error in the toaster_web.log as:

ProtocolError: <ProtocolError for 0.0.0.0:42952/: 503 Service Unavailable>

Not able to understand why it is not able to connect to the port. Because
as per my understanding when a build is triggered from toaster, we connect
to the host:port and execute the commands. The runcommand is failing badly
with the log:

2016-01-18 16:06:05,608 ERROR Internal Server Error:
/toastergui/project/1/builds/
Traceback (most recent call last):
  File
"/home/sujith/build/poky-push/venv/lib/python2.7/site-packages/django/core/handlers/base.py",
line 132, in get_response
    response = wrapped_callback(request, *callback_args, **callback_kwargs)
  File
"/home/sujith/build/poky-push/bitbake/lib/toaster/toastergui/views.py",
line 171, in returned_wrapper
    context = view(request, *args, **kwargs)
  File
"/home/sujith/build/poky-push/bitbake/lib/toaster/toastergui/views.py",
line 2896, in projectbuilds
    bbctrl.forceShutDown()
  File
"/home/sujith/build/poky-push/bitbake/lib/toaster/bldcontrol/bbcontroller.py",
line 73, in forceShutDown
    return self._runCommand(["stateForceShutdown"])
  File
"/home/sujith/build/poky-push/bitbake/lib/toaster/bldcontrol/bbcontroller.py",
line 50, in _runCommand
    result, error = self.connection.runCommand(command)
  File "/usr/lib64/python2.7/xmlrpclib.py", line 1240, in __call__
    return self.__send(self.__name, args)
  File "/usr/lib64/python2.7/xmlrpclib.py", line 1599, in __request
    verbose=self.__verbose
  File "/usr/lib64/python2.7/xmlrpclib.py", line 1280, in request
    return self.single_request(host, handler, request_body, verbose)
  File "/usr/lib64/python2.7/xmlrpclib.py", line 1328, in single_request
    response.msg,
ProtocolError: <ProtocolError for 0.0.0.0:42952/: 503 Service Unavailable>
Internal Server Error: /toastergui/project/1/builds/
Traceback (most recent call last):
  File
"/home/sujith/build/poky-push/venv/lib/python2.7/site-packages/django/core/handlers/base.py",
line 132, in get_response
    response = wrapped_callback(request, *callback_args, **callback_kwargs)
  File
"/home/sujith/build/poky-push/bitbake/lib/toaster/toastergui/views.py",
line 171, in returned_wrapper
    context = view(request, *args, **kwargs)
  File
"/home/sujith/build/poky-push/bitbake/lib/toaster/toastergui/views.py",
line 2896, in projectbuilds
    bbctrl.forceShutDown()
  File
"/home/sujith/build/poky-push/bitbake/lib/toaster/bldcontrol/bbcontroller.py",
line 73, in forceShutDown
    return self._runCommand(["stateForceShutdown"])
  File
"/home/sujith/build/poky-push/bitbake/lib/toaster/bldcontrol/bbcontroller.py",
line 50, in _runCommand
    result, error = self.connection.runCommand(command)
  File "/usr/lib64/python2.7/xmlrpclib.py", line 1240, in __call__
    return self.__send(self.__name, args)
  File "/usr/lib64/python2.7/xmlrpclib.py", line 1599, in __request
    verbose=self.__verbose
  File "/usr/lib64/python2.7/xmlrpclib.py", line 1280, in request
    return self.single_request(host, handler, request_body, verbose)
  File "/usr/lib64/python2.7/xmlrpclib.py", line 1328, in single_request
    response.msg,
ProtocolError: <ProtocolError for 0.0.0.0:42952/: 503 Service Unavailable>
[18/Jan/2016 16:06:05] "POST /toastergui/project/1/builds/ HTTP/1.1" 500
13414


Any helping hand would be appreciated. More over I would also like to know
if we can pass commands to builds triggered from command line?

Thanks,
Sujith H

-- 
സുജിത് ഹരിദാസന്
Bangalore
<Project>Contributor to KDE project
http://fci.wikia.com/wiki/Anti-DRM-Campaign
<Blog> http://sujithh.info

[-- Attachment #2: Type: text/html, Size: 6563 bytes --]

^ permalink raw reply	[flat|nested] 27+ messages in thread

* Re: Build cancellation from toaster
  2016-01-18 16:12                             ` sujith h
@ 2016-01-20 16:56                               ` Brian Avery
  2016-01-26 14:22                                 ` sujith h
  2016-01-21 15:16                               ` [Toaster] " sujith h
  1 sibling, 1 reply; 27+ messages in thread
From: Brian Avery @ 2016-01-20 16:56 UTC (permalink / raw)
  To: sujith h; +Cc: toaster

Pointer to xmlrpc test client -
https://bitbucket.org/srccode/xmlrpc-test-tool

-b

On Mon, Jan 18, 2016 at 8:12 AM, sujith h <sujith.h@gmail.com> wrote:
>
>
> On Mon, Jan 18, 2016 at 1:13 AM, Barros Pena, Belen
> <belen.barros.pena@intel.com> wrote:
>>
>>
>>
>> On 13/01/2016 16:47, "sujith h" <sujith.h@gmail.com> wrote:
>>
>> >
>> >I have updated another patch set with which I have verified with:
>> >
>> >a) cancellation of a normal build
>> >
>> >b) run again and cancel the build
>> >
>> >c) stop toaster + start toaster + run again   and cancel the build
>> >
>>
>> > >http://git.yoctoproject.org/cgit/cgit.cgi/poky-contrib/log/?h=sujith/toast
>> >er-build-cancel12
>>
>> Sorry for the delay in looking into this. Cancellation seems to be working
>> well for me for any builds I start from Toaster. However, it doesn't seem
>> to work for builds I start from the command line and I track through
>> Toaster. For those builds, a 'cancel' button appears, but when I click it,
>> nothing happens: the build proceeds until it completes.
>>
>> I am not even sure if the 'cancel' functionality can work for builds
>> started from the command line, although it would be great if it did. If it
>> is not possible to make it work, then the cancel button should not display
>> for those builds. We can provide a message instead, as we do in the case
>> of the 'run again' button, explaining that builds started from the command
>> line can only be cancelled from the command line.
>
>
> Somehow when i try to use the same logic to cancel the build triggered from
> command line ( with small modification in the code though), I am getting
> error in the toaster_web.log as:
>
> ProtocolError: <ProtocolError for 0.0.0.0:42952/: 503 Service Unavailable>
>
> Not able to understand why it is not able to connect to the port. Because as
> per my understanding when a build is triggered from toaster, we connect to
> the host:port and execute the commands. The runcommand is failing badly with
> the log:
>
> 2016-01-18 16:06:05,608 ERROR Internal Server Error:
> /toastergui/project/1/builds/
> Traceback (most recent call last):
>   File
> "/home/sujith/build/poky-push/venv/lib/python2.7/site-packages/django/core/handlers/base.py",
> line 132, in get_response
>     response = wrapped_callback(request, *callback_args, **callback_kwargs)
>   File
> "/home/sujith/build/poky-push/bitbake/lib/toaster/toastergui/views.py", line
> 171, in returned_wrapper
>     context = view(request, *args, **kwargs)
>   File
> "/home/sujith/build/poky-push/bitbake/lib/toaster/toastergui/views.py", line
> 2896, in projectbuilds
>     bbctrl.forceShutDown()
>   File
> "/home/sujith/build/poky-push/bitbake/lib/toaster/bldcontrol/bbcontroller.py",
> line 73, in forceShutDown
>     return self._runCommand(["stateForceShutdown"])
>   File
> "/home/sujith/build/poky-push/bitbake/lib/toaster/bldcontrol/bbcontroller.py",
> line 50, in _runCommand
>     result, error = self.connection.runCommand(command)
>   File "/usr/lib64/python2.7/xmlrpclib.py", line 1240, in __call__
>     return self.__send(self.__name, args)
>   File "/usr/lib64/python2.7/xmlrpclib.py", line 1599, in __request
>     verbose=self.__verbose
>   File "/usr/lib64/python2.7/xmlrpclib.py", line 1280, in request
>     return self.single_request(host, handler, request_body, verbose)
>   File "/usr/lib64/python2.7/xmlrpclib.py", line 1328, in single_request
>     response.msg,
> ProtocolError: <ProtocolError for 0.0.0.0:42952/: 503 Service Unavailable>
> Internal Server Error: /toastergui/project/1/builds/
> Traceback (most recent call last):
>   File
> "/home/sujith/build/poky-push/venv/lib/python2.7/site-packages/django/core/handlers/base.py",
> line 132, in get_response
>     response = wrapped_callback(request, *callback_args, **callback_kwargs)
>   File
> "/home/sujith/build/poky-push/bitbake/lib/toaster/toastergui/views.py", line
> 171, in returned_wrapper
>     context = view(request, *args, **kwargs)
>   File
> "/home/sujith/build/poky-push/bitbake/lib/toaster/toastergui/views.py", line
> 2896, in projectbuilds
>     bbctrl.forceShutDown()
>   File
> "/home/sujith/build/poky-push/bitbake/lib/toaster/bldcontrol/bbcontroller.py",
> line 73, in forceShutDown
>     return self._runCommand(["stateForceShutdown"])
>   File
> "/home/sujith/build/poky-push/bitbake/lib/toaster/bldcontrol/bbcontroller.py",
> line 50, in _runCommand
>     result, error = self.connection.runCommand(command)
>   File "/usr/lib64/python2.7/xmlrpclib.py", line 1240, in __call__
>     return self.__send(self.__name, args)
>   File "/usr/lib64/python2.7/xmlrpclib.py", line 1599, in __request
>     verbose=self.__verbose
>   File "/usr/lib64/python2.7/xmlrpclib.py", line 1280, in request
>     return self.single_request(host, handler, request_body, verbose)
>   File "/usr/lib64/python2.7/xmlrpclib.py", line 1328, in single_request
>     response.msg,
> ProtocolError: <ProtocolError for 0.0.0.0:42952/: 503 Service Unavailable>
> [18/Jan/2016 16:06:05] "POST /toastergui/project/1/builds/ HTTP/1.1" 500
> 13414
>
>
> Any helping hand would be appreciated. More over I would also like to know
> if we can pass commands to builds triggered from command line?
>
> Thanks,
> Sujith H
>
> --
> സുജിത് ഹരിദാസന്
> Bangalore
> <Project>Contributor to KDE project
> http://fci.wikia.com/wiki/Anti-DRM-Campaign
> <Blog> http://sujithh.info
>
> --
> _______________________________________________
> toaster mailing list
> toaster@yoctoproject.org
> https://lists.yoctoproject.org/listinfo/toaster
>


^ permalink raw reply	[flat|nested] 27+ messages in thread

* [Toaster] Build cancellation from toaster
  2016-01-18 16:12                             ` sujith h
  2016-01-20 16:56                               ` Brian Avery
@ 2016-01-21 15:16                               ` sujith h
  1 sibling, 0 replies; 27+ messages in thread
From: sujith h @ 2016-01-21 15:16 UTC (permalink / raw)
  To: bitbake-devel

[-- Attachment #1: Type: text/plain, Size: 9993 bytes --]

Hi,

After discussion with toaster community, it was decided to ask it over
bitbake-devel list. So I am sharing the issue, which I am blocked with.

Let me share the issue which I am facing: build triggered from command line
were not able to cancel from toaster, where as the build triggered from
toaster were able to cancel from toaster successfully.

The logic that I am using to cancel build from toaster is to pass
stateForceShutdown command ( as in
http://git.yoctoproject.org/cgit/cgit.cgi/poky-contrib/commit/?h=sujith/toaster-build-cancel12&id=6601df1a06abc3ce3290656e1f2f91a511653c0d).
This works like charm when the build is triggered from toaster. But when I
use the same logic to cancel the build triggered from command line I can
see error:
---------------------------
ProtocolError: <ProtocolError for 0.0.0.0:42952/: 503 Service Unavailable>

Not able to understand why it is not able to connect to the port. Because
as per my understanding when a build is triggered from toaster, we connect
to the host:port and execute the commands. The runcommand is failing badly
with the log:

2016-01-18 16:06:05,608 ERROR Internal Server Error:
/toastergui/project/1/builds/
Traceback (most recent call last):
  File
"/home/sujith/build/poky-push/venv/lib/python2.7/site-packages/django/core/handlers/base.py",
line 132, in get_response
    response = wrapped_callback(request, *callback_args, **callback_kwargs)
  File
"/home/sujith/build/poky-push/bitbake/lib/toaster/toastergui/views.py",
line 171, in returned_wrapper
    context = view(request, *args, **kwargs)
  File
"/home/sujith/build/poky-push/bitbake/lib/toaster/toastergui/views.py",
line 2896, in projectbuilds
    bbctrl.forceShutDown()
  File
"/home/sujith/build/poky-push/bitbake/lib/toaster/bldcontrol/bbcontroller.py",
line 73, in forceShutDown
    return self._runCommand(["stateForceShutdown"])
  File
"/home/sujith/build/poky-push/bitbake/lib/toaster/bldcontrol/bbcontroller.py",
line 50, in _runCommand
    result, error = self.connection.runCommand(command)
  File "/usr/lib64/python2.7/xmlrpclib.py", line 1240, in __call__
    return self.__send(self.__name, args)
  File "/usr/lib64/python2.7/xmlrpclib.py", line 1599, in __request
    verbose=self.__verbose
  File "/usr/lib64/python2.7/xmlrpclib.py", line 1280, in request
    return self.single_request(host, handler, request_body, verbose)
  File "/usr/lib64/python2.7/xmlrpclib.py", line 1328, in single_request
    response.msg,
ProtocolError: <ProtocolError for 0.0.0.0:42952/: 503 Service Unavailable>
Internal Server Error: /toastergui/project/1/builds/
Traceback (most recent call last):
  File
"/home/sujith/build/poky-push/venv/lib/python2.7/site-packages/django/core/handlers/base.py",
line 132, in get_response
    response = wrapped_callback(request, *callback_args, **callback_kwargs)
  File
"/home/sujith/build/poky-push/bitbake/lib/toaster/toastergui/views.py",
line 171, in returned_wrapper
    context = view(request, *args, **kwargs)
  File
"/home/sujith/build/poky-push/bitbake/lib/toaster/toastergui/views.py",
line 2896, in projectbuilds
    bbctrl.forceShutDown()
  File
"/home/sujith/build/poky-push/bitbake/lib/toaster/bldcontrol/bbcontroller.py",
line 73, in forceShutDown
    return self._runCommand(["stateForceShutdown"])
  File
"/home/sujith/build/poky-push/bitbake/lib/toaster/bldcontrol/bbcontroller.py",
line 50, in _runCommand
    result, error = self.connection.runCommand(command)
  File "/usr/lib64/python2.7/xmlrpclib.py", line 1240, in __call__
    return self.__send(self.__name, args)
  File "/usr/lib64/python2.7/xmlrpclib.py", line 1599, in __request
    verbose=self.__verbose
  File "/usr/lib64/python2.7/xmlrpclib.py", line 1280, in request
    return self.single_request(host, handler, request_body, verbose)
  File "/usr/lib64/python2.7/xmlrpclib.py", line 1328, in single_request
    response.msg,
ProtocolError: <ProtocolError for 0.0.0.0:42952/: 503 Service Unavailable>
[18/Jan/2016 16:06:05] "POST /toastergui/project/1/builds/ HTTP/1.1" 500
13414
-------------------------

As far as I understand the connection to bitbake server is failing.
Any helping hand or pointers to tackle this issue would be helpful for me
to move ahead with this task.

Thanks,
Sujith H


---------- Forwarded message ----------
From: sujith h <sujith.h@gmail.com>
Date: Mon, Jan 18, 2016 at 9:42 PM
Subject: Re: [Toaster] Build cancellation from toaster
To: "Barros Pena, Belen" <belen.barros.pena@intel.com>
Cc: "toaster@yoctoproject.org" <toaster@yoctoproject.org>




On Mon, Jan 18, 2016 at 1:13 AM, Barros Pena, Belen <
belen.barros.pena@intel.com> wrote:

>
>
> On 13/01/2016 16:47, "sujith h" <sujith.h@gmail.com> wrote:
>
> >
> >I have updated another patch set with which I have verified with:
> >
> >a) cancellation of a normal build
> >
> >b) run again and cancel the build
> >
> >c) stop toaster + start toaster + run again   and cancel the build
> >
> >
> http://git.yoctoproject.org/cgit/cgit.cgi/poky-contrib/log/?h=sujith/toast
> >er-build-cancel12
>
> Sorry for the delay in looking into this. Cancellation seems to be working
> well for me for any builds I start from Toaster. However, it doesn't seem
> to work for builds I start from the command line and I track through
> Toaster. For those builds, a 'cancel' button appears, but when I click it,
> nothing happens: the build proceeds until it completes.
>
> I am not even sure if the 'cancel' functionality can work for builds
> started from the command line, although it would be great if it did. If it
> is not possible to make it work, then the cancel button should not display
> for those builds. We can provide a message instead, as we do in the case
> of the 'run again' button, explaining that builds started from the command
> line can only be cancelled from the command line.
>

Somehow when i try to use the same logic to cancel the build triggered from
command line ( with small modification in the code though), I am getting
error in the toaster_web.log as:

ProtocolError: <ProtocolError for 0.0.0.0:42952/: 503 Service Unavailable>

Not able to understand why it is not able to connect to the port. Because
as per my understanding when a build is triggered from toaster, we connect
to the host:port and execute the commands. The runcommand is failing badly
with the log:

2016-01-18 16:06:05,608 ERROR Internal Server Error:
/toastergui/project/1/builds/
Traceback (most recent call last):
  File
"/home/sujith/build/poky-push/venv/lib/python2.7/site-packages/django/core/handlers/base.py",
line 132, in get_response
    response = wrapped_callback(request, *callback_args, **callback_kwargs)
  File
"/home/sujith/build/poky-push/bitbake/lib/toaster/toastergui/views.py",
line 171, in returned_wrapper
    context = view(request, *args, **kwargs)
  File
"/home/sujith/build/poky-push/bitbake/lib/toaster/toastergui/views.py",
line 2896, in projectbuilds
    bbctrl.forceShutDown()
  File
"/home/sujith/build/poky-push/bitbake/lib/toaster/bldcontrol/bbcontroller.py",
line 73, in forceShutDown
    return self._runCommand(["stateForceShutdown"])
  File
"/home/sujith/build/poky-push/bitbake/lib/toaster/bldcontrol/bbcontroller.py",
line 50, in _runCommand
    result, error = self.connection.runCommand(command)
  File "/usr/lib64/python2.7/xmlrpclib.py", line 1240, in __call__
    return self.__send(self.__name, args)
  File "/usr/lib64/python2.7/xmlrpclib.py", line 1599, in __request
    verbose=self.__verbose
  File "/usr/lib64/python2.7/xmlrpclib.py", line 1280, in request
    return self.single_request(host, handler, request_body, verbose)
  File "/usr/lib64/python2.7/xmlrpclib.py", line 1328, in single_request
    response.msg,
ProtocolError: <ProtocolError for 0.0.0.0:42952/: 503 Service Unavailable>
Internal Server Error: /toastergui/project/1/builds/
Traceback (most recent call last):
  File
"/home/sujith/build/poky-push/venv/lib/python2.7/site-packages/django/core/handlers/base.py",
line 132, in get_response
    response = wrapped_callback(request, *callback_args, **callback_kwargs)
  File
"/home/sujith/build/poky-push/bitbake/lib/toaster/toastergui/views.py",
line 171, in returned_wrapper
    context = view(request, *args, **kwargs)
  File
"/home/sujith/build/poky-push/bitbake/lib/toaster/toastergui/views.py",
line 2896, in projectbuilds
    bbctrl.forceShutDown()
  File
"/home/sujith/build/poky-push/bitbake/lib/toaster/bldcontrol/bbcontroller.py",
line 73, in forceShutDown
    return self._runCommand(["stateForceShutdown"])
  File
"/home/sujith/build/poky-push/bitbake/lib/toaster/bldcontrol/bbcontroller.py",
line 50, in _runCommand
    result, error = self.connection.runCommand(command)
  File "/usr/lib64/python2.7/xmlrpclib.py", line 1240, in __call__
    return self.__send(self.__name, args)
  File "/usr/lib64/python2.7/xmlrpclib.py", line 1599, in __request
    verbose=self.__verbose
  File "/usr/lib64/python2.7/xmlrpclib.py", line 1280, in request
    return self.single_request(host, handler, request_body, verbose)
  File "/usr/lib64/python2.7/xmlrpclib.py", line 1328, in single_request
    response.msg,
ProtocolError: <ProtocolError for 0.0.0.0:42952/: 503 Service Unavailable>
[18/Jan/2016 16:06:05] "POST /toastergui/project/1/builds/ HTTP/1.1" 500
13414


Any helping hand would be appreciated. More over I would also like to know
if we can pass commands to builds triggered from command line?

Thanks,
Sujith H

-- 
സുജിത് ഹരിദാസന്
Bangalore
<Project>Contributor to KDE project
http://fci.wikia.com/wiki/Anti-DRM-Campaign
<Blog> http://sujithh.info



-- 
സുജിത് ഹരിദാസന്
Bangalore
<Project>Contributor to KDE project
http://fci.wikia.com/wiki/Anti-DRM-Campaign
<Blog> http://sujithh.info

[-- Attachment #2: Type: text/html, Size: 12919 bytes --]

^ permalink raw reply	[flat|nested] 27+ messages in thread

* Re: Build cancellation from toaster
  2016-01-20 16:56                               ` Brian Avery
@ 2016-01-26 14:22                                 ` sujith h
  2016-01-27 16:20                                   ` sujith h
  0 siblings, 1 reply; 27+ messages in thread
From: sujith h @ 2016-01-26 14:22 UTC (permalink / raw)
  To: Brian Avery; +Cc: toaster


[-- Attachment #1.1: Type: text/plain, Size: 6571 bytes --]

On Wed, Jan 20, 2016 at 10:26 PM, Brian Avery <avery.brian@gmail.com> wrote:

> Pointer to xmlrpc test client -
> https://bitbucket.org/srccode/xmlrpc-test-tool


Today I gave a try with xmlrpc-test-tool. I tried to install php on my
local machine, followed by apache and then configured it to get it working
with php. Using this tool, I was getting the error as attached in the
screenshot.

>
>
> -b
>
> On Mon, Jan 18, 2016 at 8:12 AM, sujith h <sujith.h@gmail.com> wrote:
> >
> >
> > On Mon, Jan 18, 2016 at 1:13 AM, Barros Pena, Belen
> > <belen.barros.pena@intel.com> wrote:
> >>
> >>
> >>
> >> On 13/01/2016 16:47, "sujith h" <sujith.h@gmail.com> wrote:
> >>
> >> >
> >> >I have updated another patch set with which I have verified with:
> >> >
> >> >a) cancellation of a normal build
> >> >
> >> >b) run again and cancel the build
> >> >
> >> >c) stop toaster + start toaster + run again   and cancel the build
> >> >
> >>
> >> > >
> http://git.yoctoproject.org/cgit/cgit.cgi/poky-contrib/log/?h=sujith/toast
> >> >er-build-cancel12
> >>
> >> Sorry for the delay in looking into this. Cancellation seems to be
> working
> >> well for me for any builds I start from Toaster. However, it doesn't
> seem
> >> to work for builds I start from the command line and I track through
> >> Toaster. For those builds, a 'cancel' button appears, but when I click
> it,
> >> nothing happens: the build proceeds until it completes.
> >>
> >> I am not even sure if the 'cancel' functionality can work for builds
> >> started from the command line, although it would be great if it did. If
> it
> >> is not possible to make it work, then the cancel button should not
> display
> >> for those builds. We can provide a message instead, as we do in the case
> >> of the 'run again' button, explaining that builds started from the
> command
> >> line can only be cancelled from the command line.
> >
> >
> > Somehow when i try to use the same logic to cancel the build triggered
> from
> > command line ( with small modification in the code though), I am getting
> > error in the toaster_web.log as:
> >
> > ProtocolError: <ProtocolError for 0.0.0.0:42952/: 503 Service
> Unavailable>
> >
> > Not able to understand why it is not able to connect to the port.
> Because as
> > per my understanding when a build is triggered from toaster, we connect
> to
> > the host:port and execute the commands. The runcommand is failing badly
> with
> > the log:
> >
> > 2016-01-18 16:06:05,608 ERROR Internal Server Error:
> > /toastergui/project/1/builds/
> > Traceback (most recent call last):
> >   File
> >
> "/home/sujith/build/poky-push/venv/lib/python2.7/site-packages/django/core/handlers/base.py",
> > line 132, in get_response
> >     response = wrapped_callback(request, *callback_args,
> **callback_kwargs)
> >   File
> > "/home/sujith/build/poky-push/bitbake/lib/toaster/toastergui/views.py",
> line
> > 171, in returned_wrapper
> >     context = view(request, *args, **kwargs)
> >   File
> > "/home/sujith/build/poky-push/bitbake/lib/toaster/toastergui/views.py",
> line
> > 2896, in projectbuilds
> >     bbctrl.forceShutDown()
> >   File
> >
> "/home/sujith/build/poky-push/bitbake/lib/toaster/bldcontrol/bbcontroller.py",
> > line 73, in forceShutDown
> >     return self._runCommand(["stateForceShutdown"])
> >   File
> >
> "/home/sujith/build/poky-push/bitbake/lib/toaster/bldcontrol/bbcontroller.py",
> > line 50, in _runCommand
> >     result, error = self.connection.runCommand(command)
> >   File "/usr/lib64/python2.7/xmlrpclib.py", line 1240, in __call__
> >     return self.__send(self.__name, args)
> >   File "/usr/lib64/python2.7/xmlrpclib.py", line 1599, in __request
> >     verbose=self.__verbose
> >   File "/usr/lib64/python2.7/xmlrpclib.py", line 1280, in request
> >     return self.single_request(host, handler, request_body, verbose)
> >   File "/usr/lib64/python2.7/xmlrpclib.py", line 1328, in single_request
> >     response.msg,
> > ProtocolError: <ProtocolError for 0.0.0.0:42952/: 503 Service
> Unavailable>
> > Internal Server Error: /toastergui/project/1/builds/
> > Traceback (most recent call last):
> >   File
> >
> "/home/sujith/build/poky-push/venv/lib/python2.7/site-packages/django/core/handlers/base.py",
> > line 132, in get_response
> >     response = wrapped_callback(request, *callback_args,
> **callback_kwargs)
> >   File
> > "/home/sujith/build/poky-push/bitbake/lib/toaster/toastergui/views.py",
> line
> > 171, in returned_wrapper
> >     context = view(request, *args, **kwargs)
> >   File
> > "/home/sujith/build/poky-push/bitbake/lib/toaster/toastergui/views.py",
> line
> > 2896, in projectbuilds
> >     bbctrl.forceShutDown()
> >   File
> >
> "/home/sujith/build/poky-push/bitbake/lib/toaster/bldcontrol/bbcontroller.py",
> > line 73, in forceShutDown
> >     return self._runCommand(["stateForceShutdown"])
> >   File
> >
> "/home/sujith/build/poky-push/bitbake/lib/toaster/bldcontrol/bbcontroller.py",
> > line 50, in _runCommand
> >     result, error = self.connection.runCommand(command)
> >   File "/usr/lib64/python2.7/xmlrpclib.py", line 1240, in __call__
> >     return self.__send(self.__name, args)
> >   File "/usr/lib64/python2.7/xmlrpclib.py", line 1599, in __request
> >     verbose=self.__verbose
> >   File "/usr/lib64/python2.7/xmlrpclib.py", line 1280, in request
> >     return self.single_request(host, handler, request_body, verbose)
> >   File "/usr/lib64/python2.7/xmlrpclib.py", line 1328, in single_request
> >     response.msg,
> > ProtocolError: <ProtocolError for 0.0.0.0:42952/: 503 Service
> Unavailable>
> > [18/Jan/2016 16:06:05] "POST /toastergui/project/1/builds/ HTTP/1.1" 500
> > 13414
> >
> >
> > Any helping hand would be appreciated. More over I would also like to
> know
> > if we can pass commands to builds triggered from command line?
> >
> > Thanks,
> > Sujith H
> >
> > --
> > സുജിത് ഹരിദാസന്
> > Bangalore
> > <Project>Contributor to KDE project
> > http://fci.wikia.com/wiki/Anti-DRM-Campaign
> > <Blog> http://sujithh.info
> >
> > --
> > _______________________________________________
> > toaster mailing list
> > toaster@yoctoproject.org
> > https://lists.yoctoproject.org/listinfo/toaster
> >
>



-- 
സുജിത് ഹരിദാസന്
Bangalore
<Project>Contributor to KDE project
http://fci.wikia.com/wiki/Anti-DRM-Campaign
<Blog> http://sujithh.info

[-- Attachment #1.2: Type: text/html, Size: 9316 bytes --]

[-- Attachment #2: Screenshot_xmlrpc_test.png --]
[-- Type: image/png, Size: 89348 bytes --]

^ permalink raw reply	[flat|nested] 27+ messages in thread

* Re: Build cancellation from toaster
  2016-01-26 14:22                                 ` sujith h
@ 2016-01-27 16:20                                   ` sujith h
  2016-02-01 15:35                                     ` Barros Pena, Belen
  0 siblings, 1 reply; 27+ messages in thread
From: sujith h @ 2016-01-27 16:20 UTC (permalink / raw)
  To: Brian Avery; +Cc: toaster

[-- Attachment #1: Type: text/plain, Size: 7250 bytes --]

I have updated my patch set :
http://git.yoctoproject.org/cgit/cgit.cgi/poky-contrib/log/?h=sujith/toaster-build-cancel13
This would help to hide cancel button for builds triggered from command
line in toaster.

On Tue, Jan 26, 2016 at 7:52 PM, sujith h <sujith.h@gmail.com> wrote:

>
>
> On Wed, Jan 20, 2016 at 10:26 PM, Brian Avery <avery.brian@gmail.com>
> wrote:
>
>> Pointer to xmlrpc test client -
>> https://bitbucket.org/srccode/xmlrpc-test-tool
>
>
> Today I gave a try with xmlrpc-test-tool. I tried to install php on my
> local machine, followed by apache and then configured it to get it working
> with php. Using this tool, I was getting the error as attached in the
> screenshot.
>
>>
>>
>> -b
>>
>> On Mon, Jan 18, 2016 at 8:12 AM, sujith h <sujith.h@gmail.com> wrote:
>> >
>> >
>> > On Mon, Jan 18, 2016 at 1:13 AM, Barros Pena, Belen
>> > <belen.barros.pena@intel.com> wrote:
>> >>
>> >>
>> >>
>> >> On 13/01/2016 16:47, "sujith h" <sujith.h@gmail.com> wrote:
>> >>
>> >> >
>> >> >I have updated another patch set with which I have verified with:
>> >> >
>> >> >a) cancellation of a normal build
>> >> >
>> >> >b) run again and cancel the build
>> >> >
>> >> >c) stop toaster + start toaster + run again   and cancel the build
>> >> >
>> >>
>> >> > >
>> http://git.yoctoproject.org/cgit/cgit.cgi/poky-contrib/log/?h=sujith/toast
>> >> >er-build-cancel12
>> >>
>> >> Sorry for the delay in looking into this. Cancellation seems to be
>> working
>> >> well for me for any builds I start from Toaster. However, it doesn't
>> seem
>> >> to work for builds I start from the command line and I track through
>> >> Toaster. For those builds, a 'cancel' button appears, but when I click
>> it,
>> >> nothing happens: the build proceeds until it completes.
>> >>
>> >> I am not even sure if the 'cancel' functionality can work for builds
>> >> started from the command line, although it would be great if it did.
>> If it
>> >> is not possible to make it work, then the cancel button should not
>> display
>> >> for those builds. We can provide a message instead, as we do in the
>> case
>> >> of the 'run again' button, explaining that builds started from the
>> command
>> >> line can only be cancelled from the command line.
>> >
>> >
>> > Somehow when i try to use the same logic to cancel the build triggered
>> from
>> > command line ( with small modification in the code though), I am getting
>> > error in the toaster_web.log as:
>> >
>> > ProtocolError: <ProtocolError for 0.0.0.0:42952/: 503 Service
>> Unavailable>
>> >
>> > Not able to understand why it is not able to connect to the port.
>> Because as
>> > per my understanding when a build is triggered from toaster, we connect
>> to
>> > the host:port and execute the commands. The runcommand is failing badly
>> with
>> > the log:
>> >
>> > 2016-01-18 16:06:05,608 ERROR Internal Server Error:
>> > /toastergui/project/1/builds/
>> > Traceback (most recent call last):
>> >   File
>> >
>> "/home/sujith/build/poky-push/venv/lib/python2.7/site-packages/django/core/handlers/base.py",
>> > line 132, in get_response
>> >     response = wrapped_callback(request, *callback_args,
>> **callback_kwargs)
>> >   File
>> > "/home/sujith/build/poky-push/bitbake/lib/toaster/toastergui/views.py",
>> line
>> > 171, in returned_wrapper
>> >     context = view(request, *args, **kwargs)
>> >   File
>> > "/home/sujith/build/poky-push/bitbake/lib/toaster/toastergui/views.py",
>> line
>> > 2896, in projectbuilds
>> >     bbctrl.forceShutDown()
>> >   File
>> >
>> "/home/sujith/build/poky-push/bitbake/lib/toaster/bldcontrol/bbcontroller.py",
>> > line 73, in forceShutDown
>> >     return self._runCommand(["stateForceShutdown"])
>> >   File
>> >
>> "/home/sujith/build/poky-push/bitbake/lib/toaster/bldcontrol/bbcontroller.py",
>> > line 50, in _runCommand
>> >     result, error = self.connection.runCommand(command)
>> >   File "/usr/lib64/python2.7/xmlrpclib.py", line 1240, in __call__
>> >     return self.__send(self.__name, args)
>> >   File "/usr/lib64/python2.7/xmlrpclib.py", line 1599, in __request
>> >     verbose=self.__verbose
>> >   File "/usr/lib64/python2.7/xmlrpclib.py", line 1280, in request
>> >     return self.single_request(host, handler, request_body, verbose)
>> >   File "/usr/lib64/python2.7/xmlrpclib.py", line 1328, in single_request
>> >     response.msg,
>> > ProtocolError: <ProtocolError for 0.0.0.0:42952/: 503 Service
>> Unavailable>
>> > Internal Server Error: /toastergui/project/1/builds/
>> > Traceback (most recent call last):
>> >   File
>> >
>> "/home/sujith/build/poky-push/venv/lib/python2.7/site-packages/django/core/handlers/base.py",
>> > line 132, in get_response
>> >     response = wrapped_callback(request, *callback_args,
>> **callback_kwargs)
>> >   File
>> > "/home/sujith/build/poky-push/bitbake/lib/toaster/toastergui/views.py",
>> line
>> > 171, in returned_wrapper
>> >     context = view(request, *args, **kwargs)
>> >   File
>> > "/home/sujith/build/poky-push/bitbake/lib/toaster/toastergui/views.py",
>> line
>> > 2896, in projectbuilds
>> >     bbctrl.forceShutDown()
>> >   File
>> >
>> "/home/sujith/build/poky-push/bitbake/lib/toaster/bldcontrol/bbcontroller.py",
>> > line 73, in forceShutDown
>> >     return self._runCommand(["stateForceShutdown"])
>> >   File
>> >
>> "/home/sujith/build/poky-push/bitbake/lib/toaster/bldcontrol/bbcontroller.py",
>> > line 50, in _runCommand
>> >     result, error = self.connection.runCommand(command)
>> >   File "/usr/lib64/python2.7/xmlrpclib.py", line 1240, in __call__
>> >     return self.__send(self.__name, args)
>> >   File "/usr/lib64/python2.7/xmlrpclib.py", line 1599, in __request
>> >     verbose=self.__verbose
>> >   File "/usr/lib64/python2.7/xmlrpclib.py", line 1280, in request
>> >     return self.single_request(host, handler, request_body, verbose)
>> >   File "/usr/lib64/python2.7/xmlrpclib.py", line 1328, in single_request
>> >     response.msg,
>> > ProtocolError: <ProtocolError for 0.0.0.0:42952/: 503 Service
>> Unavailable>
>> > [18/Jan/2016 16:06:05] "POST /toastergui/project/1/builds/ HTTP/1.1" 500
>> > 13414
>> >
>> >
>> > Any helping hand would be appreciated. More over I would also like to
>> know
>> > if we can pass commands to builds triggered from command line?
>> >
>> > Thanks,
>> > Sujith H
>> >
>> > --
>> > സുജിത് ഹരിദാസന്
>> > Bangalore
>> > <Project>Contributor to KDE project
>> > http://fci.wikia.com/wiki/Anti-DRM-Campaign
>> > <Blog> http://sujithh.info
>> >
>> > --
>> > _______________________________________________
>> > toaster mailing list
>> > toaster@yoctoproject.org
>> > https://lists.yoctoproject.org/listinfo/toaster
>> >
>>
>
>
>
> --
> സുജിത് ഹരിദാസന്
> Bangalore
> <Project>Contributor to KDE project
> http://fci.wikia.com/wiki/Anti-DRM-Campaign
> <Blog> http://sujithh.info
>



-- 
സുജിത് ഹരിദാസന്
Bangalore
<Project>Contributor to KDE project
http://fci.wikia.com/wiki/Anti-DRM-Campaign
<Blog> http://sujithh.info

[-- Attachment #2: Type: text/html, Size: 10554 bytes --]

^ permalink raw reply	[flat|nested] 27+ messages in thread

* Re: Build cancellation from toaster
  2016-01-27 16:20                                   ` sujith h
@ 2016-02-01 15:35                                     ` Barros Pena, Belen
  2016-02-03 13:38                                       ` sujith h
  0 siblings, 1 reply; 27+ messages in thread
From: Barros Pena, Belen @ 2016-02-01 15:35 UTC (permalink / raw)
  To: sujith h; +Cc: toaster



On 27/01/2016 17:20, "sujith h" <sujith.h@gmail.com> wrote:

>I have updated my patch set :
>http://git.yoctoproject.org/cgit/cgit.cgi/poky-contrib/log/?h=sujith/toast
>er-build-cancel13 
><http://git.yoctoproject.org/cgit/cgit.cgi/poky-contrib/log/?h=sujith/toas
>ter-build-cancel13>

Hi Sujith,

Using this branch, the 'cancel' button does no longer show for the command
line builds. I was also able to cancel the builds I start from Toaster
without issues. So this is almost there. So the only thing left to address
is the UI:

* When I click the 'cancel' button, the build needs to go into a
'cancelling' state that tells users their cancelling command has been
received successfully by Toaster and it's being processed. This state has
to show at least for 2 seconds. Otherwise users will not be able to
process what's going on. If the build stops before those 2 seconds, we
need to hold the state anyway for that minimum amount of time.

* Once the cancelled build stops, the build now shows as successful. It
should show as cancelled instead, and it should not be listed in the
builds table.

To see the behaviour you can visit

http://www.yoctoproject.org/toaster/project-configuration.html

Type 'minimal' in the build form in the top right area of the page. Select
core-image-minimal and click 'build'. Once the build comes up, click the
'cancel' button. 

Also, you can see the details of the design in this document

https://bugzilla.yoctoproject.org/attachment.cgi?id=2706

* We also need to fix the layout a bit (the % of tasks is too close to the
progress bar, and the 'cancel' button wraps)

If you have any questions, let me know.

Thanks!

Belén




>
>This would help to hide cancel button for builds triggered from command
>line in toaster.
>
>On Tue, Jan 26, 2016 at 7:52 PM, sujith h
><sujith.h@gmail.com> wrote:
>
>
>
>On Wed, Jan 20, 2016 at 10:26 PM, Brian Avery
><avery.brian@gmail.com> wrote:
>
>Pointer to xmlrpc test client -
>https://bitbucket.org/srccode/xmlrpc-test-tool
>
>
>
>Today I gave a try with xmlrpc-test-tool. I tried to install php on my
>local machine, followed by apache and then configured it to get it
>working with php. Using this tool, I was getting the error as attached in
>the screenshot. 
>
>
>
>
>
>-b
>
>On Mon, Jan 18, 2016 at 8:12 AM, sujith h <sujith.h@gmail.com> wrote:
>>
>>
>> On Mon, Jan 18, 2016 at 1:13 AM, Barros Pena, Belen
>> <belen.barros.pena@intel.com> wrote:
>>>
>>>
>>>
>>> On 13/01/2016 16:47, "sujith h" <sujith.h@gmail.com> wrote:
>>>
>>> >
>>> >I have updated another patch set with which I have verified with:
>>> >
>>> >a) cancellation of a normal build
>>> >
>>> >b) run again and cancel the build
>>> >
>>> >c) stop toaster + start toaster + run again   and cancel the build
>>> >
>>>
>>> > 
>>>>http://git.yoctoproject.org/cgit/cgit.cgi/poky-contrib/log/?h=sujith/to
>>>>ast
>>> >er-build-cancel12
>>>
>>> Sorry for the delay in looking into this. Cancellation seems to be
>>>working
>>> well for me for any builds I start from Toaster. However, it doesn't
>>>seem
>>> to work for builds I start from the command line and I track through
>>> Toaster. For those builds, a 'cancel' button appears, but when I click
>>>it,
>>> nothing happens: the build proceeds until it completes.
>>>
>>> I am not even sure if the 'cancel' functionality can work for builds
>>> started from the command line, although it would be great if it did.
>>>If it
>>> is not possible to make it work, then the cancel button should not
>>>display
>>> for those builds. We can provide a message instead, as we do in the
>>>case
>>> of the 'run again' button, explaining that builds started from the
>>>command
>>> line can only be cancelled from the command line.
>>
>>
>> Somehow when i try to use the same logic to cancel the build triggered
>>from
>> command line ( with small modification in the code though), I am getting
>> error in the toaster_web.log as:
>>
>> ProtocolError: <ProtocolError for
>0.0.0.0:42952/ <http://0.0.0.0:42952/>: 503 Service Unavailable>
>>
>> Not able to understand why it is not able to connect to the port.
>>Because as
>> per my understanding when a build is triggered from toaster, we connect
>>to
>> the host:port and execute the commands. The runcommand is failing badly
>>with
>> the log:
>>
>> 2016-01-18 16:06:05,608 ERROR Internal Server Error:
>> /toastergui/project/1/builds/
>> Traceback (most recent call last):
>>   File
>> 
>>"/home/sujith/build/poky-push/venv/lib/python2.7/site-packages/django/cor
>>e/handlers/base.py",
>> line 132, in get_response
>>     response = wrapped_callback(request, *callback_args,
>>**callback_kwargs)
>>   File
>> "/home/sujith/build/poky-push/bitbake/lib/toaster/toastergui/views.py",
>>line
>> 171, in returned_wrapper
>>     context = view(request, *args, **kwargs)
>>   File
>> "/home/sujith/build/poky-push/bitbake/lib/toaster/toastergui/views.py",
>>line
>> 2896, in projectbuilds
>>     bbctrl.forceShutDown()
>>   File
>> 
>>"/home/sujith/build/poky-push/bitbake/lib/toaster/bldcontrol/bbcontroller
>>.py",
>> line 73, in forceShutDown
>>     return self._runCommand(["stateForceShutdown"])
>>   File
>> 
>>"/home/sujith/build/poky-push/bitbake/lib/toaster/bldcontrol/bbcontroller
>>.py",
>> line 50, in _runCommand
>>     result, error = self.connection.runCommand(command)
>>   File "/usr/lib64/python2.7/xmlrpclib.py", line 1240, in __call__
>>     return self.__send(self.__name, args)
>>   File "/usr/lib64/python2.7/xmlrpclib.py", line 1599, in __request
>>     verbose=self.__verbose
>>   File "/usr/lib64/python2.7/xmlrpclib.py", line 1280, in request
>>     return self.single_request(host, handler, request_body, verbose)
>>   File "/usr/lib64/python2.7/xmlrpclib.py", line 1328, in single_request
>>     response.msg,
>> ProtocolError: <ProtocolError for
>0.0.0.0:42952/ <http://0.0.0.0:42952/>: 503 Service Unavailable>
>> Internal Server Error: /toastergui/project/1/builds/
>> Traceback (most recent call last):
>>   File
>> 
>>"/home/sujith/build/poky-push/venv/lib/python2.7/site-packages/django/cor
>>e/handlers/base.py",
>> line 132, in get_response
>>     response = wrapped_callback(request, *callback_args,
>>**callback_kwargs)
>>   File
>> "/home/sujith/build/poky-push/bitbake/lib/toaster/toastergui/views.py",
>>line
>> 171, in returned_wrapper
>>     context = view(request, *args, **kwargs)
>>   File
>> "/home/sujith/build/poky-push/bitbake/lib/toaster/toastergui/views.py",
>>line
>> 2896, in projectbuilds
>>     bbctrl.forceShutDown()
>>   File
>> 
>>"/home/sujith/build/poky-push/bitbake/lib/toaster/bldcontrol/bbcontroller
>>.py",
>> line 73, in forceShutDown
>>     return self._runCommand(["stateForceShutdown"])
>>   File
>> 
>>"/home/sujith/build/poky-push/bitbake/lib/toaster/bldcontrol/bbcontroller
>>.py",
>> line 50, in _runCommand
>>     result, error = self.connection.runCommand(command)
>>   File "/usr/lib64/python2.7/xmlrpclib.py", line 1240, in __call__
>>     return self.__send(self.__name, args)
>>   File "/usr/lib64/python2.7/xmlrpclib.py", line 1599, in __request
>>     verbose=self.__verbose
>>   File "/usr/lib64/python2.7/xmlrpclib.py", line 1280, in request
>>     return self.single_request(host, handler, request_body, verbose)
>>   File "/usr/lib64/python2.7/xmlrpclib.py", line 1328, in single_request
>>     response.msg,
>> ProtocolError: <ProtocolError for
>0.0.0.0:42952/ <http://0.0.0.0:42952/>: 503 Service Unavailable>
>> [18/Jan/2016 16:06:05] "POST /toastergui/project/1/builds/ HTTP/1.1" 500
>> 13414
>>
>>
>> Any helping hand would be appreciated. More over I would also like to
>>know
>> if we can pass commands to builds triggered from command line?
>>
>> Thanks,
>> Sujith H
>>
>> --
>> സുജിത് ഹരിദാസന്
>> Bangalore
>> <Project>Contributor to KDE project
>> 
>http://fci.wikia.com/wiki/Anti-DRM-Campaign
><http://fci.wikia.com/wiki/Anti-DRM-Campaign>
>> <Blog> http://sujithh.info
>>
>
>
>> --
>> _______________________________________________
>> toaster mailing list
>> toaster@yoctoproject.org
>> 
>https://lists.yoctoproject.org/listinfo/toaster
><https://lists.yoctoproject.org/listinfo/toaster>
>>
>
>
>
>
>
>
>
>
>
>
>-- 
>സുജിത് ഹരിദാസന്
>Bangalore
><Project>Contributor to KDE project
>http://fci.wikia.com/wiki/Anti-DRM-Campaign
><Blog> http://sujithh.info
>
>
>
>
>
>
>
>
>
>
>
>-- 
>സുജിത് ഹരിദാസന്
>Bangalore
><Project>Contributor to KDE project
>http://fci.wikia.com/wiki/Anti-DRM-Campaign
><Blog> http://sujithh.info
>
>
>
>
>
>
>


^ permalink raw reply	[flat|nested] 27+ messages in thread

* Re: Build cancellation from toaster
  2016-02-01 15:35                                     ` Barros Pena, Belen
@ 2016-02-03 13:38                                       ` sujith h
  2016-02-09 13:40                                         ` sujith h
  0 siblings, 1 reply; 27+ messages in thread
From: sujith h @ 2016-02-03 13:38 UTC (permalink / raw)
  To: Barros Pena, Belen; +Cc: toaster


[-- Attachment #1.1: Type: text/plain, Size: 9923 bytes --]

On Mon, Feb 1, 2016 at 9:05 PM, Barros Pena, Belen <
belen.barros.pena@intel.com> wrote:

>
>
> On 27/01/2016 17:20, "sujith h" <sujith.h@gmail.com> wrote:
>
> >I have updated my patch set :
> >
> http://git.yoctoproject.org/cgit/cgit.cgi/poky-contrib/log/?h=sujith/toast
> >er-build-cancel13
> ><
> http://git.yoctoproject.org/cgit/cgit.cgi/poky-contrib/log/?h=sujith/toas
> >ter-build-cancel13>
>
> Hi Sujith,
>
> Using this branch, the 'cancel' button does no longer show for the command
> line builds. I was also able to cancel the builds I start from Toaster
> without issues. So this is almost there. So the only thing left to address
> is the UI:
>
> * When I click the 'cancel' button, the build needs to go into a
> 'cancelling' state that tells users their cancelling command has been
> received successfully by Toaster and it's being processed. This state has
> to show at least for 2 seconds. Otherwise users will not be able to
> process what's going on. If the build stops before those 2 seconds, we
> need to hold the state anyway for that minimum amount of time.
>
> * Once the cancelled build stops, the build now shows as successful. It
> should show as cancelled instead, and it should not be listed in the
> builds table.
>
> To see the behaviour you can visit
>
> http://www.yoctoproject.org/toaster/project-configuration.html
>
> Type 'minimal' in the build form in the top right area of the page. Select
> core-image-minimal and click 'build'. Once the build comes up, click the
> 'cancel' button.
>
> Also, you can see the details of the design in this document
>
> https://bugzilla.yoctoproject.org/attachment.cgi?id=2706
>
> * We also need to fix the layout a bit (the % of tasks is too close to the
> progress bar, and the 'cancel' button wraps)
>
> If you have any questions, let me know.
>

Hi Belen, on the branch
http://git.yoctoproject.org/cgit/cgit.cgi/poky-contrib/log/?h=sujith/toaster-build-cancel13,
can you apply the patch which I have attached with this mail.
Let me know if my changes match close to the feedback.

Thanks,
Sujith H

>
>
>
> >
> >This would help to hide cancel button for builds triggered from command
> >line in toaster.
> >
> >On Tue, Jan 26, 2016 at 7:52 PM, sujith h
> ><sujith.h@gmail.com> wrote:
> >
> >
> >
> >On Wed, Jan 20, 2016 at 10:26 PM, Brian Avery
> ><avery.brian@gmail.com> wrote:
> >
> >Pointer to xmlrpc test client -
> >https://bitbucket.org/srccode/xmlrpc-test-tool
> >
> >
> >
> >Today I gave a try with xmlrpc-test-tool. I tried to install php on my
> >local machine, followed by apache and then configured it to get it
> >working with php. Using this tool, I was getting the error as attached in
> >the screenshot.
> >
> >
> >
> >
> >
> >-b
> >
> >On Mon, Jan 18, 2016 at 8:12 AM, sujith h <sujith.h@gmail.com> wrote:
> >>
> >>
> >> On Mon, Jan 18, 2016 at 1:13 AM, Barros Pena, Belen
> >> <belen.barros.pena@intel.com> wrote:
> >>>
> >>>
> >>>
> >>> On 13/01/2016 16:47, "sujith h" <sujith.h@gmail.com> wrote:
> >>>
> >>> >
> >>> >I have updated another patch set with which I have verified with:
> >>> >
> >>> >a) cancellation of a normal build
> >>> >
> >>> >b) run again and cancel the build
> >>> >
> >>> >c) stop toaster + start toaster + run again   and cancel the build
> >>> >
> >>>
> >>> >
> >>>>
> http://git.yoctoproject.org/cgit/cgit.cgi/poky-contrib/log/?h=sujith/to
> >>>>ast
> >>> >er-build-cancel12
> >>>
> >>> Sorry for the delay in looking into this. Cancellation seems to be
> >>>working
> >>> well for me for any builds I start from Toaster. However, it doesn't
> >>>seem
> >>> to work for builds I start from the command line and I track through
> >>> Toaster. For those builds, a 'cancel' button appears, but when I click
> >>>it,
> >>> nothing happens: the build proceeds until it completes.
> >>>
> >>> I am not even sure if the 'cancel' functionality can work for builds
> >>> started from the command line, although it would be great if it did.
> >>>If it
> >>> is not possible to make it work, then the cancel button should not
> >>>display
> >>> for those builds. We can provide a message instead, as we do in the
> >>>case
> >>> of the 'run again' button, explaining that builds started from the
> >>>command
> >>> line can only be cancelled from the command line.
> >>
> >>
> >> Somehow when i try to use the same logic to cancel the build triggered
> >>from
> >> command line ( with small modification in the code though), I am getting
> >> error in the toaster_web.log as:
> >>
> >> ProtocolError: <ProtocolError for
> >0.0.0.0:42952/ <http://0.0.0.0:42952/>: 503 Service Unavailable>
> >>
> >> Not able to understand why it is not able to connect to the port.
> >>Because as
> >> per my understanding when a build is triggered from toaster, we connect
> >>to
> >> the host:port and execute the commands. The runcommand is failing badly
> >>with
> >> the log:
> >>
> >> 2016-01-18 16:06:05,608 ERROR Internal Server Error:
> >> /toastergui/project/1/builds/
> >> Traceback (most recent call last):
> >>   File
> >>
> >>"/home/sujith/build/poky-push/venv/lib/python2.7/site-packages/django/cor
> >>e/handlers/base.py",
> >> line 132, in get_response
> >>     response = wrapped_callback(request, *callback_args,
> >>**callback_kwargs)
> >>   File
> >> "/home/sujith/build/poky-push/bitbake/lib/toaster/toastergui/views.py",
> >>line
> >> 171, in returned_wrapper
> >>     context = view(request, *args, **kwargs)
> >>   File
> >> "/home/sujith/build/poky-push/bitbake/lib/toaster/toastergui/views.py",
> >>line
> >> 2896, in projectbuilds
> >>     bbctrl.forceShutDown()
> >>   File
> >>
> >>"/home/sujith/build/poky-push/bitbake/lib/toaster/bldcontrol/bbcontroller
> >>.py",
> >> line 73, in forceShutDown
> >>     return self._runCommand(["stateForceShutdown"])
> >>   File
> >>
> >>"/home/sujith/build/poky-push/bitbake/lib/toaster/bldcontrol/bbcontroller
> >>.py",
> >> line 50, in _runCommand
> >>     result, error = self.connection.runCommand(command)
> >>   File "/usr/lib64/python2.7/xmlrpclib.py", line 1240, in __call__
> >>     return self.__send(self.__name, args)
> >>   File "/usr/lib64/python2.7/xmlrpclib.py", line 1599, in __request
> >>     verbose=self.__verbose
> >>   File "/usr/lib64/python2.7/xmlrpclib.py", line 1280, in request
> >>     return self.single_request(host, handler, request_body, verbose)
> >>   File "/usr/lib64/python2.7/xmlrpclib.py", line 1328, in single_request
> >>     response.msg,
> >> ProtocolError: <ProtocolError for
> >0.0.0.0:42952/ <http://0.0.0.0:42952/>: 503 Service Unavailable>
> >> Internal Server Error: /toastergui/project/1/builds/
> >> Traceback (most recent call last):
> >>   File
> >>
> >>"/home/sujith/build/poky-push/venv/lib/python2.7/site-packages/django/cor
> >>e/handlers/base.py",
> >> line 132, in get_response
> >>     response = wrapped_callback(request, *callback_args,
> >>**callback_kwargs)
> >>   File
> >> "/home/sujith/build/poky-push/bitbake/lib/toaster/toastergui/views.py",
> >>line
> >> 171, in returned_wrapper
> >>     context = view(request, *args, **kwargs)
> >>   File
> >> "/home/sujith/build/poky-push/bitbake/lib/toaster/toastergui/views.py",
> >>line
> >> 2896, in projectbuilds
> >>     bbctrl.forceShutDown()
> >>   File
> >>
> >>"/home/sujith/build/poky-push/bitbake/lib/toaster/bldcontrol/bbcontroller
> >>.py",
> >> line 73, in forceShutDown
> >>     return self._runCommand(["stateForceShutdown"])
> >>   File
> >>
> >>"/home/sujith/build/poky-push/bitbake/lib/toaster/bldcontrol/bbcontroller
> >>.py",
> >> line 50, in _runCommand
> >>     result, error = self.connection.runCommand(command)
> >>   File "/usr/lib64/python2.7/xmlrpclib.py", line 1240, in __call__
> >>     return self.__send(self.__name, args)
> >>   File "/usr/lib64/python2.7/xmlrpclib.py", line 1599, in __request
> >>     verbose=self.__verbose
> >>   File "/usr/lib64/python2.7/xmlrpclib.py", line 1280, in request
> >>     return self.single_request(host, handler, request_body, verbose)
> >>   File "/usr/lib64/python2.7/xmlrpclib.py", line 1328, in single_request
> >>     response.msg,
> >> ProtocolError: <ProtocolError for
> >0.0.0.0:42952/ <http://0.0.0.0:42952/>: 503 Service Unavailable>
> >> [18/Jan/2016 16:06:05] "POST /toastergui/project/1/builds/ HTTP/1.1" 500
> >> 13414
> >>
> >>
> >> Any helping hand would be appreciated. More over I would also like to
> >>know
> >> if we can pass commands to builds triggered from command line?
> >>
> >> Thanks,
> >> Sujith H
> >>
> >> --
> >> സുജിത് ഹരിദാസന്
> >> Bangalore
> >> <Project>Contributor to KDE project
> >>
> >http://fci.wikia.com/wiki/Anti-DRM-Campaign
> ><http://fci.wikia.com/wiki/Anti-DRM-Campaign>
> >> <Blog> http://sujithh.info
> >>
> >
> >
> >> --
> >> _______________________________________________
> >> toaster mailing list
> >> toaster@yoctoproject.org
> >>
> >https://lists.yoctoproject.org/listinfo/toaster
> ><https://lists.yoctoproject.org/listinfo/toaster>
> >>
> >
> >
> >
> >
> >
> >
> >
> >
> >
> >
> >--
> >സുജിത് ഹരിദാസന്
> >Bangalore
> ><Project>Contributor to KDE project
> >http://fci.wikia.com/wiki/Anti-DRM-Campaign
> ><Blog> http://sujithh.info
> >
> >
> >
> >
> >
> >
> >
> >
> >
> >
> >
> >--
> >സുജിത് ഹരിദാസന്
> >Bangalore
> ><Project>Contributor to KDE project
> >http://fci.wikia.com/wiki/Anti-DRM-Campaign
> ><Blog> http://sujithh.info
> >
> >
> >
> >
> >
> >
> >
>
>


-- 
സുജിത് ഹരിദാസന്
Bangalore
<Project>Contributor to KDE project
http://fci.wikia.com/wiki/Anti-DRM-Campaign
<Blog> http://sujithh.info

[-- Attachment #1.2: Type: text/html, Size: 15657 bytes --]

[-- Attachment #2: 0001-Toaster-UI-changes-as-per-Belen.patch --]
[-- Type: text/x-patch, Size: 3939 bytes --]

From 30f588d6d2b9b6d2d81879b66cbe19aa9d7e8170 Mon Sep 17 00:00:00 2001
From: Sujith Haridasan <Sujith_Haridasan@mentor.com>
Date: Wed, 3 Feb 2016 19:04:34 +0530
Subject: [PATCH] Toaster: UI changes as per Belen

UI Changes as per Belen

Signed-off-by: Sujith Haridasan <Sujith_Haridasan@mentor.com>
---
 bitbake/lib/toaster/orm/models.py                         | 2 ++
 bitbake/lib/toaster/toastergui/static/js/libtoaster.js    | 5 +++++
 bitbake/lib/toaster/toastergui/tables.py                  | 7 ++++++-
 bitbake/lib/toaster/toastergui/templates/mrb_section.html | 2 ++
 4 files changed, 15 insertions(+), 1 deletion(-)

diff --git a/bitbake/lib/toaster/orm/models.py b/bitbake/lib/toaster/orm/models.py
index 2a615a9..4d57c8d 100644
--- a/bitbake/lib/toaster/orm/models.py
+++ b/bitbake/lib/toaster/orm/models.py
@@ -351,11 +351,13 @@ class Build(models.Model):
     SUCCEEDED = 0
     FAILED = 1
     IN_PROGRESS = 2
+    CANCELLED = 3
 
     BUILD_OUTCOME = (
         (SUCCEEDED, 'Succeeded'),
         (FAILED, 'Failed'),
         (IN_PROGRESS, 'In Progress'),
+        (CANCELLED, 'Cancelled'),
     )
 
     search_allowed_fields = ['machine', 'cooker_log_path', "target__target", "target__target_image_file__file_name"]
diff --git a/bitbake/lib/toaster/toastergui/static/js/libtoaster.js b/bitbake/lib/toaster/toastergui/static/js/libtoaster.js
index c688f79..39837b7 100644
--- a/bitbake/lib/toaster/toastergui/static/js/libtoaster.js
+++ b/bitbake/lib/toaster/toastergui/static/js/libtoaster.js
@@ -131,11 +131,16 @@ var libtoaster = (function (){
         url: url,
         data: { 'buildCancel': build_ids },
         headers: { 'X-CSRFToken' : $.cookie('csrftoken')},
+        beforeSend: function() {
+          $('#loading-notification').html("Build cancellation is in process. Please wait");
+        },
         success: function (_data) {
 	  /* No proper reponse YOCTO #7995
           if (_data.error !== "ok") {
             console.warn(_data.error);
             } else {*/
+            $('#loading-notification').html("Build cancellation successful");
+            setTimeout(function() {}, 2000)
             if (onsuccess !== undefined) onsuccess(_data);
           //}
         },
diff --git a/bitbake/lib/toaster/toastergui/tables.py b/bitbake/lib/toaster/toastergui/tables.py
index 48a7c7b..2af4b73 100644
--- a/bitbake/lib/toaster/toastergui/tables.py
+++ b/bitbake/lib/toaster/toastergui/tables.py
@@ -1272,8 +1272,13 @@ class BuildsTable(ToasterTable):
                     bbctrl = bbcontroller.BitbakeController(br.environment)
                     bbctrl.forceShutDown()
                     while True:
-                        if BuildRequest.objects.get(pk = i).build.outcome == 0:
+                        import time
+                        time.sleep(2)
+                        build = BuildRequest.objects.get(pk = i).build
+                        if build.outcome == 0:
                             br.state = BuildRequest.REQ_DELETED
+                            build.outcome = 3
+                            build.save()
                             br.save()
                             break
                 except BuildRequest.DoesNotExist:
diff --git a/bitbake/lib/toaster/toastergui/templates/mrb_section.html b/bitbake/lib/toaster/toastergui/templates/mrb_section.html
index 68e18d1..0a389f7 100644
--- a/bitbake/lib/toaster/toastergui/templates/mrb_section.html
+++ b/bitbake/lib/toaster/toastergui/templates/mrb_section.html
@@ -134,6 +134,8 @@
                           Cancel
                          </button>
                  {%endif%}
+            {%else%}
+               <i class="icon-question-sign get-help heading-help pull-right" data-placement="left" title="" data-original-title="Builds in this projects cannot be cancelled from Toaster: they can only be cancelled from the command line"></i>
             {%endif%}
     {%endif%}
         </div>
-- 
1.9.1


^ permalink raw reply related	[flat|nested] 27+ messages in thread

* Re: Build cancellation from toaster
  2016-02-03 13:38                                       ` sujith h
@ 2016-02-09 13:40                                         ` sujith h
  2016-02-12 11:04                                           ` Barros Pena, Belen
  2016-02-19 23:11                                           ` Michael Wood
  0 siblings, 2 replies; 27+ messages in thread
From: sujith h @ 2016-02-09 13:40 UTC (permalink / raw)
  To: Barros Pena, Belen; +Cc: toaster

[-- Attachment #1: Type: text/plain, Size: 10716 bytes --]

On Wed, Feb 3, 2016 at 7:08 PM, sujith h <sujith.h@gmail.com> wrote:

>
>
> On Mon, Feb 1, 2016 at 9:05 PM, Barros Pena, Belen <
> belen.barros.pena@intel.com> wrote:
>
>>
>>
>> On 27/01/2016 17:20, "sujith h" <sujith.h@gmail.com> wrote:
>>
>> >I have updated my patch set :
>> >
>> http://git.yoctoproject.org/cgit/cgit.cgi/poky-contrib/log/?h=sujith/toast
>> >er-build-cancel13
>> ><
>> http://git.yoctoproject.org/cgit/cgit.cgi/poky-contrib/log/?h=sujith/toas
>> >ter-build-cancel13>
>>
>> Hi Sujith,
>>
>> Using this branch, the 'cancel' button does no longer show for the command
>> line builds. I was also able to cancel the builds I start from Toaster
>> without issues. So this is almost there. So the only thing left to address
>> is the UI:
>>
>> * When I click the 'cancel' button, the build needs to go into a
>> 'cancelling' state that tells users their cancelling command has been
>> received successfully by Toaster and it's being processed. This state has
>> to show at least for 2 seconds. Otherwise users will not be able to
>> process what's going on. If the build stops before those 2 seconds, we
>> need to hold the state anyway for that minimum amount of time.
>>
>> * Once the cancelled build stops, the build now shows as successful. It
>> should show as cancelled instead, and it should not be listed in the
>> builds table.
>>
>> To see the behaviour you can visit
>>
>> http://www.yoctoproject.org/toaster/project-configuration.html
>>
>> Type 'minimal' in the build form in the top right area of the page. Select
>> core-image-minimal and click 'build'. Once the build comes up, click the
>> 'cancel' button.
>>
>> Also, you can see the details of the design in this document
>>
>> https://bugzilla.yoctoproject.org/attachment.cgi?id=2706
>>
>> * We also need to fix the layout a bit (the % of tasks is too close to the
>> progress bar, and the 'cancel' button wraps)
>>
>> If you have any questions, let me know.
>>
>
> Hi Belen, on the branch
> http://git.yoctoproject.org/cgit/cgit.cgi/poky-contrib/log/?h=sujith/toaster-build-cancel13,
> can you apply the patch which I have attached with this mail.
> Let me know if my changes match close to the feedback.
>

Hi Belen as per our discussions, I have updated the changes at
http://git.yoctoproject.org/cgit/cgit.cgi/poky-contrib/log/?h=sujith/toaster-build-cancel14
.


> Thanks,
> Sujith H
>
>>
>>
>>
>> >
>> >This would help to hide cancel button for builds triggered from command
>> >line in toaster.
>> >
>> >On Tue, Jan 26, 2016 at 7:52 PM, sujith h
>> ><sujith.h@gmail.com> wrote:
>> >
>> >
>> >
>> >On Wed, Jan 20, 2016 at 10:26 PM, Brian Avery
>> ><avery.brian@gmail.com> wrote:
>> >
>> >Pointer to xmlrpc test client -
>> >https://bitbucket.org/srccode/xmlrpc-test-tool
>> >
>> >
>> >
>> >Today I gave a try with xmlrpc-test-tool. I tried to install php on my
>> >local machine, followed by apache and then configured it to get it
>> >working with php. Using this tool, I was getting the error as attached in
>> >the screenshot.
>> >
>> >
>> >
>> >
>> >
>> >-b
>> >
>> >On Mon, Jan 18, 2016 at 8:12 AM, sujith h <sujith.h@gmail.com> wrote:
>> >>
>> >>
>> >> On Mon, Jan 18, 2016 at 1:13 AM, Barros Pena, Belen
>> >> <belen.barros.pena@intel.com> wrote:
>> >>>
>> >>>
>> >>>
>> >>> On 13/01/2016 16:47, "sujith h" <sujith.h@gmail.com> wrote:
>> >>>
>> >>> >
>> >>> >I have updated another patch set with which I have verified with:
>> >>> >
>> >>> >a) cancellation of a normal build
>> >>> >
>> >>> >b) run again and cancel the build
>> >>> >
>> >>> >c) stop toaster + start toaster + run again   and cancel the build
>> >>> >
>> >>>
>> >>> >
>> >>>>
>> http://git.yoctoproject.org/cgit/cgit.cgi/poky-contrib/log/?h=sujith/to
>> >>>>ast
>> >>> >er-build-cancel12
>> >>>
>> >>> Sorry for the delay in looking into this. Cancellation seems to be
>> >>>working
>> >>> well for me for any builds I start from Toaster. However, it doesn't
>> >>>seem
>> >>> to work for builds I start from the command line and I track through
>> >>> Toaster. For those builds, a 'cancel' button appears, but when I click
>> >>>it,
>> >>> nothing happens: the build proceeds until it completes.
>> >>>
>> >>> I am not even sure if the 'cancel' functionality can work for builds
>> >>> started from the command line, although it would be great if it did.
>> >>>If it
>> >>> is not possible to make it work, then the cancel button should not
>> >>>display
>> >>> for those builds. We can provide a message instead, as we do in the
>> >>>case
>> >>> of the 'run again' button, explaining that builds started from the
>> >>>command
>> >>> line can only be cancelled from the command line.
>> >>
>> >>
>> >> Somehow when i try to use the same logic to cancel the build triggered
>> >>from
>> >> command line ( with small modification in the code though), I am
>> getting
>> >> error in the toaster_web.log as:
>> >>
>> >> ProtocolError: <ProtocolError for
>> >0.0.0.0:42952/ <http://0.0.0.0:42952/>: 503 Service Unavailable>
>> >>
>> >> Not able to understand why it is not able to connect to the port.
>> >>Because as
>> >> per my understanding when a build is triggered from toaster, we connect
>> >>to
>> >> the host:port and execute the commands. The runcommand is failing badly
>> >>with
>> >> the log:
>> >>
>> >> 2016-01-18 16:06:05,608 ERROR Internal Server Error:
>> >> /toastergui/project/1/builds/
>> >> Traceback (most recent call last):
>> >>   File
>> >>
>>
>> >>"/home/sujith/build/poky-push/venv/lib/python2.7/site-packages/django/cor
>> >>e/handlers/base.py",
>> >> line 132, in get_response
>> >>     response = wrapped_callback(request, *callback_args,
>> >>**callback_kwargs)
>> >>   File
>> >> "/home/sujith/build/poky-push/bitbake/lib/toaster/toastergui/views.py",
>> >>line
>> >> 171, in returned_wrapper
>> >>     context = view(request, *args, **kwargs)
>> >>   File
>> >> "/home/sujith/build/poky-push/bitbake/lib/toaster/toastergui/views.py",
>> >>line
>> >> 2896, in projectbuilds
>> >>     bbctrl.forceShutDown()
>> >>   File
>> >>
>>
>> >>"/home/sujith/build/poky-push/bitbake/lib/toaster/bldcontrol/bbcontroller
>> >>.py",
>> >> line 73, in forceShutDown
>> >>     return self._runCommand(["stateForceShutdown"])
>> >>   File
>> >>
>>
>> >>"/home/sujith/build/poky-push/bitbake/lib/toaster/bldcontrol/bbcontroller
>> >>.py",
>> >> line 50, in _runCommand
>> >>     result, error = self.connection.runCommand(command)
>> >>   File "/usr/lib64/python2.7/xmlrpclib.py", line 1240, in __call__
>> >>     return self.__send(self.__name, args)
>> >>   File "/usr/lib64/python2.7/xmlrpclib.py", line 1599, in __request
>> >>     verbose=self.__verbose
>> >>   File "/usr/lib64/python2.7/xmlrpclib.py", line 1280, in request
>> >>     return self.single_request(host, handler, request_body, verbose)
>> >>   File "/usr/lib64/python2.7/xmlrpclib.py", line 1328, in
>> single_request
>> >>     response.msg,
>> >> ProtocolError: <ProtocolError for
>> >0.0.0.0:42952/ <http://0.0.0.0:42952/>: 503 Service Unavailable>
>> >> Internal Server Error: /toastergui/project/1/builds/
>> >> Traceback (most recent call last):
>> >>   File
>> >>
>>
>> >>"/home/sujith/build/poky-push/venv/lib/python2.7/site-packages/django/cor
>> >>e/handlers/base.py",
>> >> line 132, in get_response
>> >>     response = wrapped_callback(request, *callback_args,
>> >>**callback_kwargs)
>> >>   File
>> >> "/home/sujith/build/poky-push/bitbake/lib/toaster/toastergui/views.py",
>> >>line
>> >> 171, in returned_wrapper
>> >>     context = view(request, *args, **kwargs)
>> >>   File
>> >> "/home/sujith/build/poky-push/bitbake/lib/toaster/toastergui/views.py",
>> >>line
>> >> 2896, in projectbuilds
>> >>     bbctrl.forceShutDown()
>> >>   File
>> >>
>>
>> >>"/home/sujith/build/poky-push/bitbake/lib/toaster/bldcontrol/bbcontroller
>> >>.py",
>> >> line 73, in forceShutDown
>> >>     return self._runCommand(["stateForceShutdown"])
>> >>   File
>> >>
>>
>> >>"/home/sujith/build/poky-push/bitbake/lib/toaster/bldcontrol/bbcontroller
>> >>.py",
>> >> line 50, in _runCommand
>> >>     result, error = self.connection.runCommand(command)
>> >>   File "/usr/lib64/python2.7/xmlrpclib.py", line 1240, in __call__
>> >>     return self.__send(self.__name, args)
>> >>   File "/usr/lib64/python2.7/xmlrpclib.py", line 1599, in __request
>> >>     verbose=self.__verbose
>> >>   File "/usr/lib64/python2.7/xmlrpclib.py", line 1280, in request
>> >>     return self.single_request(host, handler, request_body, verbose)
>> >>   File "/usr/lib64/python2.7/xmlrpclib.py", line 1328, in
>> single_request
>> >>     response.msg,
>> >> ProtocolError: <ProtocolError for
>> >0.0.0.0:42952/ <http://0.0.0.0:42952/>: 503 Service Unavailable>
>> >> [18/Jan/2016 16:06:05] "POST /toastergui/project/1/builds/ HTTP/1.1"
>> 500
>> >> 13414
>> >>
>> >>
>> >> Any helping hand would be appreciated. More over I would also like to
>> >>know
>> >> if we can pass commands to builds triggered from command line?
>> >>
>> >> Thanks,
>> >> Sujith H
>> >>
>> >> --
>> >> സുജിത് ഹരിദാസന്
>> >> Bangalore
>> >> <Project>Contributor to KDE project
>> >>
>> >http://fci.wikia.com/wiki/Anti-DRM-Campaign
>> ><http://fci.wikia.com/wiki/Anti-DRM-Campaign>
>> >> <Blog> http://sujithh.info
>> >>
>> >
>> >
>> >> --
>> >> _______________________________________________
>> >> toaster mailing list
>> >> toaster@yoctoproject.org
>> >>
>> >https://lists.yoctoproject.org/listinfo/toaster
>> ><https://lists.yoctoproject.org/listinfo/toaster>
>> >>
>> >
>> >
>> >
>> >
>> >
>> >
>> >
>> >
>> >
>> >
>> >--
>> >സുജിത് ഹരിദാസന്
>> >Bangalore
>> ><Project>Contributor to KDE project
>> >http://fci.wikia.com/wiki/Anti-DRM-Campaign
>> ><Blog> http://sujithh.info
>> >
>> >
>> >
>> >
>> >
>> >
>> >
>> >
>> >
>> >
>> >
>> >--
>> >സുജിത് ഹരിദാസന്
>> >Bangalore
>> ><Project>Contributor to KDE project
>> >http://fci.wikia.com/wiki/Anti-DRM-Campaign
>> ><Blog> http://sujithh.info
>> >
>> >
>> >
>> >
>> >
>> >
>> >
>>
>>
>
>
> --
> സുജിത് ഹരിദാസന്
> Bangalore
> <Project>Contributor to KDE project
> http://fci.wikia.com/wiki/Anti-DRM-Campaign
> <Blog> http://sujithh.info
>



-- 
സുജിത് ഹരിദാസന്
Bangalore
<Project>Contributor to KDE project
http://fci.wikia.com/wiki/Anti-DRM-Campaign
<Blog> http://sujithh.info

[-- Attachment #2: Type: text/html, Size: 16992 bytes --]

^ permalink raw reply	[flat|nested] 27+ messages in thread

* Re: Build cancellation from toaster
  2016-02-09 13:40                                         ` sujith h
@ 2016-02-12 11:04                                           ` Barros Pena, Belen
  2016-02-19 23:11                                           ` Michael Wood
  1 sibling, 0 replies; 27+ messages in thread
From: Barros Pena, Belen @ 2016-02-12 11:04 UTC (permalink / raw)
  To: sujith h, toaster



On 09/02/2016 14:40, "sujith h" <sujith.h@gmail.com> wrote:

> 
>
>Hi Belen as per our discussions, I have updated the changes at
>http://git.yoctoproject.org/cgit/cgit.cgi/poky-contrib/log/?h=sujith/toast
>er-build-cancel14.

From the UI side of things, this is looking great.

Thanks!

Belén



^ permalink raw reply	[flat|nested] 27+ messages in thread

* Re: Build cancellation from toaster
  2016-02-09 13:40                                         ` sujith h
  2016-02-12 11:04                                           ` Barros Pena, Belen
@ 2016-02-19 23:11                                           ` Michael Wood
  2016-02-22  6:23                                             ` sujith h
  1 sibling, 1 reply; 27+ messages in thread
From: Michael Wood @ 2016-02-19 23:11 UTC (permalink / raw)
  To: toaster

On 09/02/16 13:40, sujith h wrote:
>
> snip
>
> Hi Belen as per our discussions, I have updated the changes at 
> http://git.yoctoproject.org/cgit/cgit.cgi/poky-contrib/log/?h=sujith/toaster-build-cancel14.

A few code review notes on those commits

toaster: update BuildEnvironmentController and BitbakeController

[ MW
  - Not sure why getArtifact method is being removed here
  - The arguments in the __init__ need realigning
]

toaster: add cancelled state in models

[ MW
  - finished_criteria white space - we try to stick to 80 cols if possible
  - The commit summary ideally could also include a little more info 
e.g. toaster: models Add cancelled state to build outcome
  - After modifying model definitions you also need to add a database 
migration running. ./mange.py makemigrations will do this for you
]

toaster: add function cancelBuild to mrb_section.html

[ MW this patch doesn't seem to be needed as there are only unused 
variables here which are wrapping libtoaster.cancelABuild ]

toaster: add get_tasks function

[ MW I prefer this compared to the filters, but as this is already 
implemented and currently in use, it's best not to duplicate it. See the 
custom filter in projectfilters.py and it's usage in the mrb_section 
template. More info about filters here 
https://docs.djangoproject.com/en/1.8/ref/templates/builtins/#ref-templates-builtins-filters
]

toaster: update css for build cancellation

[ MW This css isn't needed, the build button just needs to have the 
class 'pull-right' ]

toaster: update toastergui's table for build cancellation

[ MW
  - It's neater to us Use exclude(Q(conditions) | Q(conditions)) in 
exclude instead of a new call
  - Use the 'enum' for the state CANCELLED instead of '3'  - 3 might 
change and this could introduce a bug
  - No need to re-get the build object, it's part of buildrequest.build
  - I can understand the while loop and the timing issue we have here I 
will look into another solution for this because we could end up in an 
infinite loop here.
]

toaster: add cancel button to UI

[ MW
  - Here we don't want to use an inline onclick= handlers in the html 
element with the django template code. To keep a good separation of JS, 
django template and html we make use of the data attribute of the 
element and then retrieve it in the JS.
- Avoid using the name of the 'command line builds' project to identify 
it, if that name changes this will fail. Better to use the (admittedly 
obscure) property 'is_default' on the project object to identify it
]

As we've not been able to help you much with this feature I've fixed all 
the above issues and have pushed a new branch at

http://git.yoctoproject.org/cgit/cgit.cgi/poky-contrib/log/?h=michaelw/sujith/build-cancel

It's not quite finished yet - some more testing is needed. I've added 
you as a co-author on some of the commits in which I've added or changed 
additional code. Hope this is OK.

Thanks,

Michael


>
>
>     Thanks,
>     Sujith H
>
>
>
>
>         >
>         >This would help to hide cancel button for builds triggered
>         from command
>         >line in toaster.
>         >
>         >On Tue, Jan 26, 2016 at 7:52 PM, sujith h
>         ><sujith.h@gmail.com <mailto:sujith.h@gmail.com>> wrote:
>         >
>         >
>         >
>         >On Wed, Jan 20, 2016 at 10:26 PM, Brian Avery
>         ><avery.brian@gmail.com <mailto:avery.brian@gmail.com>> wrote:
>         >
>         >Pointer to xmlrpc test client -
>         >https://bitbucket.org/srccode/xmlrpc-test-tool
>         >
>         >
>         >
>         >Today I gave a try with xmlrpc-test-tool. I tried to install
>         php on my
>         >local machine, followed by apache and then configured it to
>         get it
>         >working with php. Using this tool, I was getting the error as
>         attached in
>         >the screenshot.
>         >
>         >
>         >
>         >
>         >
>         >-b
>         >
>         >On Mon, Jan 18, 2016 at 8:12 AM, sujith h <sujith.h@gmail.com
>         <mailto:sujith.h@gmail.com>> wrote:
>         >>
>         >>
>         >> On Mon, Jan 18, 2016 at 1:13 AM, Barros Pena, Belen
>         >> <belen.barros.pena@intel.com
>         <mailto:belen.barros.pena@intel.com>> wrote:
>         >>>
>         >>>
>         >>>
>         >>> On 13/01/2016 16:47, "sujith h" <sujith.h@gmail.com
>         <mailto:sujith.h@gmail.com>> wrote:
>         >>>
>         >>> >
>         >>> >I have updated another patch set with which I have
>         verified with:
>         >>> >
>         >>> >a) cancellation of a normal build
>         >>> >
>         >>> >b) run again and cancel the build
>         >>> >
>         >>> >c) stop toaster + start toaster + run again   and cancel
>         the build
>         >>> >
>         >>>
>         >>> >
>         >>>>http://git.yoctoproject.org/cgit/cgit.cgi/poky-contrib/log/?h=sujith/to
>         >>>>ast
>         >>> >er-build-cancel12
>         >>>
>         >>> Sorry for the delay in looking into this. Cancellation
>         seems to be
>         >>>working
>         >>> well for me for any builds I start from Toaster. However,
>         it doesn't
>         >>>seem
>         >>> to work for builds I start from the command line and I
>         track through
>         >>> Toaster. For those builds, a 'cancel' button appears, but
>         when I click
>         >>>it,
>         >>> nothing happens: the build proceeds until it completes.
>         >>>
>         >>> I am not even sure if the 'cancel' functionality can work
>         for builds
>         >>> started from the command line, although it would be great
>         if it did.
>         >>>If it
>         >>> is not possible to make it work, then the cancel button
>         should not
>         >>>display
>         >>> for those builds. We can provide a message instead, as we
>         do in the
>         >>>case
>         >>> of the 'run again' button, explaining that builds started
>         from the
>         >>>command
>         >>> line can only be cancelled from the command line.
>         >>
>         >>
>         >> Somehow when i try to use the same logic to cancel the
>         build triggered
>         >>from
>         >> command line ( with small modification in the code though),
>         I am getting
>         >> error in the toaster_web.log as:
>         >>
>         >> ProtocolError: <ProtocolError for
>         >0.0.0.0:42952/ <http://0.0.0.0:42952/>
>         <http://0.0.0.0:42952/>: 503 Service Unavailable>
>         >>
>         >> Not able to understand why it is not able to connect to the
>         port.
>         >>Because as
>         >> per my understanding when a build is triggered from
>         toaster, we connect
>         >>to
>         >> the host:port and execute the commands. The runcommand is
>         failing badly
>         >>with
>         >> the log:
>         >>
>         >> 2016-01-18 16:06:05,608 ERROR Internal Server Error:
>         >> /toastergui/project/1/builds/
>         >> Traceback (most recent call last):
>         >>   File
>         >>
>         >>"/home/sujith/build/poky-push/venv/lib/python2.7/site-packages/django/cor
>         >>e/handlers/base.py",
>         >> line 132, in get_response
>         >>     response = wrapped_callback(request, *callback_args,
>         >>**callback_kwargs)
>         >>   File
>         >>
>         "/home/sujith/build/poky-push/bitbake/lib/toaster/toastergui/views.py",
>         >>line
>         >> 171, in returned_wrapper
>         >>     context = view(request, *args, **kwargs)
>         >>   File
>         >>
>         "/home/sujith/build/poky-push/bitbake/lib/toaster/toastergui/views.py",
>         >>line
>         >> 2896, in projectbuilds
>         >>     bbctrl.forceShutDown()
>         >>   File
>         >>
>         >>"/home/sujith/build/poky-push/bitbake/lib/toaster/bldcontrol/bbcontroller
>         >>.py",
>         >> line 73, in forceShutDown
>         >>     return self._runCommand(["stateForceShutdown"])
>         >>   File
>         >>
>         >>"/home/sujith/build/poky-push/bitbake/lib/toaster/bldcontrol/bbcontroller
>         >>.py",
>         >> line 50, in _runCommand
>         >>     result, error = self.connection.runCommand(command)
>         >>   File "/usr/lib64/python2.7/xmlrpclib.py", line 1240, in
>         __call__
>         >>     return self.__send(self.__name, args)
>         >>   File "/usr/lib64/python2.7/xmlrpclib.py", line 1599, in
>         __request
>         >>     verbose=self.__verbose
>         >>   File "/usr/lib64/python2.7/xmlrpclib.py", line 1280, in
>         request
>         >>     return self.single_request(host, handler, request_body,
>         verbose)
>         >>   File "/usr/lib64/python2.7/xmlrpclib.py", line 1328, in
>         single_request
>         >>     response.msg,
>         >> ProtocolError: <ProtocolError for
>         >0.0.0.0:42952/ <http://0.0.0.0:42952/>
>         <http://0.0.0.0:42952/>: 503 Service Unavailable>
>         >> Internal Server Error: /toastergui/project/1/builds/
>         >> Traceback (most recent call last):
>         >>   File
>         >>
>         >>"/home/sujith/build/poky-push/venv/lib/python2.7/site-packages/django/cor
>         >>e/handlers/base.py",
>         >> line 132, in get_response
>         >>     response = wrapped_callback(request, *callback_args,
>         >>**callback_kwargs)
>         >>   File
>         >>
>         "/home/sujith/build/poky-push/bitbake/lib/toaster/toastergui/views.py",
>         >>line
>         >> 171, in returned_wrapper
>         >>     context = view(request, *args, **kwargs)
>         >>   File
>         >>
>         "/home/sujith/build/poky-push/bitbake/lib/toaster/toastergui/views.py",
>         >>line
>         >> 2896, in projectbuilds
>         >>     bbctrl.forceShutDown()
>         >>   File
>         >>
>         >>"/home/sujith/build/poky-push/bitbake/lib/toaster/bldcontrol/bbcontroller
>         >>.py",
>         >> line 73, in forceShutDown
>         >>     return self._runCommand(["stateForceShutdown"])
>         >>   File
>         >>
>         >>"/home/sujith/build/poky-push/bitbake/lib/toaster/bldcontrol/bbcontroller
>         >>.py",
>         >> line 50, in _runCommand
>         >>     result, error = self.connection.runCommand(command)
>         >>   File "/usr/lib64/python2.7/xmlrpclib.py", line 1240, in
>         __call__
>         >>     return self.__send(self.__name, args)
>         >>   File "/usr/lib64/python2.7/xmlrpclib.py", line 1599, in
>         __request
>         >>     verbose=self.__verbose
>         >>   File "/usr/lib64/python2.7/xmlrpclib.py", line 1280, in
>         request
>         >>     return self.single_request(host, handler, request_body,
>         verbose)
>         >>   File "/usr/lib64/python2.7/xmlrpclib.py", line 1328, in
>         single_request
>         >>     response.msg,
>         >> ProtocolError: <ProtocolError for
>         >0.0.0.0:42952/ <http://0.0.0.0:42952/>
>         <http://0.0.0.0:42952/>: 503 Service Unavailable>
>         >> [18/Jan/2016 16:06:05] "POST /toastergui/project/1/builds/
>         HTTP/1.1" 500
>         >> 13414
>         >>
>         >>
>         >> Any helping hand would be appreciated. More over I would
>         also like to
>         >>know
>         >> if we can pass commands to builds triggered from command line?
>         >>
>         >> Thanks,
>         >> Sujith H
>         >>
>         >> --
>         >> സുജിത് ഹരിദാസന്
>         >> Bangalore
>         >> <Project>Contributor to KDE project
>         >>
>         >http://fci.wikia.com/wiki/Anti-DRM-Campaign
>         ><http://fci.wikia.com/wiki/Anti-DRM-Campaign>
>         >> <Blog> http://sujithh.info
>         >>
>         >
>         >
>         >> --
>         >> _______________________________________________
>         >> toaster mailing list
>         >> toaster@yoctoproject.org <mailto:toaster@yoctoproject.org>
>         >>
>         >https://lists.yoctoproject.org/listinfo/toaster
>         ><https://lists.yoctoproject.org/listinfo/toaster>
>         >>
>         >
>         >
>         >
>         >
>         >
>         >
>         >
>         >
>         >
>         >
>         >--
>         >സുജിത് ഹരിദാസന്
>         >Bangalore
>         ><Project>Contributor to KDE project
>         >http://fci.wikia.com/wiki/Anti-DRM-Campaign
>         ><Blog> http://sujithh.info
>         >
>         >
>         >
>         >
>         >
>         >
>         >
>         >
>         >
>         >
>         >
>         >--
>         >സുജിത് ഹരിദാസന്
>         >Bangalore
>         ><Project>Contributor to KDE project
>         >http://fci.wikia.com/wiki/Anti-DRM-Campaign
>         ><Blog> http://sujithh.info
>         >
>         >
>         >
>         >
>         >
>         >
>         >
>
>
>
>
>     -- 
>     സുജിത് ഹരിദാസന്
>     Bangalore
>     <Project>Contributor to KDE project
>     http://fci.wikia.com/wiki/Anti-DRM-Campaign
>     <Blog> http://sujithh.info
>
>
>
>
> -- 
> സുജിത് ഹരിദാസന്
> Bangalore
> <Project>Contributor to KDE project
> http://fci.wikia.com/wiki/Anti-DRM-Campaign
> <Blog> http://sujithh.info
>
>



^ permalink raw reply	[flat|nested] 27+ messages in thread

* Re: Build cancellation from toaster
  2016-02-19 23:11                                           ` Michael Wood
@ 2016-02-22  6:23                                             ` sujith h
  0 siblings, 0 replies; 27+ messages in thread
From: sujith h @ 2016-02-22  6:23 UTC (permalink / raw)
  To: toaster

[-- Attachment #1: Type: text/plain, Size: 14874 bytes --]

On Sat, Feb 20, 2016 at 4:41 AM, Michael Wood <michael.g.wood@intel.com>
wrote:

> On 09/02/16 13:40, sujith h wrote:
>
>>
>> snip
>>
>> Hi Belen as per our discussions, I have updated the changes at
>> http://git.yoctoproject.org/cgit/cgit.cgi/poky-contrib/log/?h=sujith/toaster-build-cancel14
>> .
>>
>
> A few code review notes on those commits
>
> toaster: update BuildEnvironmentController and BitbakeController
>
> [ MW
>  - Not sure why getArtifact method is being removed here
>  - The arguments in the __init__ need realigning
> ]
>
> toaster: add cancelled state in models
>
> [ MW
>  - finished_criteria white space - we try to stick to 80 cols if possible
>  - The commit summary ideally could also include a little more info e.g.
> toaster: models Add cancelled state to build outcome
>  - After modifying model definitions you also need to add a database
> migration running. ./mange.py makemigrations will do this for you
> ]
>
> toaster: add function cancelBuild to mrb_section.html
>
> [ MW this patch doesn't seem to be needed as there are only unused
> variables here which are wrapping libtoaster.cancelABuild ]
>
> toaster: add get_tasks function
>
> [ MW I prefer this compared to the filters, but as this is already
> implemented and currently in use, it's best not to duplicate it. See the
> custom filter in projectfilters.py and it's usage in the mrb_section
> template. More info about filters here
> https://docs.djangoproject.com/en/1.8/ref/templates/builtins/#ref-templates-builtins-filters
> ]
>
> toaster: update css for build cancellation
>
> [ MW This css isn't needed, the build button just needs to have the class
> 'pull-right' ]
>
> toaster: update toastergui's table for build cancellation
>
> [ MW
>  - It's neater to us Use exclude(Q(conditions) | Q(conditions)) in exclude
> instead of a new call
>  - Use the 'enum' for the state CANCELLED instead of '3'  - 3 might change
> and this could introduce a bug
>  - No need to re-get the build object, it's part of buildrequest.build
>  - I can understand the while loop and the timing issue we have here I
> will look into another solution for this because we could end up in an
> infinite loop here.
> ]
>
> toaster: add cancel button to UI
>
> [ MW
>  - Here we don't want to use an inline onclick= handlers in the html
> element with the django template code. To keep a good separation of JS,
> django template and html we make use of the data attribute of the element
> and then retrieve it in the JS.
> - Avoid using the name of the 'command line builds' project to identify
> it, if that name changes this will fail. Better to use the (admittedly
> obscure) property 'is_default' on the project object to identify it
> ]
>
> As we've not been able to help you much with this feature I've fixed all
> the above issues and have pushed a new branch at
>
>
> http://git.yoctoproject.org/cgit/cgit.cgi/poky-contrib/log/?h=michaelw/sujith/build-cancel
>
> It's not quite finished yet - some more testing is needed. I've added you
> as a co-author on some of the commits in which I've added or changed
> additional code. Hope this is OK.
>

Michael I am perfectly OK with your decision. Thanks a bunch for pointing
out the issues which I have made in my patch set and pointing out them
aptly. I will have a look at the new branch mentioned today.

Thanks,
Sujith H


>
> Thanks,
>
> Michael
>
>
>
>>
>>     Thanks,
>>     Sujith H
>>
>>
>>
>>
>>         >
>>         >This would help to hide cancel button for builds triggered
>>         from command
>>         >line in toaster.
>>         >
>>         >On Tue, Jan 26, 2016 at 7:52 PM, sujith h
>>         ><sujith.h@gmail.com <mailto:sujith.h@gmail.com>> wrote:
>>         >
>>         >
>>         >
>>         >On Wed, Jan 20, 2016 at 10:26 PM, Brian Avery
>>         ><avery.brian@gmail.com <mailto:avery.brian@gmail.com>> wrote:
>>         >
>>         >Pointer to xmlrpc test client -
>>         >https://bitbucket.org/srccode/xmlrpc-test-tool
>>         >
>>         >
>>         >
>>         >Today I gave a try with xmlrpc-test-tool. I tried to install
>>         php on my
>>         >local machine, followed by apache and then configured it to
>>         get it
>>         >working with php. Using this tool, I was getting the error as
>>         attached in
>>         >the screenshot.
>>         >
>>         >
>>         >
>>         >
>>         >
>>         >-b
>>         >
>>         >On Mon, Jan 18, 2016 at 8:12 AM, sujith h <sujith.h@gmail.com
>>         <mailto:sujith.h@gmail.com>> wrote:
>>         >>
>>         >>
>>         >> On Mon, Jan 18, 2016 at 1:13 AM, Barros Pena, Belen
>>         >> <belen.barros.pena@intel.com
>>         <mailto:belen.barros.pena@intel.com>> wrote:
>>         >>>
>>         >>>
>>         >>>
>>         >>> On 13/01/2016 16:47, "sujith h" <sujith.h@gmail.com
>>         <mailto:sujith.h@gmail.com>> wrote:
>>         >>>
>>         >>> >
>>         >>> >I have updated another patch set with which I have
>>         verified with:
>>         >>> >
>>         >>> >a) cancellation of a normal build
>>         >>> >
>>         >>> >b) run again and cancel the build
>>         >>> >
>>         >>> >c) stop toaster + start toaster + run again   and cancel
>>         the build
>>         >>> >
>>         >>>
>>         >>> >
>>         >>>>
>> http://git.yoctoproject.org/cgit/cgit.cgi/poky-contrib/log/?h=sujith/to
>>         >>>>ast
>>         >>> >er-build-cancel12
>>         >>>
>>         >>> Sorry for the delay in looking into this. Cancellation
>>         seems to be
>>         >>>working
>>         >>> well for me for any builds I start from Toaster. However,
>>         it doesn't
>>         >>>seem
>>         >>> to work for builds I start from the command line and I
>>         track through
>>         >>> Toaster. For those builds, a 'cancel' button appears, but
>>         when I click
>>         >>>it,
>>         >>> nothing happens: the build proceeds until it completes.
>>         >>>
>>         >>> I am not even sure if the 'cancel' functionality can work
>>         for builds
>>         >>> started from the command line, although it would be great
>>         if it did.
>>         >>>If it
>>         >>> is not possible to make it work, then the cancel button
>>         should not
>>         >>>display
>>         >>> for those builds. We can provide a message instead, as we
>>         do in the
>>         >>>case
>>         >>> of the 'run again' button, explaining that builds started
>>         from the
>>         >>>command
>>         >>> line can only be cancelled from the command line.
>>         >>
>>         >>
>>         >> Somehow when i try to use the same logic to cancel the
>>         build triggered
>>         >>from
>>         >> command line ( with small modification in the code though),
>>         I am getting
>>         >> error in the toaster_web.log as:
>>         >>
>>         >> ProtocolError: <ProtocolError for
>>         >0.0.0.0:42952/ <http://0.0.0.0:42952/>
>>         <http://0.0.0.0:42952/>: 503 Service Unavailable>
>>         >>
>>         >> Not able to understand why it is not able to connect to the
>>         port.
>>         >>Because as
>>         >> per my understanding when a build is triggered from
>>         toaster, we connect
>>         >>to
>>         >> the host:port and execute the commands. The runcommand is
>>         failing badly
>>         >>with
>>         >> the log:
>>         >>
>>         >> 2016-01-18 16:06:05,608 ERROR Internal Server Error:
>>         >> /toastergui/project/1/builds/
>>         >> Traceback (most recent call last):
>>         >>   File
>>         >>
>>
>> >>"/home/sujith/build/poky-push/venv/lib/python2.7/site-packages/django/cor
>>         >>e/handlers/base.py",
>>         >> line 132, in get_response
>>         >>     response = wrapped_callback(request, *callback_args,
>>         >>**callback_kwargs)
>>         >>   File
>>         >>
>>
>> "/home/sujith/build/poky-push/bitbake/lib/toaster/toastergui/views.py",
>>         >>line
>>         >> 171, in returned_wrapper
>>         >>     context = view(request, *args, **kwargs)
>>         >>   File
>>         >>
>>
>> "/home/sujith/build/poky-push/bitbake/lib/toaster/toastergui/views.py",
>>         >>line
>>         >> 2896, in projectbuilds
>>         >>     bbctrl.forceShutDown()
>>         >>   File
>>         >>
>>
>> >>"/home/sujith/build/poky-push/bitbake/lib/toaster/bldcontrol/bbcontroller
>>         >>.py",
>>         >> line 73, in forceShutDown
>>         >>     return self._runCommand(["stateForceShutdown"])
>>         >>   File
>>         >>
>>
>> >>"/home/sujith/build/poky-push/bitbake/lib/toaster/bldcontrol/bbcontroller
>>         >>.py",
>>         >> line 50, in _runCommand
>>         >>     result, error = self.connection.runCommand(command)
>>         >>   File "/usr/lib64/python2.7/xmlrpclib.py", line 1240, in
>>         __call__
>>         >>     return self.__send(self.__name, args)
>>         >>   File "/usr/lib64/python2.7/xmlrpclib.py", line 1599, in
>>         __request
>>         >>     verbose=self.__verbose
>>         >>   File "/usr/lib64/python2.7/xmlrpclib.py", line 1280, in
>>         request
>>         >>     return self.single_request(host, handler, request_body,
>>         verbose)
>>         >>   File "/usr/lib64/python2.7/xmlrpclib.py", line 1328, in
>>         single_request
>>         >>     response.msg,
>>         >> ProtocolError: <ProtocolError for
>>         >0.0.0.0:42952/ <http://0.0.0.0:42952/>
>>         <http://0.0.0.0:42952/>: 503 Service Unavailable>
>>         >> Internal Server Error: /toastergui/project/1/builds/
>>         >> Traceback (most recent call last):
>>         >>   File
>>         >>
>>
>> >>"/home/sujith/build/poky-push/venv/lib/python2.7/site-packages/django/cor
>>         >>e/handlers/base.py",
>>         >> line 132, in get_response
>>         >>     response = wrapped_callback(request, *callback_args,
>>         >>**callback_kwargs)
>>         >>   File
>>         >>
>>
>> "/home/sujith/build/poky-push/bitbake/lib/toaster/toastergui/views.py",
>>         >>line
>>         >> 171, in returned_wrapper
>>         >>     context = view(request, *args, **kwargs)
>>         >>   File
>>         >>
>>
>> "/home/sujith/build/poky-push/bitbake/lib/toaster/toastergui/views.py",
>>         >>line
>>         >> 2896, in projectbuilds
>>         >>     bbctrl.forceShutDown()
>>         >>   File
>>         >>
>>
>> >>"/home/sujith/build/poky-push/bitbake/lib/toaster/bldcontrol/bbcontroller
>>         >>.py",
>>         >> line 73, in forceShutDown
>>         >>     return self._runCommand(["stateForceShutdown"])
>>         >>   File
>>         >>
>>
>> >>"/home/sujith/build/poky-push/bitbake/lib/toaster/bldcontrol/bbcontroller
>>         >>.py",
>>         >> line 50, in _runCommand
>>         >>     result, error = self.connection.runCommand(command)
>>         >>   File "/usr/lib64/python2.7/xmlrpclib.py", line 1240, in
>>         __call__
>>         >>     return self.__send(self.__name, args)
>>         >>   File "/usr/lib64/python2.7/xmlrpclib.py", line 1599, in
>>         __request
>>         >>     verbose=self.__verbose
>>         >>   File "/usr/lib64/python2.7/xmlrpclib.py", line 1280, in
>>         request
>>         >>     return self.single_request(host, handler, request_body,
>>         verbose)
>>         >>   File "/usr/lib64/python2.7/xmlrpclib.py", line 1328, in
>>         single_request
>>         >>     response.msg,
>>         >> ProtocolError: <ProtocolError for
>>         >0.0.0.0:42952/ <http://0.0.0.0:42952/>
>>         <http://0.0.0.0:42952/>: 503 Service Unavailable>
>>         >> [18/Jan/2016 16:06:05] "POST /toastergui/project/1/builds/
>>         HTTP/1.1" 500
>>         >> 13414
>>         >>
>>         >>
>>         >> Any helping hand would be appreciated. More over I would
>>         also like to
>>         >>know
>>         >> if we can pass commands to builds triggered from command line?
>>         >>
>>         >> Thanks,
>>         >> Sujith H
>>         >>
>>         >> --
>>         >> സുജിത് ഹരിദാസന്
>>         >> Bangalore
>>         >> <Project>Contributor to KDE project
>>         >>
>>         >http://fci.wikia.com/wiki/Anti-DRM-Campaign
>>         ><http://fci.wikia.com/wiki/Anti-DRM-Campaign>
>>         >> <Blog> http://sujithh.info
>>         >>
>>         >
>>         >
>>         >> --
>>         >> _______________________________________________
>>         >> toaster mailing list
>>         >> toaster@yoctoproject.org <mailto:toaster@yoctoproject.org>
>>
>>         >>
>>         >https://lists.yoctoproject.org/listinfo/toaster
>>         ><https://lists.yoctoproject.org/listinfo/toaster>
>>         >>
>>         >
>>         >
>>         >
>>         >
>>         >
>>         >
>>         >
>>         >
>>         >
>>         >
>>         >--
>>         >സുജിത് ഹരിദാസന്
>>         >Bangalore
>>         ><Project>Contributor to KDE project
>>         >http://fci.wikia.com/wiki/Anti-DRM-Campaign
>>         ><Blog> http://sujithh.info
>>         >
>>         >
>>         >
>>         >
>>         >
>>         >
>>         >
>>         >
>>         >
>>         >
>>         >
>>         >--
>>         >സുജിത് ഹരിദാസന്
>>         >Bangalore
>>         ><Project>Contributor to KDE project
>>         >http://fci.wikia.com/wiki/Anti-DRM-Campaign
>>         ><Blog> http://sujithh.info
>>         >
>>         >
>>         >
>>         >
>>         >
>>         >
>>         >
>>
>>
>>
>>
>>     --     സുജിത് ഹരിദാസന്
>>     Bangalore
>>     <Project>Contributor to KDE project
>>     http://fci.wikia.com/wiki/Anti-DRM-Campaign
>>     <Blog> http://sujithh.info
>>
>>
>>
>>
>> --
>> സുജിത് ഹരിദാസന്
>> Bangalore
>> <Project>Contributor to KDE project
>> http://fci.wikia.com/wiki/Anti-DRM-Campaign
>> <Blog> http://sujithh.info
>>
>>
>>
> --
> _______________________________________________
> toaster mailing list
> toaster@yoctoproject.org
> https://lists.yoctoproject.org/listinfo/toaster
>



-- 
സുജിത് ഹരിദാസന്
Bangalore
<Project>Contributor to KDE project
<Project>Contributor to Yocto project
http://fci.wikia.com/wiki/Anti-DRM-Campaign
<Blog> http://sujithh.info

[-- Attachment #2: Type: text/html, Size: 22897 bytes --]

^ permalink raw reply	[flat|nested] 27+ messages in thread

end of thread, other threads:[~2016-02-22  6:23 UTC | newest]

Thread overview: 27+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-12-17 16:56 Build cancellation from toaster sujith h
2015-12-18 12:24 ` Michael Wood
2015-12-18 13:46 ` Ed Bartosh
2015-12-19 15:27   ` sujith h
2015-12-21  8:07     ` sujith h
2015-12-21 13:12       ` sujith h
2015-12-22 10:49         ` sujith h
2016-01-04 13:16           ` sujith h
2016-01-05 13:44             ` Barros Pena, Belen
2016-01-05 14:13               ` sujith h
2016-01-06 13:38                 ` sujith h
2016-01-09 16:53                   ` sujith h
2016-01-11 11:25                     ` Barros Pena, Belen
2016-01-12 10:34                       ` Barros Pena, Belen
2016-01-13 16:47                         ` sujith h
2016-01-17 19:43                           ` Barros Pena, Belen
2016-01-18 16:12                             ` sujith h
2016-01-20 16:56                               ` Brian Avery
2016-01-26 14:22                                 ` sujith h
2016-01-27 16:20                                   ` sujith h
2016-02-01 15:35                                     ` Barros Pena, Belen
2016-02-03 13:38                                       ` sujith h
2016-02-09 13:40                                         ` sujith h
2016-02-12 11:04                                           ` Barros Pena, Belen
2016-02-19 23:11                                           ` Michael Wood
2016-02-22  6:23                                             ` sujith h
2016-01-21 15:16                               ` [Toaster] " sujith h

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.