Contents Menu Expand Light mode Dark mode Auto light/dark, in light mode Auto light/dark, in dark mode Skip to content
Flower Framework
Logo
main

教程

  • 什么是联邦学习?
  • 开始使用Flower
  • 使用联邦学习策略
  • 从零开始制定策略
  • 自定义客户端
  • 快速入门教程
    • PyTorch快速入门
    • 快速入门 TensorFlow
    • Quickstart MLX
    • 🤗 Transformers快速入门
    • 快速入门 JAX
    • 快速入门Pandas
    • 快速入门 fastai
    • 快速入门 PyTorch Lightning
    • scikit-learn快速入门
    • XGBoost快速入门
    • 快速入门 Android
    • 快速入门 iOS

How-to Guides

  • Build
    • 安装Flower
    • Configure Clients
    • Design stateful ClientApps
    • 使用策略
    • 实施策略
    • 整合评估结果
    • Save and Load Model Checkpoints
    • Use Built-in Mods
    • Use Differential Privacy
    • Implement FedBN
    • Use CLI JSON output
    • 升级至 Flower 1.0
    • Upgrade to Flower 1.13
  • Simulate
    • 运行模拟
  • Deploy
    • Run Flower with the Deployment Engine
    • Enable TLS connections
    • Authenticate SuperNodes
    • Configure logging
    • Run Flower on Azure
    • Run Flower using Docker
      • Quickstart with Docker
      • Enable TLS for Secure Connections
      • Persist the State of the SuperLink
      • Set Environment Variables
      • Run with Root User Privileges
      • Run ServerApp or ClientApp as a Subprocess
      • Pin a Docker Image to a Specific Version
      • Use a Different Flower Version
      • Quickstart with Docker Compose
      • Run Flower Quickstart Examples with Docker Compose
      • Deploy Flower on Multiple Machines with Docker Compose

说明

  • 联邦学习评估
  • 差分隐私
  • Flower的架构

参考资料

  • Reference
    • flwr
      • 客户端
        • start_client
        • start_numpy_client
        • 客户端
        • ClientApp
        • NumPyClient
        • mod
          • adaptiveclipping_mod
          • arrays_size_mod
          • fixedclipping_mod
          • make_ffn
          • message_size_mod
          • secagg_mod
          • secaggplus_mod
          • LocalDpMod
      • 常见
        • array_from_numpy
        • bytes_to_ndarray
        • configure
        • event
        • log
        • ndarray_to_bytes
        • ndarrays_to_parameters
        • now
        • parameters_to_ndarrays
        • Array
        • ArrayRecord
        • ClientMessage
        • Code
        • Config
        • ConfigRecord
        • ConfigsRecord
        • Context
        • DisconnectRes
        • Error
        • EvaluateIns
        • EvaluateRes
        • EventType
        • FitIns
        • FitRes
        • GetParametersIns
        • GetParametersRes
        • GetPropertiesIns
        • GetPropertiesRes
        • Message
        • MessageType
        • MessageTypeLegacy
        • 描述数据
        • MetricRecord
        • Metrics
        • MetricsRecord
        • NDArray
        • NDArrays
        • 参数
        • ParametersRecord
        • Properties
        • ReconnectIns
        • RecordDict
        • RecordSet
        • ServerMessage
        • Status
      • 服务器
        • start_server
        • ClientManager
        • Driver
        • Grid
        • History
        • LegacyContext
        • 服务器
        • ServerApp
        • ServerAppComponents
        • ServerConfig
        • SimpleClientManager
        • strategy
          • Bulyan
          • DPFedAvgAdaptive
          • DPFedAvgFixed
          • DifferentialPrivacyClientSideAdaptiveClipping
          • DifferentialPrivacyClientSideFixedClipping
          • DifferentialPrivacyServerSideAdaptiveClipping
          • DifferentialPrivacyServerSideFixedClipping
          • FaultTolerantFedAvg
          • FedAdagrad
          • FedAdam
          • FedAvg
          • FedAvgAndroid
          • FedAvgM
          • FedMedian
          • FedOpt
          • FedProx
          • FedTrimmedAvg
          • FedXgbBagging
          • FedXgbCyclic
          • FedXgbNnAvg
          • FedYogi
          • Krum
          • QFedAvg
          • Strategy
        • workflow
          • DefaultWorkflow
          • SecAggPlusWorkflow
          • SecAggWorkflow
      • simulation
        • run_simulation
        • run_simulation_process
        • start_simulation
        • SimulationIoConnection
    • Flower CLI 参考
    • 项目实例
    • 遥测功能
    • 更新日志
    • Flower Network Communication
    • Exit Codes
      • [0] SUCCESS
      • [1] GRACEFUL_EXIT_SIGINT
      • [2] GRACEFUL_EXIT_SIGQUIT
      • [3] GRACEFUL_EXIT_SIGTERM
      • [100] SUPERLINK_THREAD_CRASH
      • [300] SUPERNODE_REST_ADDRESS_INVALID
      • [301] SUPERNODE_NODE_AUTH_KEYS_REQUIRED
      • [302] SUPERNODE_NODE_AUTH_KEYS_INVALID
      • [600] COMMON_ADDRESS_INVALID
      • [601] COMMON_MISSING_EXTRA_REST
      • [602] COMMON_TLS_NOT_SUPPORTED
    • 常见问题

贡献者文档

  • Contribute
    • 在 GitHub 上投稿
    • 成为贡献者
    • 安装开发版本
    • 建立虚拟环境
    • 使用 VSCode Dev Containers 进行开发
    • 编写文件
    • 发布 Flower
    • 贡献译文
    • How to Build Docker Flower Images Locally
    • Public and private APIs
    • 首次代码贡献
    • 安全聚合协议
  • v1.8.0
  • v1.9.0
  • v1.10.0
  • v1.11.0
  • v1.11.1
  • v1.12.0
  • v1.13.0
  • v1.13.1
  • v1.14.0
  • v1.15.0
  • v1.15.1
  • v1.15.2
  • v1.16.0
  • v1.17.0
  • v1.18.0
  • main
🇬🇧 🇫🇷 🇨🇳 🇰🇷
Back to top
View this page

Persist the State of the SuperLink¶

By default, the Flower SuperLink keeps its state in-memory. When using the Docker flag --rm, the state is not persisted between container starts.

If you want to persist the state of the SuperLink on your host system, all you need to do is specify a directory where you want to save the file on your host system and a name for the database file.

By default, the SuperLink container runs with a non-root user called app with the user ID 49999. When working with Docker on Linux, it is recommended to create a new directory and set the user ID to 49999 to ensure the mounted directory has the proper permissions.

If you later want to delete the directory, you can change the user ID back to the current user ID by running sudo chown -R $USER:$(id -gn) state.

Example¶

In the example below, we create a new directory called state, change the user ID and tell Docker via the flag --volume to mount the local state directory into the /app/state directory of the container. Lastly, we use the flag --database to specify the name of the database file.

$ mkdir state
$ sudo chown -R 49999:49999 state
$ docker run --rm \
     --volume ./state/:/app/state flwr/superlink:1.18.0 \
     --database state.db \
     <additional-args>

As soon as the SuperLink starts, the file state.db is created in the state directory on your host system. If the file already exists, the SuperLink tries to restore the state from the file. To start the SuperLink with an empty database, ensure that there is no database called state.db in the state directory (rm state.db) before you execute the docker run command above.

Next
Set Environment Variables
Previous
Enable TLS for Secure Connections
Copyright © 2025 Flower Labs GmbH
Made with Sphinx and @pradyunsg's Furo
On this page
  • Persist the State of the SuperLink
    • Example