-
Notifications
You must be signed in to change notification settings - Fork 383
Add a faster way to try Polaris #192
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
6 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 |
|---|---|---|
|
|
@@ -44,14 +44,19 @@ Apache Polaris is built using Gradle with Java 21+ and Docker 27+. | |
| - `./gradlew assemble` - To skip tests. | ||
| - `./gradlew test` - To run unit tests and integration tests. | ||
| - `./gradlew runApp` - To run the Polaris server locally on localhost:8181. | ||
| - The server starts with the in-memory mode, and it prints the auto-generated credentials to STDOUT in a message like this `realm: default-realm root principal credentials: <id>:<secret>` | ||
| - These credentials can be used as "Client ID" and "Client Secret" in OAuth2 requests (e.g. the `curl` command below). | ||
| - `./regtests/run.sh` - To run regression tests or end-to-end tests in another terminal. | ||
| - `./regtests/run_spark_sql.sh` - To connect from Spark SQL. Here are some example commands to run in the Spark SQL shell: | ||
| ```sql | ||
| create database db1; | ||
| show databases; | ||
| create table db1.table1 (id int, name string); | ||
| insert into db1.table1 values (1, 'a'); | ||
| select * from db1.table1; | ||
| ``` | ||
|
|
||
| ### More build and run options | ||
| Running in Docker | ||
| - `docker build -t localhost:5001/polaris:latest .` - To build the image. | ||
| - `docker run -p 8181:8181 localhost:5001/polaris:latest` - To run the image in standalone mode. | ||
| - `docker compose up --build --exit-code-from regtest` - To run regression tests in a Docker environment. | ||
|
|
||
| Running in Kubernetes | ||
| - `./run.sh` - To run Polaris as a mini-deployment locally. This will create one pod that bind itself to ports `8181` and `8182`. | ||
|
|
@@ -63,6 +68,10 @@ Running in Kubernetes | |
| - `kubectl get deployment -n polaris` - To check the status of the deployment. | ||
| - `kubectl describe deployment polaris-deployment -n polaris` - To troubleshoot if things aren't working as expected. | ||
|
|
||
| Running regression tests | ||
| - `./regtests/run.sh` - To run regression tests in another terminal. | ||
| - `docker compose up --build --exit-code-from regtest` - To run regression tests in a Docker environment. | ||
|
|
||
| Building docs | ||
| - Docs are generated using [Redocly](https://redocly.com/docs/cli/installation). To regenerate them, run the following | ||
| commands from the project root directory. | ||
|
|
@@ -71,24 +80,6 @@ docker run -p 8080:80 -v ${PWD}:/spec docker.io/redocly/cli join spec/docs.yaml | |
| docker run -p 8080:80 -v ${PWD}:/spec docker.io/redocly/cli build-docs spec/index.yaml --output=docs/index.html --config=spec/redocly.yaml | ||
| ``` | ||
|
|
||
| ## Connecting from an Engine | ||
|
||
| To connect from an engine like Spark, first create a catalog with these steps: | ||
| ```bash | ||
| # Generate a token for the root principal, replacing <CLIENT_ID> and <CLIENT_SECRET> with | ||
| # the values from the Polaris server output. | ||
| export PRINCIPAL_TOKEN=$(curl -X POST http://localhost:8181/api/catalog/v1/oauth/tokens \ | ||
| -d 'grant_type=client_credentials&client_id=<CLIENT_ID>&client_secret=<CLIENT_SECRET>&scope=PRINCIPAL_ROLE:ALL' \ | ||
| | jq -r '.access_token') | ||
|
|
||
| # Create a catalog named `polaris` | ||
| curl -i -X POST -H "Authorization: Bearer $PRINCIPAL_TOKEN" -H 'Accept: application/json' -H 'Content-Type: application/json' \ | ||
| http://localhost:8181/api/management/v1/catalogs \ | ||
| -d '{"name": "polaris", "id": 100, "type": "INTERNAL", "readOnly": false, "storageConfigInfo": {"storageType": "FILE"}, "properties": {"default-base-location": "file:///tmp/polaris"}}' | ||
| ``` | ||
|
|
||
| From here, you can use Spark to create namespaces, tables, etc. More details can be found in the | ||
| [Quick Start Guide](https://polaris.apache.org/#section/Quick-Start/Using-Iceberg-and-Polaris). | ||
|
|
||
| ## License | ||
|
|
||
| Apache Polaris is under the Apache License Version 2.0. See the [LICENSE](LICENSE). | ||
|
|
||
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.
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.
Adding a subtitle to separate the advanced build/run options from the basic ones.
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 think maybe we should separate out the spark sql command. Currently it is like
Build Stuff
Start Service Locally
Quick Demo // Unrelated?
Uh oh!
There was an error while loading. Please reload this page.
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 thought this a lot of time actually, we like it to be more logical organized. But I didn't do this since it makes the page much longer. I still prefer a compacted front page.