Skip to content

Commit e87de54

Browse files
authored
Add databricks.yml.tmpl to appkit pre-rendered templates (#229)
* Add appkit-serving template and regenerate AppKit templates Add new appkit-serving template for Databricks Model Serving endpoint integration. Regenerate all existing AppKit templates with latest appkit, bumping @databricks/appkit from 0.21.0 to 0.22.0. Update README with serving template entry. Co-authored-by: Isaac * Add databricks.yml.tmpl to appkit pre-rendered templates Copy the full appkit databricks.yml.tmpl into each appkit-* template directory. When `databricks apps init --template <pre-rendered>` runs, the CLI's copyTemplate() processes files in lexical order — the static databricks.yml is written first, then databricks.yml.tmpl renders and overwrites it. This means --set values now properly render into the output databricks.yml through {{.bundle.resources}}, {{.bundle.variables}}, {{.bundle.targetVariables}}, {{.projectName}}, and {{.workspaceHost}}. The static databricks.yml remains as a readable reference for users who copy the template directory without using the CLI. Co-authored-by: Isaac * Regenerate AppKit templates: remove serving from all-in-one, add postgres.project Regenerated all 6 appkit templates from the latest appkit template source. Key changes: - appkit-all-in-one: remove serving plugin (analytics, files, genie, lakebase only) - All lakebase templates: add postgres.project field (new manifest requirement) - All templates: include databricks.yml.tmpl for CLI template rendering - Synced plugin manifests and dependencies to latest appkit Co-authored-by: Isaac
1 parent bb6c8d5 commit e87de54

84 files changed

Lines changed: 41292 additions & 39248 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

appkit-all-in-one/.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,3 +8,6 @@ build/
88
.smoke-test/
99
test-results/
1010
playwright-report/
11+
12+
# Auto-generated types (endpoint-specific, varies per developer)
13+
shared/appkit-types/serving.d.ts

appkit-all-in-one/CLAUDE.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,6 @@ This project uses Databricks AppKit packages. For AI assistant guidance on using
1313
For enhanced AI assistance with Databricks CLI operations, authentication, data exploration, and app development, install the Databricks skills:
1414

1515
```bash
16-
databricks experimental aitools skills install
16+
databricks aitools install
1717
```
1818
<!-- appkit-instructions-end -->

appkit-all-in-one/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# appkit-all-in-one
22

3-
A Databricks App powered by [AppKit](https://databricks.github.io/appkit/), featuring React, TypeScript, and Tailwind CSS.
3+
A Databricks App powered by [AppKit](https://www.databricks.com/devhub/docs/appkit/v0/), featuring React, TypeScript, and Tailwind CSS.
44

55
**Enabled plugins:**
66
- **Analytics** -- SQL query execution against Databricks SQL Warehouses
@@ -34,7 +34,7 @@ DATABRICKS_APP_PORT=8000
3434

3535
#### Lakebase Configuration
3636

37-
The Lakebase plugin requires additional environment variables for PostgreSQL connectivity. To learn how to configure the Lakebase plugin, see the [Lakebase plugin documentation](https://databricks.github.io/appkit/docs/plugins/lakebase).
37+
The Lakebase plugin requires additional environment variables for PostgreSQL connectivity. To learn how to configure the Lakebase plugin, see the [Lakebase plugin documentation](https://www.databricks.com/devhub/docs/appkit/v0/plugins/lakebase).
3838

3939
### CLI Authentication
4040

appkit-all-in-one/appkit.plugins.json

Lines changed: 232 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,33 @@
11
{
22
"$schema": "https://databricks.github.io/appkit/schemas/template-plugins.schema.json",
3-
"version": "1.0",
3+
"version": "2.0",
44
"plugins": {
5+
"agents": {
6+
"name": "agents",
7+
"displayName": "Agents Plugin",
8+
"description": "AI agents driven by markdown configs or code, with auto-tool-discovery from registered plugins",
9+
"package": "@databricks/appkit",
10+
"resources": {
11+
"required": [],
12+
"optional": [
13+
{
14+
"type": "serving_endpoint",
15+
"alias": "Default LLM for agents",
16+
"resourceKey": "agents-serving-endpoint",
17+
"description": "Default streaming-capable LLM endpoint for agents that don't pin their own model",
18+
"permission": "CAN_QUERY",
19+
"fields": {
20+
"name": {
21+
"env": "DATABRICKS_SERVING_ENDPOINT_NAME",
22+
"description": "Default LLM serving endpoint name",
23+
"origin": "user"
24+
}
25+
}
26+
}
27+
]
28+
},
29+
"stability": "beta"
30+
},
531
"analytics": {
632
"name": "analytics",
733
"displayName": "Analytics Plugin",
@@ -18,13 +44,28 @@
1844
"fields": {
1945
"id": {
2046
"env": "DATABRICKS_WAREHOUSE_ID",
21-
"description": "SQL Warehouse ID"
47+
"description": "SQL Warehouse ID",
48+
"discovery": {
49+
"type": "kind",
50+
"resourceKind": "warehouse"
51+
},
52+
"origin": "user"
2253
}
2354
}
2455
}
2556
],
2657
"optional": []
2758
},
59+
"scaffolding": {
60+
"rules": {
61+
"must": [
62+
"Before init, ensure the SQL Warehouse passed via --set analytics.sql-warehouse.id is running"
63+
],
64+
"should": [
65+
"After init, ensure config/queries/ has at least one .sql file before running npm run typegen"
66+
]
67+
}
68+
},
2869
"requiredByTemplate": true
2970
},
3071
"files": {
@@ -43,13 +84,26 @@
4384
"fields": {
4485
"path": {
4586
"env": "DATABRICKS_VOLUME_FILES",
46-
"description": "Volume path for file storage (e.g. /Volumes/catalog/schema/volume_name)"
87+
"description": "Volume path for file storage (e.g. /Volumes/catalog/schema/volume_name)",
88+
"discovery": {
89+
"type": "kind",
90+
"resourceKind": "volume",
91+
"select": "full_name"
92+
},
93+
"origin": "user"
4794
}
4895
}
4996
}
5097
],
5198
"optional": []
5299
},
100+
"scaffolding": {
101+
"rules": {
102+
"must": [
103+
"Before init, verify your Unity Catalog volume exists and you have WRITE_VOLUME permission"
104+
]
105+
}
106+
},
53107
"requiredByTemplate": true
54108
},
55109
"genie": {
@@ -68,15 +122,56 @@
68122
"fields": {
69123
"id": {
70124
"env": "DATABRICKS_GENIE_SPACE_ID",
71-
"description": "Default Genie Space ID"
125+
"description": "Default Genie Space ID",
126+
"discovery": {
127+
"type": "kind",
128+
"resourceKind": "genie_space"
129+
},
130+
"origin": "user"
131+
},
132+
"name": {
133+
"description": "Genie Space display name",
134+
"origin": "user"
72135
}
73136
}
74137
}
75138
],
76139
"optional": []
77140
},
141+
"scaffolding": {
142+
"rules": {
143+
"must": [
144+
"After init, configure the 'spaces' map in plugin config with alias-to-Space-ID mappings"
145+
]
146+
}
147+
},
78148
"requiredByTemplate": true
79149
},
150+
"jobs": {
151+
"name": "jobs",
152+
"displayName": "Jobs Plugin",
153+
"description": "Manage Databricks Lakeflow Jobs.",
154+
"package": "@databricks/appkit",
155+
"resources": {
156+
"required": [
157+
{
158+
"type": "job",
159+
"alias": "Job",
160+
"resourceKey": "job",
161+
"description": "A Databricks job to trigger and monitor",
162+
"permission": "CAN_MANAGE_RUN",
163+
"fields": {
164+
"id": {
165+
"env": "DATABRICKS_JOB_ID",
166+
"description": "Numeric Databricks job ID. Find it in the Jobs UI or via `databricks jobs list`.",
167+
"origin": "user"
168+
}
169+
}
170+
}
171+
],
172+
"optional": []
173+
}
174+
},
80175
"lakebase": {
81176
"name": "lakebase",
82177
"displayName": "Lakebase",
@@ -91,56 +186,95 @@
91186
"description": "Lakebase Postgres database for persistent storage",
92187
"permission": "CAN_CONNECT_AND_CREATE",
93188
"fields": {
189+
"project": {
190+
"description": "Full Lakebase Postgres project resource name. Obtain by running `databricks postgres list-projects`, select the desired item from the output array and use its .name value.",
191+
"examples": [
192+
"projects/{project-id}"
193+
],
194+
"discovery": {
195+
"type": "kind",
196+
"resourceKind": "postgres_project",
197+
"select": "name"
198+
},
199+
"origin": "user"
200+
},
94201
"branch": {
95-
"description": "Full Lakebase Postgres branch resource name. Obtain by running `databricks postgres list-branches projects/{project-id}`, select the desired item from the output array and use its .name value.",
202+
"description": "Full Lakebase Postgres branch resource name. Obtain by running `databricks postgres list-branches {project-name}`, select the desired item from the output array and use its .name value. Requires the project resource name.",
96203
"examples": [
97204
"projects/{project-id}/branches/{branch-id}"
98-
]
205+
],
206+
"discovery": {
207+
"type": "kind",
208+
"resourceKind": "postgres_branch",
209+
"select": "name",
210+
"dependsOn": "project"
211+
},
212+
"origin": "user"
99213
},
100214
"database": {
101215
"description": "Full Lakebase Postgres database resource name. Obtain by running `databricks postgres list-databases {branch-name}`, select the desired item from the output array and use its .name value. Requires the branch resource name.",
102216
"examples": [
103217
"projects/{project-id}/branches/{branch-id}/databases/{database-id}"
104-
]
218+
],
219+
"discovery": {
220+
"type": "kind",
221+
"resourceKind": "postgres_database",
222+
"select": "name",
223+
"dependsOn": "branch"
224+
},
225+
"origin": "user"
105226
},
106227
"host": {
107228
"env": "PGHOST",
229+
"description": "Postgres host for local development. Auto-injected by the platform at deploy time.",
108230
"localOnly": true,
109231
"resolve": "postgres:host",
110-
"description": "Postgres host for local development. Auto-injected by the platform at deploy time."
232+
"origin": "platform"
111233
},
112234
"databaseName": {
113235
"env": "PGDATABASE",
236+
"description": "Postgres database name for local development. Auto-injected by the platform at deploy time.",
114237
"localOnly": true,
115238
"resolve": "postgres:databaseName",
116-
"description": "Postgres database name for local development. Auto-injected by the platform at deploy time."
239+
"origin": "platform"
117240
},
118241
"endpointPath": {
119242
"env": "LAKEBASE_ENDPOINT",
120-
"bundleIgnore": true,
121-
"resolve": "postgres:endpointPath",
122243
"description": "Lakebase endpoint resource name. Auto-injected at runtime via app.yaml valueFrom: postgres. For local development, obtain by running `databricks postgres list-endpoints {branch-name}`, select the desired item from the output array and use its .name value.",
244+
"bundleIgnore": true,
123245
"examples": [
124246
"projects/{project-id}/branches/{branch-id}/endpoints/{endpoint-id}"
125-
]
247+
],
248+
"resolve": "postgres:endpointPath",
249+
"origin": "cli"
126250
},
127251
"port": {
128252
"env": "PGPORT",
253+
"description": "Postgres port. Auto-injected by the platform at deploy time.",
129254
"localOnly": true,
130255
"value": "5432",
131-
"description": "Postgres port. Auto-injected by the platform at deploy time."
256+
"origin": "platform"
132257
},
133258
"sslmode": {
134259
"env": "PGSSLMODE",
260+
"description": "Postgres SSL mode. Auto-injected by the platform at deploy time.",
135261
"localOnly": true,
136262
"value": "require",
137-
"description": "Postgres SSL mode. Auto-injected by the platform at deploy time."
263+
"origin": "platform"
138264
}
139265
}
140266
}
141267
],
142268
"optional": []
143269
},
270+
"scaffolding": {
271+
"rules": {
272+
"should": [
273+
"After init, run any database migrations for your chosen ORM before first request",
274+
"After init, verify Lakebase connectivity with 'psql $PGHOST -c \"select 1\"'"
275+
]
276+
}
277+
},
144278
"requiredByTemplate": true
145279
},
146280
"server": {
@@ -153,6 +287,90 @@
153287
"optional": []
154288
},
155289
"requiredByTemplate": true
290+
},
291+
"serving": {
292+
"name": "serving",
293+
"displayName": "Model Serving Plugin",
294+
"description": "Authenticated proxy to Databricks Model Serving endpoints",
295+
"package": "@databricks/appkit",
296+
"resources": {
297+
"required": [
298+
{
299+
"type": "serving_endpoint",
300+
"alias": "Serving Endpoint",
301+
"resourceKey": "serving-endpoint",
302+
"description": "Model Serving endpoint for inference",
303+
"permission": "CAN_QUERY",
304+
"fields": {
305+
"name": {
306+
"env": "DATABRICKS_SERVING_ENDPOINT_NAME",
307+
"description": "Serving endpoint name",
308+
"origin": "user"
309+
}
310+
}
311+
}
312+
],
313+
"optional": []
314+
}
315+
}
316+
},
317+
"scaffolding": {
318+
"command": "databricks apps init",
319+
"flags": {
320+
"--name": {
321+
"description": "Project name — sets {{.projectName}} in package.json, databricks.yml, and .env. Required for non-interactive scaffolding.",
322+
"required": true,
323+
"pattern": "^[a-z][a-z0-9-]*$"
324+
},
325+
"--template": {
326+
"description": "Template path (local directory or GitHub URL)",
327+
"required": false
328+
},
329+
"--version": {
330+
"description": "AppKit version to use; defaults to auto-detected",
331+
"required": false
332+
},
333+
"--features": {
334+
"description": "Plugins to enable (comma-separated, no spaces; must match keys in this manifest's plugins map)",
335+
"required": false,
336+
"pattern": "^[a-zA-Z0-9_-]+(,[a-zA-Z0-9_-]+)*$"
337+
},
338+
"--set": {
339+
"description": "Set resource values (format: plugin.resourceKey.field=value, repeatable)",
340+
"required": false
341+
},
342+
"--output-dir": {
343+
"description": "Directory to write the project to",
344+
"required": false
345+
},
346+
"--description": {
347+
"description": "App description",
348+
"required": false
349+
},
350+
"--run": {
351+
"description": "Run the app after creation (none, dev, dev-remote)",
352+
"required": false
353+
},
354+
"--auto-approve": {
355+
"description": "Pass as a bare flag (no value) to skip prompts for optional resources. Not recommended for agent-driven init — conflicts with the 'ask user when in doubt' rule.",
356+
"required": false
357+
},
358+
"--profile": {
359+
"description": "Databricks CLI profile to use for authentication (global flag)",
360+
"required": false
361+
}
362+
},
363+
"rules": {
364+
"must": [
365+
"Keep all secrets and credentials only in app.yaml, databricks.yml, and/or .env"
366+
],
367+
"should": [
368+
"ask user when in doubt of resource to use for plugin"
369+
],
370+
"never": [
371+
"guess resources when multiple or no options are available",
372+
"embed secrets in files that will go to the client-bundle"
373+
]
156374
}
157375
}
158376
}

0 commit comments

Comments
 (0)