Flock#
- class mobu.services.flock.Flock(*, flock_config, replica_count, replica_index, scheduler, gafaelfawr_storage, http_client, events, repo_manager, logger)#
Bases:
object
Container for a group of monkeys all running the same business.
- Parameters:
flock_config (
FlockConfig
) – Configuration for this flock of monkeys.replica_count (
int
) – The number of running mobu instances.replica_index (
int
) – The index of this replica in the StatefulSet.scheduler (
Scheduler
) – Job scheduler used to manage the tasks for the monkeys.gafaelfawr_storage (
GafaelfawrStorage
) – Gafaelfawr storage client.http_client (
AsyncClient
) – Shared HTTP client.events (
Events
) – Event publishers.repo_manager (
RepoManager
) – For efficiently cloning git repos.logger (
BoundLogger
) – Global logger.
Methods Summary
dump
()Return information about all running monkeys.
get_monkey
(name)Retrieve a given monkey by name.
List the names of the monkeys.
Signal all the monkeys to refresh their busniess.
start
()Start all the monkeys.
stop
()Stop all the monkeys.
summary
()Return summary statistics about the flock.
uses_repo
(repo_url, repo_ref)Methods Documentation
- get_monkey(name)#
Retrieve a given monkey by name.
- Parameters:
name (
str
) – Name of monkey to return.- Returns:
Requested monkey.
- Return type:
- Raises:
MonkeyNotFoundError – Raised if no monkey was found with that name.
- async stop()#
Stop all the monkeys.
Stopping a monkey can require waiting for a timeout from JupyterHub if it were in the middle of spawning, so stop them all in parallel to avoid waiting for the sum of all timeouts.
- Return type:
- summary()#
Return summary statistics about the flock.
- Return type: