Skip to content

Commit

Permalink
Update PA directories from plugins to root
Browse files Browse the repository at this point in the history
Signed-off-by: sruti1312 <srutiparthiban@gmail.com>
  • Loading branch information
sruti1312 committed Apr 19, 2022
1 parent 7c732e9 commit e0c9c60
Show file tree
Hide file tree
Showing 8 changed files with 9 additions and 19 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ function runOpensearch {
OPENSEARCH_PID=$!

# Start performance analyzer agent
performance-analyzer-agent-cli > $OPENSEARCH_HOME/logs/performance-analyzer.log 2>&1 &
$OPENSEARCH_HOME/bin/opensearch-performance-analyzer/performance-analyzer-agent-cli > $OPENSEARCH_HOME/logs/performance-analyzer.log 2>&1 &
PA_PID=$!

# Wait for the child processes to terminate
Expand Down
4 changes: 2 additions & 2 deletions docker/release/dockerfiles/opensearch.al2.dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ ARG GID=1000
ARG TEMP_DIR=/tmp/opensearch
ARG OPENSEARCH_HOME=/usr/share/opensearch
ARG SECURITY_PLUGIN_DIR=$OPENSEARCH_HOME/plugins/opensearch-security
ARG PERFORMANCE_ANALYZER_PLUGIN_DIR=$OPENSEARCH_HOME/plugins/opensearch-performance-analyzer
ARG PERFORMANCE_ANALYZER_PLUGIN_CONFIG_DIR=$OPENSEARCH_HOME/config/opensearch-performance-analyzer

# Update packages
# Install the tools we need: tar and gzip to unpack the OpenSearch tarball, and shadow-utils to give us `groupadd` and `useradd`.
Expand All @@ -39,7 +39,7 @@ RUN ls -l $TEMP_DIR && \
tar -xzpf /tmp/opensearch/opensearch-`uname -p`.tgz -C $OPENSEARCH_HOME --strip-components=1 && \
mkdir -p $OPENSEARCH_HOME/data && chown -Rv $UID:$GID $OPENSEARCH_HOME/data && \
if [[ -d $SECURITY_PLUGIN_DIR ]] ; then chmod -v 750 $SECURITY_PLUGIN_DIR/tools/* ; fi && \
if [[ -d $PERFORMANCE_ANALYZER_PLUGIN_DIR ]] ; then cp -v $TEMP_DIR/performance-analyzer.properties $PERFORMANCE_ANALYZER_PLUGIN_DIR/config/; fi && \
if [[ -d $PERFORMANCE_ANALYZER_PLUGIN_CONFIG_DIR ]] ; then cp -v $TEMP_DIR/performance-analyzer.properties $PERFORMANCE_ANALYZER_PLUGIN_CONFIG_DIR; fi && \
cp -v $TEMP_DIR/opensearch-docker-entrypoint.sh $TEMP_DIR/opensearch-onetime-setup.sh $OPENSEARCH_HOME/ && \
cp -v $TEMP_DIR/log4j2.properties $TEMP_DIR/opensearch.yml $OPENSEARCH_HOME/config/ && \
ls -l $OPENSEARCH_HOME && \
Expand Down
2 changes: 0 additions & 2 deletions scripts/components/performance-analyzer/install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -69,5 +69,3 @@ fi

## Setup Performance Analyzer Agent
mv $OUTPUT/plugins/opensearch-performance-analyzer/performance-analyzer-rca $OUTPUT/
mv $OUTPUT/bin/opensearch-performance-analyzer/performance-analyzer-agent-cli $OUTPUT/bin
rm -rf $OUTPUT/bin/opensearch-performance-analyzer
2 changes: 1 addition & 1 deletion scripts/deploy_single_tar_cluster.sh
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ echo "script.context.field.max_compilations_rate: 1000/1m" >> config/opensearch.
# Required for Security
echo "plugins.security.unsupported.restapi.allow_securityconfig_modification: true" >> config/opensearch.yml
# Required for PA
echo "webservice-bind-host = 0.0.0.0" >> plugins/opensearch-performance-analyzer/config/performance-analyzer.properties
echo "webservice-bind-host = 0.0.0.0" >> config/opensearch-performance-analyzer/performance-analyzer.properties
# Security setup
if [ "$ENABLE_SECURITY" == "false" ]
then
Expand Down
7 changes: 2 additions & 5 deletions scripts/legacy/tar/linux/opensearch-tar-install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,8 @@ KNN_LIB_DIR=$OPENSEARCH_HOME/plugins/opensearch-knn/lib
##Security Plugin
bash $OPENSEARCH_HOME/plugins/opensearch-security/tools/install_demo_configuration.sh -y -i -s

##Perf Plugin
chmod 755 $OPENSEARCH_HOME/plugins/opensearch-performance-analyzer/bin/performance-analyzer-agent
chmod 755 $OPENSEARCH_HOME/bin/performance-analyzer-agent-cli
echo "done security"
PA_AGENT_JAVA_OPTS="-Dlog4j.configurationFile=$OPENSEARCH_HOME/plugins/opensearch-performance-analyzer/config/log4j2.xml \
PA_AGENT_JAVA_OPTS="-Dlog4j.configurationFile=$OPENSEARCH_HOME/config/opensearch-performance-analyzer/log4j2.xml \
-Xms64M -Xmx64M -XX:+UseSerialGC -XX:CICompilerCount=1 -XX:-TieredCompilation -XX:InitialCodeCacheSize=4096 \
-XX:MaxRAM=400m"

Expand All @@ -26,7 +23,7 @@ if ! grep -q '## OpenSearch Performance Analyzer' $OPENSEARCH_HOME/config/jvm.op
echo '## OpenSearch Performance Analyzer' >> $OPENSEARCH_HOME/config/jvm.options
echo "-Dclk.tck=$CLK_TCK" >> $OPENSEARCH_HOME/config/jvm.options
echo "-Djdk.attach.allowAttachSelf=true" >> $OPENSEARCH_HOME/config/jvm.options
echo "-Djava.security.policy=$OPENSEARCH_HOME/plugins/opensearch-performance-analyzer/config/opensearch_security.policy" >> $OPENSEARCH_HOME/config/jvm.options
echo "-Djava.security.policy=$OPENSEARCH_HOME/config/opensearch-performance-analyzer/opensearch_security.policy" >> $OPENSEARCH_HOME/config/jvm.options
echo "--add-opens=jdk.attach/sun.tools.attach=ALL-UNNAMED" >> $OPENSEARCH_HOME/config/jvm.options
fi
echo "done plugins"
Expand Down
7 changes: 1 addition & 6 deletions scripts/opensearch-onetime-setup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -34,18 +34,13 @@ fi
##Perf Plugin
PA_PLUGIN="opensearch-performance-analyzer"

if [ -d $OPENSEARCH_HOME/plugins/$PA_PLUGIN ]; then
chmod 755 $OPENSEARCH_HOME/plugins/$PA_PLUGIN/bin/performance-analyzer-agent
chmod 755 $OPENSEARCH_HOME/bin/performance-analyzer-agent-cli
fi

if ! grep -q '## OpenDistro Performance Analyzer' $OPENSEARCH_HOME/config/jvm.options; then
CLK_TCK=`/usr/bin/getconf CLK_TCK`
echo >> $OPENSEARCH_HOME/config/jvm.options
echo '## OpenDistro Performance Analyzer' >> $OPENSEARCH_HOME/config/jvm.options
echo "-Dclk.tck=$CLK_TCK" >> $OPENSEARCH_HOME/config/jvm.options
echo "-Djdk.attach.allowAttachSelf=true" >> $OPENSEARCH_HOME/config/jvm.options
echo "-Djava.security.policy=$OPENSEARCH_HOME/plugins/$PA_PLUGIN/config/opensearch_security.policy" >> $OPENSEARCH_HOME/config/jvm.options
echo "-Djava.security.policy=$OPENSEARCH_HOME/config/$PA_PLUGIN/opensearch_security.policy" >> $OPENSEARCH_HOME/config/jvm.options
echo "--add-opens=jdk.attach/sun.tools.attach=ALL-UNNAMED" >> $OPENSEARCH_HOME/config/jvm.options
fi

2 changes: 1 addition & 1 deletion scripts/pkg/build_templates/opensearch/opensearch.rpm.spec
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ if ! grep -q '## OpenSearch Performance Analyzer' %{config_dir}/jvm.options; the
echo '## OpenSearch Performance Analyzer' >> %{config_dir}/jvm.options
echo "-Dclk.tck=$CLK_TCK" >> %{config_dir}/jvm.options
echo "-Djdk.attach.allowAttachSelf=true" >> %{config_dir}/jvm.options
echo "-Djava.security.policy=file:///usr/share/opensearch/plugins/opensearch-performance-analyzer/config/opensearch_security.policy" >> %{config_dir}/jvm.options
echo "-Djava.security.policy=file:///etc/opensearch/opensearch-performance-analyzer/opensearch_security.policy" >> %{config_dir}/jvm.options
echo "--add-opens=jdk.attach/sun.tools.attach=ALL-UNNAMED" >> %{config_dir}/jvm.options
fi
# Reload systemctl daemon
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ Description=OpenSearch Performance Analyzer

[Service]
Type=simple
ExecStart=/usr/share/opensearch/bin/performance-analyzer-agent-cli
ExecStart=/usr/share/opensearch/bin/opensearch-performance-analyzer/performance-analyzer-agent-cli
Restart=on-failure
User=opensearch
Group=opensearch
Expand Down

0 comments on commit e0c9c60

Please sign in to comment.