Skip to content

Commit

Permalink
Initial Configuration for the repository (#2)
Browse files Browse the repository at this point in the history
Signed-off-by: Mohit Godwani <[email protected]>
  • Loading branch information
mgodwan authored Jul 15, 2024
1 parent 22845b6 commit e3b4fc6
Show file tree
Hide file tree
Showing 13 changed files with 1,134 additions and 8 deletions.
67 changes: 67 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@

# intellij files
.idea/
*.iml
*.ipr
*.iws
build-idea/
out/

# include shared intellij config
!.idea/inspectionProfiles/Project_Default.xml
!.idea/runConfigurations/Debug_OpenSearch.xml
!.idea/vcs.xml
!.idea/icon.svg

# These files are generated in the main tree by annotation processors
benchmarks/src/main/generated/*
benchmarks/bin/*
benchmarks/build-eclipse-default/*
server/bin/*
server/build-eclipse-default/*
test/framework/build-eclipse-default/*

# eclipse files
.project
.classpath
.settings
build-eclipse/

# netbeans files
nb-configuration.xml
nbactions.xml

# gradle stuff
.gradle/
build/

# vscode stuff
.vscode/

# testing stuff
**/.local*
.vagrant/
/logs/

# osx stuff
.DS_Store

# default folders in which the create_bwc_index.py expects to find old es versions in
/backwards
/dev-tools/backwards

# needed in case docs build is run...maybe we can configure doc build to generate files under build?
html_docs

# random old stuff that we should look at the necessity of...
/tmp/
eclipse-build

# projects using testfixtures
testfixtures_shared/

# These are generated from .ci/jobs.t
.ci/jobs/

# build files generated
doc-tools/missing-doclet/bin/
33 changes: 33 additions & 0 deletions .whitesource
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
{
"scanSettings": {
"configMode": "AUTO",
"configExternalURL": "",
"projectToken": "",
"baseBranches": []
},
"scanSettingsSAST": {
"enableScan": false,
"scanPullRequests": false,
"incrementalScan": true,
"baseBranches": [],
"snippetSize": 10
},
"checkRunSettings": {
"vulnerableCheckRunConclusionLevel": "failure",
"displayMode": "diff",
"useMendCheckNames": true
},
"checkRunSettingsSAST": {
"checkRunConclusionLevel": "failure",
"severityThreshold": "high"
},
"issueSettings": {
"minSeverityLevel": "LOW",
"issueType": "DEPENDENCY"
},
"remediateSettings": {
"workflowRules": {
"enabled": true
}
}
}
15 changes: 15 additions & 0 deletions MAINTAINERS.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
This document contains a list of maintainers in this repo. See [opensearch-project/.github/RESPONSIBILITIES.md](https://github.com/opensearch-project/.github/blob/main/RESPONSIBILITIES.md#maintainer-responsibilities) that explains what the role of maintainer means, what maintainers do in this and other repos, and how they should be doing it. If you're interested in contributing, and becoming a maintainer, see [CONTRIBUTING](CONTRIBUTING.md).

## Current Maintainers

| Maintainer | GitHub ID | Affiliation |
|----------------|---------------------------------------------------|-------------|
| Ankit Kala | [ankitkala](https://github.com/ankitkala) | Amazon |
| Mohit Godwani | [mgodwan](https://github.com/mgodwan) | Amazon |
| Prabhakar Sithanandam | [backslasht](https://github.com/backslasht) | Amazon |
| Shweta Thareja | [shwetathareja](https://github.com/shwetathareja) | Amazon |

## Emeritus

| Maintainer | GitHub ID | Affiliation |
|-------------| ------------------------------------------ | ----------- |
3 changes: 2 additions & 1 deletion NOTICE
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
OpenSearch (https://opensearch.org)
Copyright OpenSearch Contributors
11 changes: 4 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,8 @@
## My Project
## OpenSearch System Templates

TODO: Fill this README out!

Be sure to:

* Change the title in this README
* Edit your repository description on GitHub
The repository is a plugin which acts as a repository for system templates which should be loaded as part of the cluster setup.
These contain application based configuration templates which are used to provide sensible defaults for various use-cases
for which users may be using OpenSearch.

## Security

Expand Down
235 changes: 235 additions & 0 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,235 @@
/*
* 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.
*
* Modifications Copyright OpenSearch Contributors. See
* GitHub history for details.
*/

/*
* Licensed to Elasticsearch under one or more contributor
* license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright
* ownership. Elasticsearch licenses this file to you under
* the Apache License, Version 2.0 (the "License"); you may
* not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/

buildscript {
ext {
opensearch_group = "org.opensearch"
opensearch_version = System.getProperty("opensearch.version", "3.0.0-SNAPSHOT")
isSnapshot = "true" == System.getProperty("build.snapshot", "true")
buildVersionQualifier = System.getProperty("build.version_qualifier", "")
}

repositories {
mavenLocal()
mavenCentral()
maven { url "https://aws.oss.sonatype.org/content/repositories/snapshots" }
maven { url "https://plugins.gradle.org/m2/" }
}

dependencies {
classpath "${opensearch_group}.gradle:build-tools:${opensearch_version}"
classpath "org.jacoco:org.jacoco.agent:0.8.5"
}
}

plugins {
id 'java'
id 'com.diffplug.spotless' version '6.25.0'
}

apply plugin: 'opensearch.opensearchplugin'
apply plugin: 'opensearch.internal-cluster-test'
apply plugin: 'opensearch.pluginzip'
apply plugin: 'opensearch.rest-test'
apply from: 'gradle/formatting.gradle'

repositories {
mavenLocal()
mavenCentral()
maven { url "https://plugins.gradle.org/m2/" }
maven { url "https://aws.oss.sonatype.org/content/repositories/snapshots" }
}

allprojects {
group 'org.opensearch'
version = opensearch_version.tokenize('-')[0] + '.0'
if (buildVersionQualifier) {
version += "-${buildVersionQualifier}"
}
if (isSnapshot) {
version += "-SNAPSHOT"
}

java {
targetCompatibility = JavaVersion.VERSION_21
sourceCompatibility = JavaVersion.VERSION_21
}
}

opensearchplugin {
name 'opensearch-system-templates'
description 'OpenSearch plugin that provides basic application based configuration templates.'
classname 'org.opensearch.system.applicationtemplates.ApplicationBasedConfigurationSystemTemplatesPlugin'
licenseFile rootProject.file('LICENSE')
noticeFile rootProject.file('NOTICE')
}

dependencies {
implementation "org.opensearch:opensearch-common:${opensearch_version}"
implementation "org.opensearch:opensearch-core:${opensearch_version}"
implementation "org.opensearch:opensearch-x-content:${opensearch_version}"
}

allprojects {
// Default to the apache license
project.ext.licenseName = 'The Apache Software License, Version 2.0'
project.ext.licenseUrl = 'http://www.apache.org/licenses/LICENSE-2.0.txt'
publishing {
repositories {
maven {
name = 'staging'
url = "${rootProject.buildDir}/local-staging-repo"
}
}
publications {
// add license information to generated poms
pluginZip(MavenPublication) { publication ->
pom {
name = "opensearch-system-templates"
description = "OpenSearch plugin that provides basic application based configuration templates."
}
pom.withXml { XmlProvider xml ->
Node node = xml.asNode()
node.appendNode('inceptionYear', '2021')

Node license = node.appendNode('licenses').appendNode('license')
license.appendNode('name', project.licenseName)
license.appendNode('url', project.licenseUrl)

Node developer = node.appendNode('developers').appendNode('developer')
developer.appendNode('name', 'OpenSearch')
developer.appendNode('url', 'https://github.com/opensearch-project/opensearch-system-templates')
}
}
}
}
}

publishing {
publications {
pluginZip(MavenPublication) { publication ->
pom {
name = "opensearch-system-templates"
description = "OpenSearch plugin that provides basic application based configuration templates."
groupId = "org.opensearch.plugin"
}
}
}
repositories {
maven {
name = "Snapshots"
url = "https://aws.oss.sonatype.org/content/repositories/snapshots"
credentials {
username "$System.env.SONATYPE_USERNAME"
password "$System.env.SONATYPE_PASSWORD"
}
}
}
}

// ignore missing javadocs
tasks.withType(Javadoc).configureEach { Javadoc javadoc ->
// the -quiet here is because of a bug in gradle, in that adding a string option
// by itself is not added to the options. By adding quiet, both this option and
// the "value" -quiet is added, separated by a space. This is ok since the javadoc
// command already adds -quiet, so we are just duplicating it
// see https://discuss.gradle.org/t/add-custom-javadoc-option-that-does-not-take-an-argument/5959
javadoc.options.encoding = 'UTF8'
javadoc.options.addStringOption('Xdoclint:all,-missing', '-quiet')
boolean failOnJavadocWarning = project.ext.has('failOnJavadocWarning') ? project.ext.get('failOnJavadocWarning') : true
if (failOnJavadocWarning) {
javadoc.options.addStringOption('Xwerror', '-quiet')
}
javadoc.options.tags = ["opensearch.internal", "opensearch.api", "opensearch.experimental"]
javadoc.options.addStringOption("-release", java.targetCompatibility.majorVersion)
}

loggerUsageCheck.enabled = false
validateNebulaPom.enabled = false

sourceSets {
integTest {
java {
srcDirs file("src/integrationTest/java")
}
compileClasspath += sourceSets["main"].output + configurations["testRuntimeClasspath"]
runtimeClasspath += output + compileClasspath
}
}

tasks.named("testingConventions").configure {
naming.clear()
naming {
Tests {
baseClass "org.apache.lucene.tests.util.LuceneTestCase"
}
IT {
baseClass "org.opensearch.test.OpenSearchIntegTestCase"
baseClass "org.opensearch.test.OpenSearchSingleNodeTestCase"
}
}
}

integTest {
description = "Run tests against a cluster"
testClassesDirs = sourceSets.integTest.output.classesDirs
classpath = sourceSets.integTest.runtimeClasspath

dependsOn "bundlePlugin"
systemProperty 'tests.security.manager', 'true'

systemProperty "https", System.getProperty("https")
systemProperty "user", System.getProperty("user")
systemProperty "password", System.getProperty("password")
}

testClusters.integTest {
testDistribution = "ARCHIVE"
plugin(project.tasks.bundlePlugin.archiveFile)
}

tasks.withType(PublishToMavenRepository) {
def predicate = provider {
publication.name == "pluginZip"
}
onlyIf("Publishing only ZIP distributions") {
predicate.get()
}
}

task updateVersion {
onlyIf { System.getProperty('newVersion') }
doLast {
ext.newVersion = System.getProperty('newVersion')
println "Setting version to ${newVersion}."
// String tokenization to support -SNAPSHOT
ant.replaceregexp(file:'build.gradle', match: '"opensearch.version", "\\d.*"', replace: '"opensearch.version", "' + newVersion.tokenize('-')[0] + '-SNAPSHOT"', flags:'g', byline:true)
}
}
Loading

0 comments on commit e3b4fc6

Please sign in to comment.