Skip to content

Commit 41833f2

Browse files
Add debugger template and instructions
1 parent bbb6871 commit 41833f2

File tree

3 files changed

+64
-1
lines changed

3 files changed

+64
-1
lines changed

doc/usage/debugger/README.md

+14
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
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.template](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+
This can be done by running the following commands in the root of your project:
6+
```bash
7+
mkdir --parents .vscode
8+
cp --interactive doc/usage/debugger/launch.json.template .vscode/launch.json
9+
```
10+
- In the `launch.json` file, update the `args` sections with the path to your kubeconfig.
11+
- In VSCode on the activity bar click `Run and Debug` or `CTRL + SHIFT + D` to start a local debugging session of MCAD.
12+
13+
### Optional
14+
To set the desired log level set `--v`, `<desired_logging_level>` in the args sections of the `launch.json` file.
+49
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
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+
// Uncomment the line below to enable race testing.
16+
// "buildFlags": "-race",
17+
"env": {
18+
"DISPATCH_RESOURCE_RESERVATION_TIMEOUT":"120000",
19+
"PREEMPTION":"false",
20+
"DISPATCHER_MODE":"false",
21+
"QUOTA_ENABLED":"false",
22+
},
23+
// To set the desired log level set "--v", "<desired_logging_level>" in the args.
24+
"args": ["--kubeconfig", "</path/to/your/kube/config>", "--v", "15", "--logtostderr"],
25+
// This controls the working directory the code runs in
26+
"cwd": "${workspaceRoot}",
27+
"showLog": true
28+
},
29+
{
30+
"name": "Launch MCAD Controller with QuotaManager",
31+
"type": "go",
32+
"request": "launch",
33+
"mode": "auto",
34+
"program": "cmd/kar-controllers/main.go",
35+
"buildFlags": "-race",
36+
"env": {
37+
"DISPATCH_RESOURCE_RESERVATION_TIMEOUT":"120000",
38+
"PREEMPTION":"false",
39+
"DISPATCHER_MODE":"false",
40+
},
41+
// To set the desired log level set "--v", "<desired_logging_level>" in the args.
42+
"args": ["--kubeconfig", "</path/to/your/kube/config>", "--quotaEnabled", "true", "--v", "4", "--logtostderr"],
43+
// This controls the working directory the code runs in
44+
"cwd": "${workspaceRoot}",
45+
"showLog": true,
46+
"port": 8081
47+
}
48+
]
49+
}

pkg/controller/queuejobresources/genericresource/genericresource.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -337,7 +337,7 @@ func (gr *GenericResources) SyncQueueJob(aw *arbv1.AppWrapper, awr *arbv1.AppWra
337337

338338
// Get the related resources of created object
339339
// var thisObj *unstructured.Unstructured
340-
//var err1 error
340+
// var err1 error
341341
// if namespaced {
342342
// thisObj, err1 = dclient.Resource(rsrc).Namespace(namespace).Get(context.Background(), name, metav1.GetOptions{})
343343
// } else {

0 commit comments

Comments
 (0)