Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[PLAT-11996][PLAT-13576]Create YAML/JSON template for create universe…
… input Summary: Introduce `--config-template` to create universe to allow users to specify the universe spec via a JSON or YAML file. Allow flags to override values if provided explicitly example : `yba universe create --config-template <file-path> --name dkumar` Change input value of master-gflags to accept map of json or yaml type. CLI input for yaml map would look like: ``` ./yba universe create -n dkumar-master-gflags-yaml-cli --provider-code gcp --provider-name dkumar-cli \ > --yb-db-version 2.23.0.0-b293 \ > --master-gflags "cdc_wal_retention_time_secs: 1 > log_min_segments_to_retain: 1 > log_cache_size_limit_mb: 0 > global_log_cache_size_limit_mb: 0 > log_stop_retaining_min_disk_mb: 9223372036854775807" \ > --num-nodes 1 --replication-factor 1 --user-tags yb_owner=dkumar,yb_task=dev,yb_dept=eng --debug ``` and json type would look like: ```./yba universe create -n dkumar-master-gflags --provider-code gcp --provider-name dkumar-cli \ --yb-db-version 2.23.0.0-b293 \ --master-gflags "{\"cdc_wal_retention_time_secs\": \"1\",\"log_min_segments_to_retain\": \"1\",\"log_cache_size_limit_mb\": \"0\",\"global_log_cache_size_limit_mb\": \"0\",\"log_stop_retaining_min_disk_mb\": \"9223372036854775807\"}" \ --num-nodes 1 --replication-factor 1 --user-tags yb_owner=dkumar,yb_task=dev,yb_dept=eng ``` Change input of Server Gflags: JSON: ``` ./yba universe create -n dkumar-tserver-cli-new --yb-db-version 2.23.0.0-b293 \ --provider-code gcp --provider-name dkumar-cli --add-read-replica --num-nodes 1,1 --replication-factor 1,1 \ --tserver-gflags "{\"primary\": {\"log_min_segments_to_retain\": \"1\",\"log_cache_size_limit_mb\": \"0\",\"global_log_cache_size_limit_mb\": \"0\",\"log_stop_retaining_min_disk_mb\": \"9223372036854775807\"},\"async\": {\"log_min_segments_to_retain\": \"2\",\"log_cache_size_limit_mb\": \"0\",\"global_log_cache_size_limit_mb\": \"0\"}}" ``` YAML: ``` ./yba universe create -n dkumar-tserver-cli-new --yb-db-version 2.23.0.0-b293 \ --provider-code gcp --provider-name dkumar-cli --add-read-replica --num-nodes 1,1 --replication-factor 1,1 \ --tserver-gflags "primary: log_min_segments_to_retain: 1 log_cache_size_limit_mb: 0 global_log_cache_size_limit_mb: 0 log_stop_retaining_min_disk_mb: 9223372036854775807 async: log_min_segments_to_retain: 2 log_cache_size_limit_mb: 0 global_log_cache_size_limit_mb: 0" ``` Template files would have it in map format according to file type Test Plan: Testing the fields via config file and flags independently. Using the flags to override values provided in the config file. YAML and JSON templates has been added in the /templates directory to guide users. Reviewers: sneelakantan Reviewed By: sneelakantan Subscribers: yugaware Differential Revision: https://phorge.dev.yugabyte.com/D34514
- Loading branch information