Campaign

class zambeze.campaign.campaign.Campaign(name: str, activities: list[Activity] | None = None, logger: Logger | None = None, force_login: bool = False)

Bases: object

A Scientific Campaign class to manage and dispatch campaign activities.

add_activity(activity: Activity) None

Adds an activity to the campaign.

Parameters:

activity (Activity) – The activity to add to the campaign.

dispatch() None

Dispatches the serialized Directed Acyclic Graph (DAG) of activities via ZeroMQ to the Zambeze service.

This method prepares a ZeroMQ context and socket, connects to the specified Zambeze service host and port (from user’s settings), and sends the serialized DAG.

It handles sending and receiving acknowledgments to ensure the DAG is received by the Zambeze service. The method logs all critical steps, errors, and exceptions during the dispatch process.

Notes

  • This method uses ZeroMQ for communication. Ensure that the network settings are correctly configured.

  • The Zambeze agent must be running and accessible at the specified host and port.

  • The method will log detailed error messages if it fails to send the DAG or does not receive a response within the expected time frame. It suggests possible actions to resolve such issues.