Skip to content

chore(mqtt): use developer's cloudflared tunnel on :7883 - #13

Closed
bkearns wants to merge 1 commit into
mainfrom
chore/mqtt-port-7883
Closed

chore(mqtt): use developer's cloudflared tunnel on :7883#13
bkearns wants to merge 1 commit into
mainfrom
chore/mqtt-port-7883

Conversation

@bkearns

@bkearns bkearns commented May 5, 2026

Copy link
Copy Markdown
Contributor

Stops running our own EMQX in the lab. The developer's cloudflared exposes the real broker on host 127.0.0.1:7883; the agent now connects there.

  • docker-compose.yml: mqtt: service is now profile-gated under internal-broker. Default make sim-up no longer starts EMQX. Bring it back with docker compose --profile internal-broker up -d for offline dev.
  • docker-compose.sim.yml: agent drops the mqtt healthcheck dep, gets extra_hosts: [host.docker.internal:host-gateway] for Docker portability (podman supplies this automatically), defaults BROKER_URL=tcp://host.docker.internal:7883. BROKER_URL env override remains.
  • Makefile (CI): make ci-up/ci-down now always include --profile internal-broker because CI runners don't have cloudflared. Smoke test stays self-contained.
  • Makefile (lab): header comment documents 7883 as the host-side cloudflared listener; lab-status probes it.

Verified locally

Stopped + removed temporal-hack-lab-mqtt-1; recreated agent. Logs:

mqtt connected   broker=tcp://host.docker.internal:7883
agent starting   robot_id=sim-robot-01
ota executor subscribed   topic=cmd/sim-robot-01/ota

Pre-push smoke green (CI cluster came up with internal-broker profile).

The user runs a Cloudflare-tunneled MQTT broker, exposed locally
via cloudflared on 127.0.0.1:7883. The lab no longer needs its
own EMQX in the default path.

docker-compose.yml:
  - mqtt: now profile-gated under "internal-broker". `make sim-up`
    no longer starts EMQX. Bring it back when needed:
      docker compose --profile internal-broker up -d

docker-compose.sim.yml:
  - agent: drop the `mqtt` healthcheck dep (service no longer up by
    default).
  - extra_hosts: ["host.docker.internal:host-gateway"] so the alias
    resolves on Docker; podman supplies host.containers.internal +
    host.docker.internal automatically.
  - BROKER_URL default: tcp://host.docker.internal:7883. Override
    with the BROKER_URL env if your tunnel listens elsewhere.

Makefile:
  - Header comment: MQTT documented as the host-side cloudflared
    tunnel listener, not a lab container.
  - lab-status MQTT default already 7883; will probe whatever
    listener (cloudflared OR local broker via internal-broker
    profile) is on that port.

Verified locally: stopped + removed temporal-hack-lab-mqtt-1;
recreated agent; logs show
  "mqtt connected" broker=tcp://host.docker.internal:7883
  "ota executor subscribed" topic=cmd/sim-robot-01/ota
@bkearns bkearns closed this May 5, 2026
@bkearns
bkearns deleted the chore/mqtt-port-7883 branch May 5, 2026 21:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant