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

[Build] bundle OpenSearch Dashboards #590

Merged

Conversation

kavilla
Copy link
Member

@kavilla kavilla commented Sep 24, 2021

Description

Produce an OpenSearch Dashboards bundle with plugins provided by a manifest.

This requires the manifest to be in order with plugins first and then Dashboards
being last. The plugins will need to pulled down and placed in the plugins
folder. Then we need to bootstrap to generate the modules so that we can actually
install the plugins to the release build.

What is missing or not verified

  • Environment setup, this requires nvm and yarn to be already set up.
    We will need to set that up.
  • Dropping the custom config into the bundle
  • Signing of the artifact
  • Tests

Signed-off-by: Kawika Avilla [email protected]

Issues Resolved

Partial #158

Check List

  • Commits are signed per the DCO using --signoff

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
For more information on following Developer Certificate of Origin and signing off your commits, please check here.

@kavilla kavilla force-pushed the avillk/osd_build_plugins_in_default branch from 7b2665c to b5f3140 Compare September 24, 2021 06:45
@kavilla
Copy link
Member Author

kavilla commented Sep 24, 2021

Previous PR: #435

@kavilla kavilla force-pushed the avillk/osd_build_plugins_in_default branch 3 times, most recently from 508c001 to 466268d Compare September 24, 2021 07:16
Produce an OpenSearch Dashboards bundle with plugins provided by a manifest.

This requires the manifest to be in order with plugins first and then Dashboards
being last. The plugins will need to pulled down and placed in the plugins
folder. Then we need to bootstrap to generate the modules so that we can actually
install the plugins to the release build.

What is missing or not verified
* Environment setup, this requires nvm and yarn to be already set up.
We will need to set that up.
* Dropping the custom config into the bundle
* Signing of the artifact
* Tests

Related Issue:
opensearch-project#158

Signed-off-by: Kawika Avilla <[email protected]>
@kavilla kavilla force-pushed the avillk/osd_build_plugins_in_default branch from 466268d to 4acf66c Compare September 24, 2021 07:19
@codecov-commenter
Copy link

codecov-commenter commented Sep 24, 2021

Codecov Report

Merging #590 (4acf66c) into main (1a7fefc) will decrease coverage by 0.18%.
The diff coverage is 64.28%.

Impacted file tree graph

@@            Coverage Diff             @@
##             main     #590      +/-   ##
==========================================
- Coverage   82.65%   82.46%   -0.19%     
==========================================
  Files          61       61              
  Lines        1660     1671      +11     
==========================================
+ Hits         1372     1378       +6     
- Misses        288      293       +5     
Impacted Files Coverage Δ
bundle-workflow/src/build_workflow/builder.py 95.65% <50.00%> (-4.35%) ⬇️
bundle-workflow/src/assemble_workflow/bundle.py 92.20% <60.00%> (-4.90%) ⬇️
...ndle-workflow/src/build_workflow/build_recorder.py 100.00% <100.00%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 1a7fefc...4acf66c. Read the comment docs.

@dblock
Copy link
Member

dblock commented Sep 24, 2021

Good. I can take the refactoring of the dashboards if on top of this.

Copy link
Member

@saratvemulapalli saratvemulapalli left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is nice, love to see Dashboards coming along quickly.

Comment on lines +68 to +88
mkdir -p $OUTPUT/plugins
PLUGIN_NAME=$(basename "$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_NAME/ ../OpenSearch-Dashboards/plugins
echo "BUILD MODULES FOR $PLUGIN_NAME"
(cd ../OpenSearch-Dashboards && yarn osd bootstrap)
echo "BUILD RELEASE ZIP FOR $PLUGIN_NAME"
(cd ../OpenSearch-Dashboards/plugins/$PLUGIN_NAME && yarn plugin-helpers build)
echo "COPY $PLUGIN_NAME.zip"
cp -r ../OpenSearch-Dashboards/plugins/$PLUGIN_NAME/build/$PLUGIN_NAME-$VERSION.zip $OUTPUT/plugins/
else
./gradlew assemble --no-daemon --refresh-dependencies -DskipTests=true -Dopensearch.version=$VERSION -Dbuild.snapshot=$SNAPSHOT

zipPath=$(find . -path \*build/distributions/*.zip)
distributions="$(dirname "${zipPath}")"

echo "COPY ${distributions}/*.zip"
mkdir -p $OUTPUT/plugins
cp ${distributions}/*.zip ./$OUTPUT/plugins
fi
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should test these scripts as part of our CI workflows.
A follow up for both OpenSearch and Dashboards.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Opened up an issue: #591

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants