[Zoo-discuss] tmpPath and tmpUrl

rakesh prithiviraj rakeshuk at outlook.com
Tue Jun 28 05:34:21 PDT 2016


Thanks Gerald for the valuable comments. You are right, setting "generated_file" to « /tmp/outFile.tif » creates a valid URL in WPS execute response. But setting it to « outFile.tif » (which should not be done in the first case), makes me believe that the logic to construct output URL is as follows:
OutputURL = tmpUrl + '/' + drop the first "n" characters from value of "generated_file", where n=length of value of tmpPath
So setting "generated_file" to « outFile.tif » and having "tmpPath =/tmp" (n=4) gives output URL as http://192.168.3.86/zoo/ile.tif
and setting "generated_file" to « outFile.tif » and having "tmpPath =/tmp/" (n=5 with additional slash) gives output URL as http://192.168.3.86/zoo/le.tif
I did not check the source code constructing the output URL, but is this how WPS kernel constructs the URL? May be it is not checking if the file actually exists as per the constructed URL or may be it not the responsibility of WPS kernel to check if the file exists as per output URL.
In my use case, as there will be hundreds of WPS requests from several users, we decided not to generate all the outputs under /tmp. Instead the output is generated under /wps-vm/jobs/<job-id>
e.g: /wps-vm/jobs/1234/outFile.tif
As the first 'n' characters are chopped from the genenrated_file, as a workaround, i am appending "n" extra dummy characters at the beginning of the generated_file, so that the outputURL stays like http://192.168.3.86/zoo/wps-vm/jobs/1234/outFile.tif
Hope this is clear.
ThanksRakesh
 


  

> Subject: Re: [Zoo-discuss] tmpPath and tmpUrl
> From: gerald.fenoy at geolabs.fr
> Date: Tue, 28 Jun 2016 12:13:40 +0200
> CC: zoo-discuss at lists.osgeo.org
> To: rakeshuk at outlook.com
> 
> Dear Rakesh,
> sorry for late reply.
> 
> I am not sure to understand the issue here. May I ask, if you have set your generated_file to « /tmp/outFile.tif » as it should be ?
> In case you have used outFile.tif, then, the ZOO-Kernel will be unable to find the file.
> 
> I hope this helps.
> 
> Best regards,
> 
> > Le 24 juin 2016 à 17:00, rakesh prithiviraj <rakeshuk at outlook.com> a écrit :
> > 
> > Hi,
> > 
> > I have the following config in my main.cfg file.
> > 
> > tmpPath=/tmp/
> > tmpUrl = http://192.168.3.86/zoo
> > 
> > I also have a WPS service that creates output product outfile.tif in /tmp. In the service configuraion, asReference is set to true and in the service, I am using "generated_file" key to point to the output file.
> > 
> > After the service execution, in the WPS response I am getting the URL of the file as
> > 
> > http://192.168.3.86/zoo/le.tif
> > 
> > the first 5 characters of the outfile name is dropped. If I change the parameter tmpPath from /tmp/ (5 characters) to /tmp (4 characters), I am getting http://192.168.3.86/zoo/ile.tif in the WPS response as URL. It looks like the length of value of tmpPath has impact on the response URL. I would expect http://192.168.3.86/zoo/outFile.tif as the response.
> > 
> > could you please let me know how to fix this?
> > 
> > regards
> > Rakesh 
> > _______________________________________________
> > Zoo-discuss mailing list
> > Zoo-discuss at lists.osgeo.org
> > http://lists.osgeo.org/mailman/listinfo/zoo-discuss
> 
> 
> 
> Gérald Fenoy
> http://wiki.osgeo.org/wiki/User:Djay
> 
 		 	   		  
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/zoo-discuss/attachments/20160628/7d449b72/attachment.html>


More information about the Zoo-discuss mailing list