From a1a1fa72b7e86a8ea286c76b492a82a117dac45c Mon Sep 17 00:00:00 2001 From: Peter Zhu Date: Wed, 11 Jan 2023 16:05:44 -0500 Subject: [PATCH 1/2] Add PA fix to missing config files errors Signed-off-by: Peter Zhu --- .../OpenSearch-Dashboards/install.sh | 2 +- scripts/components/OpenSearch/install.sh | 2 +- .../performance-analyzer/install.sh | 23 ++++++++++++------- scripts/default/install.sh | 2 +- .../opensearch/rpm/opensearch.rpm.spec | 3 --- 5 files changed, 18 insertions(+), 14 deletions(-) diff --git a/scripts/components/OpenSearch-Dashboards/install.sh b/scripts/components/OpenSearch-Dashboards/install.sh index 0a577bb3d8..ad06c91bb0 100755 --- a/scripts/components/OpenSearch-Dashboards/install.sh +++ b/scripts/components/OpenSearch-Dashboards/install.sh @@ -48,7 +48,7 @@ while getopts ":h:v:s:o:p:a:d:f:" arg; do DISTRIBUTION=$OPTARG ;; f) - ARTIFACTS=$ARTIFACTS + ARTIFACTS=$OPTARG ;; :) echo "Error: -${OPTARG} requires an argument" diff --git a/scripts/components/OpenSearch/install.sh b/scripts/components/OpenSearch/install.sh index 6c8da9eb1a..7b384c939d 100755 --- a/scripts/components/OpenSearch/install.sh +++ b/scripts/components/OpenSearch/install.sh @@ -48,7 +48,7 @@ while getopts ":h:v:s:o:p:a:d:f:" arg; do DISTRIBUTION=$OPTARG ;; f) - ARTIFACTS=$ARTIFACTS + ARTIFACTS=$OPTARG ;; :) echo "Error: -${OPTARG} requires an argument" diff --git a/scripts/components/performance-analyzer/install.sh b/scripts/components/performance-analyzer/install.sh index dadfb8b18a..d3ce90b488 100755 --- a/scripts/components/performance-analyzer/install.sh +++ b/scripts/components/performance-analyzer/install.sh @@ -44,7 +44,7 @@ while getopts ":h:v:s:o:p:a:f:" arg; do ARCHITECTURE=$OPTARG ;; f) - ARTIFACTS=$ARTIFACTS + ARTIFACTS=$OPTARG ;; :) echo "Error: -${OPTARG} requires an argument" @@ -71,13 +71,20 @@ fi ## Setup Performance Analyzer Agent mv $OUTPUT/plugins/opensearch-performance-analyzer/performance-analyzer-rca $OUTPUT/ -## Create data directory by default -## Do nothing if the directory already exists -mkdir -p $OUTPUT/data +## Setup Performance Analyzer Agent +mv $OUTPUT/plugins/opensearch-performance-analyzer/performance-analyzer-rca $OUTPUT/ ## Performance Analyzer Configs -echo 'true' > $OUTPUT/data/rca_enabled.conf -echo 'true' > $OUTPUT/config/performance_analyzer_enabled.conf -echo 'true' > $OUTPUT/config/rca_enabled.conf - +if echo $ARTIFACTS | grep -Eo '/deb/|/rpm/'; then + echo "DEB/RPM configs" + echo 'true' > $OUTPUT/../var/lib/opensearch/rca_enabled.conf + echo 'true' > $OUTPUT/../var/lib/opensearch/performance_analyzer_enabled.conf +else + ## Create data directory by default + ## Do nothing if the directory already exists + echo "non-DEB/non-RPM configs" + mkdir -p $OUTPUT/data + echo 'true' > $OUTPUT/data/rca_enabled.conf + echo 'true' > $OUTPUT/data/performance_analyzer_enabled.conf +fi diff --git a/scripts/default/install.sh b/scripts/default/install.sh index a7a1475e21..f00c4ec6f7 100755 --- a/scripts/default/install.sh +++ b/scripts/default/install.sh @@ -47,7 +47,7 @@ while getopts ":h:v:q:s:o:p:a:f:" arg; do ARCHITECTURE=$OPTARG ;; f) - ARTIFACTS=$ARTIFACTS + ARTIFACTS=$OPTARG ;; :) echo "Error: -${OPTARG} requires an argument" diff --git a/scripts/pkg/build_templates/opensearch/rpm/opensearch.rpm.spec b/scripts/pkg/build_templates/opensearch/rpm/opensearch.rpm.spec index c7c427cbaa..132c02c822 100644 --- a/scripts/pkg/build_templates/opensearch/rpm/opensearch.rpm.spec +++ b/scripts/pkg/build_templates/opensearch/rpm/opensearch.rpm.spec @@ -151,9 +151,6 @@ exit 0 %config(noreplace) %{config_dir}/%{name}.yml %config(noreplace) %{config_dir}/jvm.options %config(noreplace) %{config_dir}/log4j2.properties -%config(noreplace) %{config_dir}/performance_analyzer_enabled.conf -%config(noreplace) %{data_dir}/rca_enabled.conf -%config(noreplace) %{config_dir}/rca_enabled.conf # Service files %attr(0644, root, root) %{_prefix}/lib/systemd/system/%{name}.service From 6bdf2e2c21423951454b2d6b6b669befa51b02b6 Mon Sep 17 00:00:00 2001 From: Peter Zhu Date: Wed, 11 Jan 2023 16:36:06 -0500 Subject: [PATCH 2/2] Add more changes Signed-off-by: Peter Zhu --- scripts/components/performance-analyzer/install.sh | 11 ----------- 1 file changed, 11 deletions(-) diff --git a/scripts/components/performance-analyzer/install.sh b/scripts/components/performance-analyzer/install.sh index d3ce90b488..7e9068ae64 100755 --- a/scripts/components/performance-analyzer/install.sh +++ b/scripts/components/performance-analyzer/install.sh @@ -71,20 +71,9 @@ fi ## Setup Performance Analyzer Agent mv $OUTPUT/plugins/opensearch-performance-analyzer/performance-analyzer-rca $OUTPUT/ -## Setup Performance Analyzer Agent -mv $OUTPUT/plugins/opensearch-performance-analyzer/performance-analyzer-rca $OUTPUT/ - ## Performance Analyzer Configs if echo $ARTIFACTS | grep -Eo '/deb/|/rpm/'; then echo "DEB/RPM configs" echo 'true' > $OUTPUT/../var/lib/opensearch/rca_enabled.conf echo 'true' > $OUTPUT/../var/lib/opensearch/performance_analyzer_enabled.conf -else - ## Create data directory by default - ## Do nothing if the directory already exists - echo "non-DEB/non-RPM configs" - mkdir -p $OUTPUT/data - - echo 'true' > $OUTPUT/data/rca_enabled.conf - echo 'true' > $OUTPUT/data/performance_analyzer_enabled.conf fi