-
Notifications
You must be signed in to change notification settings - Fork 63
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add debugger template and instructions
- Loading branch information
1 parent
bbb6871
commit 41833f2
Showing
3 changed files
with
64 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | ||
} | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters