From c125b2b4e2f8d07d950bd7ea0313919ab4e3e7ae Mon Sep 17 00:00:00 2001 From: Yong Date: Mon, 19 May 2025 00:27:56 -0500 Subject: [PATCH 1/7] Fix quickstart doc with docker compose --- getting-started/assets/.env | 2 ++ .../assets/postgres/docker-compose-postgres.yml | 2 +- getting-started/eclipselink/README.md | 3 ++- .../eclipselink/docker-compose-bootstrap-db.yml | 4 ++-- getting-started/eclipselink/docker-compose.yml | 8 ++++---- .../in-dev/unreleased/getting-started/quickstart.md | 3 ++- 6 files changed, 13 insertions(+), 9 deletions(-) create mode 100644 getting-started/assets/.env diff --git a/getting-started/assets/.env b/getting-started/assets/.env new file mode 100644 index 0000000000..4f34a2b211 --- /dev/null +++ b/getting-started/assets/.env @@ -0,0 +1,2 @@ +CLIENT_ID=root +CLIENT_SECRET=s3cr3t \ No newline at end of file diff --git a/getting-started/assets/postgres/docker-compose-postgres.yml b/getting-started/assets/postgres/docker-compose-postgres.yml index 393f59fb6c..2684b141a9 100644 --- a/getting-started/assets/postgres/docker-compose-postgres.yml +++ b/getting-started/assets/postgres/docker-compose-postgres.yml @@ -32,7 +32,7 @@ services: volumes: # Bind local conf file to a convenient location in the container - type: bind - source: ../assets/postgres/postgresql.conf + source: ${ASSETS_PATH}/postgres/postgresql.conf target: /etc/postgresql/postgresql.conf command: - "postgres" diff --git a/getting-started/eclipselink/README.md b/getting-started/eclipselink/README.md index aaeac63714..ebba6a9818 100644 --- a/getting-started/eclipselink/README.md +++ b/getting-started/eclipselink/README.md @@ -37,7 +37,8 @@ This example requires `jq` to be installed on your machine. 2. Start the docker compose group by running the following command from the root of the repository: ```shell - docker compose -f getting-started/eclipselink/docker-compose-bootstrap-db.yml -f getting-started/assets/postgres/docker-compose-postgres.yml -f getting-started/eclipselink/docker-compose.yml up + export ASSETS_PATH=$(pwd)/getting-started/assets/ + docker compose --env-file getting-started/assets/.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 ``` 3. Using spark-sql: attach to the running spark-sql container: diff --git a/getting-started/eclipselink/docker-compose-bootstrap-db.yml b/getting-started/eclipselink/docker-compose-bootstrap-db.yml index 5861f59166..7edc91fad3 100644 --- a/getting-started/eclipselink/docker-compose-bootstrap-db.yml +++ b/getting-started/eclipselink/docker-compose-bootstrap-db.yml @@ -25,11 +25,11 @@ services: polaris.persistence.type: eclipse-link polaris.persistence.eclipselink.configuration-file: /deployments/config/eclipselink/persistence.xml volumes: - - ../assets/eclipselink/:/deployments/config/eclipselink + - ${ASSETS_PATH}/eclipselink/:/deployments/config/eclipselink command: - "bootstrap" - "--realm=POLARIS" - - "--credential=POLARIS,root,s3cr3t" + - "--credential=POLARIS,${CLIENT_ID},${CLIENT_SECRET}" polaris: depends_on: polaris-bootstrap: diff --git a/getting-started/eclipselink/docker-compose.yml b/getting-started/eclipselink/docker-compose.yml index 68a682c622..e6e737d171 100644 --- a/getting-started/eclipselink/docker-compose.yml +++ b/getting-started/eclipselink/docker-compose.yml @@ -38,7 +38,7 @@ services: quarkus.otel.sdk.disabled: "true" POLARIS_BOOTSTRAP_CREDENTIALS: POLARIS,${CLIENT_ID},${CLIENT_SECRET} volumes: - - ../assets/eclipselink/:/deployments/config/eclipselink + - ${ASSETS_PATH}/eclipselink/:/deployments/config/eclipselink healthcheck: test: ["CMD", "curl", "http://localhost:8182/q/health"] interval: 2s @@ -58,7 +58,7 @@ services: - CLIENT_ID=${CLIENT_ID} - CLIENT_SECRET=${CLIENT_SECRET} volumes: - - ../assets/polaris/:/polaris + - ${ASSETS_PATH}/polaris/:/polaris entrypoint: '/bin/sh -c "chmod +x /polaris/create-catalog.sh && /polaris/create-catalog.sh"' spark-sql: @@ -82,7 +82,7 @@ services: --conf, "spark.sql.catalog.quickstart_catalog.type=rest", --conf, "spark.sql.catalog.quickstart_catalog.warehouse=quickstart_catalog", --conf, "spark.sql.catalog.quickstart_catalog.uri=http://polaris:8181/api/catalog", - --conf, "spark.sql.catalog.quickstart_catalog.credential=${USER_CLIENT_ID}:${USER_CLIENT_SECRET}", + --conf, "spark.sql.catalog.quickstart_catalog.credential=${CLIENT_ID}:${CLIENT_SECRET}", --conf, "spark.sql.catalog.quickstart_catalog.scope=PRINCIPAL_ROLE:ALL", --conf, "spark.sql.defaultCatalog=quickstart_catalog", --conf, "spark.sql.catalogImplementation=in-memory", @@ -102,4 +102,4 @@ services: ports: - "8080:8080" volumes: - - ../assets/trino-config/catalog:/etc/trino/catalog + - ${ASSETS_PATH}/trino-config/catalog:/etc/trino/catalog diff --git a/site/content/in-dev/unreleased/getting-started/quickstart.md b/site/content/in-dev/unreleased/getting-started/quickstart.md index 166d87ba1a..70b8e25504 100644 --- a/site/content/in-dev/unreleased/getting-started/quickstart.md +++ b/site/content/in-dev/unreleased/getting-started/quickstart.md @@ -36,7 +36,8 @@ 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 +export ASSETS_PATH=$(pwd)/getting-started/assets/ +docker compose --env-file getting-started/assets/.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 ``` 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: From 6a4be53ddee9c27dcb4f1e0bcba8d5c9b26840ee Mon Sep 17 00:00:00 2001 From: Yong Date: Mon, 19 May 2025 22:34:37 -0500 Subject: [PATCH 2/7] Fix quickstart doc with docker compose --- getting-started/assets/{.env => env} | 0 getting-started/eclipselink/README.md | 2 +- site/content/in-dev/unreleased/getting-started/quickstart.md | 2 +- 3 files changed, 2 insertions(+), 2 deletions(-) rename getting-started/assets/{.env => env} (100%) diff --git a/getting-started/assets/.env b/getting-started/assets/env similarity index 100% rename from getting-started/assets/.env rename to getting-started/assets/env diff --git a/getting-started/eclipselink/README.md b/getting-started/eclipselink/README.md index ebba6a9818..6819fe0c74 100644 --- a/getting-started/eclipselink/README.md +++ b/getting-started/eclipselink/README.md @@ -38,7 +38,7 @@ This example requires `jq` to be installed on your machine. ```shell export ASSETS_PATH=$(pwd)/getting-started/assets/ - docker compose --env-file getting-started/assets/.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 + docker compose --env-file getting-started/assets/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 ``` 3. Using spark-sql: attach to the running spark-sql container: diff --git a/site/content/in-dev/unreleased/getting-started/quickstart.md b/site/content/in-dev/unreleased/getting-started/quickstart.md index 70b8e25504..0ed5c3ba6a 100644 --- a/site/content/in-dev/unreleased/getting-started/quickstart.md +++ b/site/content/in-dev/unreleased/getting-started/quickstart.md @@ -37,7 +37,7 @@ cd ~/polaris -Dquarkus.container-image.tag=postgres-latest \ -Dquarkus.container-image.build=true export ASSETS_PATH=$(pwd)/getting-started/assets/ -docker compose --env-file getting-started/assets/.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 +docker compose --env-file getting-started/assets/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 ``` 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: From f776509c76eae2873da1327995895098aeb6a305 Mon Sep 17 00:00:00 2001 From: Yong Date: Mon, 19 May 2025 22:35:25 -0500 Subject: [PATCH 3/7] Fix quickstart doc with docker compose --- getting-started/assets/{env => getting-started.env} | 0 getting-started/eclipselink/README.md | 2 +- site/content/in-dev/unreleased/getting-started/quickstart.md | 2 +- 3 files changed, 2 insertions(+), 2 deletions(-) rename getting-started/assets/{env => getting-started.env} (100%) diff --git a/getting-started/assets/env b/getting-started/assets/getting-started.env similarity index 100% rename from getting-started/assets/env rename to getting-started/assets/getting-started.env diff --git a/getting-started/eclipselink/README.md b/getting-started/eclipselink/README.md index 6819fe0c74..dd59251fed 100644 --- a/getting-started/eclipselink/README.md +++ b/getting-started/eclipselink/README.md @@ -38,7 +38,7 @@ This example requires `jq` to be installed on your machine. ```shell export ASSETS_PATH=$(pwd)/getting-started/assets/ - docker compose --env-file getting-started/assets/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 + docker compose --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 ``` 3. Using spark-sql: attach to the running spark-sql container: diff --git a/site/content/in-dev/unreleased/getting-started/quickstart.md b/site/content/in-dev/unreleased/getting-started/quickstart.md index 0ed5c3ba6a..83d6fd527a 100644 --- a/site/content/in-dev/unreleased/getting-started/quickstart.md +++ b/site/content/in-dev/unreleased/getting-started/quickstart.md @@ -37,7 +37,7 @@ cd ~/polaris -Dquarkus.container-image.tag=postgres-latest \ -Dquarkus.container-image.build=true export ASSETS_PATH=$(pwd)/getting-started/assets/ -docker compose --env-file getting-started/assets/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 +docker compose --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 ``` 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: From 1c4a0b8026bdbfcd825ee77bf6e04305c7aac792 Mon Sep 17 00:00:00 2001 From: Yong Date: Wed, 21 May 2025 00:34:39 -0500 Subject: [PATCH 4/7] Fix quickstart doc with docker compose --- getting-started/eclipselink/README.md | 5 +- .../eclipselink/docker-compose.yml | 2 +- .../unreleased/getting-started/quickstart.md | 56 ++++++++++++------- .../getting-started/using-polaris.md | 6 +- 4 files changed, 46 insertions(+), 23 deletions(-) diff --git a/getting-started/eclipselink/README.md b/getting-started/eclipselink/README.md index dd59251fed..e969839a04 100644 --- a/getting-started/eclipselink/README.md +++ b/getting-started/eclipselink/README.md @@ -38,7 +38,10 @@ This example requires `jq` to be installed on your machine. ```shell export ASSETS_PATH=$(pwd)/getting-started/assets/ - docker compose --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 + docker compose --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 ``` 3. Using spark-sql: attach to the running spark-sql container: diff --git a/getting-started/eclipselink/docker-compose.yml b/getting-started/eclipselink/docker-compose.yml index 13921094bc..d228adfec8 100644 --- a/getting-started/eclipselink/docker-compose.yml +++ b/getting-started/eclipselink/docker-compose.yml @@ -82,7 +82,7 @@ services: --conf, "spark.sql.catalog.quickstart_catalog.type=rest", --conf, "spark.sql.catalog.quickstart_catalog.warehouse=quickstart_catalog", --conf, "spark.sql.catalog.quickstart_catalog.uri=http://polaris:8181/api/catalog", - --conf, "spark.sql.catalog.quickstart_catalog.credential=${CLIENT_ID}:${CLIENT_SECRET}", + --conf, "spark.sql.catalog.quickstart_catalog.credential=${USER_CLIENT_ID}:${USER_CLIENT_SECRET}", --conf, "spark.sql.catalog.quickstart_catalog.scope=PRINCIPAL_ROLE:ALL", --conf, "spark.sql.defaultCatalog=quickstart_catalog", --conf, "spark.sql.catalogImplementation=in-memory", diff --git a/site/content/in-dev/unreleased/getting-started/quickstart.md b/site/content/in-dev/unreleased/getting-started/quickstart.md index 97065a24c7..2cfd846822 100644 --- a/site/content/in-dev/unreleased/getting-started/quickstart.md +++ b/site/content/in-dev/unreleased/getting-started/quickstart.md @@ -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,10 +36,38 @@ cd ~/polaris :polaris-quarkus-admin:assemble --rerun \ -Dquarkus.container-image.tag=postgres-latest \ -Dquarkus.container-image.build=true +``` +- **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/ -docker compose --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 ``` +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. +- **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: ``` @@ -49,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 ``` @@ -84,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 diff --git a/site/content/in-dev/unreleased/getting-started/using-polaris.md b/site/content/in-dev/unreleased/getting-started/using-polaris.md index 7713b149cb..370f831f58 100644 --- a/site/content/in-dev/unreleased/getting-started/using-polaris.md +++ b/site/content/in-dev/unreleased/getting-started/using-polaris.md @@ -21,12 +21,16 @@ Title: Using Polaris type: docs weight: 400 --- + ## Setup + Define your `CLIENT_ID` & `CLIENT_SECRET` and export them for future use. + ```shell export CLIENT_ID=YOUR_CLIENT_ID export CLIENT_SECRET=YOUR_CLIENT_SECRET ``` + ## Defining a Catalog In Polaris, the [catalog]({{% relref "../entities#catalog" %}}) is the top-level entity that objects like [tables]({{% relref "../entities#table" %}}) and [views]({{% relref "../entities#view" %}}) are organized under. With a Polaris service running, you can create a catalog like so: @@ -167,7 +171,6 @@ bin/spark-sql \ --conf spark.sql.catalog.quickstart_catalog.client.region=us-west-2 ``` - Similar to the CLI commands above, this configures Spark to use the Polaris running at `localhost:8181`. If your Polaris server is running elsewhere, but sure to update the configuration appropriately. Finally, note that we include the `iceberg-aws-bundle` package here. If your table is using a different filesystem, be sure to include the appropriate dependency. @@ -176,6 +179,7 @@ Finally, note that we include the `iceberg-aws-bundle` package here. If your tab Refresh the Docker container with the user's credentials: ```shell +docker compose -f getting-started/eclipselink/docker-compose.yml down spark-sql docker compose -f getting-started/eclipselink/docker-compose.yml up -d ``` From 37b35eb643ed22bcd9c457e49c1b2a0a619b173e Mon Sep 17 00:00:00 2001 From: Yong Date: Wed, 21 May 2025 00:59:47 -0500 Subject: [PATCH 5/7] Fix quickstart doc with docker compose --- getting-started/eclipselink/docker-compose.yml | 4 ++-- .../unreleased/getting-started/using-polaris.md | 12 +++++++----- 2 files changed, 9 insertions(+), 7 deletions(-) diff --git a/getting-started/eclipselink/docker-compose.yml b/getting-started/eclipselink/docker-compose.yml index d228adfec8..cf41c7d271 100644 --- a/getting-started/eclipselink/docker-compose.yml +++ b/getting-started/eclipselink/docker-compose.yml @@ -95,8 +95,8 @@ services: polaris-setup: condition: service_completed_successfully environment: - - CLIENT_ID=${CLIENT_ID} - - CLIENT_SECRET=${CLIENT_SECRET} + - CLIENT_ID=${USER_CLIENT_ID} + - CLIENT_SECRET=${USER_CLIENT_SECRET} stdin_open: true tty: true ports: diff --git a/site/content/in-dev/unreleased/getting-started/using-polaris.md b/site/content/in-dev/unreleased/getting-started/using-polaris.md index 370f831f58..9c01d1c164 100644 --- a/site/content/in-dev/unreleased/getting-started/using-polaris.md +++ b/site/content/in-dev/unreleased/getting-started/using-polaris.md @@ -179,8 +179,9 @@ Finally, note that we include the `iceberg-aws-bundle` package here. If your tab Refresh the Docker container with the user's credentials: ```shell -docker compose -f getting-started/eclipselink/docker-compose.yml down spark-sql -docker compose -f getting-started/eclipselink/docker-compose.yml up -d +docker compose -p polaris -f getting-started/eclipselink/docker-compose.yml stop spark-sql +docker compose -p polaris -f getting-started/eclipselink/docker-compose.yml rm -f spark-sql +docker compose -p polaris -f getting-started/eclipselink/docker-compose.yml up -d --no-deps spark-sql ``` Attach to the running spark-sql container: @@ -241,14 +242,15 @@ org.apache.iceberg.exceptions.ForbiddenException: Forbidden: Principal 'quicksta Refresh the Docker container with the user's credentials: ```shell -docker compose -f getting-started/eclipselink/docker-compose.yml down trino -docker compose -f getting-started/eclipselink/docker-compose.yml up -d +docker compose -p polaris -f getting-started/eclipselink/docker-compose.yml stop trino +docker compose -p polaris -f getting-started/eclipselink/docker-compose.yml rm -f trino +docker compose -p polaris -f getting-started/eclipselink/docker-compose.yml up -d --no-deps trino ``` Attach to the running Trino container: ```shell -docker exec -it eclipselink-trino-1 trino +docker exec -it $(docker ps -q --filter name=trino) trino ``` You may not see Trino's prompt immediately, type ENTER to see it. A few commands that you can try: From 841ec2e757918b0a3bc5da17409dd9f93c28518d Mon Sep 17 00:00:00 2001 From: Yong Date: Thu, 22 May 2025 22:48:32 -0500 Subject: [PATCH 6/7] Fix quickstart doc with docker compose --- getting-started/assets/getting-started.env | 2 -- getting-started/eclipselink/README.md | 5 ++-- getting-started/jdbc/README.md | 1 + getting-started/jdbc/docker-compose.yml | 4 ++-- .../quickstart-deploy-aws.md | 2 ++ .../quickstart-deploy-azure.md | 2 ++ .../quickstart-deploy-gcp.md | 2 ++ .../unreleased/getting-started/quickstart.md | 24 ++++--------------- 8 files changed, 16 insertions(+), 26 deletions(-) delete mode 100644 getting-started/assets/getting-started.env diff --git a/getting-started/assets/getting-started.env b/getting-started/assets/getting-started.env deleted file mode 100644 index 4f34a2b211..0000000000 --- a/getting-started/assets/getting-started.env +++ /dev/null @@ -1,2 +0,0 @@ -CLIENT_ID=root -CLIENT_SECRET=s3cr3t \ No newline at end of file diff --git a/getting-started/eclipselink/README.md b/getting-started/eclipselink/README.md index e969839a04..ed5e5be3f2 100644 --- a/getting-started/eclipselink/README.md +++ b/getting-started/eclipselink/README.md @@ -38,8 +38,9 @@ This example requires `jq` to be installed on your machine. ```shell export ASSETS_PATH=$(pwd)/getting-started/assets/ - docker compose --env-file getting-started/assets/getting-started.env \ - -f getting-started/assets/postgres/docker-compose-postgres.yml \ + export CLIENT_ID=root + export CLIENT_SECRET=s3cr3t + docker compose -p polaris -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 ``` diff --git a/getting-started/jdbc/README.md b/getting-started/jdbc/README.md index ca2b181ee1..184667bd4b 100644 --- a/getting-started/jdbc/README.md +++ b/getting-started/jdbc/README.md @@ -40,6 +40,7 @@ This example requires `jq` to be installed on your machine. export QUARKUS_DATASOURCE_JDBC_URL=jdbc:postgresql://postgres:5432/POLARIS export QUARKUS_DATASOURCE_USERNAME=postgres export QUARKUS_DATASOURCE_PASSWORD=postgres + export ASSETS_PATH=$(pwd)/getting-started/assets/ docker compose -f getting-started/jdbc/docker-compose-bootstrap-db.yml -f getting-started/assets/postgres/docker-compose-postgres.yml -f getting-started/jdbc/docker-compose.yml up ``` diff --git a/getting-started/jdbc/docker-compose.yml b/getting-started/jdbc/docker-compose.yml index 7429f3a706..a10e0855b2 100644 --- a/getting-started/jdbc/docker-compose.yml +++ b/getting-started/jdbc/docker-compose.yml @@ -58,7 +58,7 @@ services: - AWS_ROLE_ARN=${AWS_ROLE_ARN} - AZURE_TENANT_ID=${AZURE_TENANT_ID} volumes: - - ../assets/polaris/:/polaris + - ${ASSETS_PATH}/polaris/:/polaris entrypoint: '/bin/sh -c "chmod +x /polaris/create-catalog.sh && /polaris/create-catalog.sh"' spark-sql: @@ -99,4 +99,4 @@ services: ports: - "8080:8080" volumes: - - ../assets/trino-config/catalog:/etc/trino/catalog + - ${ASSETS_PATH}/trino-config/catalog:/etc/trino/catalog diff --git a/site/content/in-dev/unreleased/getting-started/deploying-polaris/quickstart-deploy-aws.md b/site/content/in-dev/unreleased/getting-started/deploying-polaris/quickstart-deploy-aws.md index 7425c6e344..8754408c87 100644 --- a/site/content/in-dev/unreleased/getting-started/deploying-polaris/quickstart-deploy-aws.md +++ b/site/content/in-dev/unreleased/getting-started/deploying-polaris/quickstart-deploy-aws.md @@ -37,6 +37,7 @@ The requirements to run the script below are: ```shell chmod +x getting-started/assets/cloud_providers/deploy-aws.sh +export ASSETS_PATH=$(pwd)/getting-started/assets/ ./getting-started/assets/cloud_providers/deploy-aws.sh ``` @@ -50,6 +51,7 @@ export CLIENT_SECRET=s3cr3t To shut down the Polaris server, run the following commands: ```shell +export ASSETS_PATH=$(pwd)/getting-started/assets/ docker compose -f getting-started/eclipselink/docker-compose.yml down ``` diff --git a/site/content/in-dev/unreleased/getting-started/deploying-polaris/quickstart-deploy-azure.md b/site/content/in-dev/unreleased/getting-started/deploying-polaris/quickstart-deploy-azure.md index f8b75de79b..53ab57a9a3 100644 --- a/site/content/in-dev/unreleased/getting-started/deploying-polaris/quickstart-deploy-azure.md +++ b/site/content/in-dev/unreleased/getting-started/deploying-polaris/quickstart-deploy-azure.md @@ -32,6 +32,7 @@ The requirements to run the script below are: ```shell chmod +x getting-started/assets/cloud_providers/deploy-azure.sh +export ASSETS_PATH=$(pwd)/getting-started/assets/ ./getting-started/assets/cloud_providers/deploy-azure.sh ``` @@ -45,6 +46,7 @@ export CLIENT_SECRET=s3cr3t To shut down the Polaris server, run the following commands: ```shell +export ASSETS_PATH=$(pwd)/getting-started/assets/ docker compose -f getting-started/eclipselink/docker-compose.yml down ``` diff --git a/site/content/in-dev/unreleased/getting-started/deploying-polaris/quickstart-deploy-gcp.md b/site/content/in-dev/unreleased/getting-started/deploying-polaris/quickstart-deploy-gcp.md index 86ec4a89f0..d76d82b74f 100644 --- a/site/content/in-dev/unreleased/getting-started/deploying-polaris/quickstart-deploy-gcp.md +++ b/site/content/in-dev/unreleased/getting-started/deploying-polaris/quickstart-deploy-gcp.md @@ -32,6 +32,7 @@ The requirements to run the script below are: ```shell chmod +x getting-started/assets/cloud_providers/deploy-gcp.sh +export ASSETS_PATH=$(pwd)/getting-started/assets/ ./getting-started/assets/cloud_providers/deploy-gcp.sh ``` @@ -45,6 +46,7 @@ export CLIENT_SECRET=s3cr3t To shut down the Polaris server, run the following commands: ```shell +export ASSETS_PATH=$(pwd)/getting-started/assets/ docker compose -f getting-started/eclipselink/docker-compose.yml down ``` diff --git a/site/content/in-dev/unreleased/getting-started/quickstart.md b/site/content/in-dev/unreleased/getting-started/quickstart.md index 2cfd846822..d59d76ac73 100644 --- a/site/content/in-dev/unreleased/getting-started/quickstart.md +++ b/site/content/in-dev/unreleased/getting-started/quickstart.md @@ -39,35 +39,19 @@ cd ~/polaris ``` - **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. -- **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 \ +export ASSETS_PATH=$(pwd)/getting-started/assets/ +export CLIENT_ID=root +export CLIENT_SECRET=s3cr3t +docker compose -p polaris -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: ``` From 8fd5ff8d0bfbe4d7b117b75d03d7acf3a94c8c4c Mon Sep 17 00:00:00 2001 From: Yong Date: Thu, 22 May 2025 22:53:58 -0500 Subject: [PATCH 7/7] Fix conflict --- getting-started/jdbc/README.md | 3 --- 1 file changed, 3 deletions(-) diff --git a/getting-started/jdbc/README.md b/getting-started/jdbc/README.md index 061de61fae..0d562094c7 100644 --- a/getting-started/jdbc/README.md +++ b/getting-started/jdbc/README.md @@ -40,12 +40,9 @@ This example requires `jq` to be installed on your machine. export QUARKUS_DATASOURCE_JDBC_URL=jdbc:postgresql://postgres:5432/POLARIS export QUARKUS_DATASOURCE_USERNAME=postgres export QUARKUS_DATASOURCE_PASSWORD=postgres -<<<<<<< HEAD export ASSETS_PATH=$(pwd)/getting-started/assets/ -======= export CLIENT_ID=root export CLIENT_SECRET=s3cr3t ->>>>>>> main docker compose -f getting-started/jdbc/docker-compose-bootstrap-db.yml -f getting-started/assets/postgres/docker-compose-postgres.yml -f getting-started/jdbc/docker-compose.yml up ```