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 #435

Closed
wants to merge 3 commits into from

Conversation

kavilla
Copy link
Member

@kavilla kavilla commented Sep 9, 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?

  • Environment setup, this requires nvm and yarn to be already set up.
    We will need to set that up.
  • Signing of the artifact
  • Diff between release and snapshot
  • Default script for plugins, this will need more information on how we want this to
    look like.
  • All the other plugins included into the manifest.

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

Issues Resolved

#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.

yarn osd bootstrap

echo "Building artifact"
yarn build --skip-os-packages --release
Copy link
Member Author

Choose a reason for hiding this comment

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

We are working on actually working on de-coupling things here: opensearch-project/OpenSearch-Dashboards#473

For now this will build all the non-OS Packages artifacts and then it will just grab the one it needs.

@codecov-commenter
Copy link

codecov-commenter commented Sep 9, 2021

Codecov Report

❗ No coverage uploaded for pull request base (main@a0f2614). Click here to learn what that means.
The diff coverage is n/a.

Impacted file tree graph

@@           Coverage Diff           @@
##             main     #435   +/-   ##
=======================================
  Coverage        ?   69.31%           
=======================================
  Files           ?       58           
  Lines           ?     1509           
  Branches        ?        0           
=======================================
  Hits            ?     1046           
  Misses          ?      463           
  Partials        ?        0           

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 a0f2614...0142caf. Read the comment docs.

./"${OUTPUT}"/bundle/opensearch-dashboards/bin/opensearch-dashboards-plugin --allow-root install file:./plugins/$PLUGIN_NAME/build/$PLUGIN_NAME-$VERSION.zip
done


Copy link
Member Author

Choose a reason for hiding this comment

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

TODO: recreate the bundled tarball.

# - name: ganttChartDashboards
# repository: ????????
# ref: main
- name: OpenSearch-Dashboards
Copy link
Member Author

Choose a reason for hiding this comment

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

This needs to be last.

Copy link
Member

Choose a reason for hiding this comment

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

It shouldn't be last if each component only builds as part of build, and is installed as part of assemble.

Copy link
Member

@dblock dblock 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 good. Let's turn this into something we can start committing?


mkdir -p "${OUTPUT}/bundle/opensearch-dashboards"

# Untar for the plugins
Copy link
Member

Choose a reason for hiding this comment

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

You should not be installing plugins here, but let the assemble step take care of it one plugin at a time.

Copy link
Member

@peterzhuamazon peterzhuamazon left a comment

Choose a reason for hiding this comment

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

Hi @kavilla thanks for the initial scripts.

Please also check our old script for reference, you missed some steps such as adding the tweaked dashboards yml file, etc.

https://github.com/opensearch-project/opensearch-build/blob/main/release/tar/linux/opensearch-dashboards-tar-build.sh#L142-L143

mkdir -p "${OUTPUT}/bundle"
mkdir -p "${OUTPUT}/plugins"

# Release gets built to /target, regular non-tarball gets built to /build
Copy link
Member

Choose a reason for hiding this comment

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

This needs to be moved out into the assemble step.

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?
* Environment setup, this requires nvm and yarn to be already set up.
We will need to set that up.
* Signing of the artifact
* Diff between release and snapshot

Related Issue:
opensearch-project#158

Signed-off-by: Kawika Avilla <[email protected]>
There was conditional being checked if the plugin had the x.x.x.x
versioning while yarn plugin builder outputs regular semvar. Modified
the conditional to get building.

Moved the manifests to the correct location and updated to strings.

Signed-off-by: Kawika Avilla <[email protected]>
Signed-off-by: Kawika Avilla <[email protected]>
Copy link
Member

@dblock dblock left a comment

Choose a reason for hiding this comment

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

Does this work? If so can we get this to a merge-able PR please?

There's a bunch of refactoring to do avoid many of the if's, I can take it after it's merged.

@@ -48,6 +48,21 @@ $ pipenv --version
pipenv, version 19.0
```

#### Install NVM and Node
Copy link
Member

Choose a reason for hiding this comment

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

Add TOC.

@kavilla kavilla closed this Sep 24, 2021
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