Hi all,
A customer has asked that we add more configuration options to the
softwareProcess.start() effector. They want to just launch the process,
skipping previous phases like install/customize.
They are looking for more symmetry with stop, where there are options
for `stopProcessMode` and `stopMachineMode` that can be set to ALWAYS,
IF_NOT_STOPPED or NEVER.
The use-case is that their own customers can stop a process (e.g. for
maintenance). They want a safe way to ensure the process is running.
To do this, they currently call restart - this will first stop the
process (if it is not already running) and then launch the process
without going through install/customize. However, they want a way that
does not first stop the process, and does not require them to first
inspect the sensor to see if it is running.
This implies that if the process is already running, then it should be a
no-op.
_*Proposal for SoftwareProcess.start*_
I propose that we add an optional parameter `String runFromPhase` for
the start effector. This would have valid values of "install",
"customize" and "launch" (though other entities could be written that
understood other phases). If blank, then all phases would be run.
If "launch" were specified, then the pre-launch and post-launch would
still be run. Same for install/customize.
We would also change the call to launch, to only call driver.launch if
driver.isRunning is false.
For entities written in pure YAML, the same thing applies: commands are
supplied for isRunning, launch, etc.
Entity authors would be encouraged to:
* Always implement isRunning (and not just return "true", as I've seen
some people do!)
* Make launch idempotent, where possible.
_*Alternative for SoftwareProcess.start (not to be done)*_
The customer proposed a `skipInstallation` boolean parameter. However,
that does not convey whether "customize" would be skipped. I also have a
personal preference for parameter names to be positively named, rather
than negatively named (e.g. runInstallation defaulting to true, rather
than skipInstallation defaulting to false).
_*Consistency with SoftwareProcess.restart*_
I'd also like to make the configuration options more consistent between
SoftwareProcess.stop() and restart().
The restart effector has restartMachine, with options "true", "false"
and "auto" (versus ALWAYS, IF_NOT_STOPPED, and NEVER for stop).
_*Other info*_
There are semi-related configuration options of
SKIP_ENTITY_START_IF_RUNNING and SKIP_ENTITY_START. However, these are
configured on the entity (or location), rather than as parameters passed
to the start method.
If start's runFromPhase was blank, then these parameters would be used.
If start's runFromPhase was supplied, then that would override the
entity's configuration.
Aled