Javascript-based automation


I have a web-app with javascript code that reads in a data file,
manipulates it, and saves the result to a data-url.

The code is currently invoked with a point-and-click interface.

Now I would like a user to be able to apply this code to hundreds of
data files. He can use python to cUrl the web-page and will get
javascript code in return, i.e. not the result.
He then needs to run the returned javascript in his own node.js or
V8 or similar engine.

I am looking for ways to achieve this in the collab.
There is a python module PyV8
that can be used to run javascript in python, using Google’s
V8 javascript engine. It requires V8 to be installed. Is this something
that we might get to work in the collab?

Alternatively I could ofcourse install V8 on the webserver and return
the processed results instead of javascript code, but that places the
computational burden on the webserver and therefore has scalability

Any general advice on how to do automation in combination with javascript
is welcome; I am reluctant to write and maintain double code in both python
and javascript, and javascript is the only choice for web apps.


You have two scenarios:

  1. People have an HPC allocation with an HBP HPC provider.
  2. People don’t have an HPC allocation with an HBP HPC provider.

In the first case you can easily launch jobs through UNICORE on the user’s behalf. I can point you to UNICORE REST example which you could adapt for your service which will do the authentication trivially.

UNICORE allows you to execute jobs on an HPC compute cluster asynchronously using a REST API. The Task Framework developed in the Ramp-up was supposed to do the same, but we don’t have funding to continue advancing that.

In the second case you should consider getting an allocation with an HPC centre or Cloud provider for yourself which you can then offer to execute the service running on your allocation. Probably you will need a Cloud provider because the HPC centre rules might make it difficult to offer a service this way.

In each case you would install the V8 interpreter and make it available to the execution manager (UNICORE or other) and then it would be simple to run your users jobs.

Hopefully that makes sense. I’d love to know more about what this webapp is supposed to achieve. Maybe there’s another approach which can work as well.