Skip to content

Commit

Permalink
Add debugger template and instructions
Browse files Browse the repository at this point in the history
  • Loading branch information
ChristianZaccaria committed Nov 10, 2023
1 parent 280e750 commit 12a3995
Show file tree
Hide file tree
Showing 2 changed files with 52 additions and 0 deletions.
6 changes: 6 additions & 0 deletions doc/usage/debugger/debugger.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
## Local debugging with VSCode
Steps outlining how to run MCAD locally from your IDE / debugger.
- Ensure you are authenticated to your Kubernetes/OpenShift Cluster.
- Copy the [launch.json.example](https://github.com/project-codeflare/multi-cluster-app-dispatcher/tree/main/doc/usage/debugger/launch.json.example) file and save it as `launch.json` in the `.vscode` folder in the root of your project.
- In the `launch.json` file, update the `args` sections with the path to your kubeconfig.
- In VSCode on the activity bar click `Run and Debug` or `CTRL + SHIFT + D` to start a local debugging session of MCAD.
46 changes: 46 additions & 0 deletions doc/usage/debugger/launch.json.template
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
{
// MCAD Debugger configuration for VSCode

// Use IntelliSense to learn about possible attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"name": "Launch MCAD Controller",
"type": "go",
"request": "launch",
"mode": "auto",
"program": "cmd/kar-controllers/main.go",
//"buildFlags": "-race",
"env": {
"DISPATCH_RESOURCE_RESERVATION_TIMEOUT":"120000",
"PREEMPTION":"false",
"DISPATCHER_MODE":"false",
"QUOTA_ENABLED":"false",
},
"args": ["--kubeconfig", "</path/to/your/kube/config>", "--v", "15", "--logtostderr"],
// This controls the Working directory the code runs in
"cwd": "${workspaceRoot}",
"showLog": true
},
{
"name": "Launch MCAD Controller with QuotaManager",
"type": "go",
"request": "launch",
"mode": "auto",
"program": "cmd/kar-controllers/main.go",
"buildFlags": "-race",
"env": {
"DISPATCH_RESOURCE_RESERVATION_TIMEOUT":"120000",
"PREEMPTION":"false",
"DISPATCHER_MODE":"false",
},
"args": ["--kubeconfig", "</path/to/your/kube/config>", "--quotaEnabled", "true", "--v", "4", "--logtostderr"],
// This controls the Working directory the code runs in
"cwd": "${workspaceRoot}",
"showLog": true,
"port": 8081
}
]
}

0 comments on commit 12a3995

Please sign in to comment.