Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add --vip-identity for vctl agent control, e.g., vctl restart, vctl start, vctl stop, etc. #165

Open
kefeimo opened this issue Mar 14, 2023 · 9 comments

Comments

@kefeimo
Copy link

kefeimo commented Mar 14, 2023

Description

Considering the following situation

(env) kefei@ubuntu-22:~/sandbox/dnp3-driver-sandbox$ vctl status
UUID   AGENT                             IDENTITY                     TAG PRIORITY STATUS          HEALTH
e      volttron-listener-0.2.0rc0        volttron-listener-0.2.0rc0_1                              
1      volttron-listener-0.2.0rc0        volttron-listener-0.2.0rc0_2              running [23479] GOOD
2      volttron-openadr-ven-0.0.0        openadr.ven                                               
3      volttron-platform-driver-0.2.0rc1 platform.driver                                           
5      volttron-platform-driver-0.2.0rc1 platform_driver_for_dnp3                  running [23599] GOOD

The vctl [start|stop|restart] do not have --vip-identity option, which can be useful, especially when

  • --tag is not defined,
  • --name is not unique
  • --uuid is random
  • Plus, it is consistent with vctl install, which has the --vip-identity option.
(env) kefei@ubuntu-22:~/sandbox/dnp3-driver-sandbox$ vctl start -h

usage: vctl command [OPTIONS] ... start [-h] [--name] [--tag] [--all-tagged] [--uuid] [-c FILE] [--debug] [-t SECS] [--msgdebug MSGDEBUG] [--vip-address ZMQADDR]
                                        [pattern ...]

positional arguments:
  pattern               UUID or name of agent

options:
  -h, --help            show this help message and exit
  --name                filter/search by agent name. value passed should be quoted if it contains a regular expression
  --tag                 filter/search by tag name. value passed should be quoted if it contains a regular expression
  --all-tagged          filter/search by all tagged agents
  --uuid                filter/search by UUID (default). value passed should be quoted if it contains a regular expression
  -c FILE, --config FILE
                        read configuration from FILE
  --debug               show tracebacks for errors rather than a brief message
  -t SECS, --timeout SECS
                        timeout in seconds for remote calls (default: 60)
  --msgdebug MSGDEBUG   route all messages to an agent while debugging
  --vip-address ZMQADDR
                        ZeroMQ URL to bind for VIP connections

To make it consistent

@schandrika
Copy link
Contributor

I would prefer if all vctl accepted vip identity as default in addition to uuid - i.e. search for uuid if there is no match, search against vip id

@craig8
Copy link
Contributor

craig8 commented Mar 15, 2023

From meeting on 3/15/2023

  • Yes we want to have --vip-identity as an option...

Search vip-identity first as default argument to start, stop remove, etc. If fails then search on uuid list.

  • Yes
(env) kefei@ubuntu-22:~/sandbox/dnp3-driver-sandbox$ vctl start 1
OR
(env) kefei@ubuntu-22:~/sandbox/dnp3-driver-sandbox$ vctl start volttron-listener-0.2.0rc0_2
WILL PRODUCE a status of...
UUID   AGENT                             IDENTITY                     TAG PRIORITY STATUS          HEALTH
e      volttron-listener-0.2.0rc0        volttron-listener-0.2.0rc0_1                              
1      volttron-listener-0.2.0rc0        volttron-listener-0.2.0rc0_2              running [23479] GOOD

@kefeimo
Copy link
Author

kefeimo commented Mar 15, 2023

@craig8, Can we add functionality that for the following situation it would not cause confusion?

(env) kefei@ubuntu-22:~/sandbox/dnp3-driver-sandbox$ vctl start volttron-listener-0.2.0rc0_2
WILL PRODUCE a status of...
UUID   AGENT                             IDENTITY                     TAG PRIORITY STATUS          HEALTH
e      volttron-listener-0.2.0rc0        1                              
1      volttron-listener-0.2.0rc0       e            

(env) kefei@ubuntu-22:~/sandbox/dnp3-driver-sandbox$ vctl start 1
You use ambiguous command, please use "--uuid" or "--vip-identity" to specify the agent

(env) kefei@ubuntu-22:~/sandbox/dnp3-driver-sandbox$ vctl start --uuid 1
WILL PRODUCE a status of...
UUID   AGENT                             IDENTITY                     TAG PRIORITY STATUS          HEALTH
e      volttron-listener-0.2.0rc0        1                              
1      volttron-listener-0.2.0rc0        e             running [23479] GOOD

(update at 5:24 Central time, 03/15/2023), per answer at: #165 (comment)
We would like to avoid creating UUID that start with existing VIP-identity. Though, kudos to people who use those troublesome vip-identities

@craig8
Copy link
Contributor

craig8 commented Mar 15, 2023

Yeah so lets make sure that any new UUID's don't start with any existing identities.

@craig8 craig8 added the 10.0 label Mar 15, 2023
@kefeimo
Copy link
Author

kefeimo commented Mar 16, 2023

Yeah so lets make sure that any new UUID's don't start with any existing identities.

Though this is very rare to happen, consider the following situation that a user use single asscii characters as vip-identity, then there will not be uuid available to avoid staring with vip-identity names

UUID   AGENT                             IDENTITY                     TAG PRIORITY STATUS          HEALTH
!1      volttron-listener-0.2.0rc0        1                              
!2      volttron-listener-0.2.0rc0        2           
!3      volttron-listener-0.2.0rc0        3                              
!4      volttron-listener-0.2.0rc0        4           
!5      volttron-listener-0.2.0rc0        5                              
!6      volttron-listener-0.2.0rc0        6          
...

@craig8
Copy link
Contributor

craig8 commented Mar 16, 2023

why are there ! in the example?

@kefeimo
Copy link
Author

kefeimo commented Mar 16, 2023

why are there ! in the example?

To avoid starting with existing vio-identity, which are 0, 1, 2, etc-- assuming uuid can take any ascii. The point to show the concern when newly created uuid tries to avoid starting with existing vip identity.
Though a mitigation can be "the vip identity cannot start with digit", then the avoiding strategy should work by simply start with digit.

@craig8
Copy link
Contributor

craig8 commented Mar 16, 2023

why are there ! in the example?

To avoid starting with existing vio-identity, which are 0, 1, 2, etc-- assuming uuid can take any ascii. The point to show the concern when newly created uuid tries to avoid starting with existing vip identity. Though a mitigation can be "the vip identity cannot start with digit", then the avoiding strategy should work by simply start with digit.

UUIDs can only be [a-f][0-9] I am not sure I understand your point.

@kefeimo
Copy link
Author

kefeimo commented Mar 16, 2023

why are there ! in the example?

To avoid starting with existing vio-identity, which are 0, 1, 2, etc-- assuming uuid can take any ascii. The point to show the concern when newly created uuid tries to avoid starting with existing vip identity. Though a mitigation can be "the vip identity cannot start with digit", then the avoiding strategy should work by simply start with digit.

UUIDs can only be [a-f][0-9] I am not sure I understand your point.

I am referring to this: "Yeah so lets make sure that any new UUID's don't start with any existing identities." in #165 (comment)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants