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 authored and openshift-merge-bot[bot] committed Nov 14, 2023
1 parent bbb6871 commit 41833f2
Show file tree
Hide file tree
Showing 3 changed files with 64 additions and 1 deletion.
14 changes: 14 additions & 0 deletions doc/usage/debugger/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
## 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.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.
This can be done by running the following commands in the root of your project:
```bash
mkdir --parents .vscode
cp --interactive doc/usage/debugger/launch.json.template .vscode/launch.json
```
- 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.

### Optional
To set the desired log level set `--v`, `<desired_logging_level>` in the args sections of the `launch.json` file.
49 changes: 49 additions & 0 deletions doc/usage/debugger/launch.json.template
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
{
// 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",
// Uncomment the line below to enable race testing.
// "buildFlags": "-race",
"env": {
"DISPATCH_RESOURCE_RESERVATION_TIMEOUT":"120000",
"PREEMPTION":"false",
"DISPATCHER_MODE":"false",
"QUOTA_ENABLED":"false",
},
// To set the desired log level set "--v", "<desired_logging_level>" in the args.
"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",
},
// To set the desired log level set "--v", "<desired_logging_level>" in the args.
"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
}
]
}
Original file line number Diff line number Diff line change
Expand Up @@ -337,7 +337,7 @@ func (gr *GenericResources) SyncQueueJob(aw *arbv1.AppWrapper, awr *arbv1.AppWra

// Get the related resources of created object
// var thisObj *unstructured.Unstructured
//var err1 error
// var err1 error
// if namespaced {
// thisObj, err1 = dclient.Resource(rsrc).Namespace(namespace).Get(context.Background(), name, metav1.GetOptions{})
// } else {
Expand Down

0 comments on commit 41833f2

Please sign in to comment.