Flower CLI 참조

Basic Commands

flwr CLI

flower-supernode

Start a Flower SuperNode

usage: flower-supernode [-h] [--insecure]
                        [--grpc-rere | --grpc-adapter | --rest]
                        [--root-certificates ROOT_CERT]
                        [--superlink SUPERLINK] [--max-retries MAX_RETRIES]
                        [--max-wait-time MAX_WAIT_TIME]
                        [--auth-supernode-private-key AUTH_SUPERNODE_PRIVATE_KEY]
                        [--auth-supernode-public-key AUTH_SUPERNODE_PUBLIC_KEY]
                        [--node-config NODE_CONFIG] [--flwr-dir FLWR_DIR]
                        [--isolation {subprocess,process}]
                        [--clientappio-api-address CLIENTAPPIO_API_ADDRESS]

Named Arguments

--insecure

Run the client without HTTPS. By default, the client runs with HTTPS enabled. Use this flag only if you understand the risks.

Default: False

--grpc-rere

Use grpc-rere as a transport layer for the client.

Default: “grpc-rere”

--grpc-adapter

Use grpc-adapter as a transport layer for the client.

--rest

Use REST as a transport layer for the client.

--root-certificates

Specifies the path to the PEM-encoded root certificate file for establishing secure HTTPS connections.

--superlink

SuperLink Fleet API address (IPv4, IPv6, or a domain name). If using the REST (experimental) transport, ensure your address is in the form http://… or https://… when TLS is enabled.

Default: “0.0.0.0:9092”

--max-retries

The maximum number of times the client will try to reconnect to theSuperLink before giving up in case of a connection error. By default,it is set to None, meaning there is no limit to the number of tries.

--max-wait-time

The maximum duration before the client stops trying toconnect to the SuperLink in case of connection error. By default, itis set to None, meaning there is no limit to the total time.

--auth-supernode-private-key

The SuperNode’s private key (as a path str) to enable authentication.

--auth-supernode-public-key

The SuperNode’s public key (as a path str) to enable authentication.

--node-config

A space separated list of key/value pairs (separated by =) to configure the SuperNode. E.g. –node-config ‘key1=”value1” partition-id=0 num-partitions=100’

--flwr-dir
The path containing installed Flower Apps.

The default directory is:

  • $FLWR_HOME/ if $FLWR_HOME is defined

  • $XDG_DATA_HOME/.flwr/ if $XDG_DATA_HOME is defined

  • $HOME/.flwr/ in all other cases

--isolation

Possible choices: subprocess, process

Isolation mode when running a ClientApp (subprocess by default, possible values: subprocess, process). Use subprocess to configure SuperNode to run a ClientApp in a subprocess. Use process to indicate that a separate independent process gets created outside of SuperNode.

Default: “subprocess”

--clientappio-api-address

ClientAppIo API (gRPC) server address (IPv4, IPv6, or a domain name). By default, it is set to 0.0.0.0:9094.

Default: “0.0.0.0:9094”

Advanced Commands

flwr-serverapp

Run a Flower ServerApp

usage: flwr-serverapp [-h] [--serverappio-api-address SERVERAPPIO_API_ADDRESS]
                      [--run-once] [--flwr-dir FLWR_DIR] [--insecure]

Named Arguments

--serverappio-api-address

Address of SuperLink’s ServerAppIo API (IPv4, IPv6, or a domain name).By default, it is set to 127.0.0.1:9091.

Default: “127.0.0.1:9091”

--run-once

When set, this process will start a single ServerApp for a pending Run. If there is no pending Run, the process will exit.

Default: False

--flwr-dir
The path containing installed Flower Apps.

By default, this value is equal to:

  • $FLWR_HOME/ if $FLWR_HOME is defined

  • $XDG_DATA_HOME/.flwr/ if $XDG_DATA_HOME is defined

  • $HOME/.flwr/ in all other cases

--insecure

Run the server without HTTPS, regardless of whether certificate paths are provided. Data transmitted between the gRPC client and server is not encrypted. By default, the server runs with HTTPS enabled. Use this flag only if you understand the risks.

Default: False

flwr-clientapp

Run a Flower ClientApp

usage: flwr-clientapp [-h] [--clientappio-api-address CLIENTAPPIO_API_ADDRESS]
                      [--token TOKEN] [--flwr-dir FLWR_DIR] [--insecure]

Named Arguments

--clientappio-api-address

Address of SuperNode’s ClientAppIo API (IPv4, IPv6, or a domain name).By default, it is set to 127.0.0.1:9094.

Default: “127.0.0.1:9094”

--token

Unique token generated by SuperNode for each ClientApp execution

--flwr-dir
The path containing installed Flower Apps.

By default, this value is equal to:

  • $FLWR_HOME/ if $FLWR_HOME is defined

  • $XDG_DATA_HOME/.flwr/ if $XDG_DATA_HOME is defined

  • $HOME/.flwr/ in all other cases

--insecure

Run the server without HTTPS, regardless of whether certificate paths are provided. Data transmitted between the gRPC client and server is not encrypted. By default, the server runs with HTTPS enabled. Use this flag only if you understand the risks.

Default: False

Technical Commands

flower-simulation

Start a Flower simulation

usage: flower-simulation [-h] --app APP --num-supernodes NUM_SUPERNODES
                         [--run-config RUN_CONFIG] [--backend BACKEND]
                         [--backend-config BACKEND_CONFIG]
                         [--enable-tf-gpu-growth] [--verbose]
                         [--flwr-dir FLWR_DIR] [--run-id RUN_ID]

Named Arguments

--app

Path to a directory containing a FAB-like structure with a pyproject.toml.

--num-supernodes

Number of simulated SuperNodes.

--run-config

Override configuration key-value pairs.

--backend

Simulation backend that executes the ClientApp.

Default: “ray”

--backend-config

A JSON formatted stream, e.g ‘{“<keyA>”:<value>, “<keyB>”:<value>}’ to configure a backend. Values supported in <value> are those included by flwr.common.typing.ConfigRecordValues.

Default: “{}”

--enable-tf-gpu-growth

Enables GPU growth on the main thread. This is desirable if you make use of a TensorFlow model on your ServerApp while having your ClientApp running on the same GPU. Without enabling this, you might encounter an out-of-memory error because TensorFlow by default allocates all GPU memory.Read more about how tf.config.experimental.set_memory_growth() works in the TensorFlow documentation: https://www.tensorflow.org/api/stable.

Default: False

--verbose

When unset, only INFO, WARNING and ERROR log messages will be shown. If set, DEBUG-level logs will be displayed.

Default: False

--flwr-dir
The path containing installed Flower Apps.

By default, this value is equal to:

  • $FLWR_HOME/ if $FLWR_HOME is defined

  • $XDG_DATA_HOME/.flwr/ if $XDG_DATA_HOME is defined

  • $HOME/.flwr/ in all other cases

--run-id

Sets the ID of the run started by the Simulation Engine.