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

GCP: Add bundle jar for GCP-related dependencies #8231

Merged
merged 10 commits into from
Aug 8, 2023
Merged
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.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
492 changes: 492 additions & 0 deletions gcp-bundle/LICENSE

Large diffs are not rendered by default.

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

Apache Iceberg
Copyright 2017-2022 The Apache Software Foundation

This product includes software developed at
The Apache Software Foundation (http://www.apache.org/).

--------------------------------------------------------------------------------

This binary artifact includes Apache ORC with the following in its NOTICE file:

| Apache ORC
| Copyright 2013-2019 The Apache Software Foundation
|
| This product includes software developed by The Apache Software
| Foundation (http://www.apache.org/).
|
| This product includes software developed by Hewlett-Packard:
| (c) Copyright [2014-2015] Hewlett-Packard Development Company, L.P

--------------------------------------------------------------------------------

This binary artifact includes Airlift Aircompressor with the following in its
NOTICE file:

| Snappy Copyright Notices
| =========================
|
| * Copyright 2011 Dain Sundstrom <dain@iq80.com>
| * Copyright 2011, Google Inc.<opensource@google.com>
|
|
| Snappy License
| ===============
| Copyright 2011, Google Inc.
| All rights reserved.
|
| Redistribution and use in source and binary forms, with or without
| modification, are permitted provided that the following conditions are
| met:
|
| * Redistributions of source code must retain the above copyright
| notice, this list of conditions and the following disclaimer.
| * Redistributions in binary form must reproduce the above
| copyright notice, this list of conditions and the following disclaimer
| in the documentation and/or other materials provided with the
| distribution.
| * Neither the name of Google Inc. nor the names of its
| contributors may be used to endorse or promote products derived from
| this software without specific prior written permission.
|
| THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
| "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
| LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
| A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
| OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
| SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
| LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
| DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
| THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
| (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
| OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

--------------------------------------------------------------------------------

This binary artifact includes Apache Yetus with the following in its NOTICE
file:

| Apache Yetus
| Copyright 2008-2020 The Apache Software Foundation
|
| This product includes software developed at
| The Apache Software Foundation (https://www.apache.org/).
|
| ---
| Additional licenses for the Apache Yetus Source/Website:
| ---
|
|
| See LICENSE for terms.

--------------------------------------------------------------------------------

This binary artifact includes Project Nessie with the following in its NOTICE
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@bryanck I think we need to revisit the LICENSE and NOTICE files. If this is just a GCP bundle, it shouldn't include all of the Iceberg and related dependencies. Just the GCP notice.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, thanks. I updated these.

file:

| Dremio
| Copyright 2015-2017 Dremio Corporation
|
| 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
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