Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove PA-RCA files from OS home dir #143

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -424,8 +424,11 @@ bundlePlugin {
into "extensions"
include "performance-analyzer-agent"
}
from("$rcaArtifactsDir") {
into "performance-analyzer-rca"
from("$rcaArtifactsDir/bin") {
into "rca_bin"
}
from("$rcaArtifactsDir/lib") {
into "rca_lib"
}
from("packaging") {
include "performance-analyzer-agent-cli"
Expand Down
8 changes: 4 additions & 4 deletions pa_bin/performance-analyzer-agent
Original file line number Diff line number Diff line change
Expand Up @@ -34,12 +34,12 @@ export JAVA_HOME=$JAVA_HOME
# We need to change this file: https://github.com/opensearch-project/opensearch-build/blob/main/release/docker/config/opensearch/opensearch-docker-entrypoint.sh

if ! echo $* | grep -E '(^-d |-d$| -d |--daemonize$|--daemonize )' >/dev/null; then
export JAVA_OPTS=-Dopensearch.path.home=$OPENSEARCH_HOME\ -Dlog4j.configurationFile=$OPENSEARCH_HOME/performance-analyzer-rca-1.3.0-SNAPSHOT/pa_config/log4j2.xml
exec $OPENSEARCH_HOME/performance-analyzer-rca-1.3.0-SNAPSHOT/bin/performance-analyzer-rca
export JAVA_OPTS=-Dopensearch.path.home=$OPENSEARCH_HOME\ -Dlog4j.configurationFile=$OPENSEARCH_HOME/plugins/opensearch-performance-analyzer-1.3.0-SNAPSHOT/pa_config/log4j2.xml
exec $OPENSEARCH_HOME/plugins/opensearch-performance-analyzer-1.3.0-SNAPSHOT/rca_bin/performance-analyzer-rca
else
echo 'Starting deamon'
export JAVA_OPTS=-Dopensearch.path.home=$OPENSEARCH_HOME\ -Dlog4j.configurationFile=$OPENSEARCH_HOME/performance-analyzer-rca-1.3.0-SNAPSHOT/pa_config/log4j2.xml
exec $OPENSEARCH_HOME/performance-analyzer-rca-1.3.0-SNAPSHOT/bin/performance-analyzer-rca &
export JAVA_OPTS=-Dopensearch.path.home=$OPENSEARCH_HOME\ -Dlog4j.configurationFile=$OPENSEARCH_HOME/plugins/opensearch-performance-analyzer-1.3.0-SNAPSHOT/pa_config/log4j2.xml
exec $OPENSEARCH_HOME/plugins/opensearch-performance-analyzer-1.3.0-SNAPSHOT/rca_bin/performance-analyzer-rca &

pid=$!
PID_LOC=/tmp/performance-analyzer-agent
Expand Down
11 changes: 9 additions & 2 deletions packaging/deb/postinst
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,15 @@ if [ -z "$OPENSEARCH_HOME" ]; then
fi

# Prepare the RCA reader process for execution
mv "$OPENSEARCH_HOME"/plugins/opensearch-performance-analyzer/performance-analyzer-rca $OPENSEARCH_HOME
PA_PLUGIN_PATH=$OUTPUT/plugins/opensearch-performance-analyzer
RCA_LIB_PATH=$OUTPUT/plugins/opensearch-performance-analyzer/rca_lib
# Remove common lib files between PA plugin and RCA reader process
for f in `ls -1 $PA_PLUGIN_PATH`; do
if [[ $(diff $RCA_LIB_PATH/$f $PA_PLUGIN_PATH/$f | wc -c) -eq 0 ]]; then
rm -rf $RCA_LIB_PATH/$f;
fi
done;

if [ -f "$OPENSEARCH_HOME"/bin/opensearch-performance-analyzer/performance-analyzer-agent-cli ]; then
mv "$OPENSEARCH_HOME"/bin/opensearch-performance-analyzer/performance-analyzer-agent-cli "$OPENSEARCH_HOME"/bin
rm -rf "$OPENSEARCH_HOME"/bin/opensearch-performance-analyzer
Expand All @@ -20,7 +28,6 @@ echo 'true' > /var/lib/opensearch/performance_analyzer_enabled.conf
echo 'true' > /var/lib/opensearch/rca_enabled.conf
chown opensearch /var/lib/opensearch/performance_analyzer_enabled.conf
chown opensearch /var/lib/opensearch/rca_enabled.conf
chown -R opensearch "$OPENSEARCH_HOME/performance-analyzer-rca"
chmod a+rw /tmp

if ! grep -q '## OpenSearch Performance Analyzer' /etc/opensearch/jvm.options; then
Expand Down
2 changes: 1 addition & 1 deletion packaging/performance-analyzer-agent-cli
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ PA_AGENT_JAVA_OPTS="-Dlog4j.configurationFile=$OPENSEARCH_HOME/plugins/opensearc
-XX:MaxRAM=400m"

OPENSEARCH_MAIN_CLASS="org.opensearch.performanceanalyzer.PerformanceAnalyzerApp" \
OPENSEARCH_ADDITIONAL_CLASSPATH_DIRECTORIES=performance-analyzer-rca/lib \
OPENSEARCH_ADDITIONAL_CLASSPATH_DIRECTORIES=plugins/opensearch-performance-analyzer/rca_lib:plugins/opensearch-performance-analyzer \
OPENSEARCH_JAVA_OPTS=$PA_AGENT_JAVA_OPTS \
exec $OPENSEARCH_HOME/bin/opensearch-cli \
"$@"
11 changes: 9 additions & 2 deletions packaging/rpm/postinst
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,15 @@ if [ -z "$OPENSEARCH_HOME" ]; then
fi

# Prepare the RCA reader process for execution
mv "$OPENSEARCH_HOME"/plugins/opensearch-performance-analyzer/performance-analyzer-rca $OPENSEARCH_HOME
PA_PLUGIN_PATH=$OUTPUT/plugins/opensearch-performance-analyzer
RCA_LIB_PATH=$OUTPUT/plugins/opensearch-performance-analyzer/rca_lib
# Remove common lib files between PA plugin and RCA reader process
for f in `ls -1 $PA_PLUGIN_PATH`; do
if [[ $(diff $RCA_LIB_PATH/$f $PA_PLUGIN_PATH/$f | wc -c) -eq 0 ]]; then
rm -rf $RCA_LIB_PATH/$f;
fi
done;

if [ -f "$OPENSEARCH_HOME"/bin/opensearch-performance-analyzer/performance-analyzer-agent-cli ]; then
mv "$OPENSEARCH_HOME"/bin/opensearch-performance-analyzer/performance-analyzer-agent-cli "$OPENSEARCH_HOME"/bin
rm -rf "$OPENSEARCH_HOME"/bin/opensearch-performance-analyzer
Expand All @@ -26,7 +34,6 @@ echo 'true' > /var/lib/opensearch/performance_analyzer_enabled.conf
echo 'true' > /var/lib/opensearch/rca_enabled.conf
chown opensearch /var/lib/opensearch/performance_analyzer_enabled.conf
chown opensearch /var/lib/opensearch/rca_enabled.conf
chown -R opensearch "$OPENSEARCH_HOME/performance-analyzer-rca"
chmod a+rw /tmp

if ! grep -q '## OpenSearch Performance Analyzer' /etc/opensearch/jvm.options; then
Expand Down
Loading