Skip to main content

pod

Pods for responding to tasks.

Classes

Pod

class Pod(    name: str,    datasource: BaseSource,    username: Optional[str] = None,    data_config: Optional[PodDataConfig] = None,    schema: Union[str, os.PathLike, BitfountSchema, None] = None,    pod_details_config: Optional[PodDetailsConfig] = None,    bitfounthub: Optional[BitfountHub] = None,    ms_config: Optional[MessageServiceConfig] = None,    access_manager: Optional[BitfountAM] = None,    pod_keys: Optional[PodKeys] = None,    approved_pods: Optional[List[str]] = None,    pod_dp: Optional[DPPodConfig] = None,):

Makes data and computation available remotely and responds to tasks.

The basic component of the Bitfount network is the Pod (Processor of Data). Pods are co-located with data, check users are authorized to do given operations on the data and then do any approved computation. Creating a Pod will register the pod with Bitfount Hub.

Example usage:
import bitfount as bf

pod = bf.Pod(
name="really_cool_data",
data="/path/to/data",
)
pod.start()

Arguments

  • name: Name of the pod. This will appear on Bitfount Hub and Bitfount AM. This is also used for the name of the table in a single-table BaseSource.
  • datasource: A concrete instance of the BaseSource object.
  • username: Username of the user who is registering the pod. Defaults to None.
  • data_config: Configuration for the data. Defaults to None.
  • schema: Schema for the data. This can be a BitfountSchema object or a Path to a serialized BitfountSchema. This will generated automatically if not provided. Defaults to None.
  • pod_details_config: Configuration for the pod details. Defaults to None.
  • bitfount_hub: Bitfount Hub to register the pod with. Defaults to None.
  • ms_config: Configuration for the message service. Defaults to None.
  • access_manager: Access manager to use for checking access. Defaults to None.
  • pod_keys: Keys for the pod. Defaults to None.
  • approved_pods: List of other pod identifiers this pod is happy to share a training task with. Required if the protocol uses the SecureAggregator aggregator.
  • pod_dp: Differential privacy configuration for the pod. Defaults to None.

Attributes

  • data: Data that the pod encapsulates.
  • name: Name of the pod.
  • pod_identifier: Identifier of the pod.
  • private_key: Private key of the pod.
  • public_key: Public key of the pod.
  • public_metadata: Public metadata about the pod.
  • schema: Schema for the data.

Raises

  • PodRegistrationError: If the pod could not be registered for any reason.
tip

Once you start a Pod, you can just leave it running in the background. It will automatically respond to any tasks without any intervention required.

Methods


def start(self)> None:

Starts a pod instance, listening for tasks.

Whenever a task is received, a worker is created to handle it. Runs continuously and asynchronously orchestrates training whenever a task arrives i.e. multiple tasks can run concurrently.

async def start_async(self)> None:

Starts a pod instance, listening for tasks.

Whenever a task is received, a worker is created to handle it. Runs continuously and asynchronously orchestrates training whenever a task arrives i.e. multiple tasks can run concurrently.

def to_yaml(self, output_file: Optional[str])> Optional[Dict[~KT, ~VT]]:

Convert the pod specification to yaml.

If output_file argument is given, write yaml to that locaton.

Variables

  • name : str - Pod name property.