Skip to main content

Deployment Guide

Genie Workbench is deployed as a Databricks App. This guide covers both supported install paths:

  • Method 1 (Recommended): Databricks Workspace Notebook — run notebooks/install.py directly inside the Databricks workspace UI, using notebook-native WorkspaceClient() authentication. No local terminal, CLI profile, Node, npm, or uv setup required.
  • Method 2 (Backup): Local Terminal — scripts/install.sh plus scripts/deploy.sh, using the Databricks CLI and Asset Bundles.

Both paths deploy the same app and provision the same core resources. If you are already working inside Databricks, use Method 1.

Prerequisites​

Workspace resources​

A Databricks workspace with:

  • Apps enabled
  • A SQL Warehouse (Serverless recommended)
  • A Unity Catalog with CREATE SCHEMA permission
  • Lakebase Autoscaling available (optional but recommended for persistent scan history, starred agents, and agent sessions)
  • Databricks Foundation Model APIs enabled for the curated Create Agent and Auto-Optimize model list
  • Unity AI Gateway available in the workspace's region. LLM calls go through the gateway by default so their cost is attributed in system.ai_gateway.usage; both installers send one test request and stop with guidance if it fails. To use the serving endpoints directly instead, install with llm_route set to classic

Enable required preview features​

Before installing, enable these on the Databricks Previews page (workspace admins manage preview toggles):

  • Databricks Apps – On-Behalf-Of User Authorization (Public Preview)
note

On-Behalf-Of User Authorization is what lets the app act as the signed-in user (OBO auth). Without it, Genie API calls that require user identity will fail. See Authentication & Permissions for details.

Installer permissions​

The installer creates apps, UC objects, Lakebase projects, MLflow experiments, and jobs, and grants the app service principal across all of them. The person running the installer typically needs workspace-admin equivalents. If you are uncertain, have a workspace admin run the installer. The servicePrincipal.user role on the app service principal is not required: without it, the app sets the optimization job's run_as at startup. The installer grants the app access to Genie Agents, not to the data they reference: the Auto-Optimize tab checks the app service principal's read access per agent, and a run refuses to start on a schema it cannot read. See Authentication & Permissions for the full entitlement list.

Method 1 (notebook) prerequisites​

  • The repo cloned into a Databricks Git folder (covered in the steps below)
  • A Serverless compute session (environment v5) that can run the notebook

Method 2 (local terminal) prerequisites​

  • Databricks CLI v0.297.2+ (validated by preflight)
  • uv — Python package manager
  • Node.js ^20.19.0 or >=22.12.0 and npm
  • Python 3.11+
  • Network access to your npm registry — required to install frontend npm dependencies during the build step. Databricks internal users can run npm config set registry https://npm-proxy.dev.databricks.com/; external users use registry.npmjs.org. If you are behind a corporate firewall or VPN that blocks this, allowlist the registry or connect via a network that permits outbound HTTPS to it. The deploy script validates this connectivity during pre-flight checks.

First-Time Setup​

Choose one install path. Do not mix Method 1 and Method 2 for the same app instance unless you intentionally understand which source path is being deployed.

Use this path when you are already working inside Databricks. It runs entirely in the workspace UI — no local terminal, CLI profile, Node, npm, or uv required.

1. Clone the repo into your workspace​

In the Databricks workspace, go to Workspace → Create → Git folder and paste the repo URL:

https://github.com/databricks-solutions/databricks-genie-workbench.git

This creates a Git folder containing the full project, including notebooks/install.py.

2. Run notebooks/install.py​

Open notebooks/install.py, attach a Serverless compute session (environment v5), set the notebook widgets, and Run All.

WidgetRequiredDescription
app_nameYesDatabricks App name to create or update
catalogYesUnity Catalog where the optimizer writes its tables and artifacts
warehouse_idYesServerless SQL Warehouse ID used by the app and GSO
lakebase_modeYescreate, existing, or skip
lakebase_project_nameConditionalLakebase project name for create or existing; for create, blank keeps the project an existing app already uses, or <app-name>-lakebase for a new app. Leave blank when lakebase_mode is skip
llm_routeNogateway (default) sends LLM calls through Unity AI Gateway; classic calls the serving endpoints directly. There is no automatic fallback between them
release_checkNoauto (default) turns the daily release check on for a new app; for an existing app it keeps the previous answer, or asks users on the Admin tab if there was none. yes / no set it explicitly
note

The notebook user must hold the installer permissions. The notebook automatically grants visible Genie Agents to the app service principal, so the user needs CAN_MANAGE on each visible agent they want the app to manage.

3. What the notebook does​

The installer uses the shared scripts.deploy_lib Python library and notebook-native WorkspaceClient() authentication. It:

  1. Creates or updates the Databricks App and resolves its service principal, then, on the gateway route, sends one test request to Unity AI Gateway and stops with guidance if it fails
  2. Generates a clean source folder under /Workspace/Users/<you>/.genie-workbench-deploy/<app-name>/app (excluding deploy-only files, docs, tests, notebooks, scripts/, .git, .env*, node_modules, and requirements.txt)
  3. Provisions the UC schema, volume, GSO tables, Version Control tables/volume, CDF, and permissions
  4. Provisions or attaches Lakebase when requested
  5. Creates or updates the GSO optimization job (<app-name>-gso-optimization-job) via the SDK/Jobs API
  6. Renders a patched app.yaml into the generated source folder and patches app OAuth scopes and resources
  7. Deploys the app from the generated source folder
  8. Grants the app SP access to visible Genie Agents

The Git folder is never modified — the generated workspace folder is deployment output; do not edit it by hand.

4. Updating a notebook-installed app​

See Upgrading.

Method 2: Local Terminal Installer (Backup)​

Use this path when you prefer to deploy from a local machine with the Databricks CLI.

1. Clone the repo​

git clone https://github.com/databricks-solutions/databricks-genie-workbench.git
cd databricks-genie-workbench

2. Authenticate with Databricks CLI​

databricks auth login --profile <workspace-profile>
danger

Do NOT run databricks bundle init — it overwrites the project configuration.

3. Run the guided installer​

./scripts/install.sh

The installer will:

  1. Check prerequisites (CLI version, Node, Python, npm, uv)
  2. Ask for your Databricks CLI profile
  3. Ask for catalog (auto-discovered from your workspace)
  4. Ask for SQL warehouse (auto-discovered)
  5. Optionally configure MLflow tracing (creates or links an experiment)
  6. Ask whether to enable the daily release check (default yes)
  7. Ask for app name
  8. Ask for the Lakebase Autoscaling project (create / existing / skip)
  9. Write .env.deploy with your configuration (including the default LLM endpoint)
  10. Run scripts/deploy.sh to build and deploy the app
  11. Resolve the app's service principal
  12. Optionally grant the SP access to your existing Genie Agents

Lakebase (automated)​

Lakebase provides persistent storage for scan history, starred agents, and agent sessions. Without it, the app uses in-memory storage (data lost on restart).

Lakebase setup is fully automated by both install paths:

  • Creates a Lakebase Autoscaling project via the SDK
  • Creates a Postgres role for the app's service principal
  • Grants database permissions (CONNECT, CREATE ON DATABASE)
  • Attaches the postgres resource to the app via the Apps API

The app creates the genie schema and tables on first startup. Since the SP executes the DDL, it owns all objects — no manual grants needed.

The notebook path reads the Lakebase project from the lakebase_mode / lakebase_project_name widgets. The local terminal path asks for a project name (defaults to the app name, stored as GENIE_LAKEBASE_INSTANCE in .env.deploy). No manual steps required for either.

note

The GRANT step requires psycopg[binary] in the project venv (installed by uv sync). If unavailable, the script prints the commands to run manually in the Lakebase SQL Editor.

