Skip to content

Commit 5e06a0d

Browse files
authored
[GPU] Switch to triple-license for the gpu plugin (elastic#137980) (elastic#138080)
The GPU plugins is in a tricky spot: - it needs to have a OSI-approved Open Source license (AGPL) - it has been decided to have it at the Enterprise subscription level In this PR, we change the license for the GPU plugin to our triple-license, for source code headers, plugin bundle LICENSE.txt, and jar file META-INF/LICENSE.txt
1 parent 9d5b91d commit 5e06a0d

31 files changed

+170
-91
lines changed

build-conventions/src/main/java/org/elasticsearch/gradle/internal/conventions/LicensingPlugin.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,8 +44,9 @@ public void apply(Project project) {
4444
Provider<String> agplLicenseURL = licenseCommitProvider.map(
4545
licenseCommit -> ELASTIC_LICENSE_URL_PREFIX + licenseCommit + AGPL_ELASTIC_LICENSE_URL_POSTFIX
4646
);
47-
// But stick the Elastic license url in project.ext so we can get it if we need to switch to it
47+
// Stick the license urls in project.ext so we can get them if we need to switch to them
4848
project.getExtensions().getExtraProperties().set("elasticLicenseUrl", elasticLicenseURL);
49+
project.getExtensions().getExtraProperties().set("agplLicenseUrl", agplLicenseURL);
4950

5051
MapProperty<String, Provider<String>> licensesProperty = project.getObjects()
5152
.mapProperty(String.class, (Class<Provider<String>>) (Class<?>) Provider.class)

x-pack/plugin/gpu/build.gradle

Lines changed: 29 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,18 @@
1-
apply plugin: 'elasticsearch.internal-es-plugin'
1+
import org.elasticsearch.gradle.plugin.PluginBuildPlugin
2+
23
apply plugin: 'elasticsearch.internal-cluster-test'
34
apply plugin: 'elasticsearch.internal-yaml-rest-test'
45
apply plugin: 'elasticsearch.mrjar'
56

7+
// Override the license file to be included in the plugin bundle.
8+
// We need to do this now, before the BaseInternalPluginBuildPlugin is applied, because the plugin will
9+
// immediately try to read it from esplugin.licenseFile (PluginPropertiesExtension) before we get a chance to set it
10+
// a few lines below.
11+
plugins.withType(PluginBuildPlugin).whenPluginAdded {
12+
project.esplugin.licenseFile = layout.settingsDirectory.file('licenses/AGPL-3.0+SSPL-1.0+ELASTIC-LICENSE-2.0.txt').asFile
13+
}
14+
apply plugin: 'elasticsearch.internal-es-plugin'
15+
616
esplugin {
717
name = 'gpu'
818
description = 'A plugin for doing vector search in GPU'
@@ -23,6 +33,24 @@ dependencies {
2333
clusterModules project(xpackModule('gpu'))
2434
}
2535

36+
ext.projectLicenses.set(
37+
[
38+
'Server Side Public License, v 1': providers.provider(() -> 'https://www.mongodb.com/licensing/server-side-public-license'),
39+
'Elastic License 2.0': ext.elasticLicenseUrl,
40+
'GNU Affero General Public License Version 3': ext.agplLicenseUrl
41+
])
42+
43+
// We need to override the JAR license file too (the one placed in META-INF)
44+
licenseFile.set(layout.settingsDirectory.file('licenses/AGPL-3.0+SSPL-1.0+ELASTIC-LICENSE-2.0.txt').asFile)
45+
46+
// And we need to reset the license header checker. Notice that we need to set additionalLicense here to
47+
// match the initial default from LicenseHeadersTask#conventionalLicenses, as the x-pack parent gradle
48+
// resets additionalLicense to 'Elastic License 2.0'
49+
tasks.named("licenseHeaders").configure {
50+
approvedLicenses = ['AGLP+SSPL+Elastic License', 'Generated', 'Vendored']
51+
additionalLicense 'TRIPL', 'AGLP+SSPL+Elastic License', "2.0\", the \"GNU Affero General Public License v3.0 only\", and the \"Server Side"
52+
}
53+
2654
artifacts {
2755
restXpackTests(new File(projectDir, "src/yamlRestTest/resources/rest-api-spec/test"))
2856
}

x-pack/plugin/gpu/src/internalClusterTest/java/org/elasticsearch/plugin/gpu/CuVSProviderDelegate.java

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,10 @@
11
/*
22
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
3-
* or more contributor license agreements. Licensed under the Elastic License
4-
* 2.0; you may not use this file except in compliance with the Elastic License
5-
* 2.0.
3+
* or more contributor license agreements. Licensed under the "Elastic License
4+
* 2.0", the "GNU Affero General Public License v3.0 only", and the "Server Side
5+
* Public License v 1"; you may not use this file except in compliance with, at
6+
* your election, the "Elastic License 2.0", the "GNU Affero General Public
7+
* License v3.0 only", or the "Server Side Public License, v 1".
68
*/
79

810
package org.elasticsearch.plugin.gpu;

x-pack/plugin/gpu/src/internalClusterTest/java/org/elasticsearch/plugin/gpu/GPUIndexIT.java

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,10 @@
11
/*
22
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
3-
* or more contributor license agreements. Licensed under the Elastic License
4-
* 2.0; you may not use this file except in compliance with the Elastic License
5-
* 2.0.
3+
* or more contributor license agreements. Licensed under the "Elastic License
4+
* 2.0", the "GNU Affero General Public License v3.0 only", and the "Server Side
5+
* Public License v 1"; you may not use this file except in compliance with, at
6+
* your election, the "Elastic License 2.0", the "GNU Affero General Public
7+
* License v3.0 only", or the "Server Side Public License, v 1".
68
*/
79

810
package org.elasticsearch.plugin.gpu;

x-pack/plugin/gpu/src/internalClusterTest/java/org/elasticsearch/plugin/gpu/GPUPluginInitializationUnsupportedIT.java

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,10 @@
11
/*
22
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
3-
* or more contributor license agreements. Licensed under the Elastic License
4-
* 2.0; you may not use this file except in compliance with the Elastic License
5-
* 2.0.
3+
* or more contributor license agreements. Licensed under the "Elastic License
4+
* 2.0", the "GNU Affero General Public License v3.0 only", and the "Server Side
5+
* Public License v 1"; you may not use this file except in compliance with, at
6+
* your election, the "Elastic License 2.0", the "GNU Affero General Public
7+
* License v3.0 only", or the "Server Side Public License, v 1".
68
*/
79

810
package org.elasticsearch.plugin.gpu;

x-pack/plugin/gpu/src/internalClusterTest/java/org/elasticsearch/plugin/gpu/GPUPluginInitializationWithGPUIT.java

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,10 @@
11
/*
22
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
3-
* or more contributor license agreements. Licensed under the Elastic License
4-
* 2.0; you may not use this file except in compliance with the Elastic License
5-
* 2.0.
3+
* or more contributor license agreements. Licensed under the "Elastic License
4+
* 2.0", the "GNU Affero General Public License v3.0 only", and the "Server Side
5+
* Public License v 1"; you may not use this file except in compliance with, at
6+
* your election, the "Elastic License 2.0", the "GNU Affero General Public
7+
* License v3.0 only", or the "Server Side Public License, v 1".
68
*/
79

810
package org.elasticsearch.plugin.gpu;

x-pack/plugin/gpu/src/internalClusterTest/java/org/elasticsearch/plugin/gpu/GPUPluginInitializationWithoutGPUIT.java

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,10 @@
11
/*
22
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
3-
* or more contributor license agreements. Licensed under the Elastic License
4-
* 2.0; you may not use this file except in compliance with the Elastic License
5-
* 2.0.
3+
* or more contributor license agreements. Licensed under the "Elastic License
4+
* 2.0", the "GNU Affero General Public License v3.0 only", and the "Server Side
5+
* Public License v 1"; you may not use this file except in compliance with, at
6+
* your election, the "Elastic License 2.0", the "GNU Affero General Public
7+
* License v3.0 only", or the "Server Side Public License, v 1".
68
*/
79

810
package org.elasticsearch.plugin.gpu;

x-pack/plugin/gpu/src/internalClusterTest/java/org/elasticsearch/plugin/gpu/TestCuVSServiceProvider.java

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,10 @@
11
/*
22
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
3-
* or more contributor license agreements. Licensed under the Elastic License
4-
* 2.0; you may not use this file except in compliance with the Elastic License
5-
* 2.0.
3+
* or more contributor license agreements. Licensed under the "Elastic License
4+
* 2.0", the "GNU Affero General Public License v3.0 only", and the "Server Side
5+
* Public License v 1"; you may not use this file except in compliance with, at
6+
* your election, the "Elastic License 2.0", the "GNU Affero General Public
7+
* License v3.0 only", or the "Server Side Public License, v 1".
68
*/
79

810
package org.elasticsearch.plugin.gpu;

x-pack/plugin/gpu/src/main/java/module-info.java

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,10 @@
11
/*
22
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
3-
* or more contributor license agreements. Licensed under the Elastic License
4-
* 2.0; you may not use this file except in compliance with the Elastic License
5-
* 2.0.
3+
* or more contributor license agreements. Licensed under the "Elastic License
4+
* 2.0", the "GNU Affero General Public License v3.0 only", and the "Server Side
5+
* Public License v 1"; you may not use this file except in compliance with, at
6+
* your election, the "Elastic License 2.0", the "GNU Affero General Public
7+
* License v3.0 only", or the "Server Side Public License, v 1".
68
*/
79

810
import org.elasticsearch.xpack.gpu.codec.ES92GpuHnswSQVectorsFormat;

x-pack/plugin/gpu/src/main/java/org/elasticsearch/xpack/gpu/GPUFeatures.java

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,10 @@
11
/*
22
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
3-
* or more contributor license agreements. Licensed under the Elastic License
4-
* 2.0; you may not use this file except in compliance with the Elastic License
5-
* 2.0.
3+
* or more contributor license agreements. Licensed under the "Elastic License
4+
* 2.0", the "GNU Affero General Public License v3.0 only", and the "Server Side
5+
* Public License v 1"; you may not use this file except in compliance with, at
6+
* your election, the "Elastic License 2.0", the "GNU Affero General Public
7+
* License v3.0 only", or the "Server Side Public License, v 1".
68
*/
79

810
package org.elasticsearch.xpack.gpu;

0 commit comments

Comments
 (0)