Integrating Custom Job Submissions via OOD API

Hi everyone,

I’m developing a passenger app using vanilla JavaScript to serve as a visual pipeline. The goal is to let users launch multiple jobs—such as geophysics filters—within a specific cluster. Currently, these jobs are triggered by executing a Bash script with SLURM parameters (like output directory, nodelist, etc.).

I’d like to know: is it possible to leverage the OOD API from the source code to submit these job on my Js passenger app, in the same way that happens when a user clicks “Submit” on the Job Composer page?

Cordialement,
Souza Bruno

Hi and welcome!

You’re asking for functionality like a user clicks a button in the OnDemand, but that button redirects to your Passenger application (and submits a job or does some other action within your Passenger application)?

Thanks!

To clarify, my Passenger app is a kind of job orchestrator, initially, I was planning to handle job submission directly through SLURM’s REST API (if available), but then I had the idea of possibly reusing Open OnDemand’s existing job submission logic instead — assuming there is some internal API or mechanism exposed that handles what the Job Composer does when you click “Submit”.

Does Open OnDemand expose any kind of API (internal or not) that could be called from a custom Passenger app to submit jobs the same way the OnDemand does?

I see. There are APIs just from the fact that it’s a web application, so it does respond to POST & GET requests, but I would discourage you from using them.

We (the OnDemand developers) cannot make guarantees on their stability or interface. They’re internal APIs and subject to change to meet our needs, not external APIs that have stability or interface guarantees.

Plus to make matters worse - while these APIs accept requests, they always respond in HTML formats (i.e., the web page that we want to present). So it’s not like these APIs will respond in JSON or similar which you can read/interpret and present as you wish. And even if they did respond in JSON (IIRC at least 1 does), that JSON return value is subject to change without notification or documentation because we consider it to be internal.

Lastly the Job Composer is in maintenance mode and will be removed entirely at some point.

I understand. So I think the best solution for now is to integrate the SLURM REST API directly into my Passenger app. I might run into some challenges with auth, but that’s a problem for future me.

Thanks again for your support!

Cordialement,
Souza Bruno

You could use the CLI like we do. Of course if it was a Ruby application you could use the ood_core gem that’s our “Rosetta Stone” type library for communicating with schedulers.

But yea, in any case, the command line doesn’t need authentication because the app is already running as your current unprivileged user.