coreemu / core

Common Open Research Emulator
BSD 2-Clause "Simplified" License
681 stars 165 forks source link

[FEATURE] Custom Nodes cannot have Config Services #691

Closed ydahhrk closed 2 years ago

ydahhrk commented 2 years ago

Is your feature request related to a problem? Please describe.

It seems "Services" are being deprecated in favor of "Config Services":

deprecated

But Custom Nodes do not offer an option to add Config Services, hereby discouraging them:

custom-nodes

Describe the solution you'd like

Can you please provide the option to customize the default Config Services of Custom Nodes?

Describe alternatives you've considered

Additional context

bharnden commented 2 years ago

Good point, will update this.

ydahhrk commented 2 years ago

Actually, Services don't work all that well either.

I converted my two "Config Services" into "Services." I can now add them to Custom Nodes:

Screenshot from 2022-06-09 12-03-37

However, once the node is created, CORE wants to treat them as Config Services, even though the option isn't actually available. The following picture is my node's Config Service list. Notice my Service is added, but its group is absent:

Screenshot from 2022-06-09 12-06-59

So CORE's code treats custom node default Services as strings, and when it creates nodes, it assumes they refer to Config Services. I suppose this works fine for all default Services, because they all have Config Service counterparts.

Starting the simulation with the bogus Config Service results in an error:

2022-06-09 12:12:04,948 - ERROR - utils:threadpool - thread pool exception
Traceback (most recent call last):
  File "/home/ahhrk/git/core/daemon/core/utils.py", line 428, in threadpool
    result = future.result()
  File "/usr/lib/python3.8/concurrent/futures/_base.py", line 437, in result
    return self.__get_result()
  File "/usr/lib/python3.8/concurrent/futures/_base.py", line 389, in __get_result
    raise self._exception
  File "/usr/lib/python3.8/concurrent/futures/thread.py", line 57, in run
    result = self.fn(*self.args, **self.kwargs)
  File "/home/ahhrk/git/core/daemon/core/emulator/session.py", line 576, in add_node
    service_class = self.service_manager.get_service(name)
  File "/home/ahhrk/git/core/daemon/core/configservice/manager.py", line 35, in get_service
    raise CoreError(f"service does not exist {name}")
core.errors.CoreError: service does not exist NAT64-Jool

I'm going to try to work around this by having both Services and Config Services simultaneously.

bharnden commented 2 years ago

This should all have been just config services. I updated things on develop for the custom node dialog to use config services and label things as such, as well as actually using config services when running the node. It should all be consistent now.

The intent will be eventually for old style services to go away and config services will just become "services"