clp icon indicating copy to clipboard operation
clp copied to clipboard

package: Add `--exclude` option to exclude components from being started.

Open junhaoliao opened this issue 1 year ago • 2 comments

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:

  1. Add --exclude option to exclude components from being started.

Validation performed

  1. Built the package.
    cd <clp-root>
    task
    
  2. Started the package, excluding components webui and log_viewer_webui.
    cd build/clp-package/sbin
    ./start-clp.sh --exclude webui log_viewer_webui
    
  3. Observed all components started except webui and log_viewer_webui.

junhaoliao avatar Jul 23 '24 20:07 junhaoliao

Thanks for making the change, it now makes much more sense to me

haiqi96 avatar Jul 29 '24 19:07 haiqi96

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)

haiqi96 avatar Aug 07 '24 15:08 haiqi96

What's the status of this PR?

kirkrodrigues avatar Nov 13 '24 12:11 kirkrodrigues

What's the status of this PR?

I guess Junhao got too busy on other stuff and this gets deprioritized

haiqi96 avatar Nov 13 '24 15:11 haiqi96

Let's close this for now. We will refactor the WebUI components and the mechanism proposed in this PR may no longer apply.

junhaoliao avatar Dec 26 '24 04:12 junhaoliao