Within the context of clarifying what MIA should do to run pipelines, and linked to #167 and #180, I open a different issue not to add confusion on existing issues, and more to discuss what should be done.
We already have an initialization function, and a postprocess function (in #167 at least). I have questions about what and when things should be done:
initialization
- check that the pipeline is OK
- check requirements and config
- complete parameters
- index processes/bricks and future output data ? This is done by this time in the current code. Processes which will run are registered in the database, and all their ouput data also. A record of their init time is kept.
However this is not clear in my mind why this has to be done before running. Processes have not run yet; output data do not exist yet, so why registering them in the database ? Why is it interesting/important to record init time ?
A pipeline may be initialized several times (with or without being run later), and currently we get an growing list of init records for the same (possibly non-existing) data. Is it really OK ? I feel it's confusing for the user, and things get messy...
postprocess
- Processing nodes are postprocessed: if they have a
manage_brick_after_run method, then it is called)
- data indexation: currently this is done during init. But I feel output data should be indexed after the processing has ended, and when data actually exist, so this may be the right time ?
- processes indexation: as for data currently this is done during init, but I feel this should be done after the process has run.
which pipeline(s) to postprocess
For init, this is rather clear: init a pipeline, then run it (although there is the multiple init issue mentioned above).
For postprocessing it is less clear. In a "synchronous" run, the client waits for pipeline execution to end, then postprocesses it - this is the "simple" case. But in a remote / asynchronous execution, the execution is handled in a soma-workflow server, and the client (mia) can be closed, the processing goes on and eventually finishes, then the client may be reconnected later. Several runs may be launched. So the postprocessing procedure should not be limited to a single, "current" pipeline run, but recover all runs that have been started.
Moreover a pipeline run may have been stopped (by user interruption, technical problem) or failed, and restarted after a first postprocessing. In my opinion a pipeline run is still living as long as its workflow is still in soma-workflow database (or at least it completes entierly without error).
How do we know/decide which pipelines have to be postprocessed ? How do we remember them after a client quit/restart ? Do we index runs in MIA database ? Or in soma-workflow ?
Within the context of clarifying what MIA should do to run pipelines, and linked to #167 and #180, I open a different issue not to add confusion on existing issues, and more to discuss what should be done.
We already have an initialization function, and a postprocess function (in #167 at least). I have questions about what and when things should be done:
initialization
However this is not clear in my mind why this has to be done before running. Processes have not run yet; output data do not exist yet, so why registering them in the database ? Why is it interesting/important to record init time ?
A pipeline may be initialized several times (with or without being run later), and currently we get an growing list of init records for the same (possibly non-existing) data. Is it really OK ? I feel it's confusing for the user, and things get messy...
postprocess
manage_brick_after_runmethod, then it is called)which pipeline(s) to postprocess
For init, this is rather clear: init a pipeline, then run it (although there is the multiple init issue mentioned above).
For postprocessing it is less clear. In a "synchronous" run, the client waits for pipeline execution to end, then postprocesses it - this is the "simple" case. But in a remote / asynchronous execution, the execution is handled in a soma-workflow server, and the client (mia) can be closed, the processing goes on and eventually finishes, then the client may be reconnected later. Several runs may be launched. So the postprocessing procedure should not be limited to a single, "current" pipeline run, but recover all runs that have been started.
Moreover a pipeline run may have been stopped (by user interruption, technical problem) or failed, and restarted after a first postprocessing. In my opinion a pipeline run is still living as long as its workflow is still in soma-workflow database (or at least it completes entierly without error).
How do we know/decide which pipelines have to be postprocessed ? How do we remember them after a client quit/restart ? Do we index runs in MIA database ? Or in soma-workflow ?