-
Notifications
You must be signed in to change notification settings - Fork 240
Fix quickstart doc with docker compose #1610
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
base: main
Are you sure you want to change the base?
Changes from all commits
c125b2b
6a4be53
f776509
aa8dc9f
1c4a0b8
37b35eb
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
CLIENT_ID=root | ||
CLIENT_SECRET=s3cr3t |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -24,10 +24,10 @@ weight: 200 | |
|
||
Polaris can be deployed via a docker image or as a standalone process. Before starting, be sure that you've satisfied the relevant prerequisites detailed in the previous page. | ||
|
||
## Docker Image | ||
|
||
To start using Polaris in Docker, build and launch Polaris, which is packaged with a Postgres instance, Apache Spark, and Trino. | ||
## Common Setup | ||
Before running Polaris, ensure you have completed the following setup steps: | ||
|
||
1. **Build Polaris** | ||
```shell | ||
cd ~/polaris | ||
./gradlew \ | ||
|
@@ -36,9 +36,38 @@ cd ~/polaris | |
:polaris-quarkus-admin:assemble --rerun \ | ||
-Dquarkus.container-image.tag=postgres-latest \ | ||
-Dquarkus.container-image.build=true | ||
docker compose -f getting-started/eclipselink/docker-compose-postgres.yml -f getting-started/eclipselink/docker-compose-bootstrap-db.yml -f getting-started/eclipselink/docker-compose.yml up | ||
``` | ||
- **For standalone**: Omit the `-Dquarkus.container-image.tag` and `-Dquarkus.container-image.build` options if you do not need to build a Docker image. | ||
|
||
2. **Set the Assets Path** | ||
```shell | ||
export ASSETS_PATH=$(pwd)/getting-started/assets/ | ||
``` | ||
|
||
3. **Set Authentication Credentials** | ||
|
||
Polaris supports multiple authentication methods, including the use of `CLIENT_ID` and `CLIENT_SECRET` environment variables. If you choose to use these credentials, you can set them as follows: | ||
|
||
```shell | ||
export CLIENT_ID=root | ||
export CLIENT_SECRET=s3cr3t | ||
``` | ||
- **For Docker**: These variables are configured in the `getting-started.env` file. To use custom values, export them as shown above and remove the `--env-file` option from the `docker compose` command. | ||
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. I think this is introducing additional mental complexity - why don't we just require everyone to export these variables and then remove the 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. Additionally, we need to do the same thing to the Cloud Providers pages - should be a simple copy-paste change to all 3 pages. 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. I think env file is helping. Currently we have auth hard-coded in couple place such as auth info for Postgres. Later on if we want to integrate with additional services (e.g. minio/keycloak), we will need to do the same with current route. Introducing a env file is pretty helpful for having a centralized location for config/auth info imo and keep the docker compose file clean. It is not a must for this PR, but I do think it will avoid many of those issues in the long run. |
||
- **For Standalone**: These variables are used for interacting with the Polaris CLI or other tools. | ||
|
||
## Running Polaris with Docker | ||
|
||
To start using Polaris in Docker and launch Polaris, which is packaged with a Postgres instance, Apache Spark, and Trino. | ||
|
||
```shell | ||
docker compose -p polaris --env-file getting-started/assets/getting-started.env \ | ||
-f getting-started/assets/postgres/docker-compose-postgres.yml \ | ||
-f getting-started/eclipselink/docker-compose-bootstrap-db.yml \ | ||
-f getting-started/eclipselink/docker-compose.yml up | ||
``` | ||
|
||
By default, this command uses the `getting-started.env` file to configure environment variables, including `CLIENT_ID` and `CLIENT_SECRET`. If you want to use custom authentication credentials, refer to the [Common Setup](#common-setup) section. | ||
|
||
You should see output for some time as Polaris, Spark, and Trino build and start up. Eventually, you won’t see any more logs and see some logs relating to Spark, resembling the following: | ||
|
||
``` | ||
|
@@ -48,24 +77,17 @@ spark-sql-1 | 25/04/04 05:39:38 WARN SparkSQLCLIDriver: WARNING: Direct | |
spark-sql-1 | 25/04/04 05:39:39 WARN RESTSessionCatalog: Iceberg REST client is missing the OAuth2 server URI configuration and defaults to http://polaris:8181/api/catalogv1/oauth/tokens. This automatic fallback will be removed in a future Iceberg release.It is recommended to configure the OAuth2 endpoint using the 'oauth2-server-uri' property to be prepared. This warning will disappear if the OAuth2 endpoint is explicitly configured. See https://github.com/apache/iceberg/issues/10537 | ||
``` | ||
|
||
Finally, set the following static credentials for interacting with the Polaris server in the following exercises: | ||
|
||
```shell | ||
export CLIENT_ID=root | ||
export CLIENT_SECRET=s3cr3t | ||
``` | ||
|
||
The Docker image pre-configures a sample catalog called `quickstart_catalog` that uses a local file system. | ||
|
||
## Running Polaris as a Standalone Process | ||
|
||
You can also start Polaris through Gradle (packaged within the Polaris repository): | ||
|
||
1. **Start the Server** | ||
|
||
Run the following command to start Polaris: | ||
|
||
```shell | ||
cd ~/polaris | ||
# Build the server | ||
./gradlew clean :polaris-quarkus-server:assemble :polaris-quarkus-server:quarkusAppPartsBuild --rerun | ||
# Start the server | ||
./gradlew run | ||
``` | ||
|
||
|
@@ -83,11 +105,6 @@ When using a Gradle-launched Polaris instance in this tutorial, we'll launch an | |
For more information on how to configure Polaris for production usage, see the [docs]({{% relref "../configuring-polaris-for-production" %}}). | ||
|
||
When Polaris is run using the `./gradlew run` command, the root principal credentials are `root` and `secret` for the `CLIENT_ID` and `CLIENT_SECRET`, respectively. | ||
You can also set these credentials as environment variables for use with the Polaris CLI: | ||
```shell | ||
export CLIENT_ID=root | ||
export CLIENT_SECRET=secret | ||
``` | ||
|
||
### Installing Apache Spark and Trino Locally for Testing | ||
|
||
|
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 we move this line to the top of the file with the exporting of the CLIENT_ID/SECRET, so that it only needs to be run once?
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.
Not sure if I followed, this is the beginning of the quickstart page (https://polaris.apache.org/in-dev/unreleased/getting-started/quickstart/#docker-image). This is only needed for the context of docker compose.
The export of CLIENT_ID/CLIENT_SECRET is invalid I think as the current state (without the env) file, this won't even be able to start.
If I understand correctly, we should consider move export of CLIENT_ID/CLIENT_SECRET to this section (as the current docker compose file has no credential, so it will try to set empty string for root credential (as well as username, which is in-valid).
The export is only needed if user doesn't want to use env file (as env file will load the credential in the updated command). Let me know what you think.
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.
Sorry, this comment is in conjunction with the suggestion from the overall review's comment. We should do the following:
Does this make sense?
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 I got what you mean. I had made some changes to this doc for refactor. Please review.