Skip to content

Commit 0eafcaa

Browse files
Fix quickstart doc with docker compose (#1610)
1 parent 5e4a6f0 commit 0eafcaa

File tree

11 files changed

+55
-36
lines changed

11 files changed

+55
-36
lines changed

getting-started/assets/postgres/docker-compose-postgres.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ services:
3232
volumes:
3333
# Bind local conf file to a convenient location in the container
3434
- type: bind
35-
source: ../assets/postgres/postgresql.conf
35+
source: ${ASSETS_PATH}/postgres/postgresql.conf
3636
target: /etc/postgresql/postgresql.conf
3737
command:
3838
- "postgres"

getting-started/eclipselink/README.md

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,12 @@ This example requires `jq` to be installed on your machine.
3737
2. Start the docker compose group by running the following command from the root of the repository:
3838

3939
```shell
40-
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
40+
export ASSETS_PATH=$(pwd)/getting-started/assets/
41+
export CLIENT_ID=root
42+
export CLIENT_SECRET=s3cr3t
43+
docker compose -p polaris -f getting-started/assets/postgres/docker-compose-postgres.yml \
44+
-f getting-started/eclipselink/docker-compose-bootstrap-db.yml \
45+
-f getting-started/eclipselink/docker-compose.yml up
4146
```
4247

4348
3. Using spark-sql: attach to the running spark-sql container:

getting-started/eclipselink/docker-compose-bootstrap-db.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,11 +25,11 @@ services:
2525
polaris.persistence.type: eclipse-link
2626
polaris.persistence.eclipselink.configuration-file: /deployments/config/eclipselink/persistence.xml
2727
volumes:
28-
- ../assets/eclipselink/:/deployments/config/eclipselink
28+
- ${ASSETS_PATH}/eclipselink/:/deployments/config/eclipselink
2929
command:
3030
- "bootstrap"
3131
- "--realm=POLARIS"
32-
- "--credential=POLARIS,root,s3cr3t"
32+
- "--credential=POLARIS,${CLIENT_ID},${CLIENT_SECRET}"
3333
polaris:
3434
depends_on:
3535
polaris-bootstrap:

getting-started/eclipselink/docker-compose.yml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ services:
4141
polaris.features."SUPPORTED_CATALOG_STORAGE_TYPES": "[\"FILE\",\"S3\",\"GCS\",\"AZURE\"]"
4242
polaris.readiness.ignore-severe-issues: "true"
4343
volumes:
44-
- ../assets/eclipselink/:/deployments/config/eclipselink
44+
- ${ASSETS_PATH}/eclipselink/:/deployments/config/eclipselink
4545
healthcheck:
4646
test: ["CMD", "curl", "http://localhost:8182/q/health"]
4747
interval: 2s
@@ -61,7 +61,7 @@ services:
6161
- CLIENT_ID=${CLIENT_ID}
6262
- CLIENT_SECRET=${CLIENT_SECRET}
6363
volumes:
64-
- ../assets/polaris/:/polaris
64+
- ${ASSETS_PATH}/polaris/:/polaris
6565
entrypoint: '/bin/sh -c "chmod +x /polaris/create-catalog.sh && /polaris/create-catalog.sh"'
6666

6767
spark-sql:
@@ -98,11 +98,11 @@ services:
9898
polaris-setup:
9999
condition: service_completed_successfully
100100
environment:
101-
- CLIENT_ID=${CLIENT_ID}
102-
- CLIENT_SECRET=${CLIENT_SECRET}
101+
- CLIENT_ID=${USER_CLIENT_ID}
102+
- CLIENT_SECRET=${USER_CLIENT_SECRET}
103103
stdin_open: true
104104
tty: true
105105
ports:
106106
- "8080:8080"
107107
volumes:
108-
- ../assets/trino-config/catalog:/etc/trino/catalog
108+
- ${ASSETS_PATH}/trino-config/catalog:/etc/trino/catalog

getting-started/jdbc/README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@ This example requires `jq` to be installed on your machine.
4040
export QUARKUS_DATASOURCE_JDBC_URL=jdbc:postgresql://postgres:5432/POLARIS
4141
export QUARKUS_DATASOURCE_USERNAME=postgres
4242
export QUARKUS_DATASOURCE_PASSWORD=postgres
43+
export ASSETS_PATH=$(pwd)/getting-started/assets/
4344
export CLIENT_ID=root
4445
export CLIENT_SECRET=s3cr3t
4546
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

getting-started/jdbc/docker-compose.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ services:
6464
- CLIENT_ID=${CLIENT_ID}
6565
- CLIENT_SECRET=${CLIENT_SECRET}
6666
volumes:
67-
- ../assets/polaris/:/polaris
67+
- ${ASSETS_PATH}/polaris/:/polaris
6868
entrypoint: '/bin/sh -c "chmod +x /polaris/create-catalog.sh && /polaris/create-catalog.sh"'
6969

7070
spark-sql:
@@ -108,4 +108,4 @@ services:
108108
- CLIENT_ID=${CLIENT_ID}
109109
- CLIENT_SECRET=${CLIENT_SECRET}
110110
volumes:
111-
- ../assets/trino-config/catalog:/etc/trino/catalog
111+
- ${ASSETS_PATH}/trino-config/catalog:/etc/trino/catalog

site/content/in-dev/unreleased/getting-started/deploying-polaris/quickstart-deploy-aws.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ The requirements to run the script below are:
3737

3838
```shell
3939
chmod +x getting-started/assets/cloud_providers/deploy-aws.sh
40+
export ASSETS_PATH=$(pwd)/getting-started/assets/
4041
./getting-started/assets/cloud_providers/deploy-aws.sh
4142
```
4243

@@ -50,6 +51,7 @@ export CLIENT_SECRET=s3cr3t
5051
To shut down the Polaris server, run the following commands:
5152

5253
```shell
54+
export ASSETS_PATH=$(pwd)/getting-started/assets/
5355
docker compose -f getting-started/eclipselink/docker-compose.yml down
5456
```
5557

site/content/in-dev/unreleased/getting-started/deploying-polaris/quickstart-deploy-azure.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ The requirements to run the script below are:
3232

3333
```shell
3434
chmod +x getting-started/assets/cloud_providers/deploy-azure.sh
35+
export ASSETS_PATH=$(pwd)/getting-started/assets/
3536
./getting-started/assets/cloud_providers/deploy-azure.sh
3637
```
3738

@@ -45,6 +46,7 @@ export CLIENT_SECRET=s3cr3t
4546
To shut down the Polaris server, run the following commands:
4647

4748
```shell
49+
export ASSETS_PATH=$(pwd)/getting-started/assets/
4850
docker compose -f getting-started/eclipselink/docker-compose.yml down
4951
```
5052

site/content/in-dev/unreleased/getting-started/deploying-polaris/quickstart-deploy-gcp.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ The requirements to run the script below are:
3232

3333
```shell
3434
chmod +x getting-started/assets/cloud_providers/deploy-gcp.sh
35+
export ASSETS_PATH=$(pwd)/getting-started/assets/
3536
./getting-started/assets/cloud_providers/deploy-gcp.sh
3637
```
3738

@@ -45,6 +46,7 @@ export CLIENT_SECRET=s3cr3t
4546
To shut down the Polaris server, run the following commands:
4647

4748
```shell
49+
export ASSETS_PATH=$(pwd)/getting-started/assets/
4850
docker compose -f getting-started/eclipselink/docker-compose.yml down
4951
```
5052

site/content/in-dev/unreleased/getting-started/quickstart.md

Lines changed: 21 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -24,10 +24,10 @@ weight: 200
2424

2525
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.
2626

27-
## Docker Image
28-
29-
To start using Polaris in Docker, build and launch Polaris, which is packaged with a Postgres instance, Apache Spark, and Trino.
27+
## Common Setup
28+
Before running Polaris, ensure you have completed the following setup steps:
3029

30+
1. **Build Polaris**
3131
```shell
3232
cd ~/polaris
3333
./gradlew \
@@ -36,7 +36,20 @@ cd ~/polaris
3636
:polaris-quarkus-admin:assemble --rerun \
3737
-Dquarkus.container-image.tag=postgres-latest \
3838
-Dquarkus.container-image.build=true
39-
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
39+
```
40+
- **For standalone**: Omit the `-Dquarkus.container-image.tag` and `-Dquarkus.container-image.build` options if you do not need to build a Docker image.
41+
42+
## Running Polaris with Docker
43+
44+
To start using Polaris in Docker and launch Polaris, which is packaged with a Postgres instance, Apache Spark, and Trino.
45+
46+
```shell
47+
export ASSETS_PATH=$(pwd)/getting-started/assets/
48+
export CLIENT_ID=root
49+
export CLIENT_SECRET=s3cr3t
50+
docker compose -p polaris -f getting-started/assets/postgres/docker-compose-postgres.yml \
51+
-f getting-started/eclipselink/docker-compose-bootstrap-db.yml \
52+
-f getting-started/eclipselink/docker-compose.yml up
4053
```
4154

4255
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 +61,17 @@ spark-sql-1 | 25/04/04 05:39:38 WARN SparkSQLCLIDriver: WARNING: Direct
4861
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
4962
```
5063

51-
Finally, set the following static credentials for interacting with the Polaris server in the following exercises:
52-
53-
```shell
54-
export CLIENT_ID=root
55-
export CLIENT_SECRET=s3cr3t
56-
```
57-
5864
The Docker image pre-configures a sample catalog called `quickstart_catalog` that uses a local file system.
5965

6066
## Running Polaris as a Standalone Process
6167

6268
You can also start Polaris through Gradle (packaged within the Polaris repository):
6369

70+
1. **Start the Server**
71+
72+
Run the following command to start Polaris:
73+
6474
```shell
65-
cd ~/polaris
66-
# Build the server
67-
./gradlew clean :polaris-quarkus-server:assemble :polaris-quarkus-server:quarkusAppPartsBuild --rerun
68-
# Start the server
6975
./gradlew run
7076
```
7177

@@ -83,11 +89,6 @@ When using a Gradle-launched Polaris instance in this tutorial, we'll launch an
8389
For more information on how to configure Polaris for production usage, see the [docs]({{% relref "../configuring-polaris-for-production" %}}).
8490

8591
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.
86-
You can also set these credentials as environment variables for use with the Polaris CLI:
87-
```shell
88-
export CLIENT_ID=root
89-
export CLIENT_SECRET=secret
90-
```
9192

9293
### Installing Apache Spark and Trino Locally for Testing
9394

0 commit comments

Comments
 (0)