File tree Expand file tree Collapse file tree 1 file changed +16
-6
lines changed Expand file tree Collapse file tree 1 file changed +16
-6
lines changed Original file line number Diff line number Diff line change @@ -27,15 +27,25 @@ k8s_resource("chart-api", port_forwards="8081:8000")
27
27
if run_ui_locally :
28
28
venv_name = "tilt-dev-venv"
29
29
requirements = "images/ui-base/requirements.txt"
30
- # Run gradio app locally with hot-reloading
30
+
31
+ # Ensure venv exists and matches requirements.txt
31
32
local_resource (
32
- name = "gradio-app" ,
33
- deps = requirements ,
34
- serve_cmd = "" .join ([
33
+ name = "gradio-app-venv " ,
34
+ deps = [ requirements ] ,
35
+ cmd = "" .join ([
35
36
"([[ -d {} ]] || python3 -m venv {})" .format (venv_name , venv_name ),
36
37
"&& source {}/bin/activate" .format (venv_name ),
37
38
"&& pip install -r {}" .format (requirements ),
38
- "&& cd chart/web-app" ,
39
- "&& gradio app.py --demo-name app"
39
+ ])
40
+ )
41
+
42
+ # Run web app locally
43
+ local_resource (
44
+ name = "gradio-app" ,
45
+ deps = ["chart/web-app/" ],
46
+ resource_deps = ["gradio-app-venv" ],
47
+ serve_cmd = "" .join ([
48
+ "cd chart/web-app" ,
49
+ "&& python app.py" ,
40
50
])
41
51
)
You can’t perform that action at this time.
0 commit comments