[Zoo-discuss] tmpPath and tmpUrl

Fenoy Gerald gerald.fenoy at geolabs.fr
Tue Jun 28 08:36:06 PDT 2016


Dear Rakesh,
I am not sure there is any issue here.

In your case, you may have defined the following in the [main] section of your main.cfg file:

tmpPath=/wps-vm/jobs/

Then, from your service code, you create the subdirectory ‘1234’ you have defined before (you may use the usid for this purpose). To finish, you set the generated_file to /wps-vm/jobs/1234/outFile.tif and you should have the correct Url generated.

If there is anything I misunderstood please let me know.

Best regards,


> Le 28 juin 2016 à 14:34, rakesh prithiviraj <rakeshuk at outlook.com> a écrit :
> 
> 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.
> 
> Thanks
> Rakesh
> 
>  
> 
> 
> 
>   
> 
> > 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
> > 
> _______________________________________________
> Zoo-discuss mailing list
> Zoo-discuss at lists.osgeo.org
> http://lists.osgeo.org/mailman/listinfo/zoo-discuss



More information about the Zoo-discuss mailing list