forked from databricks/cli
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathapp_config.py
More file actions
53 lines (39 loc) · 1.68 KB
/
Copy pathapp_config.py
File metadata and controls
53 lines (39 loc) · 1.68 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
from typing import Any, Dict, List, TypedDict, Union
from databricks.bundles.core._variable import VariableOr, VariableOrOptional
class AppEnvVarDict(TypedDict, total=False):
"""Environment variable configuration for an app"""
name: VariableOr[str]
"""The name of the environment variable"""
value: VariableOrOptional[str]
"""
The value of the environment variable.
Either value or valueFrom must be specified, but not both.
"""
valueFrom: VariableOrOptional[str]
"""
Reference to another environment variable to get the value from.
Either value or valueFrom must be specified, but not both.
"""
class AppConfigDict(TypedDict, total=False):
"""
Configuration for a Databricks app.
This is a flexible dictionary structure that can contain various app-specific
configuration settings. Common configuration options include:
- command: List of strings for the command to run the app
- env: List of environment variable configurations
- Any other app-specific settings
"""
command: Union[List[str], VariableOr[str]]
"""
The command to run the app. This is typically a list of strings
representing the executable and its arguments.
Example: ["python", "app.py"] or ["streamlit", "run", "main.py"]
"""
env: List[AppEnvVarDict]
"""
Environment variables to set for the app.
Each variable can have a direct value or reference another environment variable.
Example: [{"name": "PORT", "value": "8080"}, {"name": "DB_URL", "valueFrom": "DATABASE_URL"}]
"""
# AppConfigParam is a flexible type that accepts various config formats
AppConfigParam = Union[AppConfigDict, Dict[str, Any]]