Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add debugger template and instructions #688

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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