Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
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
7 changes: 5 additions & 2 deletions .github/workflows/cve-scan.yml
Original file line number Diff line number Diff line change
Expand Up @@ -166,9 +166,10 @@ jobs:
scan-path: flink/v2.1/flink-runtime/build/libs
unpack: false
- distribution: open-api-test-fixtures-runtime
build-task: :iceberg-open-api:shadowJar
scan-path: open-api/build/libs
build-task: :iceberg-open-api:stageRESTFixtureRuntime
scan-path: open-api/build/iceberg-rest-server/libs
unpack: false
copy-all: true
name: ${{ matrix.distribution }}
steps:
- uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3
Expand All @@ -192,6 +193,8 @@ jobs:
mkdir -p /tmp/cve-scan
if [ "${{ matrix.unpack }}" = "true" ]; then
unzip ${{ matrix.scan-path }}/*.zip -d /tmp/cve-scan
elif [ "${{ matrix.copy-all }}" = "true" ]; then
cp ${{ matrix.scan-path }}/*.jar /tmp/cve-scan/
else
cp ${{ matrix.scan-path }}/iceberg-${{ matrix.distribution }}-*.jar /tmp/cve-scan/
fi
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/publish-iceberg-rest-fixture-docker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,8 @@ jobs:
with:
# Read-only: small job; restore opportunistically from other jobs' caches but never write.
cache-read-only: true
- name: Build Iceberg Open API project
run: ./gradlew :iceberg-open-api:shadowJar
- name: Stage REST fixture image classpath
run: ./gradlew :iceberg-open-api:stageRESTFixtureRuntime
- name: Login to Docker Hub
env:
DOCKERHUB_USER: ${{ secrets.DOCKERHUB_USER }}
Expand Down
20 changes: 6 additions & 14 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -1077,9 +1077,6 @@ project(':iceberg-snowflake') {

project(':iceberg-open-api') {
apply plugin: 'java-test-fixtures'
apply plugin: 'com.gradleup.shadow'

build.dependsOn shadowJar

dependencies {
testImplementation project(':iceberg-api')
Expand Down Expand Up @@ -1164,21 +1161,16 @@ project(':iceberg-open-api') {
}
check.dependsOn('validateRESTCatalogSpec')

shadowJar {
archiveBaseName.set("iceberg-open-api-test-fixtures-runtime")
archiveClassifier.set(null)
configurations = [project.configurations.testFixturesRuntimeClasspath]
from sourceSets.testFixtures.output
zip64 true

// include the LICENSE and NOTICE files for the runtime Jar
// REST server runtime as a dir of jars; consumed by docker/iceberg-rest-fixture.
tasks.register('stageRESTFixtureRuntime', Sync) {
into layout.buildDirectory.dir('iceberg-rest-server')
from(projectDir) {
include 'LICENSE'
include 'NOTICE'
}

manifest {
attributes 'Main-Class': 'org.apache.iceberg.rest.RESTCatalogServer'
into('libs') {
from configurations.testFixturesRuntimeClasspath
from tasks.testFixturesJar
}
}

Expand Down
9 changes: 7 additions & 2 deletions deploy.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -54,8 +54,8 @@ subprojects {
testArtifacts testJar
}

// add LICENSE and NOTICE
[jar, sourceJar, javadocJar, testJar].each { task ->
// add build info, LICENSE, and NOTICE
def addBuildInfoAndLicense = { task ->
task.dependsOn rootProject.tasks.buildInfo
task.from("${rootDir}/build") {
include 'iceberg-build.properties'
Expand All @@ -65,6 +65,11 @@ subprojects {
include 'NOTICE'
}
}
[jar, sourceJar, javadocJar, testJar].each(addBuildInfoAndLicense)
if (isOpenApi) {
// OpenAPI also publishes testFixturesJar for REST fixture consumers.
addBuildInfoAndLicense(testFixturesJar)
}
}

publishing {
Expand Down
4 changes: 2 additions & 2 deletions docker/iceberg-rest-fixture/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,8 @@ RUN set -xeu && \
# Working directory for the application
WORKDIR /usr/lib/iceberg-rest

# Copy runtime files directly to the target location
COPY --chown=iceberg:iceberg open-api/build/libs/iceberg-open-api-test-fixtures-runtime-*.jar /usr/lib/iceberg-rest/iceberg-rest-adapter.jar
# Copy staged REST fixture runtime, including libs/ and LICENSE/NOTICE
COPY --chown=iceberg:iceberg open-api/build/iceberg-rest-server/ /usr/lib/iceberg-rest/
COPY --chown=iceberg:iceberg docker/iceberg-rest-fixture/entrypoint.sh /usr/lib/iceberg-rest/entrypoint.sh

ENV CATALOG_CATALOG__IMPL=org.apache.iceberg.jdbc.JdbcCatalog
Expand Down
2 changes: 1 addition & 1 deletion docker/iceberg-rest-fixture/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ When making changes to the local files and test them out, you can build the imag

```bash
# Build the project from iceberg root directory
./gradlew :iceberg-open-api:shadowJar
./gradlew :iceberg-open-api:stageRESTFixtureRuntime

# Rebuild the docker image
docker image rm -f apache/iceberg-rest-fixture && docker build -t apache/iceberg-rest-fixture -f docker/iceberg-rest-fixture/Dockerfile .
Expand Down
3 changes: 2 additions & 1 deletion docker/iceberg-rest-fixture/entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,8 @@

set -eu

CLASSPATH="iceberg-rest-adapter.jar"
# The staged runtime puts all REST server jars under libs/; Java expands this wildcard.
CLASSPATH="libs/*"

if [ -n "${LOG_CONFIG_DIR:-}" ]; then
CLASSPATH="${LOG_CONFIG_DIR}:${CLASSPATH}"
Expand Down