Skip to content

Commit

Permalink
GCP: Add bundle jar for GCP-related dependencies (apache#8231)
Browse files Browse the repository at this point in the history
  • Loading branch information
bryanck authored Aug 8, 2023
1 parent 00f771d commit 5150549
Show file tree
Hide file tree
Showing 13 changed files with 635 additions and 3 deletions.
4 changes: 2 additions & 2 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -608,8 +608,8 @@ project(':iceberg-gcp') {
implementation project(':iceberg-common')
implementation project(':iceberg-core')

implementation platform(libs.google.libraries.bom)
implementation "com.google.cloud:google-cloud-storage"
compileOnly platform(libs.google.libraries.bom)
compileOnly "com.google.cloud:google-cloud-storage"

testImplementation "com.google.cloud:google-cloud-nio"

Expand Down
1 change: 1 addition & 0 deletions flink/v1.15/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -162,6 +162,7 @@ project(":iceberg-flink:iceberg-flink-runtime-${flinkMajorVersion}") {
exclude group: 'org.apache.httpcomponents', module: 'httpclient'
exclude group: 'commons-logging', module: 'commons-logging'
}
implementation project(':iceberg-gcp')
implementation(project(':iceberg-nessie')) {
exclude group: 'com.google.code.findbugs', module: 'jsr305'
}
Expand Down
1 change: 1 addition & 0 deletions flink/v1.16/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -162,6 +162,7 @@ project(":iceberg-flink:iceberg-flink-runtime-${flinkMajorVersion}") {
exclude group: 'org.apache.httpcomponents', module: 'httpclient'
exclude group: 'commons-logging', module: 'commons-logging'
}
implementation project(':iceberg-gcp')
implementation(project(':iceberg-nessie')) {
exclude group: 'com.google.code.findbugs', module: 'jsr305'
}
Expand Down
1 change: 1 addition & 0 deletions flink/v1.17/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -162,6 +162,7 @@ project(":iceberg-flink:iceberg-flink-runtime-${flinkMajorVersion}") {
exclude group: 'org.apache.httpcomponents', module: 'httpclient'
exclude group: 'commons-logging', module: 'commons-logging'
}
implementation project(':iceberg-gcp')
implementation(project(':iceberg-nessie')) {
exclude group: 'com.google.code.findbugs', module: 'jsr305'
}
Expand Down
561 changes: 561 additions & 0 deletions gcp-bundle/LICENSE

Large diffs are not rendered by default.

6 changes: 6 additions & 0 deletions gcp-bundle/NOTICE
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@

Apache Iceberg
Copyright 2017-2023 The Apache Software Foundation

This product includes software developed at
The Apache Software Foundation (http://www.apache.org/).
54 changes: 54 additions & 0 deletions gcp-bundle/build.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
/*
* 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.
*/

project(":iceberg-gcp-bundle") {

apply plugin: 'com.github.johnrengelman.shadow'

tasks.jar.dependsOn tasks.shadowJar

dependencies {
implementation platform(libs.google.libraries.bom)
implementation "com.google.cloud:google-cloud-storage"
}

shadowJar {
archiveClassifier.set(null)
zip64 true

// include the LICENSE and NOTICE files for the shaded Jar
from(projectDir) {
include 'LICENSE'
include 'NOTICE'
}

// relocate GCP-specific versions
relocate 'com.fasterxml.jackson', 'org.apache.iceberg.gcp.shaded.com.fasterxml.jackson'
relocate 'com.google.common', 'org.apache.iceberg.gcp.shaded.com.google.common'
relocate 'com.google.errorprone', 'org.apache.iceberg.gcp.shaded.com.google.errorprone'
relocate 'com.google.gson', 'org.apache.iceberg.gcp.shaded.com.google.gson'
relocate 'com.google.protobuf', 'org.apache.iceberg.gcp.shaded.com.google.protobuf'
relocate 'org.apache.http', 'org.apache.iceberg.gcp.shaded.org.apache.http'
relocate 'io.netty', 'org.apache.iceberg.gcp.shaded.io.netty'
}

jar {
enabled = false
}
}
1 change: 1 addition & 0 deletions hive-runtime/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ project(':iceberg-hive-runtime') {
exclude group: 'org.apache.httpcomponents', module: 'httpclient'
exclude group: 'commons-logging', module: 'commons-logging'
}
implementation project(':iceberg-gcp')
}

shadowJar {
Expand Down
2 changes: 2 additions & 0 deletions settings.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ include 'pig'
include 'hive-metastore'
include 'nessie'
include 'gcp'
include 'gcp-bundle'
include 'dell'
include 'snowflake'
include 'delta-lake'
Expand All @@ -52,6 +53,7 @@ project(':pig').name = 'iceberg-pig'
project(':hive-metastore').name = 'iceberg-hive-metastore'
project(':nessie').name = 'iceberg-nessie'
project(':gcp').name = 'iceberg-gcp'
project(':gcp-bundle').name = 'iceberg-gcp-bundle'
project(':dell').name = 'iceberg-dell'
project(':snowflake').name = 'iceberg-snowflake'
project(':delta-lake').name = 'iceberg-delta-lake'
Expand Down
1 change: 1 addition & 0 deletions spark/v3.1/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -220,6 +220,7 @@ project(':iceberg-spark:iceberg-spark-runtime-3.1_2.12') {
exclude group: 'org.apache.httpcomponents', module: 'httpclient'
exclude group: 'commons-logging', module: 'commons-logging'
}
implementation project(':iceberg-gcp')
implementation project(':iceberg-hive-metastore')
implementation(project(':iceberg-nessie')) {
exclude group: 'com.google.code.findbugs', module: 'jsr305'
Expand Down
1 change: 1 addition & 0 deletions spark/v3.2/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -215,6 +215,7 @@ project(":iceberg-spark:iceberg-spark-runtime-${sparkMajorVersion}_${scalaVersio
exclude group: 'org.apache.httpcomponents', module: 'httpclient'
exclude group: 'commons-logging', module: 'commons-logging'
}
implementation project(':iceberg-gcp')
implementation project(':iceberg-hive-metastore')
implementation(project(':iceberg-nessie')) {
exclude group: 'com.google.code.findbugs', module: 'jsr305'
Expand Down
1 change: 1 addition & 0 deletions spark/v3.3/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -221,6 +221,7 @@ project(":iceberg-spark:iceberg-spark-runtime-${sparkMajorVersion}_${scalaVersio
exclude group: 'org.apache.httpcomponents', module: 'httpclient'
exclude group: 'commons-logging', module: 'commons-logging'
}
implementation project(':iceberg-gcp')
implementation project(':iceberg-hive-metastore')
implementation(project(':iceberg-nessie')) {
exclude group: 'com.google.code.findbugs', module: 'jsr305'
Expand Down
4 changes: 3 additions & 1 deletion spark/v3.4/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -220,6 +220,7 @@ project(":iceberg-spark:iceberg-spark-runtime-${sparkMajorVersion}_${scalaVersio
exclude group: 'org.apache.httpcomponents', module: 'httpclient'
exclude group: 'commons-logging', module: 'commons-logging'
}
implementation project(':iceberg-gcp')
implementation project(':iceberg-hive-metastore')
implementation(project(':iceberg-nessie')) {
exclude group: 'com.google.code.findbugs', module: 'jsr305'
Expand Down Expand Up @@ -255,7 +256,8 @@ project(":iceberg-spark:iceberg-spark-runtime-${sparkMajorVersion}_${scalaVersio
}

// Relocate dependencies to avoid conflicts
relocate 'com.google', 'org.apache.iceberg.shaded.com.google'
relocate 'com.google.errorprone', 'org.apache.iceberg.shaded.com.google.errorprone'
relocate 'com.google.flatbuffers', 'org.apache.iceberg.shaded.com.google.flatbuffers'
relocate 'com.fasterxml', 'org.apache.iceberg.shaded.com.fasterxml'
relocate 'com.github.benmanes', 'org.apache.iceberg.shaded.com.github.benmanes'
relocate 'org.checkerframework', 'org.apache.iceberg.shaded.org.checkerframework'
Expand Down

0 comments on commit 5150549

Please sign in to comment.