-
Notifications
You must be signed in to change notification settings - Fork 47
Gateway Remote Debug #1233
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
base: main
Are you sure you want to change the base?
Gateway Remote Debug #1233
Changes from all commits
ef406c0
9f7e1b5
ae3b074
65826aa
305af97
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||
|---|---|---|---|---|---|---|---|---|---|---|
| @@ -0,0 +1,98 @@ | ||||||||||
| # -------------------------------------------------------------------- | ||||||||||
| # Copyright (c) 2026, WSO2 LLC. (https://www.wso2.com). | ||||||||||
| # | ||||||||||
| # WSO2 LLC. licenses this file to you under the Apache License, | ||||||||||
| # Version 2.0 (the "License"); you may not use this file except | ||||||||||
| # in compliance with the License. | ||||||||||
| # You may obtain a copy of the License at | ||||||||||
| # | ||||||||||
| # http://www.apache.org/licenses/LICENSE-2.0 | ||||||||||
| # | ||||||||||
| # Unless required by applicable law or agreed to in writing, | ||||||||||
| # software distributed under the License is distributed on an | ||||||||||
| # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY | ||||||||||
| # KIND, either express or implied. See the License for the | ||||||||||
| # specific language governing permissions and limitations | ||||||||||
| # under the License. | ||||||||||
| # -------------------------------------------------------------------- | ||||||||||
|
|
||||||||||
| # Compose overlay for remote debugging gateway components with dlv. | ||||||||||
| # Usage: docker compose -f docker-compose.yaml -f docker-compose.debug.yaml up | ||||||||||
|
Comment on lines
+19
to
+20
Contributor
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. Fix the usage comment — this file is standalone, not an overlay. As noted in the debug guide review, this file defines complete service definitions. Running it as an overlay on Proposed fix # Compose overlay for remote debugging gateway components with dlv.
-# Usage: docker compose -f docker-compose.yaml -f docker-compose.debug.yaml up
+# Usage: docker compose -f docker-compose.debug.yaml up📝 Committable suggestion
Suggested change
🤖 Prompt for AI Agents |
||||||||||
| # | ||||||||||
| # Prerequisites: | ||||||||||
| # 1. Build debug images: | ||||||||||
| # cd gateway-controller && make build-debug | ||||||||||
| # cd gateway-runtime && make build-debug | ||||||||||
| # 2. In VS Code Run & Debug: | ||||||||||
| # - "Gateway Controller (Remote)" (port 2345) | ||||||||||
| # - "Policy Engine (Remote)" (port 2346) | ||||||||||
|
|
||||||||||
| # NOTE: gateway-controller and gateway-runtime here duplicate docker-compose.yaml — keep in sync. | ||||||||||
|
|
||||||||||
| services: | ||||||||||
| gateway-controller: | ||||||||||
| image: ghcr.io/wso2/api-platform/gateway-controller-debug:latest | ||||||||||
| command: ["-config", "/etc/gateway-controller/config.toml"] | ||||||||||
| ports: | ||||||||||
| - "9090:9090" # REST API | ||||||||||
| - "9094:9092" # Admin API | ||||||||||
| - "18000:18000" # xDS gRPC (Router) | ||||||||||
| - "18001:18001" # xDS gRPC (Policy Engine) | ||||||||||
| - "9011:9091" # Metrics | ||||||||||
| - "2345:2345" # dlv remote debug port | ||||||||||
| environment: | ||||||||||
| - APIP_GW_CONTROLLER_STORAGE_TYPE=sqlite | ||||||||||
| - APIP_GW_CONTROLLER_STORAGE_SQLITE_PATH=./data/gateway.db | ||||||||||
| - APIP_GW_CONTROLLER_LOGGING_LEVEL=info | ||||||||||
| - APIP_GW_CONTROLLER_METRICS_PORT=9091 | ||||||||||
| - APIP_GW_GATEWAY_REGISTRATION_TOKEN=${GATEWAY_REGISTRATION_TOKEN:-} | ||||||||||
| - APIP_GW_CONTROLPLANE_HOST=${GATEWAY_CONTROLPLANE_HOST:-host.docker.internal:9243} | ||||||||||
| volumes: | ||||||||||
| - controller-data:/app/data | ||||||||||
| - ./configs/config.toml:/etc/gateway-controller/config.toml:ro | ||||||||||
| - ./gateway-controller/certificates:/app/certificates | ||||||||||
| - ./gateway-controller/listener-certs:/app/listener-certs:ro | ||||||||||
| extra_hosts: | ||||||||||
| - "host.docker.internal:host-gateway" | ||||||||||
| networks: | ||||||||||
| - gateway-network | ||||||||||
| cap_add: | ||||||||||
| - SYS_PTRACE # required by dlv for process introspection | ||||||||||
| security_opt: | ||||||||||
| - seccomp:unconfined # dlv uses syscalls blocked by the default seccomp profile | ||||||||||
|
|
||||||||||
| gateway-runtime: | ||||||||||
| image: ghcr.io/wso2/api-platform/gateway-runtime-debug:latest | ||||||||||
| command: ["--pol.config", "/etc/policy-engine/config.toml"] | ||||||||||
| ports: | ||||||||||
| # Router (Envoy) | ||||||||||
| - "8080:8080" # HTTP ingress | ||||||||||
| - "8443:8443" # HTTPS ingress | ||||||||||
| - "8081:8081" # xDS-managed API listener | ||||||||||
| - "8082:8082" # WebSub Hub dynamic forward proxy | ||||||||||
| - "8083:8083" # WebSub Hub internal listener | ||||||||||
| - "9901:9901" # Envoy admin | ||||||||||
| # Policy Engine | ||||||||||
| - "9002:9002" # Admin API | ||||||||||
| - "9003:9003" # Metrics | ||||||||||
| - "2346:2346" # dlv remote debug port | ||||||||||
| environment: | ||||||||||
| - GATEWAY_CONTROLLER_HOST=gateway-controller | ||||||||||
| - MOESIF_KEY=${MOESIF_KEY:-} | ||||||||||
| - LOG_LEVEL=info | ||||||||||
| volumes: | ||||||||||
| - ./configs/config.toml:/etc/policy-engine/config.toml:ro | ||||||||||
| networks: | ||||||||||
| - gateway-network | ||||||||||
| cap_add: | ||||||||||
| - SYS_PTRACE # required by dlv for process introspection | ||||||||||
| security_opt: | ||||||||||
| - seccomp:unconfined # dlv uses syscalls blocked by the default seccomp profile | ||||||||||
|
|
||||||||||
| volumes: | ||||||||||
| controller-data: | ||||||||||
| driver: local | ||||||||||
|
|
||||||||||
| networks: | ||||||||||
| gateway-network: | ||||||||||
| driver: bridge | ||||||||||
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.
Usage command here conflicts with the header comment in
docker-compose.debug.yaml.The guide correctly runs the debug compose file standalone (
-f docker-compose.debug.yaml), butdocker-compose.debug.yamlline 20 says:Since the debug file defines complete service definitions (not partial overrides), running it as an overlay on top of
docker-compose.yamlwould cause port-binding conflicts. One of the two should be updated for consistency — the guide appears correct here, so the comment indocker-compose.debug.yamlshould be fixed.🤖 Prompt for AI Agents