[PyWPS-dev] Running a subprocess via pyWPS?

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

[PyWPS-dev] Running a subprocess via pyWPS?

dhohls
Hi

I am using pyWPS 4.  I am trying to use it to trigger the opening of a sub-process in a thread.  However, I get no response back, nor does the subprocess appear to activate.  

I am looking for help in (a) how to get this going and (b) how to debug what the cause of the issue is.

I have a attached a sample 'dummy' app (Note that for my actual application, the thread that is launched is expected to run continuously in the background; so the "ls" function I have used here is not a really good, representative example but the simplest one I could think of).

Thanks in advance

Derek


_______________________________________________
pywps-dev mailing list
[hidden email]
https://lists.osgeo.org/mailman/listinfo/pywps-dev

thread_runner.py (2K) Download Attachment
thread_controller.py (2K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: Running a subprocess via pyWPS?

Carsten Ehbrecht-3
Hi Derek,

I just had a glimpse view on your code example. If I understand it correctly your PyWPS process is calling a threaded python function. So, I would try to test both independently … the process (just returning a dummy result) and your python function.

To test pywps you might find hints here:


Cheers,
Carsten

On 7 Dec 2018, at 1:40 pm, Derek Hohls <[hidden email]> wrote:

Hi

I am using pyWPS 4.  I am trying to use it to trigger the opening of a sub-process in a thread.  However, I get no response back, nor does the subprocess appear to activate.  

I am looking for help in (a) how to get this going and (b) how to debug what the cause of the issue is.

I have a attached a sample 'dummy' app (Note that for my actual application, the thread that is launched is expected to run continuously in the background; so the "ls" function I have used here is not a really good, representative example but the simplest one I could think of).

Thanks in advance

Derek

<thread_runner.py><thread_controller.py>_______________________________________________
pywps-dev mailing list
[hidden email]
https://lists.osgeo.org/mailman/listinfo/pywps-dev


_______________________________________________
pywps-dev mailing list
[hidden email]
https://lists.osgeo.org/mailman/listinfo/pywps-dev

smime.p7s (6K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: Running a subprocess via pyWPS?

David Huard
Hi Derek, 

My guess is that you're missing a join() call on your thread before returning the wps response. 

David

On Fri, Dec 7, 2018 at 9:29 AM Carsten Ehbrecht <[hidden email]> wrote:
Hi Derek,

I just had a glimpse view on your code example. If I understand it correctly your PyWPS process is calling a threaded python function. So, I would try to test both independently … the process (just returning a dummy result) and your python function.

To test pywps you might find hints here:


Cheers,
Carsten

On 7 Dec 2018, at 1:40 pm, Derek Hohls <[hidden email]> wrote:

Hi

I am using pyWPS 4.  I am trying to use it to trigger the opening of a sub-process in a thread.  However, I get no response back, nor does the subprocess appear to activate.  

I am looking for help in (a) how to get this going and (b) how to debug what the cause of the issue is.

I have a attached a sample 'dummy' app (Note that for my actual application, the thread that is launched is expected to run continuously in the background; so the "ls" function I have used here is not a really good, representative example but the simplest one I could think of).

Thanks in advance

Derek

<thread_runner.py><thread_controller.py>_______________________________________________
_______________________________________________
pywps-dev mailing list
[hidden email]
https://lists.osgeo.org/mailman/listinfo/pywps-dev

_______________________________________________
pywps-dev mailing list
[hidden email]
https://lists.osgeo.org/mailman/listinfo/pywps-dev
Reply | Threaded
Open this post in threaded view
|

Re: Running a subprocess via pyWPS?

Luí­s Moreira de Sousa
In reply to this post by dhohls
Hi Derek,

I explored this at some length back in the day of PyWPS 3.2. The multithreading package never functioned from a PyWPS process (launched asa CGI). I never found out why and eventually moved to multiprocessing, which did the job. This was all quite some time ago, but I would still advise you to try the multiprocessing package.

Regards.
--
Luís Moreira de Sousa
RingID: ring:7ca91d83f4f9dec82fec9f1144b8e5c1ef2a110c

Sent with ProtonMail Secure Email.

‐‐‐‐‐‐‐ Original Message ‐‐‐‐‐‐‐
On Friday, December 7, 2018 1:40 PM, Derek Hohls <[hidden email]> wrote:

Hi

I am using pyWPS 4.  I am trying to use it to trigger the opening of a sub-process in a thread.  However, I get no response back, nor does the subprocess appear to activate.  

I am looking for help in (a) how to get this going and (b) how to debug what the cause of the issue is.

I have a attached a sample 'dummy' app (Note that for my actual application, the thread that is launched is expected to run continuously in the background; so the "ls" function I have used here is not a really good, representative example but the simplest one I could think of).

Thanks in advance

Derek


_______________________________________________
pywps-dev mailing list
[hidden email]
https://lists.osgeo.org/mailman/listinfo/pywps-dev