-
Notifications
You must be signed in to change notification settings - Fork 911
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
[PROPOSAL] Introduce an OpenSearch-Dashboards SDK #2608
Comments
They actually don't have to if they set a reserve word in the |
@dblock I have a few question's about this approach.
|
This will need a design from people who understand the underlying tech better. UI extension points will need to be documented and follow semver is a given. Should I be able to author react components in a different version of React and Dashboards support that (microfrontends)? Maybe. From the developer point of view in a scenario of alerts/monitors I'd like to be able to create a bar chart visualization in extension A, allow a user to right click on a column, choose "Create Monitor" (coming from extension B), and then see an alert rendered on that visualization (implemented in extension C that displays alerts). I don't know how best to accomplish that.
Yes. An extension should be able to expose its own extension points and follow its own semver. An extension consuming that would declare that it needs Dashboards ~> X.Y and Extension ~> Y.Z installed. |
for extensibility, I'm looking forward to see SDK extension experience like https://vscode.dev/ |
@dblock this is a little bit vague, need clarification Relax version check from OSD to OS, or release plugin's version check to OSD. or both |
There are a couple of areas that I often see from the orbiting the Security space to include in this new design, if we built up these areas we can create better user experiences and unlock plugins for Dashboards we've never seen before. Ways to know users permissionsThere are some ugly user experiences where Dashboards plugins are unaware of what the user's capabilities are. This often manifests in buttons / actions they are shown, but fail after the action is rejected by an OpenSearch API call. While building up this SDK for Dashboards extension there is a opportunity to make sure permissions are accessible and that features added by plugins can express those permissions. Create rich plugins without a OpenSearch Core pluginMost of the todays Dashboards plugins that have in a 'read-only' way - there is a backend component that has read/write capabilities but the visualization component don't have a separate data layer. This necessitates that a Dashboards plugins require a OpenSearch Plugin running on the backend - a big adoption bottleneck. Some plugins will absolutely depend on an OpenSearch Plugin, but for visualization focused experiences its not necessary with data storage is easy and trustworthy. Secure all metadataI am guessing on the utility of this one - today this isolation is only possible with a side-by-side OpenSearch plugin Today dashboards data is all stored in an index that is fully accessible. Consider sensitive annotations like 'security breach detected' that should have limited read or update access. More than just moving to a hidden index, Dashboard Extension shouldn't be able to read everything by default, its should have limits to what it can do. A simpler example, user specific settings it could be nice to store them on Dashboards so if you changed browser windows or computers the settings followed you. |
@dblock if we want to address the build overhead due to versioning, do we really need to build a sophisticated extension framework? As @kavilla mentioned in this thread, developers can specify their plugin version to match building OpenSearch Dashboards version in the plugin manifest file, so that they can just build and release new version without making code change. Regarding the release process, shall we consider doing something like merging all plugins into one single OpenSearch Dashboards repository, so that all build and release can be unified into the same place? That mono-repo approach is what Elasticsearch and Kibana have been doing for years. They even have their commercial feature and OSS feature in the same repo and control what to be released in their build process. |
I think one of the major goals of this SDK is the empower extension developers more. The ideal state being we have a bunch of community extensions not under the OpenSearch project. So if abstract stuff into the SDK and verify compatibility with the SDK, then we and extension developers have more insight about versioning and we can feel more confident about breaking changes. |
If we want to solve the version compatibility problem, I think we need to ensure complete functional test being executed for all plugins with each new version of OpenSearch Dashboards, to ensure all functions are working as expected. A mono-repo can solve this in a pretty straight forward way. Or with separate repositories, we can built some sort of notification mechanism so that all changes to OpenSearch Dashboards repo will generate a notification event. Then all plugins can subscribe to that event and execute their tests to ensure the plugin works with new OpenSearch Dashboards changes. Community 3rd party plugin developers can also subscribe to that event and automate their tests with new Dashboards if they want. With regard to the SDK and extensions, does the extensions run as a separate process out side of OpenSearch Dashboards process or it still runs in the Dashboards process like plugins today? |
👍 to this one. Right now the saved objects construct in Dashboards is way too coupled with OpenSearch. As we think of the future of sharing with Dashboards (i.e. what today is somewhat fulfilled by Tenants, cc @shanilpa), we will have to provide data isolation purely inside of the Dashboards application (decoupling the metadata store), and we should account for extensions in doing so, being able to give them access to some metadata (i.e. "sharing" with the extension). |
Thanks @dblock for the proposal.
💯 We should strive to expose simple interfaces for developers to consume while not having to worry about versions of Dashboards.
I love where we are starting and excited to see this rolling. |
Related #2880 to interfaces that plugins utilized. |
Is your feature request related to a problem? Please describe.
Around 2015, Kibana started offering a plugin system, but no public plugin APIs. By 2020, before the OpenSearch fork, it has launched the Kibana Development Platform that significantly improved plugin development, including foundational APIs, and runtime isolation. Plugins can register HTTP endpoints and UI applications, query and create back-end data, and provide generic services to other plugins.
Post-fork, the major problems in extensibility that remain unsolved are as follows:
Describe the solution you'd like
tl;dr An OpenSearch Dashboards SDK, similar to OpenSearch: https://github.com/opensearch-project/opensearch-sdk-java.
Since OpenSearch adopted semver at fork it may seem like we can now relax the exact version check (problem 1), and assume that a plugin developed during 2.3.0 will work with the next release of OpenSearch Dashboards, 2.4.0. This is because per semver, as plugins reach deep into
@osd/core/server
we can safely assume that those interfaces don't change between 2.3.0 and 2.4.0. Or do they? Well, maintaining semver in all OpenSearch Dashboards interfaces seems quite difficult, and relies on maintainers to be extra careful about changing anything. TODO: @kavilla a specific example pls?An SDK solves this by providing a logical and physical separation.
An SDK provides a logical separation. The SDK will only contain the set of APIs that need to follow semver, significantly reducing the surface of APIs that OpenSearch Dashboards needs to worry about since plugins only take a dependency on the SDK. Backwards incompatible changes can be immediately caught by testing every API in an already shipped SDK against all released versions of OpenSearch Dashboards (including the next version). Thus, we guarantee backwards and forwards compatibility. With a semver-stable SDK plugins should be able to confidently declare that they work with OpenSearch Dashboards
>= 2.3.0
or~> 2.5
. The SDK could provide support for integration testing against those versions. Finally, an SDK can begin selecting common functionality that all plugins may need, such as storing credentials or saving objects, and be strongly opinionated about what constitutes a semver-compatible extension point for OpenSearch Dashboards.An SDK provides a physical separation. The SDK would be much smaller than Dashboards. Thus, to develop a plugin on top of an SDK, no need to check out and build the kitchen sink, much less a specific version of the kitchen sink. The SDK can be published to npm, and follow its own semver, and document only the public interfaces it contains. It can also implement wrappers that translate for multiple major versions of OpenSearch Dashboards, extending compatibility much further, enabling developers to write plugins once for several versions of OpenSearch. Testing your custom plugin should be done against a released, downloaded, and stable version of OpenSearch Dashboards.
There are downsides to an SDK: it's a standalone additional project. It will have to forward/copy code/interfaces. What else?
Describe alternatives you've considered
Additional context
I propose we call plugins that use the SDK extensions to make it easy to identify those by a set of new capabilities (broad version compatibility), and match how OpenSearch is thinking about extensibility.
The remaining questions are:
Some related issues:
yarn opensearch
arg to setup dependencies #2544The text was updated successfully, but these errors were encountered: