-
Notifications
You must be signed in to change notification settings - Fork 476
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
Changes from 1 commit
c125b2b
6a4be53
f776509
aa8dc9f
1c4a0b8
37b35eb
841ec2e
f338738
8fd5ff8
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 |
|---|---|---|
|
|
@@ -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}", | ||
|
Contributor
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. This is a regression, it should remain USER_CLIENT_ID/SECRET - these are user credentials rather than the admin credentials in CLIENT_ID/SECRET
Contributor
Author
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 did noticed this one last night and assuming there is intensional. However, going through the quickstart guide, this is supposed to be the credential created at the end of the polaris CLI. But Now assuming we want to keep it this way, an end-user can't really define this one until polaris CLI returns the value back (which needed to bring up docker compose first, run polaris CLI for entities creation, then restart spark-sql to have this be effective). This restart workflow is really odd imo and we should replace it with other more automated workflow. If this is causing regression, I can change it back. But I don't think we ask user to follow the restart workflow as it is really tedious imo. Let me know what you think.
Contributor
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. Take a look at this: https://polaris.apache.org/in-dev/unreleased/getting-started/using-polaris/#connecting-with-spark We do ask users to refresh their Docker containers once they export the required variables. You've correctly pointed out the chicken-and-the-egg problem we have here, but unfortunately this is how we have solved it so far - asking the user for one line ran is not completely unreasonable and we have no better known solution without breaking the Docker Compose file down even further :(
Contributor
Author
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. But there are couple problem with both existed route as well as the above, let me share my observations: On terminal 1, we will run the following: Due to Now on terminal 2, we do the needed work to bootstrap polaris entities and have a different principal created and run the following to set values for environment variables: and try to start the failed containers here with current command in the doc: This will actually crashed the first setup as two docker compose command on diff terminal/session will create two diff projects and they are trying to bind to the same ports. Now to workaround the problem, I added
Contributor
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. Sorry, missed this comment. But I see what's the issue here - the original Docker Compose command should've been run with the "-d" detached option so that everything runs in one terminal only. Not sure how I missed that, sorry about that. We shouldn't need to force users to run multiple terminals for any of these commands. |
||
| --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 | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -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/ | ||
|
Contributor
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. 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?
Contributor
Author
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. 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.
Contributor
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. Sorry, this comment is in conjunction with the suggestion from the overall review's comment. We should do the following:
Does this make sense?
Contributor
Author
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 I got what you mean. I had made some changes to this doc for refactor. Please review. |
||
| 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: | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.