From 85e294a5134590f976113796f224c0a78c6296aa Mon Sep 17 00:00:00 2001 From: Peter Zhu Date: Mon, 9 Jan 2023 18:10:24 -0500 Subject: [PATCH] Add missing PA configuration files to TAR/Docker Signed-off-by: Peter Zhu --- scripts/components/performance-analyzer/install.sh | 14 ++++++++++++++ .../rpm/opensearch-dashboards.rpm.spec | 2 +- .../opensearch/rpm/opensearch.rpm.spec | 4 ---- 3 files changed, 15 insertions(+), 5 deletions(-) diff --git a/scripts/components/performance-analyzer/install.sh b/scripts/components/performance-analyzer/install.sh index 167601926f..8ae7829d1a 100755 --- a/scripts/components/performance-analyzer/install.sh +++ b/scripts/components/performance-analyzer/install.sh @@ -70,3 +70,17 @@ fi ## Setup Performance Analyzer Agent mv $OUTPUT/plugins/opensearch-performance-analyzer/performance-analyzer-rca $OUTPUT/ + +## Setup necessary configurations +# Create data directory by default +# Do nothing if the directory already exists +if [ -d "$OUTPUT/data" ]; then + mkdir -p $OUTPUT/data +fi + +# 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 + + diff --git a/scripts/pkg/build_templates/opensearch-dashboards/rpm/opensearch-dashboards.rpm.spec b/scripts/pkg/build_templates/opensearch-dashboards/rpm/opensearch-dashboards.rpm.spec index ceedf557aa..6e019a2348 100644 --- a/scripts/pkg/build_templates/opensearch-dashboards/rpm/opensearch-dashboards.rpm.spec +++ b/scripts/pkg/build_templates/opensearch-dashboards/rpm/opensearch-dashboards.rpm.spec @@ -82,7 +82,7 @@ fi # Reload other configs systemd-tmpfiles --create %{name}.conf # Messages -echo "### NOT starting on installation, please execute the following statements to configure opensearch service to start automatically using systemd" +echo "### NOT starting on installation, please execute the following statements to configure opensearch-dashboards service to start automatically using systemd" echo " sudo systemctl daemon-reload" echo " sudo systemctl enable opensearch-dashboards.service" echo "### You can start opensearch-dashboards service by executing" diff --git a/scripts/pkg/build_templates/opensearch/rpm/opensearch.rpm.spec b/scripts/pkg/build_templates/opensearch/rpm/opensearch.rpm.spec index f1b8d2fe2f..c7c427cbaa 100644 --- a/scripts/pkg/build_templates/opensearch/rpm/opensearch.rpm.spec +++ b/scripts/pkg/build_templates/opensearch/rpm/opensearch.rpm.spec @@ -60,10 +60,6 @@ mkdir -p %{buildroot}%{product_dir}/performance-analyzer-rca # Symlinks (do not symlink config dir as security demo installer has dependency, if no presense it will switch to rpm/deb mode) ln -s %{data_dir} %{buildroot}%{product_dir}/data ln -s %{log_dir} %{buildroot}%{product_dir}/logs -# Performance Analyzer Settings -echo 'true' > %{buildroot}%{data_dir}/rca_enabled.conf -echo 'true' > %{buildroot}%{config_dir}/performance_analyzer_enabled.conf -echo 'true' > %{buildroot}%{config_dir}/rca_enabled.conf # Change Permissions chmod -Rf a+rX,u+w,g-w,o-w %{buildroot}/* exit 0