Upgrading an existing install​

See Upgrading for upgrade steps for both install paths, how to find your version, what changes between versions, and upgrade troubleshooting.

Release update check​

Genie Workbench can tell you when a newer release is available. The check lives on the Admin tab, which every user can open.

  • What is called: https://api.github.com/repos/databricks-solutions/databricks-genie-workbench/releases/latest, at most once a day per browser, plus whenever someone clicks Check now in Admin -> Settings.
  • Who calls it: the browser of whoever has the Admin tab open. The app server never calls the internet, and other pages never trigger the check.
  • What is sent: nothing about your workspace. The request runs from a hidden, sandboxed frame, so the browser sends Origin: null instead of the app's address, with no referrer and no cookies. The installed version stays in the browser (the comparison happens locally). GitHub sees the browser's IP address and user agent, the same as visiting github.com.
  • What you see: a dot on the Admin tab and a banner on the Admin Dashboard ("Genie Workbench 0.2.2 is available (you're on 0.2.1)") with links to the release notes and the upgrade steps.

Choosing at install. The terminal installer asks (default yes) and saves GENIE_UPDATE_CHECK in .env.deploy. The notebook installer uses the release_check widget. A true or false chosen at install is locked: Admin -> Settings shows the state, but it cannot be changed in the app.

Upgrading from an earlier version. If no choice was recorded at install, anyone who opens the Admin tab sees a one-time banner until someone answers (turn the check on, or decline). With Lakebase, that answer applies to everyone using the app, and the banner says so; anyone can change it later in Admin -> Settings. Without Lakebase, each browser keeps its own answer.

Turning it off later. Set GENIE_UPDATE_CHECK=false in .env.deploy and run ./scripts/deploy.sh --update, or set the notebook release_check widget to no and rerun the installer.

Restricted networks. If a browser cannot reach api.github.com (blocked, offline, or rate limited), nothing breaks: Admin -> Settings shows "Couldn't reach GitHub" and the browser tries again a day later.

What deploy.sh Does​

This applies to Method 2 (local terminal). The notebook installer runs the equivalent steps through the scripts.deploy_lib library instead — see What the notebook does.

Full Deploy (8 steps)​

  1. Pre-flight checks — validates tools, CLI profile, warehouse, catalog, app state
  2. Build frontend — npm ci + npm run build (strict lockfile)
  3. Create app — databricks apps create (skipped if app already exists)
  4. Sync files — databricks sync --full + explicit frontend/dist/ upload
  5. Grant UC permissions — resolves app SP, creates GSO schema/tables and the Version Control tables/volume, grants SP access, enables CDF
  6. Set up optimization job — builds GSO wheel, uploads notebooks, creates/finds the Databricks job, grants SP CAN_MANAGE
  7. Redeploy app — patches app.yaml with config values, configures scopes, deploys
  8. Verify — checks critical files, waits for deployment to succeed

Deploy Commands​

./scripts/deploy.sh # Full deploy
./scripts/deploy.sh --update # Code-only update (skips app creation)
./scripts/deploy.sh --destroy # Tear down app and clean up jobs
./scripts/deploy.sh --destroy --auto-approve # Tear down without confirmation

What --update skips​

--update skips step 3 (app creation). Use it for iterating on code changes after the initial deploy.

