-
Notifications
You must be signed in to change notification settings - Fork 0
Polaris POC #133
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
base: main
Are you sure you want to change the base?
Polaris POC #133
Changes from all commits
4a41b5d
f87ddab
e30e37e
96171a3
b9c75cb
92c038d
a1f1f71
f26fa35
8b0f05d
745af4d
79e98dc
322409c
a9f65d7
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,51 @@ | ||
| """ | ||
| Initialize MinIO and Polaris credentials. | ||
|
|
||
| This runs after 00-notebookutils.py loads all the imports, so get_minio_credentials | ||
| is already available in the global namespace. | ||
| """ | ||
|
|
||
| # Setup logging | ||
| import logging | ||
|
|
||
| logger = logging.getLogger("berdl.startup") | ||
| logger.setLevel(logging.INFO) | ||
| if not logger.handlers: | ||
| handler = logging.StreamHandler() | ||
| formatter = logging.Formatter("%(message)s") | ||
| handler.setFormatter(formatter) | ||
| logger.addHandler(handler) | ||
|
|
||
| # --- MinIO Credentials --- | ||
| try: | ||
| # Set MinIO credentials to environment - also creates user if they don't exist | ||
| credentials = get_minio_credentials() # noqa: F821 | ||
| logger.info(f"✅ MinIO credentials set for user: {credentials.username}") | ||
|
|
||
| except Exception as e: | ||
| import warnings | ||
|
|
||
| warnings.warn(f"Failed to set MinIO credentials: {str(e)}", UserWarning) | ||
| logger.error(f"❌ Failed to set MinIO credentials: {str(e)}") | ||
| credentials = None | ||
|
|
||
| # --- Polaris Credentials --- | ||
| try: | ||
| polaris_creds = get_polaris_credentials() # noqa: F821 | ||
| if polaris_creds: | ||
| logger.info(f"✅ Polaris credentials set for catalog: {polaris_creds['personal_catalog']}") | ||
| if polaris_creds["tenant_catalogs"]: | ||
| logger.info(f" Tenant catalogs: {', '.join(polaris_creds['tenant_catalogs'])}") | ||
| # Clear the settings cache so downstream code (e.g., Spark Connect server startup) | ||
| # picks up the POLARIS_CREDENTIAL, POLARIS_PERSONAL_CATALOG, and | ||
| # POLARIS_TENANT_CATALOGS env vars that get_polaris_credentials() just set. | ||
| get_settings.cache_clear() # noqa: F821 | ||
| else: | ||
| logger.info("ℹ️ Polaris not configured, skipping Polaris credential setup") | ||
|
|
||
| except Exception as e: | ||
| import warnings | ||
|
|
||
| warnings.warn(f"Failed to set Polaris credentials: {str(e)}", UserWarning) | ||
| logger.warning(f"⚠️ Failed to set Polaris credentials: {str(e)}") | ||
| polaris_creds = None |
This file was deleted.
| Original file line number | Diff line number | Diff line change | ||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -68,7 +68,9 @@ | |||||||||||||
| # - MinIO: minio/minio123 | ||||||||||||||
| # - PostgreSQL: hive/hivepassword | ||||||||||||||
| services: | ||||||||||||||
| spark-notebook: | ||||||||||||||
| # Service names use the pattern: spark-notebook-{CI_KBASE_USERNAME} | ||||||||||||||
| # Update these keys if you change the usernames in .env | ||||||||||||||
| spark-notebook-tgu2: | ||||||||||||||
| # image: ghcr.io/berdatalakehouse/spark_notebook:main | ||||||||||||||
| # platform: linux/amd64 | ||||||||||||||
|
Comment on lines
+71
to
75
|
||||||||||||||
| build: | ||||||||||||||
|
|
@@ -85,7 +87,7 @@ services: | |||||||||||||
| - CDM_TASK_SERVICE_URL=http://localhost:8080 | ||||||||||||||
| - SPARK_CLUSTER_MANAGER_API_URL=http://localhost:8000 | ||||||||||||||
| - SPARK_MASTER_URL=spark://spark-master:7077 | ||||||||||||||
| - BERDL_POD_IP=spark-notebook | ||||||||||||||
| - BERDL_POD_IP=spark-notebook-${CI_KBASE_USERNAME} | ||||||||||||||
| - BERDL_HIVE_METASTORE_URI=thrift://hive-metastore:9083 | ||||||||||||||
|
|
||||||||||||||
| # MINIO CONFIGURATION | ||||||||||||||
|
|
@@ -98,6 +100,9 @@ services: | |||||||||||||
| # DATALAKE MCP SERVER CONFIGURATION | ||||||||||||||
| - DATALAKE_MCP_SERVER_URL=http://datalake-mcp-server:8000/apis/mcp | ||||||||||||||
|
|
||||||||||||||
| # POLARIS CONFIGURATION (per-user credentials provisioned dynamically by 01-credentials.py) | ||||||||||||||
| - POLARIS_CATALOG_URI=http://polaris:8181/api/catalog | ||||||||||||||
|
|
||||||||||||||
| # TRINO CONFIGURATION | ||||||||||||||
| - TRINO_HOST=trino | ||||||||||||||
| - TRINO_PORT=8080 | ||||||||||||||
|
|
@@ -148,6 +153,9 @@ services: | |||||||||||||
| - KBASE_ADMIN_ROLES=CDM_JUPYTERHUB_ADMIN | ||||||||||||||
| - KBASE_APPROVED_ROLES=BERDL_USER | ||||||||||||||
| - REDIS_URL=redis://redis:6379 | ||||||||||||||
| # Polaris admin credentials (only the governance service needs root access) | ||||||||||||||
| - POLARIS_CATALOG_URI=http://polaris:8181/api/catalog | ||||||||||||||
| - POLARIS_CREDENTIAL=root:s3cr3t | ||||||||||||||
Tianhao-Gu marked this conversation as resolved.
Show resolved
Hide resolved
Tianhao-Gu marked this conversation as resolved.
Show resolved
Hide resolved
|
||||||||||||||
| # Credential store (PostgreSQL) | ||||||||||||||
| - MMS_DB_HOST=postgres | ||||||||||||||
| - MMS_DB_PORT=5432 | ||||||||||||||
|
|
@@ -182,8 +190,16 @@ services: | |||||||||||||
| - KBASE_AUTH_URL=https://ci.kbase.us/services/auth/ | ||||||||||||||
| - KBASE_REQUIRED_ROLES=BERDL_USER | ||||||||||||||
| - MFA_EXEMPT_USERS=${CI_KBASE_USERNAME} | ||||||||||||||
| # POLARIS CONFIGURATION (per-user credentials provisioned dynamically) | ||||||||||||||
| - POLARIS_CATALOG_URI=http://polaris:8181/api/catalog | ||||||||||||||
| - BERDL_REDIS_HOST=redis | ||||||||||||||
| - BERDL_REDIS_PORT=6379 | ||||||||||||||
| volumes: | ||||||||||||||
| # Mount the shared /home directory to access all users' credentials | ||||||||||||||
| # This allows the MCP server to dynamically read any user's credentials | ||||||||||||||
| # from /home/{username}/.berdl_minio_credentials | ||||||||||||||
| # In K8s: mount the parent directory or use a shared volume | ||||||||||||||
| - users_home:/home:ro | ||||||||||||||
|
Comment on lines
+197
to
+202
|
||||||||||||||
| volumes: | |
| # Mount the shared /home directory to access all users' credentials | |
| # This allows the MCP server to dynamically read any user's credentials | |
| # from /home/{username}/.berdl_minio_credentials | |
| # In K8s: mount the parent directory or use a shared volume | |
| - users_home:/home:ro |
Uh oh!
There was an error while loading. Please reload this page.