From 08e38128a6888ddf231ad5aee3bdcbf13fba4ed4 Mon Sep 17 00:00:00 2001 From: Marc Handalian Date: Fri, 20 Aug 2021 00:35:56 -0700 Subject: [PATCH] Enable performance-analyzer build and bundle steps Signed-off-by: Marc Handalian --- .../performance-analyzer-rca/build.sh | 3 ++ .../components/performance-analyzer/build.sh | 9 +++-- .../performance-analyzer/install.sh | 39 +++++++++++++++++++ manifests/opensearch-1.1.0.yml | 15 +++---- release/tar/linux/opensearch-tar-install.sh | 2 +- 5 files changed, 54 insertions(+), 14 deletions(-) create mode 100755 bundle-workflow/scripts/components/performance-analyzer/install.sh diff --git a/bundle-workflow/scripts/components/performance-analyzer-rca/build.sh b/bundle-workflow/scripts/components/performance-analyzer-rca/build.sh index c4c3417978..2d8f02f936 100755 --- a/bundle-workflow/scripts/components/performance-analyzer-rca/build.sh +++ b/bundle-workflow/scripts/components/performance-analyzer-rca/build.sh @@ -56,4 +56,7 @@ fi [ -z "$OUTPUT" ] && OUTPUT=artifacts ./gradlew build -Dopensearch.version=$VERSION -Dbuild.snapshot=$SNAPSHOT -x test + +mkdir -p $OUTPUT/maven/org/opensearch ./gradlew publishToMavenLocal -Dopensearch.version=$VERSION -Dbuild.snapshot=$SNAPSHOT +cp -r ~/.m2/repository/org/opensearch/performanceanalyzer-rca $OUTPUT/maven/org/opensearch \ No newline at end of file diff --git a/bundle-workflow/scripts/components/performance-analyzer/build.sh b/bundle-workflow/scripts/components/performance-analyzer/build.sh index dddec80a5b..151f88b8c0 100755 --- a/bundle-workflow/scripts/components/performance-analyzer/build.sh +++ b/bundle-workflow/scripts/components/performance-analyzer/build.sh @@ -55,9 +55,10 @@ fi [[ "$SNAPSHOT" == "true" ]] && VERSION=$VERSION-SNAPSHOT [ -z "$OUTPUT" ] && OUTPUT=artifacts -# remove this script when https://github.com/opensearch-project/performance-analyzer/issues/44 is fixed -git fetch origin main -git checkout main - ./gradlew build -Dopensearch.version=$VERSION -Dbuild.snapshot=$SNAPSHOT -x test +mkdir -p $OUTPUT/plugins +cp ./build/distributions/*.zip $OUTPUT/plugins + +mkdir -p $OUTPUT/maven/org/opensearch ./gradlew publishToMavenLocal -Dopensearch.version=$VERSION -Dbuild.snapshot=$SNAPSHOT +cp -r ~/.m2/repository/org/opensearch/opensearch-performance-analyzer $OUTPUT/maven/org/opensearch diff --git a/bundle-workflow/scripts/components/performance-analyzer/install.sh b/bundle-workflow/scripts/components/performance-analyzer/install.sh new file mode 100755 index 0000000000..a5dfe1aa21 --- /dev/null +++ b/bundle-workflow/scripts/components/performance-analyzer/install.sh @@ -0,0 +1,39 @@ +#!/bin/bash + +# Copyright OpenSearch Contributors. +# SPDX-License-Identifier: Apache-2.0 + +set -ex + +function usage() { + echo "Usage: $0 [args]" + echo "" + echo "Arguments:" + echo -e "-a ARTIFACTS\t[Required] Location of build artifacts." + echo -e "-o OUTPUT\t[Required] Output path." + echo -e "-h help" +} + +while getopts ":h:a:o:" arg; do + case $arg in + h) + usage + exit 1 + ;; + o) + OUTPUT=$OPTARG + ;; + a) + ARTIFACTS=$OPTARG + ;; + ?) + echo "Invalid option: -${arg}" + exit 1 + ;; + esac +done + +## Setup Performance Analyzer Agent +cp -r $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 diff --git a/manifests/opensearch-1.1.0.yml b/manifests/opensearch-1.1.0.yml index 842994a8f3..04951c4ade 100644 --- a/manifests/opensearch-1.1.0.yml +++ b/manifests/opensearch-1.1.0.yml @@ -26,15 +26,12 @@ components: # https://github.com/opensearch-project/security/issues/1403 repository: https://github.com/dblock/security.git ref: fix-snapshot-build - # - # https://github.com/opensearch-project/opensearch-build/issues/148 - # - # - name: performance-analyzer-rca - # repository: https://github.com/opensearch-project/performance-analyzer-rca.git - # ref: main - # - name: performance-analyzer - # repository: https://github.com/opensearch-project/performance-analyzer.git - # ref: main + - name: performance-analyzer-rca + repository: https://github.com/opensearch-project/performance-analyzer-rca.git + ref: main + - name: performance-analyzer + repository: https://github.com/opensearch-project/performance-analyzer.git + ref: main - name: index-management repository: https://github.com/opensearch-project/index-management.git ref: main diff --git a/release/tar/linux/opensearch-tar-install.sh b/release/tar/linux/opensearch-tar-install.sh index ad4f442cf4..5c7d5cf9b7 100755 --- a/release/tar/linux/opensearch-tar-install.sh +++ b/release/tar/linux/opensearch-tar-install.sh @@ -26,7 +26,7 @@ PA_AGENT_JAVA_OPTS="-Dlog4j.configurationFile=$OPENSEARCH_HOME/plugins/opensearc -Xms64M -Xmx64M -XX:+UseSerialGC -XX:CICompilerCount=1 -XX:-TieredCompilation -XX:InitialCodeCacheSize=4096 \ -XX:InitialBootClassLoaderMetaspaceSize=30720 -XX:MaxRAM=400m" -OPENSEARCH_MAIN_CLASS="com.amazon.opendistro.opensearch.performanceanalyzer.PerformanceAnalyzerApp" \ +OPENSEARCH_MAIN_CLASS="org.opensearch.performanceanalyzer.PerformanceAnalyzerApp" \ OPENSEARCH_ADDITIONAL_CLASSPATH_DIRECTORIES=plugins/opensearch-performance-analyzer \ OPENSEARCH_JAVA_OPTS=$PA_AGENT_JAVA_OPTS