-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Enable adding experimental features through sandbox modules (#691)
OpenSearch uses plugins to add new features. A plugin can be included in the distribution by default (as part of *modules* directory) or can be installed optionally from a plugin repository. This change provides a separate space called *sandbox* inside OpenSearch for the community to easily experiment new ideas and innovate. Ideally, this is where an experimental feature will reside before it can be promoted to the *modules* directory. All the plugins in this module will only be included in the **snapshot distributions**. During assembling distributions, we will check if the following two conditions are met to include the sandbox modules, * the distribution is a snapshot i.e. the build system property `build.snapshot` is set to true. We use this because it will prevent accidental bundling of these modules in a release distribution. * the `enable.sandbox` system property is set to true. By default it is set to true. The purpose of adding this extra flag is that we can exclude the modules from snapshots if needed. For example, we may want to run performance tests on snapshots without the sandbox modules. Signed-off-by: Rabi Panda <[email protected]>
- Loading branch information
Showing
7 changed files
with
146 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
/* | ||
* 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. | ||
*/ | ||
|
||
/** | ||
* This module provides a space in OpenSearch for the community to easily experiment with new ideas and innovate. | ||
* Ideally, this is where an experimental features will reside before it can be promoted to the corresponding directory | ||
* in the project root. The sandbox module contains three subdirectories, that mirror the root libs, modules and | ||
* plugins directories, each with similar intention. | ||
* | ||
* All artifacts from the sandbox/libs and sandbox/modules will be included in the snapshot distributions automatically. | ||
* During assembling distributions, however, we will check if the following two conditions are met, for including the | ||
* sandbox modules, | ||
* 1. The distribution is a snapshot i.e. the build system property build.snapshot is set to true. We use this because, | ||
* it will prevent accidental inclusion of these artifacts in a release distribution. | ||
* | ||
* 2. The sandbox.enabled system property is set to true. This new extra flag is added because we can exclude the | ||
* modules from the snapshot distributions, if needed. For instance, we may want to run performance tests on snapshots | ||
* without the sandbox modules. | ||
* | ||
* To build the distributions without the sandbox modules, | ||
* ./gradlew assemble -Dsandbox.enabled=false | ||
* | ||
* Similarly we can run OpenSearch from source without the sandbox modules | ||
* ./gradlew run -Dsandbox.enabled=false | ||
*/ | ||
subprojects { | ||
group = 'org.opensearch.sandbox' | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
/* | ||
* 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. | ||
*/ | ||
|
||
subprojects { | ||
/* | ||
* All subprojects are java projects using OpenSearch's standard build | ||
* tools. | ||
*/ | ||
apply plugin: 'opensearch.build' | ||
|
||
/* | ||
* Subprojects may depend on the "core" lib but may not depend on any | ||
* other libs. This keeps our dependencies simpler. | ||
*/ | ||
project.afterEvaluate { | ||
configurations.all { Configuration conf -> | ||
dependencies.matching { it instanceof ProjectDependency }.all { ProjectDependency dep -> | ||
Project depProject = dep.dependencyProject | ||
if (depProject != null | ||
&& false == depProject.path.equals(':libs:opensearch-core') | ||
&& depProject.path.startsWith(':libs')) { | ||
throw new InvalidUserDataException("projects in :libs " + | ||
"may not depend on other projects libs except " + | ||
":libs:opensearch-core but " + | ||
"${project.path} depends on ${depProject.path}") | ||
} | ||
} | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
/* | ||
* 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. | ||
*/ | ||
|
||
configure(subprojects.findAll { it.parent.path == project.path }) { | ||
group = 'org.opensearch.sandbox' | ||
apply plugin: 'opensearch.testclusters' | ||
apply plugin: 'opensearch.opensearchplugin' | ||
|
||
opensearchplugin { | ||
name project.name | ||
licenseFile rootProject.file('licenses/APACHE-LICENSE-2.0.txt') | ||
noticeFile rootProject.file('NOTICE.txt') | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
/* | ||
* 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. | ||
*/ | ||
|
||
configure(subprojects.findAll { it.parent.path == project.path }) { | ||
group = 'org.opensearch.sandbox' | ||
apply plugin: 'opensearch.testclusters' | ||
apply plugin: 'opensearch.opensearchplugin' | ||
|
||
opensearchplugin { | ||
name project.name | ||
licenseFile rootProject.file('licenses/APACHE-LICENSE-2.0.txt') | ||
noticeFile rootProject.file('NOTICE.txt') | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters