-
Notifications
You must be signed in to change notification settings - Fork 2.3k
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
open-api: Build runtime jar for test fixture #11279
Conversation
} | ||
} | ||
|
||
jar { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It was an empty jar since no source code. Hence, disabled it.
build.gradle
Outdated
shadowJar { | ||
archiveBaseName.set("iceberg-open-api-test-fixtures-runtime") | ||
archiveClassifier.set(null) | ||
configurations = [project.configurations.testFixturesShadowImplementation] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can't directly depend on testFixturesImplementation
as it is not resolved. Hence using via custom testFixturesShadowImplementation
} | ||
|
||
shadowJar { | ||
archiveBaseName.set("iceberg-open-api-test-fixtures-runtime") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Double check the naming. LGTM.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is a great idea!
Should we also publish this jar to maven?
Lines 75 to 77 in 208ab20
} else if (isOpenApi) { | |
artifact testJar | |
artifact testFixturesJar |
@kevinjqliu: I wasn't sure because of #9871. I can add it. If we agree that it is useful. |
I initially thought this was creating the jar for the TCK, but it looks like its for the |
I think the current design of keeping them as test fixture make sense to me. As it is not a production code. |
|
||
// include the LICENSE and NOTICE files for the runtime Jar | ||
from(projectDir) { | ||
include 'LICENSE' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We're actually packaging up more in this runtime than what's identified in the top-level LICENSE/NOTICE files, so we need to make sure that everything is captured.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we have to do this manually or we use the standard tool for this?
I don't think we have a standard guidelines for this in "CONTRIBUTING.md". Can we add this?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Used https://github.com/jk1/Gradle-License-Report to generate License and manually updated the notice for them.
Please check again.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
cc: @jbonofre
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just spot checking the NOTICE, but it doesn't include the Kite notice from the Iceberg NOTICE file. @bryanck had some way of generating the license/notice files that included transitive dependencies (which is required by ASF).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@bryanck: Could you please help me here? I tried the same plugin that you mentioned in your PR here. I used the configuration as testFixturesRuntimeClasspath
, because it is a shadow jar for test fixture source sets.
Also, We need to add the standard way in "contributing.md" for new users to follow it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I used the same plugin, but for both the notices and licenses. Also, I appended to the root license and notice files, the root notice has the Kite notice.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@ajantha-bhat I can generate them if you want, I created a custom renderer for the plugin. I'm hoping to contribute that at some point so this is automated.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I can also try manually appending the root files contents.
It only generates licenses
, how did you generate the notice from that plugin?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It can generate both, but I added some logic to my custom renderer to dedupe the notices.
Retriggering build because of connection error
Error: Exception in thread "main" java.io.IOException: Server returned HTTP response code: 500 for URL: https://github.com/gradle/gradle-distributions/releases/download/v8.10.2/gradle-8.10.2-bin.zip |
Any more suggestions for this? PR looks to be ready. |
@ajantha-bhat First of all, thanks for working on this, and sorry for the late reply as I was on parental leave. Unfortunately, there are issues with this. I just ran the following to check what's being shipped: ./gradlew build -x test -x integrationTest And noticed that we ship quite a bit in the fat jar: ls -lah open-api/build/libs/iceberg-open-api-*
-rw-r--r-- 1 fokko.driesprong staff 6.0K Oct 28 21:12 open-api/build/libs/iceberg-open-api-1.7.0-SNAPSHOT-javadoc.jar
-rw-r--r-- 1 fokko.driesprong staff 6.0K Oct 28 21:12 open-api/build/libs/iceberg-open-api-1.7.0-SNAPSHOT-sources.jar
-rw-r--r-- 1 fokko.driesprong staff 9.5K Aug 27 20:18 open-api/build/libs/iceberg-open-api-1.7.0-SNAPSHOT-test-fixtures.jar
-rw-r--r-- 1 fokko.driesprong staff 10K Oct 28 21:12 open-api/build/libs/iceberg-open-api-1.7.0-SNAPSHOT-tests.jar
-rw-r--r-- 1 fokko.driesprong staff 109M Oct 28 21:12 open-api/build/libs/iceberg-open-api-test-fixtures-runtime-1.7.0-SNAPSHOT.jar When looking into the runtime: mkdir /tmp/vo
mv open-api/build/libs/iceberg-open-api-test-fixtures-runtime-1.7.0-SNAPSHOT.jar /tmp/vo/iceberg-open-api-test-fixtures-runtime-1.7.0-SNAPSHOT.jar
cd /tmp/vo
unzip iceberg-open-api-test-fixtures-runtime-1.7.0-SNAPSHOT.jar And looking at the content, it looks like we ship a LOT, much more than mentioned in the LICENSE. Including at least one licenses that we cannot ship as it is part of the category X: ls -lah | grep -i lgpl
-rw-r--r-- 1 fokko.driesprong wheel 7.5K Feb 1 1980 LGPL-3.0.txt Also for the release we probably want to track down where this comes from. |
Now I need your render tool to format and append the notice and license to existing file. |
Thanks for fixing that issue @ajantha-bhat, this looks much better:
I did some digging around and didn't find any red flags. I did notice that we ship parts of Hadoop that we probably need (Filesystem, Configuration, etc), and the 3.3.6 has a known vulnerability, so good to bump that: #11428 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The fix looks good. I've just asked about cloudera mention in the NOTICE
.
5f9028f
to
f0db322
Compare
This looks good, let's move this forward, and wrap up anything pending in #11283 |
@Fokko: Thanks for the review. We can merge this and I can rebase the docker PR. |
@@ -967,11 +970,9 @@ project(':iceberg-open-api') { | |||
testFixturesImplementation project(':iceberg-gcp') | |||
testFixturesImplementation project(':iceberg-azure') | |||
testFixturesImplementation(libs.hadoop3.common) { | |||
exclude group: 'log4j' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added because of the warning while brining up the runtime jar.
exclude group: 'org.slf4j' | ||
exclude group: 'ch.qos.reload4j' | ||
exclude group: 'org.apache.avro', module: 'avro' | ||
exclude group: 'com.fasterxml.woodstox' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added these because of the error while brining up the runtime jar that class not found.
@danielcweeks, @Fokko, @bryanck: Please take a look at the PR again. Thanks. |
Thanks @ajantha-bhat This looks good, if there are dangling issues, we can wrap them up in #11283 Let's move this forward, thanks @kevinjqliu, @jbonofre, @bryanck and @danielcweeks for the review 🙌 |
Since the REST catalog TCK is merged (#10908),
we can have a runtime jar from the test fixture which can be used for building the docker image of rest catalog adapter.
PR for docker image will be raised in the follow up (already working on it)