cbrain icon indicating copy to clipboard operation
cbrain copied to clipboard

Create a "mkdir" utility module for Boutiques integrator

Open prioux opened this issue 2 years ago • 1 comments

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 avatar Aug 10 '23 20:08 prioux

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.

prioux avatar Aug 10 '23 20:08 prioux