Extend frostfs-cli container policy-playground with ability to load configuration from files #1332

Open
opened 2024-08-26 08:38:25 +00:00 by a-baranov · 3 comments

The most frustrated in "frostfs-cli container policy-playground" expirience is press of Ctrl+C... Next you have to recover configuration and Replication Policy. I do suggest to add ability to load conifguration and replication policy from files at launch time.

Describe the solution you'd like

  1. Introduce new key-options for "frostfs-cli container policy-playground"
    --netmap-config
    --rep-policy
    [--one-time] - optional key to exit on complition

Each batch of "frostfs-cli container policy-playground" would return result in execution of the rep-policy over the netmap-config.
If --one-time option specified the utility would exit to bash on completion.

  1. Possible benefit - file with Replication Policy could contain multiline policy (makes notalition more clear).
    At launch utility could easily concatenate all lines to single line loading --rep-policy config.

  2. Sounds like new feature. But depending to this request.
    Add ability to export netmap properties of existing System in format of "frostfs-cli container policy-playground --netmap-config". Extremely useful to experiment with policies based on real system atttibutes. Requires valid endpoint, wallet and password of existing System.

Describe alternatives you've considered

Add command "load" for online mode to load configuration from config.
Create script to dump/convert frostfs-cli netmap to format of add rules for "frostfs-cli container policy-playground" and load rules one by one.

Don't forget to add labels!

Suggested improvement for version 1.6 - 1.7

## Is your feature request related to a problem? Please describe. The most frustrated in "frostfs-cli container policy-playground" expirience is press of Ctrl+C... Next you have to recover configuration and Replication Policy. I do suggest to add ability to load conifguration and replication policy from files at launch time. ## Describe the solution you'd like 1. Introduce new key-options for "frostfs-cli container policy-playground" --netmap-config <path-for-netmap-rules> --rep-policy <path-for-replication-policy> [--one-time] - optional key to exit on complition Each batch of "frostfs-cli container policy-playground" would return result in execution of the rep-policy over the netmap-config. If --one-time option specified the utility would exit to bash on completion. 2. Possible benefit - file with Replication Policy could contain multiline policy (makes notalition more clear). At launch utility could easily concatenate all lines to single line loading --rep-policy config. 3. Sounds like new feature. But depending to this request. Add ability to export netmap properties of existing System in format of "frostfs-cli container policy-playground --netmap-config<path-for-netmap-rules>". Extremely useful to experiment with policies based on real system atttibutes. Requires valid endpoint, wallet and password of existing System. ## Describe alternatives you've considered Add command "load" for online mode to load configuration from config. Create script to dump/convert frostfs-cli netmap to format of add rules for "frostfs-cli container policy-playground" and load rules one by one. ## Don't forget to add labels! Suggested improvement for version 1.6 - 1.7
a-baranov added the
triage
label 2024-08-26 08:38:25 +00:00
fyrchik added the
frostfs-cli
label 2024-08-26 08:43:46 +00:00
fyrchik removed the
triage
label 2024-08-26 10:14:50 +00:00
fyrchik changed title from Extend frostfs-cli container policy-playground with ability to load configuration from files to Extend frostfs-cli container policy-playground with ability to load configuration from files 2024-08-26 10:15:01 +00:00
Owner
  1. Make Ctrl+C not exit but cancel the input currently being entered.
    To exit need to press Ctrl+C twice. Maybe exit on Ctrl+D.
    See other interactive CLI for inspiration.
1. Make `Ctrl+C` not exit but cancel the input currently being entered. To exit need to press `Ctrl+C` twice. Maybe exit on `Ctrl+D`. See other interactive CLI for inspiration.
Owner

This task is big, let's split it to multiple PRs.

Fix help of -r key, it fetches an actual netmap from the endpoint.
Add help command, which lists all other commands.

This task is big, let's split it to multiple PRs. Fix help of `-r` key, it fetches an actual netmap from the endpoint. Add `help` command, which lists all other commands.
achuprov was assigned by fyrchik 2024-09-13 13:16:51 +00:00
Member
  1. Make Ctrl+C not exit but cancel the input currently being entered.
    To exit need to press Ctrl+C twice. Maybe exit on Ctrl+D.
    See other interactive CLI for inspiration.

@fyrchik don't you find this behavior misleading?
Also, could you please see the issue I created recently? I found that readline offers lots of shortcuts we could use. What do you think?

> 1. Make `Ctrl+C` not exit but cancel the input currently being entered. > To exit need to press `Ctrl+C` twice. Maybe exit on `Ctrl+D`. > See other interactive CLI for inspiration. @fyrchik don't you find this behavior misleading? Also, could you please see [the issue](https://git.frostfs.info/TrueCloudLab/frostfs-node/issues/1396) I created recently? I found that `readline` offers lots of [shortcuts](https://github.com/chzyer/readline/blob/master/doc/shortcut.md) we could use. What do you think?
fyrchik added this to the vNext milestone 2024-10-02 06:26:53 +00:00
Sign in to join this conversation.
No milestone
No project
No assignees
3 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: TrueCloudLab/frostfs-node#1332
No description provided.