From a01a562b79beb4eb6d6596a07cf7043cc0587b32 Mon Sep 17 00:00:00 2001 From: Jason Thomas Date: Wed, 13 Sep 2023 14:16:56 -0600 Subject: [PATCH] REDUCER_DISABLE instead of DISABLE_REDUCER --- .../plugins/packages/openc3-cosmos-demo/plugin.txt | 6 ++---- openc3/data/config/target.yaml | 2 +- openc3/lib/openc3/models/target_model.rb | 14 +++++++------- 3 files changed, 10 insertions(+), 12 deletions(-) diff --git a/openc3-cosmos-init/plugins/packages/openc3-cosmos-demo/plugin.txt b/openc3-cosmos-init/plugins/packages/openc3-cosmos-demo/plugin.txt index 9692e45d5..ac6f568c9 100644 --- a/openc3-cosmos-init/plugins/packages/openc3-cosmos-demo/plugin.txt +++ b/openc3-cosmos-init/plugins/packages/openc3-cosmos-demo/plugin.txt @@ -48,8 +48,6 @@ VARIABLE reduced_log_retain_time 2592000 LOG_RETAIN_TIME <%= log_retain_time %> REDUCED_LOG_RETAIN_TIME <%= reduced_log_retain_time %> TLM_LOG_CYCLE_TIME 600 - # Allow the reducer microservice to take 10% of the cpu (default 30%) - REDUCER_MAX_CPU_UTILIZATION 10 <% end %> <% if include_example %> @@ -58,7 +56,7 @@ VARIABLE reduced_log_retain_time 2592000 # Disable data reduction (min, hour, day) on this target data # No 'ruby reducer_microservice.rb DEFAULT__REDUCER__EXAMPLE' # will appear in the the process list - DISABLE_REDUCER + REDUCER_DISABLE <% end %> <% if include_templated %> @@ -67,7 +65,7 @@ VARIABLE reduced_log_retain_time 2592000 # Disable data reduction (min, hour, day) on this target data # No 'ruby reducer_microservice.rb DEFAULT__REDUCER__TEMPLATED' # will appear in the the process list - DISABLE_REDUCER + REDUCER_DISABLE <% end %> <% if include_system %> diff --git a/openc3/data/config/target.yaml b/openc3/data/config/target.yaml index 086860f26..ec2f57d40 100644 --- a/openc3/data/config/target.yaml +++ b/openc3/data/config/target.yaml @@ -156,7 +156,7 @@ TARGET: required: true description: Number of seconds between runs of the cleanup process (default = 900 = 15 minutes) values: \d+ - DISABLE_REDUCER: + REDUCER_DISABLE: summary: Disables the data reduction microservice for the target REDUCER_MAX_CPU_UTILIZATION: summary: Maximum amount of CPU utilization to apply to data reduction diff --git a/openc3/lib/openc3/models/target_model.rb b/openc3/lib/openc3/models/target_model.rb index 888f29395..0629b86a9 100644 --- a/openc3/lib/openc3/models/target_model.rb +++ b/openc3/lib/openc3/models/target_model.rb @@ -346,7 +346,7 @@ def initialize( cleanup_poll_time: 900, needs_dependencies: false, target_microservices: {'REDUCER' => [[]]}, - disable_reducer: false, + reducer_disable: false, reducer_max_cpu_utilization: 30.0, scope: ) @@ -362,7 +362,7 @@ def initialize( reduced_minute_log_retain_time: reduced_minute_log_retain_time, reduced_hour_log_retain_time: reduced_hour_log_retain_time, reduced_day_log_retain_time: reduced_day_log_retain_time, cleanup_poll_time: cleanup_poll_time, needs_dependencies: needs_dependencies, target_microservices: target_microservices, - disable_reducer: disable_reducer, reducer_max_cpu_utilization: reducer_max_cpu_utilization, + reducer_disable: reducer_disable, reducer_max_cpu_utilization: reducer_max_cpu_utilization, scope: scope) @folder_name = folder_name @requires = requires @@ -393,7 +393,7 @@ def initialize( @cleanup_poll_time = cleanup_poll_time @needs_dependencies = needs_dependencies @target_microservices = target_microservices - @disable_reducer = disable_reducer + @reducer_disable = reducer_disable @reducer_max_cpu_utilization = reducer_max_cpu_utilization @bucket = Bucket.getClient() @children = [] @@ -433,7 +433,7 @@ def as_json(*a) 'cleanup_poll_time' => @cleanup_poll_time, 'needs_dependencies' => @needs_dependencies, 'target_microservices' => @target_microservices.as_json(:allow_nan => true), - 'disable_reducer' => @disable_reducer, + 'reducer_disable' => @reducer_disable, 'reducer_max_cpu_utilization' => @reducer_max_cpu_utilization } end @@ -516,8 +516,8 @@ def handle_config(parser, keyword, parameters) @reduced_hour_log_retain_time = reduced_log_retain_time.to_i @reduced_day_log_retain_time = reduced_log_retain_time.to_i end - when 'DISABLE_REDUCER', 'DISABLE_REDUCED' # Handle typos - @disable_reducer = true + when 'REDUCER_DISABLE', 'REDUCER_DISABLED' # Handle typos + @reducer_disable = true when 'REDUCER_MAX_CPU_UTILIZATION', 'REDUCED_MAX_CPU_UTILIZATION' # Handle typos parser.verify_num_parameters(1, 1, "#{keyword} ") @reducer_max_cpu_utilization = Float(parameters[0]) @@ -1068,7 +1068,7 @@ def deploy_microservices(gem_path, variables, system) end # Reducer Microservice - unless @disable_reducer + unless @reducer_disable deploy_target_microservices('REDUCER', decom_topic_list, "#{@scope}__DECOM__{#{@name}}") do |topics, instance, parent| deploy_reducer_microservice(gem_path, variables, topics, instance, parent) end