Skip to content

Commit 66770fc

Browse files
committed
Doc: Quickstart to use JDBC persistence
1 parent 44064cb commit 66770fc

File tree

6 files changed

+26
-26
lines changed

6 files changed

+26
-26
lines changed

getting-started/assets/cloud_providers/deploy-aws.sh

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -67,9 +67,8 @@ do
6767
done
6868

6969
POSTGRES_ADDR=$(echo $DESCRIBE_DB | jq -r '.["DBInstances"][0]["Endpoint"]' | jq -r '"\(.Address):\(.Port)"')
70-
71-
FULL_POSTGRES_ADDR=$(printf '%s\n' "jdbc:postgresql://$POSTGRES_ADDR/{realm}" | sed 's/[&/\]/\\&/g')
72-
sed -i "/jakarta.persistence.jdbc.url/ s|value=\"[^\"]*\"|value=\"$FULL_POSTGRES_ADDR\"|" "getting-started/assets/eclipselink/persistence.xml"
70+
export PG_JDBC_URL=$(printf '%s' "jdbc:postgresql://$POSTGRES_ADDR/POLARIS")
71+
echo ($PG_JDBC_URL)
7372

7473
S3_BUCKET_NAME="polaris-quickstart-s3-$RANDOM_SUFFIX"
7574
echo "S3 Bucket Name: $S3_BUCKET_NAME"
@@ -83,4 +82,4 @@ export STORAGE_LOCATION="s3://$S3_BUCKET_NAME/quickstart_catalog/"
8382
-Dquarkus.container-image.build=true \
8483
--no-build-cache
8584

86-
docker compose -f getting-started/eclipselink/docker-compose-bootstrap-db.yml -f getting-started/eclipselink/docker-compose.yml up -d
85+
docker compose -f getting-started/jdbc/docker-compose-bootstrap-db.yml -f getting-started/jdbc/docker-compose.yml up -d

