Pre-filling Application Form/Submitting Job via URL

Hi all,

I want to integrate one of my OnDemand apps with a third-party application we’re developing, allowing users to launch OnDemand jobs via a button click.

Current workflow:

  1. User clicks a button in our third-party app
  2. User is redirected to the OnDemand Application Form page
  3. User manually fills out the form
  4. User submits to launch the job

Desired workflow (either option):
Option A:

  1. User clicks a button in our third-party app
  2. OnDemand job is submitted automatically with predefined parameters
  3. User is redirected to the running application interface

Option B:

  1. User clicks a button in our third-party app
  2. User is redirected to the OnDemand Application Form pre-populated with custom values
  3. User submits to launch the job
  4. User accesses the running application interface

Goal: Use the Jupyter app while hiding the OnDemand application form layer from the user experience.

I hope this makes sense. I am happy to clarify further. I could not find documentation or other posts in the discourse that cover this topic.

Thank you,
Walid

2 Likes

I know that this suggestion has come up before, and is not currently supported. If you want to leave a comment or reaction on this github issue, it is more likely to be prioritized in upcoming releases.

For now, one possible workaround is to create individual apps for different form configurations, there are lots of ways to automatically prefill forms based on user info (see User Form docs), but while this allows you to dynamically pre-fill the form through ERB syntax, it can only use information available in the ruby environment. This can be quite powerful if your form options are fairly simple, but would not be able to use any data coming from your third-party app without a special strategy (like your app writes a file which form.yml.erb reads to get that data)

Alternatively, you may check out the Slurm API (or see if your scheduler provides an API). You could use your OnDemand sessions to see what commands they submit to the scheduler, and use this as a starting point for submitting those same commands through the API. OnDemand does a lot of tricks to simplify that process so it will be a decent amount of work to re-do yourself, but if your application is able to create the necessary files and submit the script, OnDemand should be able to pick up the job and show it under the user’s interactive sessions.

Both of those workarounds are messy in their own ways, and if you are able to wait then keeping an eye on that issue (and making sure it will solve your use case) will likely be your best bet.

If you want to provide more details on the different form options you would like to fill and the various parameters that you would need to know to pick those options, I might be able to help evaluate how feasible it would be to encode that logic inside the form.

1 Like