Conversation
- Steps 2, 3, 4, 7: Replaced free-text prompts with numbered selection menus backed by auto-discovery. Profiles, catalogs, warehouses, and Lakebase instances are now fetched from the workspace and presented as a list — no more copy-pasting IDs. - Step 5: Added a recommended default to the model picker. Pressing Enter now accepts Claude Sonnet 4.6 without typing a number. The "Other" path no longer incorrectly defaulted to Claude when the user was trying to pick something different. - Step 6: MLflow tracing now defaults to enabled. Fixed a silent bug where databricks experiments create-experiment (a CLI subcommand that doesn't exist) was called and failing with no visible error, leaving MLflow disabled regardless of user input. Replaced with the REST API already used elsewhere in the script, and added a search-by-name fallback so re-runs don't fail when the experiment already exists. - Step 8: Added input validation and auto-fix for app names (enforces lowercase, hyphens only, suggests corrections). - Y/N prompts: Standardized all prompts to [Y/N] — previously mixed [Y/n] and [y/N] depending on which option was the default. - .env.deploy values: Quoted all variable assignments to handle edge cases with special characters. - Removed APP_NAME_DEFAULT — it was used to build the MLflow experiment path before the app name was collected, causing a mismatch if the user chose a different name. Test plan - Run ./scripts/install.sh end-to-end on a workspace with existing catalogs, warehouses, and Lakebase instances — verify selection menus populate correctly - Run with MLflow enabled, accept default path — verify experiment is created and ID appears in the Step 9 summary - Run a second time with the same MLflow path — verify the search fallback finds the existing experiment instead of failing - Enter an invalid app name — verify the auto-fix suggestion and confirm/reject flow works - Verify .env.deploy is written with quoted values
- install.sh: replace free-text prompts with numbered menus for profiles, catalogs, warehouses, Lakebase, and LLM model selection; add auth status sections (Default / Logged in / Not logged in) to profile picker; support Enter-to-accept for recommended model; default MLflow tracing to enabled; fix experiment creation to use REST API instead of non-existent CLI subcommand with search-by-name fallback; standardize Y/N prompts to [Y/N]; add app name validation with auto-fix; remove misleading defaults on LLM manual entry path - app.yaml: add resources section declaring sql-warehouse with __WAREHOUSE_ID__ placeholder so apps deploy attaches the warehouse as an app resource automatically - deploy.sh: inject __WAREHOUSE_ID__ via sed alongside other placeholders; remove user_api_scopes from resource PATCH (caused silent failure on workspaces without user token passthrough) - deploy-config.sh: fix LAKEBASE_INSTANCE default from app name to empty so skipping Lakebase during install is respected on redeploy Co-authored-by: Isaac
- install.sh: kept auto-discovery approach for Lakebase instances (main used APP_NAME_DEFAULT prompt which was removed in this branch) - deploy.sh: took main's Lakebase Autoscaling setup and postgres resource resolution blocks; kept this branch's fix of omitting user_api_scopes from the resources PATCH (fails on workspaces without user token passthrough enabled) Co-authored-by: Isaac
|
Test Plan First-time install (./scripts/install.sh) Step 2 — Profile selection
Step 3 — Catalog
Step 4 — SQL Warehouse
Step 5 — LLM model
Step 6 — MLflow tracing
Step 7 — Lakebase
Deploy (./scripts/deploy.sh) SQL Warehouse as App Resource
Lakebase empty-string fix
No regression on existing deploys
|
Lakebase discovery (Step 7) queries the wrong API
databricks api get /api/2.0/database/instancesBut the entire downstream pipeline — # deploy.sh
--project-name "$LAKEBASE_INSTANCE"
databricks api get "/api/2.0/postgres/projects/$LAKEBASE_INSTANCE/branches/production/databases"
# setup_lakebase.py
w.postgres.get_project(name=f"projects/{project_name}")
w.postgres.create_project(project_id=project_name, ...)A user could select a provisioned instance from the menu, then The discovery call should be |
Updated the code to only support Lakebase autoscaling vs provisioned lakebase
|
@hiydavid This has been updated! |
hiydavid
left a comment
There was a problem hiding this comment.
Missing user_api_scopes in deploy PATCH
The PR removed user_api_scopes from the deploy.sh PATCH payload (line ~562) with the assumption that databricks apps deploy applies scopes from app.yaml. It doesn't — scopes defined in app.yaml are documentation-only; the API PATCH is what actually configures them on the app.
Result: After a fresh deploy, the app only has the two default scopes (iam.current-user:read, iam.access-control:read) and is missing all the required ones:
sqldashboards.genieserving.serving-endpointscatalog.catalogs:readcatalog.schemas:readcatalog.tables:readfiles.files
Fix: Add user_api_scopes back to the PATCH payload in deploy.sh (~line 562-595). The scopes list that was removed needs to be restored:
scopes = ['sql', 'dashboards.genie', 'serving.serving-endpoints',
'catalog.catalogs:read', 'catalog.schemas:read',
'catalog.tables:read', 'files.files']And the print at the end should include them again:
print(json.dumps({'user_api_scopes': scopes, 'resources': list(by_name.values())}))The comment about "user token passthrough" in the old code was incorrect — user_api_scopes on the PATCH API works in all workspaces. That's a separate feature from what the PR description describes.
The PATCH to /api/2.0/apps/{name} is the mechanism that actually
configures OAuth scopes on a Databricks App. app.yaml user_api_scopes
are not applied by apps deploy. The prior commit removed user_api_scopes
based on incorrect reasoning about user token passthrough — these scopes
work in all workspaces.
Without this, deployed apps only get the two default scopes
(iam.current-user:read, iam.access-control:read) and are missing the
seven required ones: sql, dashboards.genie, serving.serving-endpoints,
catalog.catalogs:read, catalog.schemas:read, catalog.tables:read,
files.files.
Co-authored-by: Isaac
|
Fixed in 42d4722. Restored |
- _prompt_yn now shows which option Enter accepts ([Y/N, Enter=Y]) instead of the ambiguous static [Y/N] hint - PROFILES_EXIT is now captured correctly by running databricks auth profiles before the pipeline so the exit code reaches the parent shell (process substitution subshell prevented the original assignment) - MLflow experiment path is passed via sys.argv / os.environ instead of shell-interpolated into Python/JSON literals, preventing breakage on paths containing single or double quotes Co-authored-by: Isaac
I created this code and then resolved with Claude - I'd love extra eyes on this to confirm it works properly
Improve install.sh UX and fix deploy resource configuration
Description:
This PR overhauls the install.sh interactive setup experience and fixes several bugs discovered during real-world install testing.
UX improvements (install.sh)
"Logged in" group (with checkmarks), then a "Not logged in" group. Auth status is discovered live via databricks auth profiles.
/Shared/genie-workbench-agent-tracing.
Bug fixes
REST API (POST /api/2.0/mlflow/experiments/create) with a search-by-name fallback for experiments that already exist.
workspace has "user token passthrough" enabled. Removed user_api_scopes from the PATCH payload. Scopes are now set exclusively via app.yaml
during apps deploy.
the app name when .env.deploy contained an empty string. Fixed to ${GENIE_LAKEBASE_INSTANCE:-} (no fallback).
Files changed