Skip to content

feat: edgenode-flower — Holochain + Flower SuperNode variant#139

Draft
evangineer wants to merge 2 commits into
mainfrom
feat/edgenode-flower
Draft

feat: edgenode-flower — Holochain + Flower SuperNode variant#139
evangineer wants to merge 2 commits into
mainfrom
feat/edgenode-flower

Conversation

@evangineer
Copy link
Copy Markdown
Contributor

Summary

  • Adds a new edgenode-flower Docker image variant that bundles a Holochain conductor with a Flower SuperNode, connected by a Python conductor API bridge (fl-bridge)
  • Mirrors the edgenode-harvester architecture: s6-overlay process supervision, same /data volume layout, same happ_tool/happ_config_file install machinery
  • Implements the overlay deployment mode from the Holochain hApp layer PRD: Flower connects to an existing SuperLink while the bridge builds a tamper-evident audit trail

New files

File Purpose
docker/Dockerfile.flower Image definition — adds Python + flwr, replaces log-harvester with fl-bridge
docker/fl-bridge/bridge.py Conductor API bridge: installs FL hApp, manages Flower SuperNode subprocess, records ContributionRecord per round
docker/fl-bridge/requirements.txt flwr>=1.13.0
docker/logrotate.d/flower.conf Daily rotation for fl-bridge.log and flower-supernode.log
docker/s6-overlay-flower/ s6 service tree: setup, conductor, fl-bridge, logrotate-cron

Deployment modes (FLOWER_DEPLOYMENT_MODE)

  • overlay (implemented) — Flower SuperNode connects to an existing SuperLink via SUPERLINK_URL; bridge records a local JSONL audit trail at /data/flower/contributions.jsonl
  • augmented (scaffolded) — governance ratification checks before strategy changes are relayed to the SuperNode
  • decentralized (scaffolded) — full Holochain round coordination with no external SuperLink

Key environment variables

SUPERLINK_URL=grpcs://host:9093   # required in overlay/augmented mode
FLOWER_DEPLOYMENT_MODE=overlay    # overlay | augmented | decentralized
FLOWER_INSECURE=true              # disable TLS (dev only)
FL_HAPP_URL=https://...           # URL to download FL hApp .happ at startup
FL_ORG_NAME=my-org                # participant registry metadata
FL_JURISDICTION=EU

Quick start (overlay mode)

docker build -f docker/Dockerfile.flower -t edgenode-flower docker/
docker run --name edgenode-flower -dit \
  -v $(pwd)/holo-data:/data \
  -p 4444:4444 -p 4445:4445 -p 9091:9091 \
  -e SUPERLINK_URL=grpcs://your-superlink:9093 \
  -e FLOWER_INSECURE=true \
  -e FL_ORG_NAME=my-org \
  edgenode-flower

Known gaps / TODOs

  • Source-chain commitment of ContributionRecord via Holochain app WebSocket — pending FL hApp zome deployment (local JSONL is the current fallback)
  • augmented mode governance checks — requires FL hApp governance zome
  • decentralized mode designated-aggregator address resolution from DHT
  • Round detection regex tuning against actual flwr supernode output
  • Integration tests (following run_harvester_tests.sh pattern)

Test plan

  • docker build -f docker/Dockerfile.flower docker/ succeeds for amd64 and arm64
  • Container starts cleanly; all four s6 services reach up state
  • Holochain conductor admin WebSocket responds on port 4444
  • With FL_HAPP_URL unset: bridge logs warning and idles without crashing
  • With SUPERLINK_URL set and a running SuperLink: Flower SuperNode connects and a round completes; contributions.jsonl contains a record

🤖 Generated with Claude Code

…rNode

Introduces a new Docker image variant (`edgenode-flower`) that runs a
Holochain conductor alongside a Flower SuperNode, connected by a Python
conductor API bridge (`fl-bridge`).

The bridge installs the FL hApp at startup, manages the Flower SuperNode
process, and records a ContributionRecord to a local JSONL audit log after
each FL round. Audit trail commitment to the participant's Holochain source
chain is scaffolded with TODOs pending FL hApp zome deployment.

Supports three deployment modes via FLOWER_DEPLOYMENT_MODE:
- overlay: Flower connects to an existing SuperLink; bridge audits only
- augmented: governance ratification checks before strategy changes apply
- decentralized: full Holochain round coordination (scaffolded)

New files:
- docker/Dockerfile.flower
- docker/fl-bridge/bridge.py + requirements.txt
- docker/logrotate.d/flower.conf
- docker/s6-overlay-flower/ (s6 service tree mirroring s6-overlay-harvester)

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@evangineer evangineer self-assigned this Apr 16, 2026
…erLink scaffold and README

Aligns implementation with revised pollen PRD (one-edgenode-per-machine topology):

bridge.py:
- Add FL_CLIENT_APP_MODULE + FL_CLIENT_APP_URL; pip-installs ClientApp at
  startup and passes --clientapp to flwr supernode
- Add FL_MACHINE_NAME; participant.json and ContributionRecord now carry
  both machine-level and org-level identity fields
- Rename build_supernode_cmd -> build_flower_cmd returning (cmd, role);
  add _build_superlink_cmd scaffold for Mode C aggregator role
- start_flower_process returns (proc, role); run_bridge_loop logs to
  flower-{role}.log so supernode and superlink output are separated
- install_client_app() runs before conductor wait so pip install errors
  surface early

Dockerfile.flower:
- Add FL_CLIENT_APP_MODULE, FL_CLIENT_APP_URL, FL_MACHINE_NAME,
  FLOWER_SUPERLINK_PORT ENV declarations with inline documentation
- EXPOSE 9093 for SuperLink gRPC (Mode C aggregator role)
- Clarify comment block distinguishing machine vs org identity vars

README.flower.md:
- New: deployment modes table, quick start, full env var reference,
  multi-machine federation example, port table, data volume layout,
  s6 service table, and relationship to pollen hApp

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Base automatically changed from feat/edgenode-harvester to main April 17, 2026 14:18
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