Start Swarm¶
After having deployed your cluster, you can access it remotely by connecting your computer to the server.
# start_swarm.py
from manta.cluster import Cluster
from swarm import FLSwarm
cluster = Cluster("localhost", 50051)
if response := cluster.is_available():
print(f"Cluster is available ({response.message = })")
if response := cluster.deploy_swarm(FLSwarm()):
print(f"Swarm deployed ({response.swarm_id = })")
Then, you can execute the script:
python start_swarm.py
Output:
Cluster is available (response.message = 'Available')
Swarm deployed (response.swarm_id = '63f5699d26ae451794cf071a6d8a6476')