getting-started/assets/cloud_providers/deploy-azure.sh

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -29,9 +29,8 @@ CREATE_DB_RESPONSE=$(az postgres flexible-server create -l $CURRENT_REGION -g $C
2929
az postgres flexible-server db create -g $CURRENT_RESOURCE_GROUP -s $INSTANCE_NAME -d POLARIS
3030

3131
POSTGRES_ADDR=$(echo $CREATE_DB_RESPONSE | jq -r '.host')
32-
33-
FULL_POSTGRES_ADDR=$(printf '%s\n' "jdbc:postgresql://$POSTGRES_ADDR:5432/{realm}" | sed 's/[&/\]/\\&/g')
34-
sed -i "/jakarta.persistence.jdbc.url/ s|value=\"[^\"]*\"|value=\"$FULL_POSTGRES_ADDR\"|" "getting-started/assets/eclipselink/persistence.xml"
32+
export PG_JDBC_URL=$(printf '%s' "jdbc:postgresql://$POSTGRES_ADDR/POLARIS")
33+
echo ($PG_JDBC_URL)
3534

3635
STORAGE_ACCOUNT_NAME="polaristest$RANDOM_SUFFIX"
3736
STORAGE_CONTAINER_NAME="polaris-test-container-$RANDOM_SUFFIX"
@@ -70,4 +69,4 @@ EOF
7069
-Dquarkus.container-image.build=true \
7170
--no-build-cache
7271

73-
docker compose -f getting-started/eclipselink/docker-compose-bootstrap-db.yml -f getting-started/eclipselink/docker-compose.yml up -d
72+
docker compose -f getting-started/jdbc/docker-compose-bootstrap-db.yml -f getting-started/jdbc/docker-compose.yml up -d

getting-started/assets/cloud_providers/deploy-gcp.sh

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -37,9 +37,8 @@ gcloud sql instances create $DB_INSTANCE_NAME \
3737
gcloud sql databases create POLARIS --instance=$DB_INSTANCE_NAME
3838

3939
POSTGRES_ADDR=$(gcloud sql instances describe $DB_INSTANCE_NAME --format="get(ipAddresses[0].ipAddress)")
40-
41-
FULL_POSTGRES_ADDR=$(printf '%s\n' "jdbc:postgresql://$POSTGRES_ADDR:5432/{realm}" | sed 's/[&/\]/\\&/g')
42-
sed -i "/jakarta.persistence.jdbc.url/ s|value=\"[^\"]*\"|value=\"$FULL_POSTGRES_ADDR\"|" "getting-started/assets/eclipselink/persistence.xml"
40+
export PG_JDBC_URL=$(printf '%s' "jdbc:postgresql://$POSTGRES_ADDR/POLARIS")
41+
echo ($PG_JDBC_URL)
4342

4443
GCS_BUCKET_NAME="polaris-test-gcs-$RANDOM_SUFFIX"
4544
echo "GCS Bucket Name: $GCS_BUCKET_NAME"
@@ -52,4 +51,4 @@ export STORAGE_LOCATION="gs://$GCS_BUCKET_NAME/quickstart_catalog/"
5251
-Dquarkus.container-image.build=true \
5352
--no-build-cache
5453

55-
docker compose -f getting-started/eclipselink/docker-compose-bootstrap-db.yml -f getting-started/eclipselink/docker-compose.yml up -d
54+
docker compose -f getting-started/jdbc/docker-compose-bootstrap-db.yml -f getting-started/jdbc/docker-compose.yml up -d

getting-started/jdbc/README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ 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+
export PG_JDBC_URL=jdbc:postgresql://postgres:5432/POLARIS
4041
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
4142
```
4243

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

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -22,11 +22,13 @@ services:
2222
# IMPORTANT: the image MUST contain the Postgres JDBC driver and EclipseLink dependencies, see README for instructions
2323
image: apache/polaris-admin-tool:postgres-latest
2424
environment:
25-
polaris.persistence.type: relational-jdbc
26-
quarkus.datasource.db-kind: pgsql
27-
quarkus.datasource.jdbc.url: jdbc:postgresql://postgres:5432/POLARIS
28-
quarkus.datasource.username: postgres
29-
quarkus.datasource.password: postgres
25+
- JAVA_DEBUG=true
26+
- JAVA_DEBUG_PORT='*:5005'
27+
- POLARIS_PERSISTENCE_TYPE=relational-jdbc
28+
- QUARKUS_DATASOURCE_DB_KIND=pgsql
29+
- QUARKUS_DATASOURCE_JDBC_URL=${PG_JDBC_URL}
30+
- QUARKUS_DATASOURCE_USERNAME=postgres
31+
- QUARKUS_DATASOURCE_PASSWORD=postgres
3032
command:
3133
- "bootstrap"
3234
- "--realm=POLARIS"

getting-started/jdbc/docker-compose.yml

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -29,15 +29,15 @@ services:
2929
# Optional, allows attaching a debugger to the Polaris JVM
3030
- "5005:5005"
3131
environment:
32-
JAVA_DEBUG: "true"
33-
JAVA_DEBUG_PORT: "*:5005"
34-
polaris.persistence.type: relational-jdbc
35-
quarkus.datasource.db-kind: pgsql
36-
quarkus.datasource.jdbc.url: jdbc:postgresql://postgres:5432/POLARIS
37-
quarkus.datasource.username: postgres
38-
quarkus.datasource.password: postgres
39-
polaris.realm-context.realms: POLARIS
40-
quarkus.otel.sdk.disabled: "true"
32+
- JAVA_DEBUG=true
33+
- JAVA_DEBUG_PORT=*:5005
34+
- POLARIS_PERSISTENCE_TYPE=relational-jdbc
35+
- QUARKUS_DATASOURCE_DB_KIND=pgsql
36+
- QUARKUS_DATASOURCE_JDBC_URL=${PG_JDBC_URL}
37+
- QUARKUS_DATASOURCE_USERNAME=postgres
38+
- QUARKUS_DATASOURCE_PASSWORD=postgres
39+
- POLARIS_REALM_CONTEXT_REALMS=POLARIS
40+
- QUARKUS_OTEL_SDK_DISABLED=true
4141
healthcheck:
4242
test: ["CMD", "curl", "http://localhost:8182/q/health"]
4343
interval: 2s

0 commit comments

Comments
 (0)