From ee86a42310688b4fe364e0f9565890bd7cf43357 Mon Sep 17 00:00:00 2001 From: Rupal Mahajan Date: Fri, 6 Jan 2023 23:13:34 +0000 Subject: [PATCH 1/5] Remove chromium binary in dashboards-reports artifact Signed-off-by: Rupal Mahajan --- scripts/components/reportsDashboards/build.sh | 33 ------------------- 1 file changed, 33 deletions(-) diff --git a/scripts/components/reportsDashboards/build.sh b/scripts/components/reportsDashboards/build.sh index 3f66c43eef..3c375d057b 100755 --- a/scripts/components/reportsDashboards/build.sh +++ b/scripts/components/reportsDashboards/build.sh @@ -66,39 +66,13 @@ fi [ -z "$OUTPUT" ] && OUTPUT=artifacts [ -z "$PLATFORM" ] && PLATFORM=$(uname -s | awk '{print tolower($0)}') -[ -z "$ARCHITECTURE" ] && ARCHITECTURE=`uname -m` [ ! -z "$QUALIFIER" ] && QUALIFIER_IDENTIFIER="-$QUALIFIER" -case $PLATFORM in - linux*) - PLATFORM="linux" - ;; - windows*|*nt*) - PLATFORM="windows" - ;; - *) - echo "Unsupported platform: $PLATFORM" - exit 1 - ;; -esac - -case $ARCHITECTURE in - x64|arm64) - CHROMIUM_TARGET="chromium-$PLATFORM-$ARCHITECTURE.zip" - ;; - *) - echo "Unsupported architecture: $ARCHITECTURE" - exit 1 - ;; -esac - NVM_CMD="source $NVM_DIR/nvm.sh && nvm use" if [ "$PLATFORM" = "windows" ]; then NVM_CMD="volta install node@`cat ../../OpenSearch-Dashboards/.nvmrc` && volta install yarn@`jq -r '.engines.yarn' ../../OpenSearch-Dashboards/package.json`" fi -CHROMIUM_URL="https://github.com/opensearch-project/dashboards-reports/releases/download/chromium-1.12.0.0/$CHROMIUM_TARGET" - MINOR_VERSION=${VERSION%.*} git clone --branch $MINOR_VERSION --single-branch https://github.com/opensearch-project/OpenSearch-Dashboards ../../OpenSearch-Dashboards || echo repo exists mkdir -p ../../OpenSearch-Dashboards/plugins @@ -116,13 +90,6 @@ echo "BUILD RELEASE ZIP FOR $PLUGIN_NAME" (cd ../../OpenSearch-Dashboards && eval $NVM_CMD && cd plugins/$PLUGIN_FOLDER && yarn plugin_helpers build --opensearch-dashboards-version=$VERSION$QUALIFIER_IDENTIFIER) ZIP_NAME=`ls ../../OpenSearch-Dashboards/plugins/$PLUGIN_FOLDER/build | grep .zip` unzip ../../OpenSearch-Dashboards/plugins/$PLUGIN_FOLDER/build/$ZIP_NAME -d ../../OpenSearch-Dashboards/plugins/$PLUGIN_FOLDER/build/ -# Reporting uses headless chromium to generate reports, which needs to be included in its artifact -echo "DOWNLOADING CHROMIUM FOR $PLUGIN_NAME" -mkdir -p ../../OpenSearch-Dashboards/plugins/$PLUGIN_FOLDER/build/opensearch-dashboards/$PLUGIN_NAME -curl -SL "$CHROMIUM_URL" -o $CHROMIUM_TARGET -echo "PUTTING CHROMIUM INSIDE $PLUGIN_NAME-$VERSION$QUALIFIER_IDENTIFIER.zip" -unzip "$CHROMIUM_TARGET" -d ../../OpenSearch-Dashboards/plugins/$PLUGIN_FOLDER/build/opensearch-dashboards/$PLUGIN_NAME -(cd ../../OpenSearch-Dashboards/plugins/$PLUGIN_FOLDER/build && zip -ur $PLUGIN_NAME-$VERSION$QUALIFIER_IDENTIFIER.zip opensearch-dashboards) echo "COPY $PLUGIN_NAME.zip" cp -r ../../OpenSearch-Dashboards/plugins/$PLUGIN_FOLDER/build/$PLUGIN_NAME-$VERSION$QUALIFIER_IDENTIFIER.zip $OUTPUT/plugins/ rm -rf ../../OpenSearch-Dashboards/plugins/$PLUGIN_FOLDER From 0cb810909dc2f61c79449bc93e823cc3945d6be6 Mon Sep 17 00:00:00 2001 From: Rupal Mahajan Date: Fri, 6 Jan 2023 23:41:05 +0000 Subject: [PATCH 2/5] ignore architecture Signed-off-by: Rupal Mahajan --- scripts/components/reportsDashboards/build.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/components/reportsDashboards/build.sh b/scripts/components/reportsDashboards/build.sh index 3c375d057b..dd53de289a 100755 --- a/scripts/components/reportsDashboards/build.sh +++ b/scripts/components/reportsDashboards/build.sh @@ -17,7 +17,7 @@ function usage() { echo -e "-q QUALIFIER\t[Optional] Version qualifier." echo -e "-s SNAPSHOT\t[Optional] Build a snapshot, default is 'false'." echo -e "-p PLATFORM\t[Optional] Platform, default is 'uname -s'." - echo -e "-a ARCHITECTURE\t[Optional] Build architecture, default is 'uname -m'." + echo -e "-a ARCHITECTURE\t[Optional] Build architecture, ignored." echo -e "-o OUTPUT\t[Optional] Output path, default is 'artifacts'." echo -e "-h help" } From 8a0537d99869a7f780e02870c3305bf2ed9d2cc5 Mon Sep 17 00:00:00 2001 From: Rupal Mahajan Date: Mon, 9 Jan 2023 17:04:53 +0000 Subject: [PATCH 3/5] Remove build script for dashboards reporting Signed-off-by: Rupal Mahajan --- scripts/components/reportsDashboards/build.sh | 96 ------------------- 1 file changed, 96 deletions(-) delete mode 100755 scripts/components/reportsDashboards/build.sh diff --git a/scripts/components/reportsDashboards/build.sh b/scripts/components/reportsDashboards/build.sh deleted file mode 100755 index dd53de289a..0000000000 --- a/scripts/components/reportsDashboards/build.sh +++ /dev/null @@ -1,96 +0,0 @@ -#!/bin/bash - -# Copyright OpenSearch Contributors -# SPDX-License-Identifier: Apache-2.0 -# -# The OpenSearch Contributors require contributions made to -# this file be licensed under the Apache-2.0 license or a -# compatible open source license. - -set -ex - -function usage() { - echo "Usage: $0 [args]" - echo "" - echo "Arguments:" - echo -e "-v VERSION\t[Required] OpenSearch version." - echo -e "-q QUALIFIER\t[Optional] Version qualifier." - echo -e "-s SNAPSHOT\t[Optional] Build a snapshot, default is 'false'." - echo -e "-p PLATFORM\t[Optional] Platform, default is 'uname -s'." - echo -e "-a ARCHITECTURE\t[Optional] Build architecture, ignored." - echo -e "-o OUTPUT\t[Optional] Output path, default is 'artifacts'." - echo -e "-h help" -} - -while getopts ":h:v:q:s:o:p:a:" arg; do - case $arg in - h) - usage - exit 1 - ;; - v) - VERSION=$OPTARG - ;; - q) - QUALIFIER=$OPTARG - ;; - s) - SNAPSHOT=$OPTARG - ;; - o) - OUTPUT=$OPTARG - ;; - p) - PLATFORM=$OPTARG - ;; - a) - ARCHITECTURE=$OPTARG - ;; - :) - echo "Error: -${OPTARG} requires an argument" - usage - exit 1 - ;; - ?) - echo "Invalid option: -${arg}" - exit 1 - ;; - esac -done - -if [ -z "$VERSION" ]; then - echo "Error: You must specify the OpenSearch Dashboards version" - usage - exit 1 -fi - -[ -z "$OUTPUT" ] && OUTPUT=artifacts -[ -z "$PLATFORM" ] && PLATFORM=$(uname -s | awk '{print tolower($0)}') -[ ! -z "$QUALIFIER" ] && QUALIFIER_IDENTIFIER="-$QUALIFIER" - -NVM_CMD="source $NVM_DIR/nvm.sh && nvm use" -if [ "$PLATFORM" = "windows" ]; then - NVM_CMD="volta install node@`cat ../../OpenSearch-Dashboards/.nvmrc` && volta install yarn@`jq -r '.engines.yarn' ../../OpenSearch-Dashboards/package.json`" -fi - -MINOR_VERSION=${VERSION%.*} -git clone --branch $MINOR_VERSION --single-branch https://github.com/opensearch-project/OpenSearch-Dashboards ../../OpenSearch-Dashboards || echo repo exists -mkdir -p ../../OpenSearch-Dashboards/plugins - -mkdir -p $OUTPUT/plugins -# For hybrid plugin it actually resides in 'reportsDashboards/dashboards-reports' -PLUGIN_FOLDER=$(basename "$PWD") -PLUGIN_NAME=$(basename $(dirname "$PWD")) -# TODO: [CLEANUP] Needed OpenSearch Dashboards git repo to build the required modules for plugins -# This makes it so there is a dependency on having Dashboards pulled already. -cp -r ../$PLUGIN_FOLDER/ ../../OpenSearch-Dashboards/plugins -echo "BUILD MODULES FOR $PLUGIN_NAME" -(cd ../../OpenSearch-Dashboards && eval $NVM_CMD && yarn osd bootstrap) -echo "BUILD RELEASE ZIP FOR $PLUGIN_NAME" -(cd ../../OpenSearch-Dashboards && eval $NVM_CMD && cd plugins/$PLUGIN_FOLDER && yarn plugin_helpers build --opensearch-dashboards-version=$VERSION$QUALIFIER_IDENTIFIER) -ZIP_NAME=`ls ../../OpenSearch-Dashboards/plugins/$PLUGIN_FOLDER/build | grep .zip` -unzip ../../OpenSearch-Dashboards/plugins/$PLUGIN_FOLDER/build/$ZIP_NAME -d ../../OpenSearch-Dashboards/plugins/$PLUGIN_FOLDER/build/ -echo "COPY $PLUGIN_NAME.zip" -cp -r ../../OpenSearch-Dashboards/plugins/$PLUGIN_FOLDER/build/$PLUGIN_NAME-$VERSION$QUALIFIER_IDENTIFIER.zip $OUTPUT/plugins/ -rm -rf ../../OpenSearch-Dashboards/plugins/$PLUGIN_FOLDER - From 51ad246545127adeb46d97890158e9e8f6730325 Mon Sep 17 00:00:00 2001 From: Rupal Mahajan Date: Mon, 9 Jan 2023 20:21:31 +0000 Subject: [PATCH 4/5] remove custom build script for observabilityDashboards Signed-off-by: Rupal Mahajan --- .../observabilityDashboards/build.sh | 88 ------------------- 1 file changed, 88 deletions(-) delete mode 100755 scripts/components/observabilityDashboards/build.sh diff --git a/scripts/components/observabilityDashboards/build.sh b/scripts/components/observabilityDashboards/build.sh deleted file mode 100755 index bb05f3f48b..0000000000 --- a/scripts/components/observabilityDashboards/build.sh +++ /dev/null @@ -1,88 +0,0 @@ -#!/bin/bash - -# Copyright OpenSearch Contributors -# SPDX-License-Identifier: Apache-2.0 -# -# The OpenSearch Contributors require contributions made to -# this file be licensed under the Apache-2.0 license or a -# compatible open source license. - -set -ex - -function usage() { - echo "Usage: $0 [args]" - echo "" - echo "Arguments:" - echo -e "-v VERSION\t[Required] OpenSearch version." - echo -e "-q QUALIFIER\t[Optional] Version qualifier." - echo -e "-s SNAPSHOT\t[Optional] Build a snapshot, default is 'false'." - echo -e "-p PLATFORM\t[Optional] Platform, ignored." - echo -e "-a ARCHITECTURE\t[Optional] Build architecture, ignored." - echo -e "-o OUTPUT\t[Optional] Output path, default is 'artifacts'." - echo -e "-h help" -} - -while getopts ":h:v:q:s:o:p:a:" arg; do - case $arg in - h) - usage - exit 1 - ;; - v) - VERSION=$OPTARG - ;; - q) - QUALIFIER=$OPTARG - ;; - s) - SNAPSHOT=$OPTARG - ;; - o) - OUTPUT=$OPTARG - ;; - p) - PLATFORM=$OPTARG - ;; - a) - ARCHITECTURE=$OPTARG - ;; - :) - echo "Error: -${OPTARG} requires an argument" - usage - exit 1 - ;; - ?) - echo "Invalid option: -${arg}" - exit 1 - ;; - esac -done - -if [ -z "$VERSION" ]; then - echo "Error: You must specify the OpenSearch Dashboards version" - usage - exit 1 -fi - -[ -z "$OUTPUT" ] && OUTPUT=artifacts -[ ! -z "$QUALIFIER" ] && QUALIFIER_IDENTIFIER="-$QUALIFIER" - -NVM_CMD="source $NVM_DIR/nvm.sh && nvm use" -if [ "$PLATFORM" = "windows" ]; then - NVM_CMD="volta install node@`cat ../../OpenSearch-Dashboards/.nvmrc` && volta install yarn@`jq -r '.engines.yarn' ../../OpenSearch-Dashboards/package.json`" -fi - -mkdir -p $OUTPUT/plugins -# For hybrid plugin it actually resides in 'observability/dashboards-observability' -PLUGIN_FOLDER=$(basename "$PWD") -PLUGIN_NAME=$(basename $(dirname "$PWD")) -# TODO: [CLEANUP] Needed OpenSearch Dashboards git repo to build the required modules for plugins -# This makes it so there is a dependency on having Dashboards pulled already. -cp -r ../$PLUGIN_FOLDER/ ../../OpenSearch-Dashboards/plugins -echo "BUILD MODULES FOR $PLUGIN_NAME" -(cd ../../OpenSearch-Dashboards && eval $NVM_CMD && yarn osd bootstrap) -echo "BUILD RELEASE ZIP FOR $PLUGIN_NAME" -(cd ../../OpenSearch-Dashboards && eval $NVM_CMD && cd plugins/$PLUGIN_FOLDER && yarn plugin_helpers build --opensearch-dashboards-version=$VERSION$QUALIFIER_IDENTIFIER) -echo "COPY $PLUGIN_NAME.zip" -cp -r ../../OpenSearch-Dashboards/plugins/$PLUGIN_FOLDER/build/$PLUGIN_NAME-$VERSION$QUALIFIER_IDENTIFIER.zip $OUTPUT/plugins/ -rm -rf ../../OpenSearch-Dashboards/plugins/$PLUGIN_FOLDER From 6bf7cb0e5ff7accee3fd5d0d3e9865a9ed73d8b8 Mon Sep 17 00:00:00 2001 From: Rupal Mahajan Date: Mon, 9 Jan 2023 20:31:05 +0000 Subject: [PATCH 5/5] remove custom build script for queryWorkbenchDashboards Signed-off-by: Rupal Mahajan --- .../queryWorkbenchDashboards/build.sh | 88 ------------------- 1 file changed, 88 deletions(-) delete mode 100755 scripts/components/queryWorkbenchDashboards/build.sh diff --git a/scripts/components/queryWorkbenchDashboards/build.sh b/scripts/components/queryWorkbenchDashboards/build.sh deleted file mode 100755 index fd4df45367..0000000000 --- a/scripts/components/queryWorkbenchDashboards/build.sh +++ /dev/null @@ -1,88 +0,0 @@ -#!/bin/bash - -# Copyright OpenSearch Contributors -# SPDX-License-Identifier: Apache-2.0 -# -# The OpenSearch Contributors require contributions made to -# this file be licensed under the Apache-2.0 license or a -# compatible open source license. - -set -ex - -function usage() { - echo "Usage: $0 [args]" - echo "" - echo "Arguments:" - echo -e "-v VERSION\t[Required] OpenSearch version." - echo -e "-q QUALIFIER\t[Optional] Version qualifier." - echo -e "-s SNAPSHOT\t[Optional] Build a snapshot, default is 'false'." - echo -e "-p PLATFORM\t[Optional] Platform, ignored." - echo -e "-a ARCHITECTURE\t[Optional] Build architecture, ignored." - echo -e "-o OUTPUT\t[Optional] Output path, default is 'artifacts'." - echo -e "-h help" -} - -while getopts ":h:v:q:s:o:p:a:" arg; do - case $arg in - h) - usage - exit 1 - ;; - v) - VERSION=$OPTARG - ;; - q) - QUALIFIER=$OPTARG - ;; - s) - SNAPSHOT=$OPTARG - ;; - o) - OUTPUT=$OPTARG - ;; - p) - PLATFORM=$OPTARG - ;; - a) - ARCHITECTURE=$OPTARG - ;; - :) - echo "Error: -${OPTARG} requires an argument" - usage - exit 1 - ;; - ?) - echo "Invalid option: -${arg}" - exit 1 - ;; - esac -done - -if [ -z "$VERSION" ]; then - echo "Error: You must specify the OpenSearch Dashboards version" - usage - exit 1 -fi - -[ -z "$OUTPUT" ] && OUTPUT=artifacts -[ ! -z "$QUALIFIER" ] && QUALIFIER_IDENTIFIER="-$QUALIFIER" - -NVM_CMD="source $NVM_DIR/nvm.sh && nvm use" -if [ "$PLATFORM" = "windows" ]; then - NVM_CMD="volta install node@`cat ../../OpenSearch-Dashboards/.nvmrc` && volta install yarn@`jq -r '.engines.yarn' ../../OpenSearch-Dashboards/package.json`" -fi - -mkdir -p $OUTPUT/plugins -# For hybrid plugin it actually resides in 'queryWorkbenchDashboards/workbench' -PLUGIN_FOLDER=$(basename "$PWD") -PLUGIN_NAME=$(basename $(dirname "$PWD")) -# TODO: [CLEANUP] Needed OpenSearch Dashboards git repo to build the required modules for plugins -# This makes it so there is a dependency on having Dashboards pulled already. -cp -r ../$PLUGIN_FOLDER/ ../../OpenSearch-Dashboards/plugins -echo "BUILD MODULES FOR $PLUGIN_NAME" -(cd ../../OpenSearch-Dashboards && eval $NVM_CMD && yarn osd bootstrap) -echo "BUILD RELEASE ZIP FOR $PLUGIN_NAME" -(cd ../../OpenSearch-Dashboards && eval $NVM_CMD && cd plugins/$PLUGIN_FOLDER && yarn plugin_helpers build --opensearch-dashboards-version=$VERSION$QUALIFIER_IDENTIFIER) -echo "COPY $PLUGIN_NAME.zip" -cp -r ../../OpenSearch-Dashboards/plugins/$PLUGIN_FOLDER/build/$PLUGIN_NAME-$VERSION$QUALIFIER_IDENTIFIER.zip $OUTPUT/plugins/ -rm -rf ../../OpenSearch-Dashboards/plugins/$PLUGIN_FOLDER