nat.front_ends.fastapi.fastapi_front_end_plugin#

Attributes#

Classes#

FastApiFrontEndPlugin

Helper class that provides a standard way to create an ABC using

Module Contents#

logger#
class FastApiFrontEndPlugin(full_config: nat.data_models.config.Config)#

Bases: nat.front_ends.fastapi.dask_client_mixin.DaskClientMixin, nat.builder.front_end.FrontEndBase[nat.front_ends.fastapi.fastapi_front_end_config.FastApiFrontEndConfig]

Helper class that provides a standard way to create an ABC using inheritance.

Initializes the FrontEndBase object with the specified NAT configuration.

Parameters#

full_configConfig

The configuration object to use for the front end.

_cluster = None#
_periodic_cleanup_future = None#
_scheduler_address = None#
get_worker_class() type[nat.front_ends.fastapi.fastapi_front_end_plugin_worker.FastApiFrontEndPluginWorkerBase]#
get_worker_class_name() str#
static _periodic_cleanup(
scheduler_address: str,
db_url: str,
sleep_time_sec: int = 300,
log_level: int = logging.INFO,
)#
Async:

async _submit_cleanup_task(
scheduler_address: str,
db_url: str,
log_level: int = logging.INFO,
)#

Submit a cleanup task to the cluster to remove the job after expiry.

static _setup_worker()#

Setup function to be run in each worker process. This moves each worker into it’s own process group. This fixes an issue where a Ctrl-C in the terminal sends a SIGINT to all workers, which then causes the workers to exit before the main process can shutdown the cluster gracefully.

async run()#

Runs the specified configuration file, launching the workflow until the front end is complete.