-
Notifications
You must be signed in to change notification settings - Fork 3k
REST: Docker file for REST Fixture #11283
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
Merged
Merged
Changes from all commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -981,19 +981,33 @@ project(':iceberg-open-api') { | |
| exclude group: 'org.apache.curator' | ||
| exclude group: 'org.apache.zookeeper' | ||
| exclude group: 'org.apache.kerby' | ||
| exclude group: 'org.apache.hadoop', module: 'hadoop-auth' | ||
| exclude group: 'org.apache.commons', module: 'commons-configuration2' | ||
| exclude group: 'org.apache.hadoop.thirdparty', module: 'hadoop-shaded-protobuf_3_7' | ||
| exclude group: 'org.eclipse.jetty' | ||
| exclude group: 'com.google.re2j', module: 're2j' | ||
|
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Excluded some more which are unrelated to 'Configuration' class. These were not included in the license too. |
||
| exclude group: 'com.google.code.gson', module: 'gson' | ||
| exclude group: 'com.jcraft', module: 'jsch' | ||
| exclude group: 'com.google.code.findbugs', module: 'jsr305' | ||
| exclude group: 'io.dropwizard.metrics', module: 'metrics-core' | ||
| exclude group: 'dnsjava', module: 'dnsjava' | ||
| exclude group: 'org.xerial.snappy', module: 'snappy-java' | ||
| exclude group: 'commons-cli', module: 'commons-cli' | ||
| exclude group: 'com.github.pjfanning', module: 'jersey-json' | ||
| } | ||
| testFixturesImplementation project(path: ':iceberg-bundled-guava', configuration: 'shadow') | ||
| testFixturesImplementation libs.junit.jupiter | ||
|
|
||
| testFixturesImplementation libs.slf4j.api | ||
Fokko marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| testFixturesImplementation libs.slf4j.simple | ||
|
|
||
| testFixturesImplementation libs.jetty.servlet | ||
| testFixturesImplementation libs.jetty.server | ||
| testFixturesImplementation libs.sqlite.jdbc | ||
|
|
||
| testFixturesCompileOnly libs.apiguardian | ||
|
|
||
| testFixturesRuntimeOnly project(':iceberg-aws-bundle') | ||
| testFixturesRuntimeOnly project(':iceberg-azure-bundle') | ||
| testFixturesRuntimeOnly project(':iceberg-gcp-bundle') | ||
| } | ||
|
|
||
| test { | ||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,42 @@ | ||
| # | ||
| # 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. | ||
| # | ||
|
|
||
| FROM azul/zulu-openjdk:17-jre-headless | ||
Fokko marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
|
||
| # Set up the user and group | ||
| RUN set -xeu && \ | ||
| groupadd iceberg --gid 1000 && \ | ||
| useradd iceberg --uid 1000 --gid 1000 --create-home | ||
|
|
||
| # Working directory for the application | ||
| WORKDIR /usr/lib/iceberg-rest | ||
|
|
||
| # Copy the JAR file 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 | ||
|
|
||
| ENV CATALOG_CATALOG__IMPL=org.apache.iceberg.jdbc.JdbcCatalog | ||
| ENV CATALOG_URI=jdbc:sqlite::memory: | ||
| ENV CATALOG_JDBC_USER=user | ||
| ENV CATALOG_JDBC_PASSWORD=password | ||
| ENV REST_PORT=8181 | ||
Fokko marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
|
||
| EXPOSE $REST_PORT | ||
| USER iceberg:iceberg | ||
| ENV LANG=en_US.UTF-8 | ||
| CMD ["java", "-jar", "iceberg-rest-adapter.jar"] | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,86 @@ | ||
| <!-- | ||
| - 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. | ||
| --> | ||
|
|
||
| # Iceberg REST Catalog Adapter Test Fixture | ||
|
|
||
| For converting different catalog implementations into a rest one. | ||
ajantha-bhat marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| Adapter for wrapping the existing catalog backends over REST. | ||
|
|
||
|
|
||
| ## Build the Docker Image | ||
|
|
||
| When making changes to the local files and test them out, you can build the image locally: | ||
|
|
||
| ```bash | ||
| # Build the project from iceberg root directory | ||
| ./gradlew :iceberg-open-api:shadowJar | ||
|
|
||
| # Rebuild the docker image | ||
| docker image rm -f apache/iceberg-rest-adapter && docker build -t apache/iceberg-rest-adapter -f docker/iceberg-rest-adapter-image/Dockerfile . | ||
| ``` | ||
|
|
||
| ## Browse | ||
|
|
||
| To browse the catalog, you can use `pyiceberg`: | ||
|
|
||
| ``` | ||
| ➜ ~ pyiceberg --uri http://localhost:8181 list | ||
| default | ||
| nyc | ||
| ride_sharing_dataset | ||
| ➜ ~ pyiceberg --uri http://localhost:8181 list nyc | ||
| nyc.taxis | ||
| nyc.taxis3 | ||
| nyc.taxis4 | ||
| nyc.taxis_copy_maybe | ||
| nyc.taxis_skeleton | ||
| nyc.taxis_skeleton2 | ||
| ➜ ~ pyiceberg --uri http://localhost:8181 describe --entity=table tpcds_iceberg.customer | ||
| Table format version 2 | ||
| Metadata location s3://iceberg-test-data/tpc/tpc-ds/3.2.0/1000/iceberg/customer/metadata/00001-1bccfcc4-69f6-4505-8df5-4de78356e327.metadata.json | ||
| Table UUID dce215f7-6301-4a73-acc4-6e12db016abb | ||
| Last Updated 1653550004061 | ||
| Partition spec [] | ||
| Sort order [] | ||
| Schema Schema | ||
| ├── 1: c_customer_sk: optional int | ||
| ├── 2: c_customer_id: optional string | ||
| ├── 3: c_current_cdemo_sk: optional int | ||
| ├── 4: c_current_hdemo_sk: optional int | ||
| ├── 5: c_current_addr_sk: optional int | ||
| ├── 6: c_first_shipto_date_sk: optional int | ||
| ├── 7: c_first_sales_date_sk: optional int | ||
| ├── 8: c_salutation: optional string | ||
| ├── 9: c_first_name: optional string | ||
| ├── 10: c_last_name: optional string | ||
| ├── 11: c_preferred_cust_flag: optional string | ||
| ├── 12: c_birth_day: optional int | ||
| ├── 13: c_birth_month: optional int | ||
| ├── 14: c_birth_year: optional int | ||
| ├── 15: c_birth_country: optional string | ||
| ├── 16: c_login: optional string | ||
| ├── 17: c_email_address: optional string | ||
| └── 18: c_last_review_date: optional string | ||
| Snapshots Snapshots | ||
| └── Snapshot 0: s3://iceberg-test-data/tpc/tpc-ds/3.2.0/1000/iceberg/customer/metadata/snap-643656366840285027-1-5ce13497-7330-4d02-8206-7e313e43209c.avro | ||
| Properties write.object-storage.enabled true | ||
| write.object-storage.path s3://iceberg-test-data/tpc/tpc-ds/3.2.0/1000/iceberg/customer/data | ||
| ``` | ||
|
|
||
Fokko marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
|
||
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.