Flower CLI reference#

flower-simulation#

Start a Flower simulation

usage: flower-simulation [-h] --server-app SERVER_APP --client-app CLIENT_APP
                         --num-supernodes NUM_SUPERNODES
                         [--driver-api-address DRIVER_API_ADDRESS]
                         [--backend BACKEND] [--backend-config BACKEND_CONFIG]
                         [--enable-tf-gpu-growth] [--verbose]
                         [--app-dir APP_DIR]

Named Arguments#

--server-app

For example: server:app or project.package.module:wrapper.app

--client-app

For example: client:app or project.package.module:wrapper.app

--num-supernodes

Number of simulated SuperNodes.

--driver-api-address

For example: server:app or project.package.module:wrapper.app

Default: “0.0.0.0:9091”

--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.ConfigsRecordValues.

Default: “{“client_resources”: {“num_cpus”:2, “num_gpus”:0.0}, “tensorflow”: 0}”

--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

--app-dir

Add specified directory to the PYTHONPATH and loadClientApp and ServerApp from there. Default: current working directory.

Default: “”

flower-client-app#

Start a Flower client app

usage: flower-client-app [-h] [--insecure] [--rest]
                         [--root-certificates ROOT_CERT] [--server SERVER]
                         [--max-retries MAX_RETRIES]
                         [--max-wait-time MAX_WAIT_TIME] [--dir DIR]
                         [--authentication-keys CLIENT_PRIVATE_KEY CLIENT_PUBLIC_KEY]
                         client-app

Positional Arguments#

client-app

For example: client:app or project.package.module:wrapper.app

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

--rest

Use REST as a transport layer for the client.

Default: False

--root-certificates

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

--server

Server address

Default: “0.0.0.0:9092”

--max-retries

The maximum number of times the client will try to connect to theserver 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 server in case of connection error. By default, itis set to None, meaning there is no limit to the total time.

--dir

Add specified directory to the PYTHONPATH and load Flower app from there. Default: current working directory.

Default: “”

--authentication-keys

Provide two file paths: (1) the client’s private key file, and (2) the client’s public key file.

flower-server-app#

Start a Flower server app

usage: flower-server-app [-h] [--insecure] [--verbose]
                         [--root-certificates ROOT_CERT] [--server SERVER]
                         [--dir DIR] [--fab-id FAB_ID]
                         [--fab-version FAB_VERSION]
                         server-app

Positional Arguments#

server-app

For example: server:app or project.package.module:wrapper.app

Named Arguments#

--insecure

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

Default: False

--verbose

Set the logging to DEBUG.

Default: False

--root-certificates

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

--server

Server address

Default: “0.0.0.0:9091”

--dir

Add specified directory to the PYTHONPATH and load Flower app from there. Default: current working directory.

Default: “”

--fab-id

The identifier of the FAB used in the run.

--fab-version

The version of the FAB used in the run.