From 12a3995f4870668c1fda6dc9f441b3e49f6d76ed Mon Sep 17 00:00:00 2001 From: ChristianZaccaria Date: Fri, 10 Nov 2023 12:20:20 +0000 Subject: [PATCH] Add debugger template and instructions --- doc/usage/debugger/debugger.md | 6 ++++ doc/usage/debugger/launch.json.template | 46 +++++++++++++++++++++++++ 2 files changed, 52 insertions(+) create mode 100644 doc/usage/debugger/debugger.md create mode 100644 doc/usage/debugger/launch.json.template diff --git a/doc/usage/debugger/debugger.md b/doc/usage/debugger/debugger.md new file mode 100644 index 00000000..ce032d43 --- /dev/null +++ b/doc/usage/debugger/debugger.md @@ -0,0 +1,6 @@ + ## 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.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. + - 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. \ No newline at end of file diff --git a/doc/usage/debugger/launch.json.template b/doc/usage/debugger/launch.json.template new file mode 100644 index 00000000..e6bb2ca9 --- /dev/null +++ b/doc/usage/debugger/launch.json.template @@ -0,0 +1,46 @@ +{ + // 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", + //"buildFlags": "-race", + "env": { + "DISPATCH_RESOURCE_RESERVATION_TIMEOUT":"120000", + "PREEMPTION":"false", + "DISPATCHER_MODE":"false", + "QUOTA_ENABLED":"false", + }, + "args": ["--kubeconfig", "", "--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", + }, + "args": ["--kubeconfig", "", "--quotaEnabled", "true", "--v", "4", "--logtostderr"], + // This controls the Working directory the code runs in + "cwd": "${workspaceRoot}", + "showLog": true, + "port": 8081 + } + ] +} \ No newline at end of file