What --destroy cleans up (and what it doesn't)​

--destroy deletes:

  • The Databricks App
  • Runtime-created jobs
  • The bundle-managed optimization job

It does not remove:

  • Lakebase data (the genie schema in databricks_postgres)
  • Unity Catalog schema/tables (<catalog>.genie_space_optimizer and its tables)
  • Genie Agent SP permissions granted during install
  • MLflow experiments created during install
  • Synced tables (if manually created)

Clean these up manually if you want a full teardown.

Configuration Reference​

Set these in .env.deploy or as environment variables:

VariableRequiredDefaultDescription
GENIE_WAREHOUSE_IDYes—SQL Warehouse ID
GENIE_CATALOGYes—Unity Catalog name (needs CREATE SCHEMA)
GENIE_APP_NAMENogenie-workbenchDatabricks App name (unique in workspace)
GENIE_DEPLOY_PROFILENoDEFAULTDatabricks CLI profile name
GENIE_LLM_MODELNodatabricks-claude-sonnet-4-6LLM model (sent as system.ai.* on the gateway route; the serving endpoint name on classic)
GENIE_LLM_ROUTENogatewaygateway (Unity AI Gateway) or classic (serving endpoints directly)
GENIE_BYOK_ENABLEDNofalsetrue accepts a Unity Catalog model id as the model on the gateway route
GENIE_LAKEBASE_INSTANCENoemptyLakebase Autoscaling project name (auto-provisioned by deploy); installer suggests <app-name>-lakebase
GENIE_UPDATE_CHECKNoemptytrue / false for the daily release check. Empty: users are asked on the Admin tab

Manual Setup (Method 2, without installer)​

If you prefer non-interactive local terminal setup:

1. Create .env.deploy​

cat > .env.deploy <<'EOF'
GENIE_WAREHOUSE_ID=<your-sql-warehouse-id>
GENIE_CATALOG=<your-catalog-name>
GENIE_APP_NAME=genie-workbench
GENIE_DEPLOY_PROFILE=genie-workbench
GENIE_LLM_MODEL=databricks-claude-sonnet-4-6
GENIE_LAKEBASE_INSTANCE=genie-workbench
EOF

2. Deploy​

./scripts/deploy.sh

Platform Build Strategy​

The Databricks Apps platform detects package.json at the root and runs npm install then npm run build. To avoid cross-platform failures and redundant rebuilds:

  • Root postinstall: No-op. Frontend deps are installed by deploy.sh locally.
  • Root build: Checks for pre-built frontend/dist/index.html. If present (uploaded by deploy.sh), skips the rebuild. Falls back to a full build only if dist is missing.
  • Python deps: Use uv sync on the platform (because requirements.txt is excluded via .databricksignore). This gives a clean venv with SHA256-verified hashes.

Dependency Security​

All dependencies are pinned to exact versions with integrity hashes. Lock files are the source of truth.

FileCoversVerification
uv.lockWorkspace-wide Python transitive deps (root + GSO)SHA256 hashes
frontend/package-lock.jsonFrontend npm depsSHA-512 integrity

Updating Python dependencies​

uv lock --upgrade-package <package-name>
uv export --frozen --no-dev --no-hashes --format requirements-txt \
| grep -v "^-e " > requirements.txt
echo "-e ./packages/genie-space-optimizer" >> requirements.txt
python scripts/export_gso_job_requirements.py
git add uv.lock requirements.txt packages/genie-space-optimizer/requirements-job.txt
warning

Do not edit requirements.txt or requirements-job.txt manually. Both are generated from uv.lock.

requirements-job.txt pins the GSO optimization job's transitive dependencies to the versions in uv.lock. Every job environment installs it next to the GSO wheel, so job runs don't re-resolve against the live package index. It leaves out packages the serverless base environment already ships (listed in packages/genie-space-optimizer/serverless-env-v4-base-packages.txt), so the job never replaces base-image packages. Refresh that snapshot whenever the job's serverless environment_version changes. Databricks also patches base images in place without a version bump, so re-capture the snapshot before relying on a version it lists.

Updating npm dependencies​

cd frontend
npm install <package>@<new-version>
# Update package.json to exact version (remove ^ prefix)
git add package.json package-lock.json

Typical Workflow​

Method 1 (notebook): pull the latest repo changes in the Databricks Git folder and rerun notebooks/install.py from the top — for both first-time installs and updates.

Method 2 (local terminal):

# First time
./scripts/install.sh

# After code changes
./scripts/deploy.sh --update

# Tear down
./scripts/deploy.sh --destroy