Open ipeychev opened 1 year ago
The issue is easily reproducible with any of the skaffold examples, for example here or here. Steps to reproduce:
curl 0.0.0.0:3000
. The debugger will stop on the breakpoint.The developer will need to restart the whole session to make it work again.
Thank you for the bug report @ipeychev currently investigating this issue.
Hi @ipeychev,
I'm still looking at the skaffold example repro, meanwhile can you send us your launch.json config? This should be generated when you run "Cloud Code: Debug on Kubernetes" in Cloud Code. Usually this is our setting to ensure watch is working correctly:
{
"version": "0.2.0",
"configurations": [
{
"name": "Run on Kubernetes",
"type": "cloudcode.kubernetes",
"request": "launch",
"skaffoldConfig": "${workspaceFolder}/skaffold.yaml",
"watch": true,
"cleanUp": true,
"portForward": true,
"imageRegistry": "gcr.io/<container>",
"debug": [
{
"image": "nodejs-hello-world",
"containerName": "server",
"sourceFileMap": {
"${workspaceFolder}": "/hello-world"
}
}
]
}
]
}
Taken from: https://github.com/GoogleCloudPlatform/cloud-code-samples/blob/v1/nodejs/nodejs-hello-world/.vscode/launch.json.
Also when you start debugging, what profile do you choose, Is it the "Dev"? Can you retry debugging with "Default Profile"
Hey @glouischandra , thank you for getting back to me. Here it is:
sync
in skaffold.yaml
is enabled. I thought it was a missing feature (not entirely implemented workflow).sync
enabled. I only slightly modified Dockerfile
(use node
instead node-slim
- to get bash
), and the index.js file
- to be able to set a breakpoint. I'll attach it here.watch
is set to true
, yes. default
profile it redeploys and kills the pod, then starts a new one. In this situation, it works..vscode/launch.json
- linkBest, Iliyan
Hey @glouischandra, could I ask if everything is clear now, please? Have you had success in reproducing and resolving the issue?
Hello. Yes, I was able to get a repro using the code that you sent. Thanks for the detailed repro!
Apologies for the late reply. @glouischandra is on vacation.
Hey guys, is there any progress?
I have the same problem, with 5 services that need each other, when I make a change it actually takes it, but it disconnects from the debugger and does not reconnect until I stop the entire debugger. Also when I am managing the logs, I see that when I save a change, only that pod appears and the others are no longer there, but it says that it is still running and also when I return I make a change, the log disappears, and I don't have any errors on console or anything.
This is the launch.json
{
"version": "0.2.0",
"configurations": [
{
"name": "Kubernetes: Run/Debug",
"type": "cloudcode.kubernetes",
"request": "launch",
"skaffoldConfig": "${workspaceFolder}/skaffold-node.yaml",
"watch": true,
"cleanUp": true,
"portForward": true,
"debug": [
{
"image": "xxxx/x",
"containerName": "installer",
"sourceFileMap": {
"${workspaceFolder}/installer": "/app"
}
},
{
"image": "xxxx/x",
"containerName": "x",
"sourceFileMap": {
"${workspaceFolder}/x": "/app"
}
},
{
"image": "xxxx/x",
"containerName": "x",
"sourceFileMap": {
"${workspaceFolder}/x": "/app"
}
},
{
"image": "xxxx/x",
"containerName": "x",
"sourceFileMap": {
"${workspaceFolder}/x": "/app"
}
},
{
"image": "xxxx/x",
"containerName": "x",
"sourceFileMap": {
"${workspaceFolder}/x": "/app"
}
}
]
}
]
}
File skaffold
apiVersion: skaffold/v2beta17
kind: Config
build:
artifacts:
- image: x/x
context: x
sync:
manual:
- src: src/**/*.ts
dest: .
docker:
dockerfile: Dockerfile
- image: x/x
context: x
sync:
manual:
- src: src/**/*.ts
dest: .
docker:
dockerfile: Dockerfile
- image: x/x
context: x
sync:
manual:
- src: src/**/*.ts
dest: .
docker:
dockerfile: Dockerfile
- image: x/x
context: x
sync:
manual:
- src: src/**/*.ts
dest: .
docker:
dockerfile: Dockerfile
- image: x/x
context: x
sync:
manual:
- src: src/**/*.ts
dest: .
docker:
dockerfile: Dockerfile
local:
push: false
# useDockerCLI: true
deploy:
kubectl:
manifests:
- ./infra/k8s/*
I share a video with you, I apologize for the quality, but I hope it helps you understand a little better
Note: a collaborator told me that this does not happen in phpStorm or intelliJ, I was researching until late in the morning about this and in phpStorm or intelliJ (they are practically the same, just for a different language) they had the same problem but they solved it in their IDE .
What happened with this issue @glouischandra ? Could I ask if there are plans to fix it, please?
Hello,
Use case Cloud Code works well, but there is a missing feature which really bugs the dev process - the file sync workflow seems incomplete:
nodemon
(ornode --watch
) restarts my application - to load the new changes.If this cannot be done automatically, is there a way to execute e.g., a command to re-attach the debugger to the new process?
I looked at the hooks/lifecycle events, but I can't find a way to re-attach the debugger.
Please note - I don't want to stop the whole debugging session and run it again, because this will rebuild and redeploy the whole image, kill the old and create a new pod, etc., which is very slow. Or, maybe there is a way to avoid the re-build and re-deploy step?
Feature Maybe a way to re-attach the debugger to the to the new process - either manually, or after Skaffold's After Sync hook? Or, just automatically?
Thank you!