-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathapp.yaml
More file actions
131 lines (120 loc) · 4.99 KB
/
app.yaml
File metadata and controls
131 lines (120 loc) · 4.99 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
# Databricks Apps configuration for Genie Workbench
# See: https://docs.databricks.com/dev-tools/databricks-apps/
#
# Genie Workbench combines:
# - GenieRx: LLM-powered analysis and optimization of Genie Spaces
# - GenieIQ: Org-wide scoring with PostgreSQL (Lakebase) persistence
#
# Authentication: User-based (OBO) — users can only access Genie Spaces
# they have permission to manage.
#
# The FastAPI server serves both:
# - Static React frontend files from /frontend/dist
# - REST API endpoints under /api
command:
- "uvicorn"
- "backend.main:app"
- "--host"
- "0.0.0.0"
- "--port"
- "8000"
user_api_scopes:
- "sql"
- "dashboards.genie"
- "serving.serving-endpoints"
- "catalog.catalogs:read"
- "catalog.schemas:read"
- "catalog.tables:read"
- "files.files"
env:
# ---------------------------------------------------------------------------
# MLflow Tracing
# ---------------------------------------------------------------------------
- name: MLFLOW_TRACKING_URI
value: "databricks"
- name: MLFLOW_REGISTRY_URI
value: "databricks-uc"
- name: MLFLOW_EXPERIMENT_ID
value: "__MLFLOW_EXPERIMENT_ID__"
# ---------------------------------------------------------------------------
# LLM Model
# ---------------------------------------------------------------------------
- name: LLM_MODEL
value: "__LLM_MODEL__"
# ---------------------------------------------------------------------------
# SQL Warehouse — pulled from the app resource named "sql-warehouse".
# Configure the warehouse resource in the Databricks Apps UI.
# Falls back to auto-detect if empty.
# ---------------------------------------------------------------------------
- name: SQL_WAREHOUSE_ID
valueFrom: sql-warehouse
# ---------------------------------------------------------------------------
# Genie Space target directory (where new spaces are created)
# Defaults to /Shared/ which is writable by most service principals.
# Override to a specific folder if needed (e.g. /Workspace/Shared/Analytics/).
# ---------------------------------------------------------------------------
- name: GENIE_TARGET_DIRECTORY
value: "/Shared/"
# ---------------------------------------------------------------------------
# Local dev auth (only used when running outside Databricks Apps)
# ---------------------------------------------------------------------------
- name: DEV_USER_EMAIL
value: ""
# ---------------------------------------------------------------------------
# Lakebase PostgreSQL — connect manually via Databricks Apps UI.
# Add a postgres resource named "postgres" in the Apps UI. The platform
# injects the host via valueFrom. The app auto-creates all required tables.
# Without Lakebase, the app uses in-memory storage (ephemeral).
# ---------------------------------------------------------------------------
- name: LAKEBASE_HOST
valueFrom: postgres
- name: LAKEBASE_PORT
value: "5432"
- name: LAKEBASE_DATABASE
value: "databricks_postgres"
- name: LAKEBASE_INSTANCE_NAME
value: "__LAKEBASE_INSTANCE__"
# ---------------------------------------------------------------------------
# Auto-Optimize (GSO Engine)
# These are placeholder values. The deploy script patches them with real
# values (from bundle state) on workspace before running `apps deploy`.
# ---------------------------------------------------------------------------
- name: GSO_CATALOG
value: "__GSO_CATALOG__"
- name: GSO_SCHEMA
value: "genie_space_optimizer"
- name: GSO_JOB_ID
value: "__GSO_JOB_ID__"
- name: GSO_WAREHOUSE_ID
valueFrom: sql-warehouse
# ---------------------------------------------------------------------------
# Resources
# ---------------------------------------------------------------------------
resources:
- name: sql-warehouse
description: "SQL Warehouse for queries and catalog discovery"
sql_warehouse:
id: "__WAREHOUSE_ID__"
permission: CAN_USE
# ---------------------------------------------------------------------------
# Deployment
# ---------------------------------------------------------------------------
# Recommended local terminal path:
# ./scripts/install.sh # Guided first-time setup
# ./scripts/deploy.sh # Subsequent deploys
#
# Recommended Databricks notebook path:
# notebooks/install.py # Run from a Databricks Git folder
#
# deploy.sh handles:
# - App creation/sync/deploy
# - OAuth scopes and resource configuration
# - GSO optimization job via `databricks bundle deploy -t app`
# - Injects GSO_JOB_ID into this file before running `apps deploy`
# - UC permissions and job permissions
#
# notebooks/install.py handles the same app/resource setup with notebook-native
# auth. It treats this app.yaml as a template, writes a patched copy into
# /Workspace/Users/<user>/.genie-workbench-deploy/<app-name>/app, and deploys
# from that generated workspace source folder.
# ---------------------------------------------------------------------------