package: Add `--exclude` option to exclude components from being started.
Description
When developing / testing certain components which provide a live reload debug server, other CLP components also need to be started for functionality verifications. Previously, developers have been starting the whole CLP package and later stopping the component(s) to be debugged, to avoid resource (e.g. TCP host + port) conflicts. The approach works but has proven to be inconvenience and prone to manual errors. This PR:
- Add
--excludeoption to exclude components from being started.
Validation performed
- Built the package.
cd <clp-root> task - Started the package, excluding components
webuiandlog_viewer_webui.cd build/clp-package/sbin ./start-clp.sh --exclude webui log_viewer_webui - Observed all components started except
webuiandlog_viewer_webui.
Thanks for making the change, it now makes much more sense to me
Trying to think about this from another perspective, what if we rearrange the code, such that we have a function, takes in the target, the exclude, and generates a List: components_to_run. in that case, for each if statement, we simply need to write something like if DB_COMPONENT in components_to_run.
A trade off is that now for targets correspond to mulitple component, we would need to have some good way to define them. Like
"ALL_TARGET": [
"comp1",
"comp2",
"comp3,
...
]
"CONTROLLER_TARGET": [
"comp1",
...
]
In the long term, this might introduce some clarity though. now it isn't very obvious from code that what components are in CONTROLLER_TARGET (like you have to find every if statement that has CONTROLLER_TARGET in it)
What's the status of this PR?
What's the status of this PR?
I guess Junhao got too busy on other stuff and this gets deprioritized
Let's close this for now. We will refactor the WebUI components and the mechanism proposed in this PR may no longer apply.