From bef462cdcf680dc12107b628f6adcdecddfb6ea1 Mon Sep 17 00:00:00 2001 From: BigBodyCobain <43977454+BigBodyCobain@users.noreply.github.com> Date: Mon, 15 Jun 2026 02:19:08 -0600 Subject: [PATCH] Restore full telemetry after E2E; make participant MESH_ONLY opt-in. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit E2E harness recreates the full dashboard backend when a run ends so local map layers are not left in lean MESH_ONLY mode. Participant compose no longer forces MESH_ONLY=true — set it in .env only for lean DM-only nodes. Co-authored-by: Cursor --- docker-compose.participant.yml | 6 ++-- scripts/e2e_dm_short_address_live.py | 50 +++++++++++++++++++++++++++- 2 files changed, 52 insertions(+), 4 deletions(-) diff --git a/docker-compose.participant.yml b/docker-compose.participant.yml index 3eb8d29..14ef56b 100644 --- a/docker-compose.participant.yml +++ b/docker-compose.participant.yml @@ -1,9 +1,9 @@ -# Lean fleet participant — Infonet swarm + DM relay without global OSINT fetchers. -# Use on secondary nodes (e.g. Pete) that should stay responsive for Tor DM tests. +# Fleet participant — Infonet swarm + DM relay. OSINT fetchers stay on unless +# MESH_ONLY=true in .env (lean mode for DM-only E2E / low-memory nodes). services: backend: environment: - MESH_ONLY: "true" + MESH_ONLY: "${MESH_ONLY:-false}" SHADOWBROKER_MESH_NODE_RUNTIME: "true" MESH_ARTI_ENABLED: "true" MESH_INFONET_FLEET_JOIN: "true" diff --git a/scripts/e2e_dm_short_address_live.py b/scripts/e2e_dm_short_address_live.py index 8c390ef..19c2d3a 100644 --- a/scripts/e2e_dm_short_address_live.py +++ b/scripts/e2e_dm_short_address_live.py @@ -4,6 +4,7 @@ Environment: PETE_SSH / REMOTE_PARTICIPANT_SSH — SSH host for remote participant (default: pete) E2E_DM_TOR_ONLY=1 — skip disk-inject fallbacks; require Tor replicate-envelope only + E2E_DM_LEAVE_LEAN_BACKEND=1 — keep MESH_ONLY lean backend after E2E (default: restore full telemetry) E2E_DM_DEPLOY_FROM_GIT=1 — remote participant: git pull + compose (no harness SCP patches) E2E_DM_FRESH_BACKEND=1 — recreate local lean E2E backend before run docker-compose.participant.yml — deploy lean participant on any fleet peer @@ -68,6 +69,10 @@ LOCAL_COMPOSE_FILES = ( "docker-compose.override.yml", "docker-compose.e2e.yml", ) +FULL_LOCAL_COMPOSE_FILES = ( + "docker-compose.yml", + "docker-compose.override.yml", +) _EMBED_SIGNED_MAILBOX_HELPERS = textwrap.dedent( """ @@ -390,6 +395,42 @@ def _local_compose_cmd(*subcommand: str) -> list[str]: return cmd +def _full_compose_cmd(*subcommand: str) -> list[str]: + cmd = ["docker", "compose"] + for compose_file in FULL_LOCAL_COMPOSE_FILES: + cmd.extend(["-f", compose_file]) + cmd.extend(subcommand) + return cmd + + +def _restore_local_full_backend() -> None: + """Return the dashboard backend to full telemetry mode after E2E (MESH_ONLY off).""" + if os.environ.get("E2E_DM_LEAVE_LEAN_BACKEND", "0").strip().lower() in { + "1", + "true", + "yes", + }: + return + print("== cleanup: restore full backend (telemetry / OSINT fetchers) ==") + proc = subprocess.run( + _full_compose_cmd("up", "-d", "--force-recreate", "backend"), + capture_output=True, + text=True, + timeout=300, + check=False, + ) + if proc.returncode != 0: + print( + f"full backend restore failed: {proc.stderr.strip() or proc.stdout.strip() or 'compose error'}" + ) + return + try: + _wait_local_backend_healthy(timeout_s=180) + print("full backend restored (MESH_ONLY off — map telemetry should return)") + except Exception as exc: + print(f"full backend restore health wait: {exc}") + + def _wait_local_backend_healthy(*, timeout_s: int = 300) -> None: deadline = time.time() + timeout_s while time.time() < deadline: @@ -3524,8 +3565,15 @@ print(json.dumps({{ if __name__ == "__main__": + exit_code = 1 try: - raise SystemExit(main()) + exit_code = main() except Exception as exc: print(f"E2E FAIL: {exc}", file=sys.stderr) raise + finally: + try: + _restore_local_full_backend() + except Exception as exc: + print(f"E2E cleanup: full backend restore skipped: {exc}", file=sys.stderr) + raise SystemExit(exit_code)