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

[#5585] improvement(bundles): Refactor bundle jars and provide core jars that does not contains hadoop-{aws,gcp,aliyun,azure} #5806

Merged
merged 39 commits into from
Dec 27, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
39 commits
Select commit Hold shift + click to select a range
6be4e69
Refactor bundle jars and provide mini jars that does not contains had…
yuqi1129 Dec 9, 2024
e854f70
Fix build error.
yuqi1129 Dec 10, 2024
32be67a
fix
yuqi1129 Dec 10, 2024
b69a793
fix
yuqi1129 Dec 10, 2024
86e8c2e
fix
yuqi1129 Dec 11, 2024
4c04317
fix
yuqi1129 Dec 11, 2024
3abc788
Merge branch 'main' of github.com:apache/gravitino into fix_bundles_j…
yuqi1129 Dec 11, 2024
9a87b87
Merge branch 'main' of github.com:datastrato/graviton into fix_bundle…
yuqi1129 Dec 16, 2024
94179fa
Fix
yuqi1129 Dec 16, 2024
96b69e2
Merge branch 'main' of github.com:datastrato/graviton into fix_bundle…
yuqi1129 Dec 16, 2024
9d527cb
Fix
yuqi1129 Dec 16, 2024
cc65f17
Fix
yuqi1129 Dec 16, 2024
92b4539
Fix
yuqi1129 Dec 17, 2024
b876977
Fix
yuqi1129 Dec 17, 2024
0585df5
Merge branch 'main' of github.com:datastrato/graviton into fix_bundle…
yuqi1129 Dec 17, 2024
dc085ae
Fix
yuqi1129 Dec 17, 2024
6a0e87b
Fix
yuqi1129 Dec 17, 2024
b63a84e
Merge branch 'main' of github.com:datastrato/graviton into fix_bundle…
yuqi1129 Dec 19, 2024
e5a2083
fix
yuqi1129 Dec 19, 2024
df4884e
Merge branch 'main' of github.com:datastrato/graviton into fix_bundle…
yuqi1129 Dec 23, 2024
a78e4e8
optimize
yuqi1129 Dec 24, 2024
b7ca512
Rename bundle modules
yuqi1129 Dec 25, 2024
1f58642
fix
yuqi1129 Dec 25, 2024
742982c
polish again
yuqi1129 Dec 25, 2024
8c4386e
fix a minor mistake in docs
yuqi1129 Dec 25, 2024
9d0f57b
Merge branch 'main' of github.com:apache/gravitino into fix_bundles_j…
yuqi1129 Dec 25, 2024
258a328
Fix CI error.
yuqi1129 Dec 25, 2024
44e5807
Fix again.
yuqi1129 Dec 25, 2024
c4eac38
Fix again.
yuqi1129 Dec 25, 2024
bbefd00
Remove the newly added document as suggested.
yuqi1129 Dec 26, 2024
a9c1a29
Merge branch 'main' of github.com:datastrato/graviton into fix_bundle…
yuqi1129 Dec 26, 2024
1ee1dd1
fix docs
yuqi1129 Dec 26, 2024
1923707
fix
yuqi1129 Dec 26, 2024
3c6e20c
fix
yuqi1129 Dec 26, 2024
ac4b815
Fix again.
yuqi1129 Dec 27, 2024
d62f4c5
fix
yuqi1129 Dec 27, 2024
1e7abe4
fix
yuqi1129 Dec 27, 2024
af4bdd4
fix docs again
yuqi1129 Dec 27, 2024
0d7baf5
Fix a silly mistake in doc description.
yuqi1129 Dec 27, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions authorizations/authorization-chain/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,7 @@ dependencies {
exclude("net.java.dev.jna")
exclude("javax.ws.rs")
exclude("org.eclipse.jetty")
exclude("org.apache.hadoop", "hadoop-common")
}
testImplementation("org.apache.spark:spark-hive_$scalaVersion:$sparkVersion")
testImplementation("org.apache.spark:spark-sql_$scalaVersion:$sparkVersion") {
Expand All @@ -93,11 +94,10 @@ dependencies {
testImplementation("org.apache.kyuubi:kyuubi-spark-authz-shaded_$scalaVersion:$kyuubiVersion") {
exclude("com.sun.jersey")
}
testImplementation(libs.hadoop3.client)
testImplementation(libs.hadoop3.common) {
exclude("com.sun.jersey")
exclude("javax.servlet", "servlet-api")
}

testImplementation(libs.hadoop3.client.api)
testImplementation(libs.hadoop3.client.runtime)

testImplementation(libs.hadoop3.hdfs) {
exclude("com.sun.jersey")
exclude("javax.servlet", "servlet-api")
Expand Down
11 changes: 6 additions & 5 deletions authorizations/authorization-ranger/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,12 @@ dependencies {
exclude("net.java.dev.jna")
exclude("javax.ws.rs")
exclude("org.eclipse.jetty")
// Conflicts with hadoop-client-api used in hadoop-catalog.
exclude("org.apache.hadoop", "hadoop-common")
}
implementation(libs.hadoop3.client.api)
implementation(libs.hadoop3.client.runtime)

implementation(libs.rome)
compileOnly(libs.lombok)
testRuntimeOnly(libs.junit.jupiter.engine)
Expand All @@ -92,11 +97,7 @@ dependencies {
testImplementation("org.apache.kyuubi:kyuubi-spark-authz-shaded_$scalaVersion:$kyuubiVersion") {
exclude("com.sun.jersey")
}
testImplementation(libs.hadoop3.client)
testImplementation(libs.hadoop3.common) {
exclude("com.sun.jersey")
exclude("javax.servlet", "servlet-api")
}

testImplementation(libs.hadoop3.hdfs) {
exclude("com.sun.jersey")
exclude("javax.servlet", "servlet-api")
Expand Down
8 changes: 3 additions & 5 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -779,7 +779,7 @@ tasks {
!it.name.startsWith("client") && !it.name.startsWith("filesystem") && !it.name.startsWith("spark") && !it.name.startsWith("iceberg") && it.name != "trino-connector" &&
it.name != "integration-test" && it.name != "bundled-catalog" && !it.name.startsWith("flink") &&
it.name != "integration-test" && it.name != "hive-metastore-common" && !it.name.startsWith("flink") &&
it.name != "gcp-bundle" && it.name != "aliyun-bundle" && it.name != "aws-bundle" && it.name != "azure-bundle" && it.name != "hadoop-common"
it.parent?.name != "bundles" && it.name != "hadoop-common"
) {
from(it.configurations.runtimeClasspath)
into("distribution/package/libs")
Expand All @@ -799,10 +799,8 @@ tasks {
!it.name.startsWith("integration-test") &&
!it.name.startsWith("flink") &&
!it.name.startsWith("trino-connector") &&
it.name != "bundled-catalog" &&
it.name != "hive-metastore-common" && it.name != "gcp-bundle" &&
it.name != "aliyun-bundle" && it.name != "aws-bundle" && it.name != "azure-bundle" &&
it.name != "hadoop-common" && it.name != "docs"
it.name != "hive-metastore-common" &&
it.name != "docs" && it.name != "hadoop-common" && it.parent?.name != "bundles"
) {
dependsOn("${it.name}:build")
from("${it.name}/build/libs")
Expand Down
38 changes: 11 additions & 27 deletions bundles/aliyun-bundle/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -25,32 +25,12 @@ plugins {
}

dependencies {
compileOnly(project(":api"))
compileOnly(project(":core"))
compileOnly(project(":catalogs:catalog-common"))
compileOnly(project(":catalogs:catalog-hadoop"))
compileOnly(project(":catalogs:hadoop-common")) {
exclude("*")
}
compileOnly(libs.hadoop3.common)

implementation(libs.aliyun.credentials.sdk)
implementation(project(":bundles:aliyun"))
implementation(libs.commons.collections3)
implementation(libs.hadoop3.client.api)
implementation(libs.hadoop3.client.runtime)
implementation(libs.hadoop3.oss)

// Aliyun oss SDK depends on this package, and JDK >= 9 requires manual add
// https://www.alibabacloud.com/help/en/oss/developer-reference/java-installation?spm=a2c63.p38356.0.i1
implementation(libs.sun.activation)

// oss needs StringUtils from commons-lang3 or the following error will occur in 3.3.0
// java.lang.NoClassDefFoundError: org/apache/commons/lang3/StringUtils
// org.apache.hadoop.fs.aliyun.oss.AliyunOSSFileSystemStore.initialize(AliyunOSSFileSystemStore.java:111)
// org.apache.hadoop.fs.aliyun.oss.AliyunOSSFileSystem.initialize(AliyunOSSFileSystem.java:323)
// org.apache.hadoop.fs.FileSystem.createFileSystem(FileSystem.java:3611)
implementation(libs.commons.lang3)

implementation(project(":catalogs:catalog-common")) {
exclude("*")
}
implementation(libs.httpclient)
}

tasks.withType(ShadowJar::class.java) {
Expand All @@ -60,8 +40,12 @@ tasks.withType(ShadowJar::class.java) {
mergeServiceFiles()

// Relocate dependencies to avoid conflicts
relocate("org.jdom", "org.apache.gravitino.shaded.org.jdom")
relocate("org.apache.commons.lang3", "org.apache.gravitino.shaded.org.apache.commons.lang3")
relocate("org.jdom", "org.apache.gravitino.aliyun.shaded.org.jdom")
relocate("org.apache.commons.lang3", "org.apache.gravitino.aliyun.shaded.org.apache.commons.lang3")
relocate("com.fasterxml.jackson", "org.apache.gravitino.aliyun.shaded.com.fasterxml.jackson")
relocate("com.google.common", "org.apache.gravitino.aliyun.shaded.com.google.common")
relocate("org.apache.http", "org.apache.gravitino.aliyun.shaded.org.apache.http")
relocate("org.apache.commons.collections", "org.apache.gravitino.aliyun.shaded.org.apache.commons.collections")
}

tasks.jar {
Expand Down
87 changes: 87 additions & 0 deletions bundles/aliyun/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -0,0 +1,87 @@
/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF 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.
*/
import com.github.jengelman.gradle.plugins.shadow.tasks.ShadowJar

plugins {
`maven-publish`
id("java")
alias(libs.plugins.shadow)
}

dependencies {
compileOnly(project(":api"))
compileOnly(project(":catalogs:catalog-common"))
compileOnly(project(":catalogs:catalog-hadoop"))
compileOnly(project(":core"))
compileOnly(libs.hadoop3.client.api)
compileOnly(libs.hadoop3.client.runtime)
compileOnly(libs.hadoop3.oss)

implementation(project(":catalogs:catalog-common")) {
exclude("*")
}
implementation(project(":catalogs:hadoop-common")) {
exclude("*")
}

implementation(libs.aliyun.credentials.sdk)
implementation(libs.commons.collections3)

// oss needs StringUtils from commons-lang3 or the following error will occur in 3.3.0
// java.lang.NoClassDefFoundError: org/apache/commons/lang3/StringUtils
// org.apache.hadoop.fs.aliyun.oss.AliyunOSSFileSystemStore.initialize(AliyunOSSFileSystemStore.java:111)
// org.apache.hadoop.fs.aliyun.oss.AliyunOSSFileSystem.initialize(AliyunOSSFileSystem.java:323)
// org.apache.hadoop.fs.FileSystem.createFileSystem(FileSystem.java:3611)
implementation(libs.commons.lang3)
implementation(libs.guava)

implementation(libs.httpclient)
implementation(libs.jackson.databind)
implementation(libs.jackson.annotations)
implementation(libs.jackson.datatype.jdk8)
implementation(libs.jackson.datatype.jsr310)

// Aliyun oss SDK depends on this package, and JDK >= 9 requires manual add
// https://www.alibabacloud.com/help/en/oss/developer-reference/java-installation?spm=a2c63.p38356.0.i1
implementation(libs.sun.activation)
}

tasks.withType(ShadowJar::class.java) {
isZip64 = true
configurations = listOf(project.configurations.runtimeClasspath.get())
archiveClassifier.set("")
mergeServiceFiles()

// Relocate dependencies to avoid conflicts
relocate("org.jdom", "org.apache.gravitino.aliyun.shaded.org.jdom")
relocate("org.apache.commons.lang3", "org.apache.gravitino.aliyun.shaded.org.apache.commons.lang3")
relocate("com.fasterxml.jackson", "org.apache.gravitino.aliyun.shaded.com.fasterxml.jackson")
relocate("com.google.common", "org.apache.gravitino.aliyun.shaded.com.google.common")
relocate("org.apache.http", "org.apache.gravitino.aliyun.shaded.org.apache.http")
relocate("org.apache.commons.collections", "org.apache.gravitino.aliyun.shaded.org.apache.commons.collections")
}

tasks.jar {
dependsOn(tasks.named("shadowJar"))
archiveClassifier.set("empty")
}

tasks.compileJava {
dependsOn(":catalogs:catalog-hadoop:runtimeJars")
}
24 changes: 7 additions & 17 deletions bundles/aws-bundle/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -25,30 +25,20 @@ plugins {
}

dependencies {
compileOnly(project(":api"))
compileOnly(project(":core"))
compileOnly(project(":catalogs:catalog-common"))
compileOnly(project(":catalogs:catalog-hadoop"))
compileOnly(project(":catalogs:hadoop-common")) {
exclude("*")
}
compileOnly(libs.hadoop3.common)

implementation(libs.aws.iam)
implementation(libs.aws.policy)
implementation(libs.aws.sts)
implementation(libs.commons.lang3)
implementation(project(":bundles:aws"))
implementation(libs.hadoop3.aws)
implementation(project(":catalogs:catalog-common")) {
exclude("*")
}
implementation(libs.hadoop3.client.api)
implementation(libs.hadoop3.client.runtime)
}

tasks.withType(ShadowJar::class.java) {
isZip64 = true
configurations = listOf(project.configurations.runtimeClasspath.get())
relocate("org.apache.commons", "org.apache.gravitino.aws.shaded.org.apache.commons")
archiveClassifier.set("")

relocate("org.apache.commons.lang3", "org.apache.gravitino.aws.shaded.org.apache.commons.lang3")
relocate("com.google.common", "org.apache.gravitino.aws.shaded.com.google.common")
relocate("com.fasterxml.jackson", "org.apache.gravitino.aws.shaded.com.fasterxml.jackson")
}

tasks.jar {
Expand Down
68 changes: 68 additions & 0 deletions bundles/aws/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF 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.
*/
import com.github.jengelman.gradle.plugins.shadow.tasks.ShadowJar

plugins {
`maven-publish`
id("java")
alias(libs.plugins.shadow)
}

dependencies {
compileOnly(project(":api"))
compileOnly(project(":catalogs:catalog-common"))
compileOnly(project(":catalogs:catalog-hadoop"))
compileOnly(project(":core"))
compileOnly(libs.hadoop3.aws)
compileOnly(libs.hadoop3.client.api)
compileOnly(libs.hadoop3.client.runtime)

implementation(project(":catalogs:catalog-common")) {
exclude("*")
}
implementation(project(":catalogs:hadoop-common")) {
exclude("*")
}

implementation(libs.aws.iam)
implementation(libs.aws.policy)
implementation(libs.aws.sts)
implementation(libs.commons.lang3)
implementation(libs.hadoop3.aws)
implementation(libs.guava)
}

tasks.withType(ShadowJar::class.java) {
isZip64 = true
configurations = listOf(project.configurations.runtimeClasspath.get())
archiveClassifier.set("")

relocate("org.apache.commons.lang3", "org.apache.gravitino.aws.shaded.org.apache.commons.lang3")
relocate("com.google.common", "org.apache.gravitino.aws.shaded.com.google.common")
relocate("com.fasterxml.jackson", "org.apache.gravitino.aws.shaded.com.fasterxml.jackson")
}

tasks.jar {
dependsOn(tasks.named("shadowJar"))
archiveClassifier.set("empty")
}

tasks.compileJava {
dependsOn(":catalogs:catalog-hadoop:runtimeJars")
}
Loading
Loading