Skip to content

Commit c656a3f

Browse files
Add debugger template and instructions
1 parent 280e750 commit c656a3f

File tree

2 files changed

+57
-0
lines changed

2 files changed

+57
-0
lines changed

Diff for: doc/usage/debugger/debugger.md

+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
## Local debugging with VSCode
2+
Steps outlining how to run MCAD locally from your IDE / debugger.
3+
- Ensure you are authenticated to your Kubernetes/OpenShift Cluster.
4+
- 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.
5+
- In the `launch.json` file, update the `args` sections with the path to your kubeconfig.
6+
- In VSCode on the activity bar click `Run and Debug` or `CTRL + SHIFT + D` to start a local debugging session of MCAD.
7+
8+
### Optional
9+
To set the desired log level set `--v`, `<desired_logging_level>` in the args sections of the `launch.json` file.

Diff for: doc/usage/debugger/launch.json.template

+48
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
{
2+
// MCAD Debugger configuration for VSCode
3+
4+
// Use IntelliSense to learn about possible attributes.
5+
// Hover to view descriptions of existing attributes.
6+
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
7+
"version": "0.2.0",
8+
"configurations": [
9+
{
10+
"name": "Launch MCAD Controller",
11+
"type": "go",
12+
"request": "launch",
13+
"mode": "auto",
14+
"program": "cmd/kar-controllers/main.go",
15+
//"buildFlags": "-race",
16+
"env": {
17+
"DISPATCH_RESOURCE_RESERVATION_TIMEOUT":"120000",
18+
"PREEMPTION":"false",
19+
"DISPATCHER_MODE":"false",
20+
"QUOTA_ENABLED":"false",
21+
},
22+
// To set the desired log level set "--v", "<desired_logging_level>" in the args.
23+
"args": ["--kubeconfig", "</path/to/your/kube/config>", "--v", "15", "--logtostderr"],
24+
// This controls the Working directory the code runs in
25+
"cwd": "${workspaceRoot}",
26+
"showLog": true
27+
},
28+
{
29+
"name": "Launch MCAD Controller with QuotaManager",
30+
"type": "go",
31+
"request": "launch",
32+
"mode": "auto",
33+
"program": "cmd/kar-controllers/main.go",
34+
"buildFlags": "-race",
35+
"env": {
36+
"DISPATCH_RESOURCE_RESERVATION_TIMEOUT":"120000",
37+
"PREEMPTION":"false",
38+
"DISPATCHER_MODE":"false",
39+
},
40+
// To set the desired log level set "--v", "<desired_logging_level>" in the args.
41+
"args": ["--kubeconfig", "</path/to/your/kube/config>", "--quotaEnabled", "true", "--v", "4", "--logtostderr"],
42+
// This controls the Working directory the code runs in
43+
"cwd": "${workspaceRoot}",
44+
"showLog": true,
45+
"port": 8081
46+
}
47+
]
48+
}

0 commit comments

Comments
 (0)