aces / cbrain

CBRAIN is a flexible Ruby on Rails framework for accessing and processing of large data on high-performance computing infrastructures.
GNU General Public License v3.0
70 stars 43 forks source link

Create a "mkdir" utility module for Boutiques integrator #1343

Open prioux opened 1 year ago

prioux commented 1 year ago

Some tools integrated with boutiques receive as an input a string which will be provided on the command line, and that string is supposed to point to an existing subdirectory. E.g.

"command-line":  "supertool -out [OUTDIR] [OPT] [OPT]..."

When integrating such tools in CBRAIN, they often expect the OUTDIR to be pre-existing, and the tool crash at run time.

Historically, we modified some of these descriptor within CBRAIN so the the command was changed to

"command-line": "mkdir -p [OUTDIR] ; supertool -out [OUTDIR] [OPT] [OPT]..."

But it's kind of ugly and it means the descriptor is no longer really as generic (usable outside CBRAIN as well as within).

I suggest we implement a new utility module where a CBRAIN dev can just leave the command-line intact, and specify which input argument to run mkdir on when setting up the task.

Something like:

"BoutiquesSubdirMaker": [ "output_dir", "someinputid2" ]
prioux commented 1 year ago

Maybe the values for the configuration could instead be templates, with values subsituted from any inputs. e.g.

"BoutiquesSubdirMaker": [ "[OUTDIR]", "[OUTDIR]/[THRESHOLD]_res" ]

That woudl make the module much more flexible.