-
Notifications
You must be signed in to change notification settings - Fork 120
Automated debug environment #10054
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
Open
sylvainsf
wants to merge
39
commits into
radius-project:main
Choose a base branch
from
sylvainsf:automated-debug-environment
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+2,099
−176
Open
Automated debug environment #10054
Changes from 32 commits
Commits
Show all changes
39 commits
Select commit
Hold shift + click to select a range
df205b5
mostly working for osx, needs docs to be verified and more testing.
sylvainsf ea10cbc
start and stop scripts
sylvainsf e56570f
use proper scripts
sylvainsf 8674626
mostly working just fixing some k8s context issues.
sylvainsf 4589fd1
fully working!
sylvainsf 0ecbf9e
think DE is finally fixed
sylvainsf 9f7f071
proper script location
sylvainsf 85475d1
moved all configs and scripts to build
sylvainsf b96a699
deployment succeeded!!! need to test dynamicrp, azure, and aws
sylvainsf 5e21ed8
ignore demo symlink
sylvainsf 0a1587d
removing empty file
sylvainsf b07f0d8
clean up launch tasks
sylvainsf aa0fd8e
fixed the orphaned prereqs check in make debug-start
sylvainsf f502cd4
cleaned up bad and confusing make targets
sylvainsf c2ad755
remove unneeded lock file
sylvainsf b6810d8
fix ucp startup time issue and check postgres properly
sylvainsf 62e5898
address pr comments
sylvainsf 2985cce
added drad vscode target, deprecation banner to old instructions.
sylvainsf f99a8a5
remove deprecated script
sylvainsf e95be97
ignore drad script
sylvainsf 3a84ba2
support both brew and docker postgres auth patterns
sylvainsf 4be1d9d
fix table permissions
sylvainsf 42c7d26
remove the deprecated target
sylvainsf 5c0c298
fixed psql detection for brew vs docker
sylvainsf 21dd0e4
better linux support
sylvainsf 4d6fa20
corrected docs
sylvainsf 99120db
clarified workflow
sylvainsf 35a6be7
fixed hard coded path
sylvainsf b622deb
clearer stop comment
sylvainsf 03bf912
Update .vscode/launch.json for multiple args on cli
sylvainsf 6415aa2
merge resolution
sylvainsf 47f1b81
Merge remote-tracking branch 'origin/automated-debug-environment' int…
sylvainsf 57b8b59
Merge remote-tracking branch 'upstream/main' into automated-debug-env…
sylvainsf d5d3818
fixes port issue for k3d
sylvainsf 6a9a2fb
Update docs/contributing/contributing-code/contributing-code-debuggin…
sylvainsf cf5013b
Cleaned up and fixed all vscode tasks and launch configs
sylvainsf 86a1dc9
Merge remote-tracking branch 'origin/automated-debug-environment' int…
sylvainsf 5c98d1c
fixed debian install for correct version
sylvainsf 47f9824
Merge branch 'main' into automated-debug-environment
sylvainsf File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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 |
|---|---|---|
|
|
@@ -72,6 +72,8 @@ hack/bicep-types-radius/generated/**/*.md | |
|
|
||
| # Debug files | ||
| debug_files/* | ||
| drad | ||
| *.lock | ||
|
|
||
| # Demo app | ||
| demo/* | ||
|
|
||
This file contains hidden or 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,16 @@ | ||
| #!/bin/bash | ||
| # Simple script to read PID from file | ||
| # Usage: get-pid.sh <component-name> | ||
|
|
||
| if [ -z "$1" ]; then | ||
| echo "0" | ||
| exit 1 | ||
| fi | ||
|
|
||
| PID_FILE="debug_files/logs/$1.pid" | ||
|
|
||
| if [ -f "$PID_FILE" ]; then | ||
| cat "$PID_FILE" | ||
| else | ||
| echo "0" | ||
| fi |
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. nitpick(style): lint/format of this file will cause better readability, now big one-liners are hard to read |
This file contains hidden or 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 |
|---|---|---|
| @@ -1,113 +1,23 @@ | ||
| { | ||
| // 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": "Debug rad CLI", | ||
| "type": "go", | ||
| "request": "launch", | ||
| "mode": "auto", | ||
| "preLaunchTask": "Build Radius (all)", | ||
| "program": "${workspaceFolder}/cmd/rad/main.go", | ||
| "cwd": "${workspaceFolder}", | ||
| "args": [] | ||
| }, | ||
| { | ||
| "name": "Debug rad CLI (prompt for args)", | ||
| "type": "go", | ||
| "request": "launch", | ||
| "mode": "debug", | ||
| "preLaunchTask": "Build Radius (all)", | ||
| "program": "${workspaceFolder}/cmd/rad", | ||
| "args": "${input:cliArgs}", | ||
| "console": "integratedTerminal" | ||
| }, | ||
| { | ||
| "name": "Launch Applications RP", | ||
| "type": "go", | ||
| "request": "launch", | ||
| "mode": "auto", | ||
| "preLaunchTask": "Build Radius (all)", | ||
| "program": "${workspaceFolder}/cmd/applications-rp/main.go" | ||
| }, | ||
| { | ||
| "name": "Launch Dynamic RP", | ||
| "type": "go", | ||
| "request": "launch", | ||
| "mode": "auto", | ||
| "preLaunchTask": "Build Radius (all)", | ||
| "program": "${workspaceFolder}/cmd/dynamic-rp/main.go" | ||
| }, | ||
| { | ||
| "name": "Launch UCP", | ||
| "type": "go", | ||
| "request": "launch", | ||
| "mode": "auto", | ||
| "preLaunchTask": "Build Radius (all)", | ||
| "program": "${workspaceFolder}/cmd/ucpd/main.go" | ||
| }, | ||
| { | ||
| "name": "Launch Controller", | ||
| "type": "go", | ||
| "request": "launch", | ||
| "mode": "auto", | ||
| "preLaunchTask": "Build Radius (all)", | ||
| "program": "${workspaceFolder}/cmd/controller/main.go", | ||
| "args": ["--cert-dir", ""] | ||
| }, | ||
| { | ||
| "name": "Launch Deployment Engine", | ||
| "type": "coreclr", | ||
| "request": "launch", | ||
| "preLaunchTask": "Build Deployment Engine", | ||
| "program": "${workspaceFolder}/../deployment-engine/src/DeploymentEngine/bin/Debug/net8.0/arm-de.dll", | ||
| "args": [], | ||
| "cwd": "${workspaceFolder}/../deployment-engine/src/DeploymentEngine", | ||
| "stopAtEntry": false, | ||
| "env": { | ||
| "ASPNETCORE_URLS": "http://localhost:5017", | ||
| "ASPNETCORE_ENVIRONMENT": "Development", | ||
| "KUBERNETESBICEPEXTENSIBILITYURL": "http://localhost:5017/api", | ||
| "RADIUSBACKENDURI": "http://localhost:9000" | ||
| } | ||
| }, | ||
| { | ||
| "name": "Debug Bicep generator integration tests", | ||
| "type": "node", | ||
| "request": "launch", | ||
| "runtimeArgs": [ | ||
| "--inspect-brk", | ||
| "${workspaceRoot}/hack/bicep-types-radius/src/autorest.bicep/node_modules/.bin/jest", | ||
| "--runInBand", | ||
| "--no-cache" | ||
| ], | ||
| "cwd": "${workspaceFolder}/hack/bicep-types-radius/src/autorest.bicep/src", | ||
| "console": "integratedTerminal", | ||
| "internalConsoleOptions": "neverOpen", | ||
| "sourceMaps": true | ||
| } | ||
| ], | ||
| "compounds": [ | ||
| { | ||
| "name": "Launch Control Plane (all)", | ||
| "configurations": [ | ||
| "Launch UCP", | ||
| "Launch Applications RP", | ||
| "Launch Dynamic RP", | ||
| "Launch Controller", | ||
| "Launch Deployment Engine" | ||
| ], | ||
| "stopAll": true | ||
| } | ||
| ], | ||
| "inputs": [ | ||
| { | ||
| "id": "cliArgs", | ||
| "type": "promptString", | ||
| "description": "Args for launching Radius cli. Use --cwd to set the working directory.", | ||
| "default": "init --full" | ||
| } | ||
| ] | ||
| "version": "0.2.0", | ||
| "configurations": [ | ||
| { "name": "Attach UCP (dlv 40001)", "type": "go", "request": "attach", "mode": "remote", "port": 40001, "host": "127.0.0.1" }, | ||
| { "name": "Attach Controller (dlv 40002)", "type": "go", "request": "attach", "mode": "remote", "port": 40002, "host": "127.0.0.1" }, | ||
| { "name": "Attach Applications RP (dlv 40003)", "type": "go", "request": "attach", "mode": "remote", "port": 40003, "host": "127.0.0.1" }, | ||
| { "name": "Attach Dynamic RP (dlv 40004)", "type": "go", "request": "attach", "mode": "remote", "port": 40004, "host": "127.0.0.1" }, | ||
| { "name": "Launch UCP", "type": "go", "request": "launch", "mode": "auto", "program": "${workspaceFolder}/cmd/ucpd/main.go", "env": { "BASE_PATH": "/apis/api.ucp.dev/v1alpha3", "PORT": "9000", "AWS_REGION": "us-east-1" }, "args": ["--config-file", "${workspaceFolder}/cmd/ucpd/ucp-dev.yaml"] }, | ||
| { "name": "Launch Controller", "type": "go", "request": "launch", "mode": "auto", "program": "${workspaceFolder}/cmd/controller/main.go", "args": ["--config-file", "${workspaceFolder}/cmd/controller/controller.yaml"] }, | ||
| { "name": "Launch Applications RP", "type": "go", "request": "launch", "mode": "auto", "program": "${workspaceFolder}/cmd/applications-rp/main.go", "args": ["--config-file", "${workspaceFolder}/cmd/applications-rp/applications-rp.yaml"] }, | ||
| { "name": "Launch Dynamic RP", "type": "go", "request": "launch", "mode": "auto", "program": "${workspaceFolder}/cmd/dynamic-rp/main.go", "args": ["--config-file", "${workspaceFolder}/cmd/dynamic-rp/dynamic-rp.yaml"] }, | ||
| { "name": "Debug rad CLI", "type": "go", "request": "launch", "mode": "auto", "program": "${workspaceFolder}/cmd/rad/main.go", "args": ["version"], "env": { "RADIUS_ENV": "self-hosted" } }, | ||
| { "name": "Debug rad CLI (prompt for args)", "type": "go", "request": "launch", "mode": "auto", "program": "${workspaceFolder}/cmd/rad/main.go", "args": "${input:radArgs}", "env": { "RADIUS_ENV": "self-hosted" } }, | ||
| { "name": "Debug drad CLI (debug environment)", "type": "go", "request": "launch", "mode": "auto", "program": "${workspaceFolder}/cmd/rad/main.go", "args": "--config ${workspaceFolder}/build/configs/rad-debug-config.yaml ${input:radArgs}", "env": { "RADIUS_ENV": "self-hosted" } } | ||
| ], | ||
| "compounds": [ | ||
| { "name": "Attach Radius (all)", "configurations": ["Attach UCP (dlv 40001)", "Attach Controller (dlv 40002)", "Attach Applications RP (dlv 40003)", "Attach Dynamic RP (dlv 40004)"], "stopAll": true }, | ||
| { "name": "Launch Control Plane (all)", "configurations": ["Launch UCP", "Launch Applications RP", "Launch Dynamic RP", "Launch Controller"], "stopAll": true } | ||
| ], | ||
| "inputs": [ | ||
| { "id": "radArgs", "type": "promptString", "description": "Arguments for the rad command (e.g. 'env list')", "default": "version" } | ||
| ] | ||
| } |
This file contains hidden or 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,22 @@ | ||
| { | ||
| "go.gopath": "${env:GOPATH}", | ||
| "go.useLanguageServer": true, | ||
| "go.delveConfig": { | ||
| "apiVersion": 2, | ||
| "showGlobalVariables": true | ||
| }, | ||
| "files.associations": { | ||
| "*.yaml": "yaml", | ||
| "*.yml": "yaml" | ||
| }, | ||
| "terminal.integrated.env.linux": { | ||
| "RADIUS_DEV_ROOT": "${workspaceFolder}/debug_files" | ||
| }, | ||
| "terminal.integrated.env.osx": { | ||
| "RADIUS_DEV_ROOT": "${workspaceFolder}/debug_files" | ||
| }, | ||
| "terminal.integrated.env.windows": { | ||
| "RADIUS_DEV_ROOT": "${workspaceFolder}/debug_files" | ||
| }, | ||
| "makefile.configureOnOpen": false | ||
| } |
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. praise: Love it! |
This file contains hidden or 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 |
|---|---|---|
| @@ -1,66 +1,104 @@ | ||
| { | ||
| "version": "2.0.0", | ||
| "tasks": [ | ||
| { | ||
| "label": "Check for Deployment Engine", | ||
| "detail": "Checks if the Deployment Engine is cloned as a sibling to the Radius repo", | ||
| "command": "bash", | ||
| "args": [ | ||
| "-c", | ||
| "(test -d ../deployment-engine/src) || { echo >&1 \"The radius-project/deployment-engine is not cloned as a sibling to the Radius repo. Please clone the radius-project/deployment-engine repo next to the Radius repo.\"; exit 1; }" | ||
| ], | ||
| "type": "shell", | ||
| "options": { | ||
| "cwd": "${workspaceFolder}" | ||
| }, | ||
| "group": "none", | ||
| "presentation": { | ||
| "reveal": "silent", | ||
| "echo": false, | ||
| "clear": true | ||
| }, | ||
| "problemMatcher": [] | ||
| }, | ||
| { | ||
| "label": "Build Deployment Engine", | ||
| "detail": "Builds the Deployment Engine. This requires the radius-project/deployment engine repo to be cloned as a sibling to the radius-project/radius repo", | ||
| "dependsOn": ["Check for Deployment Engine"], | ||
| "command": "dotnet build", | ||
| "type": "shell", | ||
| "options": { | ||
| "cwd": "${workspaceFolder}/../deployment-engine/src/DeploymentEngine" | ||
| }, | ||
| "group": "build", | ||
| "presentation": { | ||
| "echo": true, | ||
| "reveal": "silent", | ||
| "panel": "shared", | ||
| "showReuseMessage": false, | ||
| "clear": true | ||
| }, | ||
| "problemMatcher": "$msCompile" | ||
| }, | ||
| { | ||
| "label": "Build Radius (all)", | ||
| "detail": "Builds the Radius repository using make build", | ||
| "command": "make", | ||
| "type": "shell", | ||
| "args": ["build"], | ||
| "options": { | ||
| "cwd": "${workspaceFolder}" | ||
| }, | ||
| "group": { | ||
| "kind": "build", | ||
| "isDefault": true | ||
| }, | ||
| "problemMatcher": "$gcc", | ||
| "presentation": { | ||
| "echo": true, | ||
| "reveal": "silent", | ||
| "panel": "shared", | ||
| "showReuseMessage": false, | ||
| "clear": true | ||
| } | ||
| } | ||
| ] | ||
| "version": "2.0.0", | ||
| "tasks": [ | ||
| { | ||
| "label": "Debug: Start All Components", | ||
| "type": "shell", | ||
| "command": "make", | ||
| "args": ["debug-start"], | ||
| "group": "build", | ||
| "presentation": { | ||
| "echo": true, | ||
| "reveal": "always", | ||
| "focus": false, | ||
| "panel": "shared", | ||
| "showReuseMessage": true, | ||
| "clear": false | ||
| }, | ||
| "problemMatcher": [] | ||
| }, | ||
| { | ||
| "label": "Debug: Stop All Components", | ||
| "type": "shell", | ||
| "command": "make", | ||
| "args": ["debug-stop"], | ||
| "group": "build", | ||
| "presentation": { | ||
| "echo": true, | ||
| "reveal": "always", | ||
| "focus": false, | ||
| "panel": "shared", | ||
| "showReuseMessage": true, | ||
| "clear": false | ||
| }, | ||
| "problemMatcher": [] | ||
| }, | ||
| { | ||
| "label": "Debug: Component Status", | ||
| "type": "shell", | ||
| "command": "make", | ||
| "args": ["debug-status"], | ||
| "group": "test", | ||
| "presentation": { | ||
| "echo": true, | ||
| "reveal": "always", | ||
| "focus": false, | ||
| "panel": "shared", | ||
| "showReuseMessage": true, | ||
| "clear": false | ||
| }, | ||
| "problemMatcher": [] | ||
| }, | ||
| { | ||
| "label": "Debug: View Logs", | ||
| "type": "shell", | ||
| "command": "make", | ||
| "args": ["debug-logs"], | ||
| "group": "test", | ||
| "presentation": { | ||
| "echo": true, | ||
| "reveal": "always", | ||
| "focus": false, | ||
| "panel": "shared", | ||
| "showReuseMessage": true, | ||
| "clear": false | ||
| }, | ||
| "problemMatcher": [] | ||
| }, | ||
| { | ||
| "label": "Build All Components", | ||
| "type": "shell", | ||
| "command": "make", | ||
| "args": ["build"], | ||
| "group": { | ||
| "kind": "build", | ||
| "isDefault": true | ||
| }, | ||
| "presentation": { | ||
| "echo": true, | ||
| "reveal": "always", | ||
| "focus": false, | ||
| "panel": "shared", | ||
| "showReuseMessage": true, | ||
| "clear": false | ||
| }, | ||
| "problemMatcher": [] | ||
| }, | ||
| { | ||
| "label": "Build Debug Components", | ||
| "type": "shell", | ||
| "command": "make", | ||
| "args": ["debug-build"], | ||
| "group": "build", | ||
| "presentation": { | ||
| "echo": true, | ||
| "reveal": "always", | ||
| "focus": false, | ||
| "panel": "shared", | ||
| "showReuseMessage": true, | ||
| "clear": false | ||
| }, | ||
| "problemMatcher": [] | ||
| } | ||
| ] | ||
| } |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I was able to attach a debugger to the CLI using the configurations in this file, but I was not able to effectively debug any CLI command that has interactive input, like
rad init. This may be an issue with the CLI framework we use rather than this particular configuration. (This is just a comment, not a request for a fix.)