feat: enable the k8s deployment for the relay server#25
Merged
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
There was a problem hiding this comment.
Pull request overview
This PR introduces infrastructure and runtime changes to support running the Go relay server in Kubernetes (multi-replica) and wires the desktop/mobile clients toward using an RxLab-hosted relay catalog, alongside some Claude/MCP integration updates.
Changes:
- Add a Redis pub/sub backplane + presence tracking to enable multi-replica relay routing, plus Kubernetes manifests and a release-gated deploy workflow.
- Add a hosted-relay catalog (
relays.json) and update the desktop “Mobile” settings UI to pick hosted relays or enter a custom relay URL. - Extend Claude/MCP config generation to optionally include an IDE-provided MCP bridge and inform the agent via an appended system prompt.
Reviewed changes
Copilot reviewed 25 out of 27 changed files in this pull request and generated 7 comments.
Show a summary per file
| File | Description |
|---|---|
| website/public/relays.json | Adds hosted relay catalog published by the website. |
| website/.gitignore | Ignores local env files for the website. |
| RxCode/Views/Settings/MobileSettingsTab.swift | Updates settings UI to support hosted relay presets vs custom URL. |
| RxCode/Services/RelayPresetCatalog.swift | Implements hosted relay preset catalog loader with bundled fallback. |
| RxCode/Services/MCPService.swift | Allows injecting an additional rxcode-ide MCP server into Claude config. |
| RxCode/Services/ClaudeService.swift | Appends IDE-tools system prompt when using an MCP config. |
| RxCode/App/AppState.swift | Allocates per-session IDE MCP port and passes bridge config to MCP service. |
| relay-server/relay.go | Adds backplane-aware routing + presence refresh on ping. |
| relay-server/backplane.go | Implements Redis backplane pub/sub + presence keys with ownership-safe clearing. |
| relay-server/main.go | Adds REDIS_URL / -redis-url to enable multi-node mode. |
| relay-server/health.go | Adds mode to /healthz response and bumps version. |
| relay-server/README.md | Documents Redis-backed multi-node mode and Kubernetes deployment. |
| relay-server/go.mod | Bumps Go version and adds Redis dependency. |
| relay-server/go.sum | Updates sums for new dependencies. |
| relay-server/Dockerfile | Updates base image version and runs as nonroot distroless. |
| relay-server/k8s/namespace.yaml | Adds namespace manifest for relay deployment. |
| relay-server/k8s/configmap.yaml | Adds config map for relay runtime configuration. |
| relay-server/k8s/deployment.yaml | Adds Deployment for multi-replica relay server. |
| relay-server/k8s/service.yaml | Adds ClusterIP service for relay. |
| relay-server/k8s/ingress.yaml | Adds NGINX ingress config with WebSocket-friendly timeouts. |
| relay-server/k8s/pdb.yaml | Adds PodDisruptionBudget to keep at least one pod serving. |
| relay-server/k8s/hpa.yaml | Adds CPU-based autoscaling configuration. |
| relay-server/k8s/kustomization.yaml | Adds Kustomize orchestration for manifests. |
| relay-server/k8s/README.md | Adds operator docs for Kubernetes deployment. |
| .github/workflows/relay-deploy.yaml | Adds CI workflow to build and (on release) deploy the relay. |
| Packages/Sources/RxCodeChatKit/ChatMessageBubble.swift | Special-cases AskUserQuestion tool calls in compact bubbles. |
| .gitignore | Ignores relay-server/k8s/secrets.yaml to avoid committing secrets. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
105
to
+114
| func (h *Hub) deliver(env *Envelope) { | ||
| if h.deliverLocal(env) { | ||
| return | ||
| } | ||
| // Not connected to this pod. | ||
| if h.backplane != nil { | ||
| // Another replica may hold the connection. The backplane round-trips | ||
| // to Redis, so run it off the hub loop to keep local routing fast. | ||
| go h.routeViaBackplane(env) | ||
| return |
Comment on lines
+124
to
129
| func (h *Hub) deliverLocal(env *Envelope) bool { | ||
| raw, err := json.Marshal(env) | ||
| if err != nil { | ||
| log.Printf("marshal envelope: %v", err) | ||
| return | ||
| return false | ||
| } |
| # Listen address inside the pod. The Service targets this port. | ||
| RELAY_ADDR: ":8787" | ||
| # APNs topic must equal the RxCode Mobile bundle identifier exactly. | ||
| APNS_TOPIC: "com.idealapp.RxCode.Mobile" |
| @@ -54,6 +54,7 @@ missing file is non-fatal — the relay just uses whatever's in the process env. | |||
| | `-apns-team-id` | `APNS_TEAM_ID` | 10-char Team ID. | | |||
| | `-apns-topic` | `APNS_TOPIC` | iOS app bundle identifier (e.g. `app.rxlab.rxcodemobile`). | | |||
Comment on lines
+4
to
+7
| metadata: | ||
| name: rxcode-relay | ||
| namespace: rxcode-relay | ||
|
|
Comment on lines
+40
to
+50
| ### 1. Populate secrets | ||
|
|
||
| Edit `secrets.yaml` with real APNs values, then apply it manually (it is | ||
| deliberately excluded from `kustomization.yaml`): | ||
|
|
||
| ```bash | ||
| # encode the .p8 auth key | ||
| base64 < AuthKey_XXXXXXXXXX.p8 | tr -d '\n' | ||
|
|
||
| kubectl apply -f secrets.yaml | ||
| ``` |
Comment on lines
+1
to
+16
| name: Deploy Relay Server | ||
|
|
||
| concurrency: | ||
| group: ${{ github.workflow }}-${{ github.ref }} | ||
| cancel-in-progress: true | ||
|
|
||
| on: | ||
| push: | ||
| branches: | ||
| - main | ||
| release: | ||
| types: | ||
| - created | ||
|
|
||
| env: | ||
| IMAGE: ghcr.io/${{ github.repository_owner }}/rxcode-relay |
Contributor
Author
|
🎉 This PR is included in version 1.6.0 🎉 The release is available on GitHub release Your semantic-release bot 📦🚀 |
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
No description provided.