Local Development: Change VS Code to use Goreman#4929
Conversation
Signed-off-by: David.Burkhalter <d2.burkhalter@gmail.com>
Signed-off-by: David.Burkhalter <d2.burkhalter@gmail.com>
…and-auth-launch-configs Signed-off-by: David.Burkhalter <d2.burkhalter@gmail.com>
Signed-off-by: David.Burkhalter <d2.burkhalter@gmail.com>
Signed-off-by: David.Burkhalter <d2.burkhalter@gmail.com>
Greptile SummaryThis PR overhauls the VS Code local development experience for Armada, replacing direct-launch debug configs with Goreman-backed dlv-DAP attach configs and adding six compound launch profiles (no-auth, auth, fake-executor — each with and without Prometheus). It also adds a Prometheus service to the Docker Compose stack, fixes a metrics config key in the scheduler ingester, and introduces helper scripts for port checking, service pre-building, and DAP readiness polling.
Confidence Score: 4/5Safe to merge for non-DAP workflows; the new Goreman DAP debugging path needs one fix before it works end-to-end. The
Important Files Changed
Sequence Diagram%%{init: {'theme': 'neutral'}}%%
sequenceDiagram
participant User as VS Code User
participant Task as preLaunchTask
participant PB as prebuild-services.sh
participant Goreman as goreman (DAP Procfile)
participant DLV as dlv dap listeners
participant Wait as wait-for-dlv.sh
participant VSCode as VS Code Debuggers
User->>Task: Launch compound config (e.g. Armada no-auth)
Task->>PB: Pre-build Go services (parallel, cache warm)
PB-->>Task: All services compile OK
Task->>Task: Check for port conflicts
Task->>Goreman: mage dev:up [profiles] -dap
Goreman->>Goreman: docker compose up (redis/postgres/pulsar)
Goreman->>DLV: "go build → dlv dap --listen=:2345 (server)"
Goreman->>DLV: "go build → dlv dap --listen=:2346 (scheduler)"
Goreman->>DLV: "go build → dlv dap --listen=:234x (...)"
Task->>Wait: wait-for-dlv.sh standard
Wait-->>Task: All dlv ports ready
Task-->>User: preLaunchTask complete
User->>VSCode: Attach debuggers (ports 2345–2353)
VSCode->>DLV: DAP attach with config file args
DLV-->>VSCode: Debugging session active
%%{init: {'theme': 'base', 'themeVariables': {"darkMode": true, "background": "#0d1117", "primaryColor": "#21262d", "primaryTextColor": "#e6edf3", "primaryBorderColor": "#8b949e", "lineColor": "#8b949e", "textColor": "#e6edf3", "edgeLabelBackground": "#161b22", "actorBkg": "#21262d", "actorBorder": "#8b949e", "actorTextColor": "#e6edf3", "actorLineColor": "#8b949e", "signalColor": "#8b949e", "signalTextColor": "#e6edf3", "noteBkgColor": "#373320", "noteBorderColor": "#d4a72c", "noteTextColor": "#f0e6c0", "labelBoxBkgColor": "#21262d", "labelBoxBorderColor": "#8b949e", "labelTextColor": "#e6edf3", "loopTextColor": "#e6edf3", "activationBkgColor": "#30363d", "activationBorderColor": "#8b949e"}}}%%
sequenceDiagram
participant User as VS Code User
participant Task as preLaunchTask
participant PB as prebuild-services.sh
participant Goreman as goreman (DAP Procfile)
participant DLV as dlv dap listeners
participant Wait as wait-for-dlv.sh
participant VSCode as VS Code Debuggers
User->>Task: Launch compound config (e.g. Armada no-auth)
Task->>PB: Pre-build Go services (parallel, cache warm)
PB-->>Task: All services compile OK
Task->>Task: Check for port conflicts
Task->>Goreman: mage dev:up [profiles] -dap
Goreman->>Goreman: docker compose up (redis/postgres/pulsar)
Goreman->>DLV: "go build → dlv dap --listen=:2345 (server)"
Goreman->>DLV: "go build → dlv dap --listen=:2346 (scheduler)"
Goreman->>DLV: "go build → dlv dap --listen=:234x (...)"
Task->>Wait: wait-for-dlv.sh standard
Wait-->>Task: All dlv ports ready
Task-->>User: preLaunchTask complete
User->>VSCode: Attach debuggers (ports 2345–2353)
VSCode->>DLV: DAP attach with config file args
DLV-->>VSCode: Debugging session active
Reviews (24): Last reviewed commit: "fix: pre build go services and have IDE ..." | Re-trigger Greptile |
Signed-off-by: David.Burkhalter <d2.burkhalter@gmail.com>
Signed-off-by: David.Burkhalter <d2.burkhalter@gmail.com>
Signed-off-by: David.Burkhalter <d2.burkhalter@gmail.com>
Signed-off-by: David.Burkhalter <d2.burkhalter@gmail.com>
Signed-off-by: David.Burkhalter <d2.burkhalter@gmail.com>
Signed-off-by: David.Burkhalter <d2.burkhalter@gmail.com>
Signed-off-by: David.Burkhalter <d2.burkhalter@gmail.com>
Signed-off-by: David.Burkhalter <d2.burkhalter@gmail.com>
|
Want your agent to iterate on Greptile's feedback? Try greploops. |
Signed-off-by: David.Burkhalter <d2.burkhalter@gmail.com>
Signed-off-by: David.Burkhalter <d2.burkhalter@gmail.com>
Signed-off-by: David.Burkhalter <d2.burkhalter@gmail.com>
Signed-off-by: David.Burkhalter <d2.burkhalter@gmail.com>
Signed-off-by: David.Burkhalter <d2.burkhalter@gmail.com>
Signed-off-by: David.Burkhalter <d2.burkhalter@gmail.com>
Signed-off-by: David.Burkhalter <d2.burkhalter@gmail.com>
Signed-off-by: David.Burkhalter <d2.burkhalter@gmail.com>
Signed-off-by: David.Burkhalter <d2.burkhalter@gmail.com>
Signed-off-by: David.Burkhalter <d2.burkhalter@gmail.com>
…and-auth-launch-configs Signed-off-by: David.Burkhalter <d2.burkhalter@gmail.com>
Signed-off-by: David.Burkhalter <d2.burkhalter@gmail.com>
…and-auth-launch-configs Signed-off-by: David.Burkhalter <d2.burkhalter@gmail.com>
Signed-off-by: David.Burkhalter <d2.burkhalter@gmail.com>
Signed-off-by: David.Burkhalter <d2.burkhalter@gmail.com>
Signed-off-by: David.Burkhalter <d2.burkhalter@gmail.com>
Signed-off-by: David.Burkhalter <d2.burkhalter@gmail.com>
…and-auth-launch-configs Signed-off-by: David.Burkhalter <d2.burkhalter@gmail.com>
Signed-off-by: David.Burkhalter <d2.burkhalter@gmail.com>
Signed-off-by: David.Burkhalter <d2.burkhalter@gmail.com>
…ersonal:d2burkhalter/armada into fix/add-prometheus-and-auth-launch-configs Signed-off-by: David.Burkhalter <d2.burkhalter@gmail.com>
| scrape_configs: | ||
| - job_name: "armada-server" | ||
| static_configs: | ||
| - targets: ["host.docker.internal:9000"] |
There was a problem hiding this comment.
host.docker.internal is a very OSX-specific feature, can we use something which would work on both Linux and OSX?
There was a problem hiding this comment.
I think the extra_hosts property here should allow it to work the same on osx and linux
prometheus:
container_name: prometheus
image: ${PROMETHEUS_IMAGE:-prom/prometheus:v3.11.3}
extra_hosts:
- "host.docker.internal:host-gateway"| We similarly provide run and debug configurations for VS Code users to run each Armada service and use the debugger (provided with VS Code). | ||
|
|
||
| The `Armada` configuration performs all required setup (setting up the Kind cluster, spinning up infrastructure services, performing database migrations) and then runs all services. | ||
| The following compound configurations are provided, each launching all relevant service debuggers at once: |
There was a problem hiding this comment.
We might have many sections in the README.md which could go in this docs/developer_guide.md, could you debloat the README also?
There was a problem hiding this comment.
I think we should have large doc changes in a separate PR. Want to try and get a consensus for what we want to do with README.md, docs/ and website/ and go from there
Signed-off-by: David.Burkhalter <d2.burkhalter@gmail.com>
Signed-off-by: David.Burkhalter <d2.burkhalter@gmail.com>
…ersonal:d2burkhalter/armada into fix/add-prometheus-and-auth-launch-configs Signed-off-by: David.Burkhalter <d2.burkhalter@gmail.com>
Signed-off-by: David.Burkhalter <d2.burkhalter@gmail.com>
Signed-off-by: David.Burkhalter <d2.burkhalter@gmail.com>
| // mage dev:up fake-executor -debug # fake executor + debug procfile | ||
| // mage dev:up auth,myservice # auth + extra compose profile "myservice" | ||
| // mage dev:up "" -dap # no-auth + dap procfile | ||
| func (Dev) Up(profiles string, dap *bool) error { |
There was a problem hiding this comment.
*bool parameter incompatible with -dap flag syntax in every task
Mage parses typed target arguments using strconv.ParseBool for *bool parameters. Every tasks.json command that calls mage dev:up <profiles> -dap will fail at argument parsing because "-dap" is not a valid bool string ("true" / "false"). The isDAP := dap != nil check is never reached — mage exits with a parse error before the function runs. All six new compound VS Code configurations use a pre-launch task with this flag, so none of them would work.
The simplest fix is to replace *bool with a string parameter and check whether it equals "-dap", or rename the check to dap != "" / dap == "-dap", preserving the existing call syntax in tasks.json. Alternatively, keep *bool and change all tasks.json invocations to pass true instead of -dap.
There was a problem hiding this comment.
From https://magefile.org/targets/
For *bool parameters, you can use the shorthand -name without a value, which is equivalent to -name=true
There was a problem hiding this comment.
You're right — I was wrong. The Mage docs explicitly document that shorthand, so -dap is valid syntax for a *bool parameter and will be parsed correctly. My concern about a parse error was unfounded. The implementation is correct as-is.
Tip: You can customize Greptile's behavior for this repo with .greptile/rules.md and .greptile/config.json.
What type of PR is this?
Enhancement for VS Code launch configurations that will align its debugger to use processes launched from Goreman with configs and docker compose in
/_localto consolidate how we do local development. Also adds launch configurations for starting Armada with authorization and prometheus.What this PR does / why we need it
/_local