e.g. fastcs-example
First deploy the developer mode helm chart:
- checkout a branch 'develop'
- Switch the container to develop mode with developMode: true
- push the change
- ec deploy bl47p-ea-fastcs-01 develop
This will deploy the container running sleep and with a new PVC called bl47p-ea-fastcs-01-develop, containing:
- /workspaces mounted at /workspaces in the container
- /venv mounted at /venv in the container
- both mounts above will have the original container contents copied in by an init-container
Exec this in the container
python -Xfrozen_modules=off -m debugpy --listen 0.0.0.0:5678 --wait-for-client --configure-subProcess true -m fastcs_example run /epics/ioc/config/controller.yamlPort forward the debug port on your workstation
k port-forward -n p47-beamline bl47p-ea-fastcs-01-0 5678mount the ...-develop PVC on your workstation and open it with vscode
pv-mounter mount p47-beamline bl47p-ea-fastcs-01-develop ./debugger
code debugger/workspaces/fastcs-exampleLaunch remote debugging with a launcher configuration like this:
{
"name": "Python Debugger: Remote Attach",
"type": "debugpy",
"request": "attach",
"connect": {
"host": "localhost",
"port": 5678
},
"pathMappings": [
{
"localRoot": "${workspaceFolder}",
"remoteRoot": "."
}
],
"justMyCode": false
},