-
Notifications
You must be signed in to change notification settings - Fork 251
Revamp the Quick Start page #1367
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
eric-maynard
merged 22 commits into
apache:main
from
adnanhemani:adnanhemani/quick-start-main
Apr 17, 2025
Merged
Changes from all commits
Commits
Show all changes
22 commits
Select commit
Hold shift + click to select a range
3f739d0
First Draft with AWS
sfc-gh-ahemani cf01d00
try again
adnanhemani 08eebeb
try again
adnanhemani 79f7416
try again
adnanhemani 3d3d506
try again
adnanhemani 66826dd
try again
adnanhemani b458e68
try now
adnanhemani 569ccd8
should work
adnanhemani cbca8f5
AWS First Draft Complete
adnanhemani ec4782b
ensure file changed
adnanhemani cba005d
Azure First Draft Complete
adnanhemani e805d28
Azure First Draft, pt. 2
adnanhemani 2e824b9
Azure Completed
adnanhemani e62ce33
GCP First Draft
adnanhemani 9a2de0d
GCP Verified
adnanhemani 76f33b1
File structure fixed
adnanhemani db282f2
Remove Trino-specific tutorial
adnanhemani 7cfc76b
resolve merge conflicts
adnanhemani ac700ce
Restructured Quick Start
adnanhemani 36cf800
Addresses minor comments from @eric-maynard
adnanhemani db62bbd
Added reference to Deploying Polaris in Production
adnanhemani 4377884
Fix MD Link Checker
adnanhemani 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
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 |
---|---|---|
@@ -0,0 +1,78 @@ | ||
# | ||
# Licensed to the Apache Software Foundation (ASF) under one | ||
# or more contributor license agreements. See the NOTICE file | ||
# distributed with this work for additional information | ||
# regarding copyright ownership. The ASF licenses this file | ||
# to you under the Apache License, Version 2.0 (the | ||
# "License"); you may not use this file except in compliance | ||
# with the License. You may obtain a copy of the License at | ||
# | ||
# http://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# Unless required by applicable law or agreed to in writing, | ||
# software distributed under the License is distributed on an | ||
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY | ||
# KIND, either express or implied. See the License for the | ||
# specific language governing permissions and limitations | ||
# under the License. | ||
# | ||
|
||
EC2_INSTANCE_ID=$(cat /var/lib/cloud/data/instance-id) | ||
|
||
DESCRIBE_INSTANCE=$(aws ec2 describe-instances \ | ||
--instance-ids $EC2_INSTANCE_ID \ | ||
--query 'Reservations[*].Instances[*].{Instance:InstanceId,VPC:VpcId,AZ:Placement.AvailabilityZone}' \ | ||
--output json) | ||
|
||
CURRENT_VPC=$(echo $DESCRIBE_INSTANCE | jq -r .[0].[0]."VPC") | ||
|
||
CURRENT_REGION=$(echo $DESCRIBE_INSTANCE | jq -r .[0].[0]."AZ" | sed 's/.$//') | ||
|
||
ALL_SUBNETS=$(aws ec2 describe-subnets \ | ||
--region $CURRENT_REGION \ | ||
--query 'Subnets[*].{SubnetId:SubnetId}' \ | ||
--output json \ | ||
| jq -r '[.[]["SubnetId"]] | join(" ")') | ||
|
||
RANDOM_SUFFIX=$(head /dev/urandom | tr -dc 'A-Za-z0-9' | head -c 8) | ||
SUBNET_GROUP_NAME="polaris-db-subnet-group-$RANDOM_SUFFIX" | ||
INSTANCE_NAME="polaris-backend-test-$RANDOM_SUFFIX" | ||
|
||
aws rds create-db-subnet-group \ | ||
--db-subnet-group-name $SUBNET_GROUP_NAME \ | ||
--db-subnet-group-description "Apache Polaris Quickstart DB Subnet Group" \ | ||
--subnet-ids $ALL_SUBNETS | ||
|
||
DB_INSTANCE_INFO=$(aws rds create-db-instance \ | ||
--db-instance-identifier $INSTANCE_NAME \ | ||
--db-instance-class db.t3.micro \ | ||
--engine postgres \ | ||
--master-username postgres \ | ||
--master-user-password postgres \ | ||
--db-name POLARIS \ | ||
--db-subnet-group-name $SUBNET_GROUP_NAME \ | ||
--allocated-storage 10) | ||
|
||
DB_ARN=$(echo $DB_INSTANCE_INFO | jq -r '.["DBInstance"]["DBInstanceArn"]') | ||
|
||
DESCRIBE_DB=$(aws rds describe-db-instances --db-instance-identifier $DB_ARN) | ||
|
||
until echo $DESCRIBE_DB | jq -e '.["DBInstances"][0] | has("Endpoint")'; | ||
do | ||
echo "sleeping 10s to wait for Postgres DB provisioning..." | ||
sleep 10 | ||
DESCRIBE_DB=$(aws rds describe-db-instances --db-instance-identifier $DB_ARN) | ||
done | ||
|
||
POSTGRES_ADDR=$(echo $DESCRIBE_DB | jq -r '.["DBInstances"][0]["Endpoint"]' | jq -r '"\(.Address):\(.Port)"') | ||
|
||
FULL_POSTGRES_ADDR=$(printf '%s\n' "jdbc:postgresql://$POSTGRES_ADDR/{realm}" | sed 's/[&/\]/\\&/g') | ||
sed -i "/jakarta.persistence.jdbc.url/ s|value=\"[^\"]*\"|value=\"$FULL_POSTGRES_ADDR\"|" "getting-started/assets/eclipselink/persistence.xml" | ||
|
||
./gradlew clean :polaris-quarkus-server:assemble :polaris-quarkus-admin:assemble \ | ||
-PeclipseLinkDeps=org.postgresql:postgresql:42.7.4 \ | ||
-Dquarkus.container-image.tag=postgres-latest \ | ||
-Dquarkus.container-image.build=true \ | ||
--no-build-cache | ||
|
||
docker compose -f getting-started/eclipselink/docker-compose-bootstrap-db.yml -f getting-started/eclipselink/docker-compose.yml up -d |
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 |
---|---|---|
@@ -0,0 +1,40 @@ | ||
# | ||
# Licensed to the Apache Software Foundation (ASF) under one | ||
# or more contributor license agreements. See the NOTICE file | ||
# distributed with this work for additional information | ||
# regarding copyright ownership. The ASF licenses this file | ||
# to you under the Apache License, Version 2.0 (the | ||
# "License"); you may not use this file except in compliance | ||
# with the License. You may obtain a copy of the License at | ||
# | ||
# http://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# Unless required by applicable law or agreed to in writing, | ||
# software distributed under the License is distributed on an | ||
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY | ||
# KIND, either express or implied. See the License for the | ||
# specific language governing permissions and limitations | ||
# under the License. | ||
# | ||
|
||
CURRENT_REGION=$(curl -H Metadata:true "http://169.254.169.254/metadata/instance?api-version=2021-02-01" | jq -r '.compute.location') | ||
CURRENT_RESOURCE_GROUP=$(curl -H Metadata:true "http://169.254.169.254/metadata/instance?api-version=2021-02-01" | jq -r '.compute.resourceGroupName') | ||
RANDOM_SUFFIX=$(head /dev/urandom | tr -dc 'a-z0-9' | head -c 8) | ||
INSTANCE_NAME="polaris-backend-test-$RANDOM_SUFFIX" | ||
|
||
CREATE_DB_RESPONSE=$(az postgres flexible-server create -l $CURRENT_REGION -g $CURRENT_RESOURCE_GROUP -n $INSTANCE_NAME -u postgres -p postgres -y) | ||
|
||
az postgres flexible-server db create -g $CURRENT_RESOURCE_GROUP -s $INSTANCE_NAME -d POLARIS | ||
|
||
POSTGRES_ADDR=$(echo $CREATE_DB_RESPONSE | jq -r '.host') | ||
|
||
FULL_POSTGRES_ADDR=$(printf '%s\n' "jdbc:postgresql://$POSTGRES_ADDR:5432/{realm}" | sed 's/[&/\]/\\&/g') | ||
sed -i "/jakarta.persistence.jdbc.url/ s|value=\"[^\"]*\"|value=\"$FULL_POSTGRES_ADDR\"|" "getting-started/assets/eclipselink/persistence.xml" | ||
|
||
./gradlew clean :polaris-quarkus-server:assemble :polaris-quarkus-admin:assemble \ | ||
-PeclipseLinkDeps=org.postgresql:postgresql:42.7.4 \ | ||
-Dquarkus.container-image.tag=postgres-latest \ | ||
-Dquarkus.container-image.build=true \ | ||
--no-build-cache | ||
|
||
docker compose -f getting-started/eclipselink/docker-compose-bootstrap-db.yml -f getting-started/eclipselink/docker-compose.yml up -d |
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 |
---|---|---|
@@ -0,0 +1,50 @@ | ||
# | ||
# Licensed to the Apache Software Foundation (ASF) under one | ||
# or more contributor license agreements. See the NOTICE file | ||
# distributed with this work for additional information | ||
# regarding copyright ownership. The ASF licenses this file | ||
# to you under the Apache License, Version 2.0 (the | ||
# "License"); you may not use this file except in compliance | ||
# with the License. You may obtain a copy of the License at | ||
# | ||
# http://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# Unless required by applicable law or agreed to in writing, | ||
# software distributed under the License is distributed on an | ||
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY | ||
# KIND, either express or implied. See the License for the | ||
# specific language governing permissions and limitations | ||
# under the License. | ||
# | ||
|
||
CURRENT_ZONE=$(curl -H "Metadata-Flavor: Google" "http://169.254.169.254/computeMetadata/v1/instance/zone" | awk -F/ '{print $NF}') | ||
CURRENT_REGION=$(echo $CURRENT_ZONE | sed 's/-[a-z]$//') | ||
VM_INSTANCE_NAME=$(curl -H "Metadata-Flavor: Google" "http://169.254.169.254/computeMetadata/v1/instance/name") | ||
RANDOM_SUFFIX=$(head /dev/urandom | tr -dc 'a-z0-9' | head -c 8) | ||
DB_INSTANCE_NAME="polaris-backend-test-$RANDOM_SUFFIX" | ||
|
||
INSTANCE_IP=$(gcloud compute instances describe $VM_INSTANCE_NAME --zone=$CURRENT_ZONE --format="get(networkInterfaces[0].accessConfigs[0].natIP)") | ||
|
||
|
||
gcloud sql instances create $DB_INSTANCE_NAME \ | ||
--database-version=POSTGRES_17 \ | ||
--region=$CURRENT_REGION \ | ||
--tier=db-perf-optimized-N-4 \ | ||
--edition=ENTERPRISE_PLUS \ | ||
--root-password=postgres \ | ||
--authorized-networks="$INSTANCE_IP/32" | ||
|
||
gcloud sql databases create POLARIS --instance=$DB_INSTANCE_NAME | ||
|
||
POSTGRES_ADDR=$(gcloud sql instances describe $DB_INSTANCE_NAME --format="get(ipAddresses[0].ipAddress)") | ||
|
||
FULL_POSTGRES_ADDR=$(printf '%s\n' "jdbc:postgresql://$POSTGRES_ADDR:5432/{realm}" | sed 's/[&/\]/\\&/g') | ||
sed -i "/jakarta.persistence.jdbc.url/ s|value=\"[^\"]*\"|value=\"$FULL_POSTGRES_ADDR\"|" "getting-started/assets/eclipselink/persistence.xml" | ||
|
||
./gradlew clean :polaris-quarkus-server:assemble :polaris-quarkus-admin:assemble \ | ||
-PeclipseLinkDeps=org.postgresql:postgresql:42.7.4 \ | ||
-Dquarkus.container-image.tag=postgres-latest \ | ||
-Dquarkus.container-image.build=true \ | ||
--no-build-cache | ||
|
||
docker compose -f getting-started/eclipselink/docker-compose-bootstrap-db.yml -f getting-started/eclipselink/docker-compose.yml up -d |
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
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
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
32 changes: 32 additions & 0 deletions
32
getting-started/eclipselink/docker-compose-bootstrap-db.yml
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 |
---|---|---|
@@ -0,0 +1,32 @@ | ||
# | ||
# Licensed to the Apache Software Foundation (ASF) under one | ||
# or more contributor license agreements. See the NOTICE file | ||
# distributed with this work for additional information | ||
# regarding copyright ownership. The ASF licenses this file | ||
# to you under the Apache License, Version 2.0 (the | ||
# "License"); you may not use this file except in compliance | ||
# with the License. You may obtain a copy of the License at | ||
# | ||
# http://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# Unless required by applicable law or agreed to in writing, | ||
# software distributed under the License is distributed on an | ||
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY | ||
# KIND, either express or implied. See the License for the | ||
# specific language governing permissions and limitations | ||
# under the License. | ||
# | ||
|
||
services: | ||
polaris-bootstrap: | ||
# IMPORTANT: the image MUST contain the Postgres JDBC driver and EclipseLink dependencies, see README for instructions | ||
image: apache/polaris-admin-tool:postgres-latest | ||
environment: | ||
polaris.persistence.type: eclipse-link | ||
polaris.persistence.eclipselink.configuration-file: /deployments/config/eclipselink/persistence.xml | ||
volumes: | ||
- ../assets/eclipselink/:/deployments/config/eclipselink | ||
command: | ||
- "bootstrap" | ||
- "--realm=POLARIS" | ||
- "--credential=POLARIS,root,s3cr3t" |
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 |
---|---|---|
@@ -0,0 +1,45 @@ | ||
# | ||
# Licensed to the Apache Software Foundation (ASF) under one | ||
# or more contributor license agreements. See the NOTICE file | ||
# distributed with this work for additional information | ||
# regarding copyright ownership. The ASF licenses this file | ||
# to you under the Apache License, Version 2.0 (the | ||
# "License"); you may not use this file except in compliance | ||
# with the License. You may obtain a copy of the License at | ||
# | ||
# http://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# Unless required by applicable law or agreed to in writing, | ||
# software distributed under the License is distributed on an | ||
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY | ||
# KIND, either express or implied. See the License for the | ||
# specific language governing permissions and limitations | ||
# under the License. | ||
# | ||
|
||
services: | ||
postgres: | ||
image: postgres:17.4 | ||
ports: | ||
- "5432:5432" | ||
# set shared memory limit when using docker-compose | ||
shm_size: 128mb | ||
environment: | ||
POSTGRES_USER: postgres | ||
POSTGRES_PASSWORD: postgres | ||
POSTGRES_DB: POLARIS | ||
POSTGRES_INITDB_ARGS: "--encoding UTF8 --data-checksums" | ||
volumes: | ||
# Bind local conf file to a convenient location in the container | ||
- type: bind | ||
source: ./postgresql.conf | ||
target: /etc/postgresql/postgresql.conf | ||
command: | ||
- "postgres" | ||
- "-c" | ||
- "config_file=/etc/postgresql/postgresql.conf" | ||
healthcheck: | ||
test: "pg_isready -U postgres" | ||
interval: 5s | ||
timeout: 2s | ||
retries: 15 |
Oops, something went wrong.
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.
nit: spurious change
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.
Actually this is on purpose 😅 it makes the code to replace the JDBC URL as part of the deployment scripts a lot easier to read/understand
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.
Oh, that makes sense!