[Iplant-api-dev] [rt.cerberus.iplantcollaborative.org #8985] iPlant Core Services Support

Dennis Roberts dennis at iplantcollaborative.org
Mon Sep 29 19:13:16 MST 2014


Hi Siavash,

Here’s some additional documentation related to this: https://github.com/iPlantCollaborativeOpenSource/iplant-agave-sdk/blob/master/docs/iplant-first-app-argpass.md. The approach suggested in this document should work well as long as the parameter values don’t contain whitespace or shell metacharacters. Based on the information in this document, it sounds as though some special care will have to be taken if you want to use “parameter.details.argument” with the approach that I suggested earlier. A full explanation is too complex to put directly in an email, so I created a gist for it:

https://gist.github.com/dennisroberts71/47b4eb6d510ad3fe800a

I did some experimentation on the command line, but did not actually try any of these examples. If you find anything wrong with the examples, please feel free to let me know.

Thanks,
Dennis

On Sep 29, 2014, at 4:36 PM, siavash mirarab <smirarab at gmail.com> wrote:

> Thanks Dennis! Yes, that was what I had in mind when I mentioned a bit of coding. I think I will just go ahead and build the arguments using shell checks, just like you mentioned in your code. 
> 
> On Mon, Sep 29, 2014 at 6:15 PM, Dennis Roberts <dennis at iplantcollaborative.org> wrote:
> Hi Siavash,
> 
> I finally had some time to look over your JSON. I apologize for the delay.
> 
> I’m forwarding this message to the API development mailing list so that someone who works more closely with the Agave API can respond as well. I don’t currently have access to the API documentation, but I was under the impression that the “argument” setting was intended to be used for the CLI execution type rather than the HPC execution type. For something like this, I’d probably leave the command-line arguments out of the JSON and build the command line arguments in the wrapper script. This is probably what you had in mind already when you mentioned the little bit of coding that you’d have to do for a workaround, but I’d probably end up doing something like this:
> 
> https://gist.github.com/dennisroberts71/357a817cfce527478757
> 
> I would recommend not using string concatenation to build the argument list. Using string concatenation forces the shell to split the argument list using whitespace more than once, which will cause problems if any of your argument values contain whitespace.
> 
> Perhaps someone who works on Agave itself has a better suggestion, but this is what I would end up doing.
> 
> Thanks,
> Dennis
> 
> Begin forwarded message:
> 
>> From: siavash mirarab <smirarab at gmail.com>
>> Subject: Re: [rt.cerberus.iplantcollaborative.org #8985] iPlant Core Services Support
>> Date: September 22, 2014 at 3:37:56 PM MST
>> To: Dennis Roberts <dennis at iplantcollaborative.org>
>> Cc: Sriram Srinivasan <sriram.iplant at gmail.com>, support-staff at iplantcollaborative.org
>> 
>> Hi Dennis, 
>> 
>> After the fixes went online on August, I have had luck with the enum structs. However, there is another problem. I cannot figure out a (simple) way to make fields optional. When fields are optional with no default values and are left blank by the user, I would expect that in the *.ipcexe file built from the template, no argument should be shown. So, for example if the argument is -a for a numerical field called A, and if the user leaves that field blank, then ${A} should be blank. Instead, -a with a blank appears in the ipcexe file. 
>> 
>> I think the correct behavior is that when there is no default and a field is not required, the corresponding variable should be left blank in the ipcexe file. 
>> 
>> The reason I am not providing defaults is that for these parameters, the selection of the default values depends on the input and cannot be hardcoded in the json file. I want the user to be able to adjust the values, but if the user leaves the fields blank, I want the server side to pick the values. 
>> 
>> Of course, I can do this with some small coding in my template file (checking for empty fields, etc.). But I thought the idea was that such coding should be made unnecessary with a well defined json file. 
>> 
>> Note that, for "input" fields, the functionality is as I expected (i.e the argument does not appear if the input is left blank). It's only for "parameters" that I have this problem. 
>> 
>> As an example, I am attaching my json file. With this json file and the template file. If on the gui you leave "Maximum subset size" empty, the corresponding flag appears in the execution command anyway. If you leave "Starting tree" empty, by contrast, -t does not appear in the execution file. 
>> 
>> Thanks
>> Siavash
>> 
>> On Wed, Jul 30, 2014 at 5:59 PM, Dennis Roberts <dennis at iplantcollaborative.org> wrote:
>> Hi Siavash,
>> 
>> I haven’t been able to find the documentation for this either, but I’ll keep looking.
>> 
>> Thanks for the offer. I might need copies of the app JSON later, but I’ve had some success defining apps. I’ll let you know if I need anything.
>> 
>> Thanks,
>> Dennis
>> 
>> On Jul 30, 2014, at 2:37 PM, siavash mirarab <smirarab at gmail.com> wrote:
>> 
>>> Great! looking forward to the next release then. Also, if you could tell me how to set the default value for enumerations, that would be great (or point me to relevant documentations). Currently, I have tried everything I could think of, but when I try to upload my json, it always fails with various errors saying basically that the default is not in the correct format. Thanks again for your help!
>>> 
>>> Also, if I can help with testing the upcoming changes, for example by providing my app and the associated json, let me know and I would be glad to do that. 
>>> 
>>> Thanks
>>> Siavash
>>> 
>>> 
>>> On Wed, Jul 30, 2014 at 4:02 PM, Dennis Roberts <dennis at iplantcollaborative.org> wrote:
>>> Hi Siavash,
>>> 
>>> You’re right; enumerated parameters aren’t currently implemented in the DE-Agave integration. I’ll be adding support for them before the next release also.
>>> 
>>> Thanks,
>>> Dennis
>>> 
>>> On Jul 30, 2014, at 1:30 PM, siavash mirarab <smirarab at gmail.com> wrote:
>>> 
>>>> Hi Dennis, 
>>>> 
>>>> I think in addition to flag, it seems that enum parameters are not implemented correctly either. After I remove my "flag" fields, the application does not still work. I have to also remove "enum" fields for this to work. Can you check out the enum also?
>>>> 
>>>> Thanks
>>>> Siavash
>>>> 
>>>> 
>>>> On Thu, Jul 24, 2014 at 2:33 PM, Dennis Roberts <dennis at iplantcollaborative.org> wrote:
>>>> Hi Siavash,
>>>> 
>>>> I just discussed this with the rest of the DE team. We’re planning to deploy the next DE release to production on August 26th.
>>>> 
>>>> Please let us know if you have any questions.
>>>> 
>>>> Thanks,
>>>> Dennis
>>>> 
>>>> On Jul 24, 2014, at 9:36 AM, siavash mirarab <smirarab at gmail.com> wrote:
>>>> 
>>>>> Hi Dennis, 
>>>>> 
>>>>> Sorry for the delayed response. Attached is the pasta .json.  You are right. It does have a flag in it (and also enumerations). 
>>>>> 
>>>>> Do you have any idea when this new release will be deployed? 
>>>>> 
>>>>> Also, in the mean time, is there a way to "kill" this hanging window on my DE? I don't seem to find a way to kill it. If there will be some time before the flags work, I can go ahead and remove them from my json for testing. But I won't be able to test, until this window is killed.
>>>>> 
>>>>> Thanks
>>>>> Siavash 
>>>>> 
>>>>> 
>>>>> On Wed, Jul 23, 2014 at 6:43 PM, Dennis Roberts <dennis at iplantcollaborative.org> wrote:
>>>>> Hi Siavash,
>>>>> 
>>>>> There were some public apps that weren’t being displayed correctly also. It appears that all of these apps contained “flag” parameters, which weren’t being handled correctly by the DE. I’ve implemented a correction for this problem, and it will be in the next release of the DE. Please let me know if this doesn’t appear to be the problem that you’re encountering.
>>>>> 
>>>>> Thanks,
>>>>> Dennis
>>>>> 
>>>>> On Jul 23, 2014, at 10:26 AM, siavash mirarab <smirarab at gmail.com> wrote:
>>>>> 
>>>>>> Thanks Sriram and sorry I misspelled your name in my previous email!
>>>>>> 
>>>>>> 
>>>>>> On Wed, Jul 23, 2014 at 12:25 PM, Sriram Srinivasan <sriram.iplant at gmail.com> wrote:
>>>>>> Hi Siavash,
>>>>>> We were busy with new release of Discovery Environment. We will take a look at today and let you know.
>>>>>> 
>>>>>> Thanks for your patience.
>>>>>> 
>>>>>> - Sriram
>>>>>> 
>>>>>> 
>>>>>> On Wed, Jul 23, 2014 at 9:48 AM, siavash mirarab <smirarab at gmail.com> wrote:
>>>>>> Any luck with this? I still have that hanging window, which means I cannot test on the discovery environment this new app that I am developing and hoping to push to production soon. Your help would be much appreciated.
>>>>>> 
>>>>>> Also, you said Sirram is added to the thread, but I don't see his email in the email list. 
>>>>>> 
>>>>>> 
>>>>>> On Fri, Jul 18, 2014 at 5:22 PM, siavash mirarab <smirarab at gmail.com> wrote:
>>>>>> hmm, I don't recall that happening ever. If it did happen, I don't remember it. And it is not redirecting me anymore. Also, before I used to be able to open this application, but at some point it stopped working. 
>>>>>> 
>>>>>> 
>>>>>> On Fri, Jul 18, 2014 at 12:36 PM, Nicole Hopkins via RT <support at iplantcollaborative.org> wrote:
>>>>>> Siavash, were you ever directed to authenticate with Agave prior to trying
>>>>>> to select the HPC category?
>>>>>> 
>>>>>> 
>>>>>> On Fri, Jul 18, 2014 at 7:28 AM, Siavash Mirarab via RT <
>>>>>> support at iplantcollaborative.org> wrote:
>>>>>> 
>>>>>> >
>>>>>> > <URL:
>>>>>> > https://cerberus.iplantcollaborative.org/rt/Ticket/Display.html?id=8985 >
>>>>>> >
>>>>>> > Hi
>>>>>> >
>>>>>> > If by authentication you are referring to login in to the discovery site,
>>>>>> > then, yes, I am doing that. Attached is a screen shot of what happens.
>>>>>> >
>>>>>> > Thanks
>>>>>> > Siavash
>>>>>> >
>>>>>> >
>>>>>> >
>>>>>> > On Thu, Jul 17, 2014 at 5:57 PM, Nicole Hopkins via RT <
>>>>>> > support at iplantcollaborative.org> wrote:
>>>>>> >
>>>>>> > > Hi Siavash,
>>>>>> > > I've added Sriram to this thread so he can investigate. Can you possibly
>>>>>> > > send a
>>>>>> > > screenshot of what you are seeing? Also, have you authenticated as
>>>>>> > "always"
>>>>>> > > with the Agave API? It should have been a web form that came up the first
>>>>>> > > time
>>>>>> > > you wanted to access these applications.
>>>>>> > >
>>>>>> > > Thanks,
>>>>>> > >
>>>>>> > > Nicole
>>>>>> > >
>>>>>> > > On Thu Jul 17 13:46:53 2014, smirarab wrote:
>>>>>> > >
>>>>>> > >
>>>>>> > >
>>>>>> > >
>>>>>> > >   Submitted on: Thursday, July 17, 2014 - 13:44 Submitted by user: From:
>>>>>> > >   128.62.32.60 Your request: First Name: Siavash Last Name: Mir arabbaygi
>>>>>> > >   E-mail: smirarab at gmail.com Comments: In my discovery environment,
>>>>>> > when I
>>>>>> > >   try to initial any of the applications under `High Performance
>>>>>> > Computing`
>>>>>> > >   section (including the app I have been developing and am currently
>>>>>> > >   testing), a new window opens up, but it hands there without loading the
>>>>>> > >   actual fields. I have let it be there for a day, and nothing happens.
>>>>>> > > Apps
>>>>>> > >   in other categories work fine. So I am wondering if someone can look
>>>>>> > into
>>>>>> > >   this and unfreeze these applications for me. My username is smirarab.
>>>>>> > >
>>>>>> > >
>>>>>> > >
>>>>>> >
>>>>>> >
>>>>>> 
>>>>>> 
>>>>>> --
>>>>>> Nicole Hopkins
>>>>>> Scientific Initiatives Coordinator
>>>>>> iPlant Collaborative- University of Arizona
>>>>>> (520) 626-7390
>>>>>> 
>>>>>> 
>>>>>> 
>>>>>> 
>>>>>> 
>>>>>> 
>>>>>> -- 
>>>>>> 
>>>>>> Regards,
>>>>>> Sriram Srinivasan
>>>>>> Software Engineer, Core Software
>>>>>> iPlant Collaborative
>>>>>> Tucson, AZ
>>>>>> 
>>>>> 
>>>>> 
>>>>> <pasta.json>
>>>> 
>>>> 
>>> 
>>> 
>> 
>> 
> 
> 
> 
> 
> 

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.iplantcollaborative.org/pipermail/iplant-api-dev/attachments/20140929/151c507a/attachment-0001.html 


More information about the Iplant-api-dev mailing list