File tree 3 files changed +58
-5
lines changed
3 files changed +58
-5
lines changed Original file line number Diff line number Diff line change @@ -147,6 +147,12 @@ spec:
147
147
- name : op
148
148
image : {{ .Values.backend_image }}
149
149
imagePullPolicy : {{ .Values.backend_pull_policy }}
150
+ {{- if .Values.backend_op_command_override }}
151
+ command :
152
+ {{- range .Values.backend_op_command_override }}
153
+ - {{ . | quote }}
154
+ {{- end }}
155
+ {{- else }}
150
156
command :
151
157
- gunicorn
152
158
- btrixcloud.main_op:app_root
@@ -158,7 +164,7 @@ spec:
158
164
- " {{ .Values.backend_workers | default 1 }}"
159
165
- --worker-class
160
166
- uvicorn.workers.UvicornWorker
161
-
167
+ {{- end }}
162
168
envFrom :
163
169
- configMapRef :
164
170
name : backend-env-config
Original file line number Diff line number Diff line change @@ -26,19 +26,25 @@ skaffold dev
26
26
```
27
27
28
28
This will deploy Browsertrix into the cluster and port forward the API with hot reloading.
29
- Navigate to ` localhost:8000/api/redoc ` or ` localhost:8000/api/docs ` to see the documentation.
30
- Changing any code in ` backend/btrixcloud ` will trigger a reload.
29
+
30
+ Navigate to ` localhost:8000/api/redoc ` or ` localhost:8000/api/docs ` to see the documentation
31
+ for the api container.
32
+
33
+ Navigate to ` http://localhost:8756/redoc ` or ` http://localhost:8756/docs ` to see the documentation
34
+ for the op container.
35
+
36
+ Changing any code in ` backend/btrixcloud ` will trigger a reload in both the op and api containers.
31
37
32
38
### Debugger
33
39
34
40
Interactive debugging uses [ debugpy] ( https://github.com/microsoft/debugpy ) , which
35
41
works on VSCode but not PyCharm.
36
42
37
- Use this debug configuration in VSCode:
43
+ Use these debug configurations in VSCode:
38
44
39
45
``` JSON
40
46
{
41
- "name" : " Attach to Browsertrix Backend" ,
47
+ "name" : " Attach to Browsertrix Backend API " ,
42
48
"type" : " debugpy" ,
43
49
"request" : " attach" ,
44
50
"connect" : {
@@ -52,6 +58,22 @@ Use this debug configuration in VSCode:
52
58
}
53
59
],
54
60
"justMyCode" : false
61
+ },
62
+ {
63
+ "name" : " Attach to Browsertrix Backend OP" ,
64
+ "type" : " debugpy" ,
65
+ "request" : " attach" ,
66
+ "connect" : {
67
+ "host" : " 127.0.0.1" ,
68
+ "port" : 5679
69
+ },
70
+ "pathMappings" : [
71
+ {
72
+ "localRoot" : " ${workspaceFolder}/backend/btrixcloud/" ,
73
+ "remoteRoot" : " /app/btrixcloud/"
74
+ }
75
+ ],
76
+ "justMyCode" : false
55
77
}
56
78
```
57
79
Original file line number Diff line number Diff line change @@ -27,6 +27,19 @@ portForward:
27
27
namespace : default
28
28
port : 5678
29
29
localPort : 5678
30
+ # so you can hit the op container on `localhost:8756`
31
+ - resourceType : service
32
+ resourceName : browsertrix-cloud-backend
33
+ namespace : default
34
+ # can't references {{ Values. }} hence hardcoding
35
+ port : 8756
36
+ localPort : 8756
37
+ # for the debugger
38
+ - resourceType : deployment
39
+ resourceName : browsertrix-cloud-backend
40
+ namespace : default
41
+ port : 5679
42
+ localPort : 5679
30
43
deploy :
31
44
helm :
32
45
releases :
@@ -39,6 +52,9 @@ deploy:
39
52
# See https://skaffold.dev/docs/deployers/helm/
40
53
# must do this to make skaffold use local images with helm
41
54
setValues :
55
+ # we hardcoded this earlier so make sure it has same value
56
+ # across the helm chart
57
+ opPort : 8756
42
58
# hot reloading doesn't work with default gunicorn command
43
59
# so need to override to use uvicorn
44
60
# plus need to start the process with debugpy to debug
@@ -51,3 +67,12 @@ deploy:
51
67
python -m debugpy --listen 0.0.0.0:5678
52
68
-m uvicorn btrixcloud.main:app_root
53
69
--reload --host 0.0.0.0 --port 8000
70
+ backend_op_command_override :
71
+ - sh
72
+ - -c
73
+ - >
74
+ pip install --no-input debugpy
75
+ &&
76
+ python -m debugpy --listen 0.0.0.0:5679
77
+ -m uvicorn btrixcloud.main_op:app_root
78
+ --reload --host 0.0.0.0 --port 8756
You can’t perform that action at this time.
0 commit comments