Python internal API#
mobu.asyncio Module#
asyncio utility functions for mobu.
Functions#
|
Schedule a function to run periodically. |
|
Return the result of the first awaitable to finish. |
Classes#
|
Automatically close async iterators that are generators. |
Class Inheritance Diagram#

mobu.config Module#
Configuration definition.
Classes#
Configuration for mobu. |
|
Configuration for GitHub CI app functionality if it is enabled. |
|
Configuration for GitHub refresh app functionality. |
Class Inheritance Diagram#

mobu.constants Module#
Global constants for mobu.
Variables#
Default path to configuration. |
|
The path to a config file with repo-specific configuration. |
|
GithHub needs some time to actually be in the state in a webhook payload. |
|
Default repository branch for NotebookRunner. |
|
Default notebook repository for NotebookRunner. |
|
Token lifetime for mobu's service tokens. |
|
Regex matching all valid usernames. |
|
How long to wait for a WebSocket connection to open (in seconds). |
mobu.events Module#
App metrics events.
Classes#
Reported when an empty loop. |
|
Attributes on every mobu event. |
|
|
Container for app metrics event publishers. |
Reported from Git LFS businesses. |
|
Attributes for all notebook-related events. |
|
Reported after a notebook cell is finished executing. |
|
Reported after a notebook is finished executing. |
|
Reported for every attempt to delete a lab. |
|
Reported after a nublado python execution. |
|
Reported for every attempt to spawn a lab. |
|
Reported when a SIA query is executed. |
|
Reported when a TAP query is executed. |
Class Inheritance Diagram#

mobu.exceptions Module#
Exceptions for mobu.
Classes#
|
Comparing two strings failed. |
|
The named flock was not found. |
|
Unable to parse the reply from Gafaelfawr. |
|
An API call to Gafaelfawr failed. |
Tried to retrieve contents for a non-existent file in a GitHub repo. |
|
|
The named monkey was not found. |
Mobu is not configured to retain logs. |
|
|
Creating an SIA client failed. |
|
Running a subprocess failed. |
Class Inheritance Diagram#

mobu.factory Module#
Component factory and process-wide status for mobu.
Classes#
|
Component factory for mobu. |
|
Per-process application context. |
Class Inheritance Diagram#

mobu.main Module#
The main application factory for the mobu service.
Functions#
|
Create the FastAPI application. |
|
Set up and tear down the the base application. |
mobu.sentry Module#
Helpers for sentry instrumentation.
Functions#
|
Add tags to fingerprint so that distinct issues are created. |
|
Start a span, set the op/start time in the context, and capture errors. |
|
Generate a fingerprint to force separate issues for tag combos. |
|
Start a transaction and mark it if an exception is raised. |
mobu.status Module#
Post periodic status to Slack.
Functions#
Post a summary of mobu status to Slack. |
mobu.dependencies.config Module#
Config dependency.
Classes#
|
Dependency to manage a cached Mobu configuration. |
Variables#
The dependency that will return the global configuration. |
Class Inheritance Diagram#

mobu.dependencies.context Module#
Request context dependency for FastAPI.
This dependency gathers a variety of information into a single object for the
convenience of writing request handlers. It also provides a place to store a
structlog.BoundLogger
that can gather additional context during processing,
including from dependencies.
Functions#
|
Per-request context for non-gafaelfawr-auth'd requests. |
Classes#
Provide a per-request context as a FastAPI dependency. |
|
|
Holds the incoming request and its surrounding context. |
Variables#
The dependency that will return the per-request context. |
Class Inheritance Diagram#

mobu.dependencies.github Module#
Dependencies GitHub CI app functionality.
Classes#
A process-global object to manage background CI workers. |
|
Try to return a CiManager, but don't blow up if it's not there. |
Class Inheritance Diagram#

mobu.handlers.external Module#
Handlers for the app’s external root, /mobu/
.
Variables#
FastAPI router for all external handlers. |
mobu.handlers.github_ci_app Module#
Github webhook handlers for CI app.
Variables#
Registers incoming HTTP GitHub webhook requests |
mobu.handlers.github_refresh_app Module#
Github webhook handlers for CI app.
Variables#
Registers incoming HTTP GitHub webhook requests |
mobu.handlers.internal Module#
Internal HTTP handlers that serve relative to the root path, /
.
These handlers aren’t externally visible since the app is available at a path,
/mobu
. See mobu.handlers.external
for the external endpoint handlers.
These handlers should be used for monitoring, health checks, internal status, or other information that should not be visible outside the Kubernetes cluster.
Variables#
FastAPI router for all internal handlers. |
mobu.models.ci_manager Module#
Models for CiManager.
Classes#
Information about a job. |
|
Information about the CiManager. |
|
Information about a running worker. |
Class Inheritance Diagram#

mobu.models.flock Module#
Models for a collection of monkeys.
Classes#
Configuration for a flock of monkeys. |
|
Information about a running flock. |
|
Summary statistics about a running flock. |
Class Inheritance Diagram#

mobu.models.index Module#
Data models for the top-level route.
Classes#
Metadata returned by the external root URL of the application. |
Class Inheritance Diagram#

mobu.models.monkey Module#
Data models for a monkey.
Classes#
Data for a running monkey. |
|
|
State of a running monkey. |
Class Inheritance Diagram#

mobu.models.repo Module#
Models related to GitHub repos for the GitHub CI app functionality.
Classes#
|
Information about a cloned git repo. |
In-repo configuration for mobu behavior. |
Class Inheritance Diagram#

mobu.models.solitary Module#
Models for running a single instance of a business by itself.
Classes#
Configuration for a solitary monkey. |
|
Results from executing a solitary monkey. |
Class Inheritance Diagram#

mobu.models.summary Module#
Combined summary of different functionalities.
Classes#
Summary of all app state. |
Class Inheritance Diagram#

mobu.models.user Module#
Data models for an authenticated user.
Classes#
Represents an authenticated user with a token. |
|
Configuration for the group memberships of a user. |
|
Configuration for the user whose credentials the monkey will use. |
|
Configuration to generate a set of users. |
Class Inheritance Diagram#

mobu.models.business.base Module#
Base models for monkey business.
Classes#
Base configuration class for monkey business. |
|
Status of a running business. |
|
Options for monkey business. |
Class Inheritance Diagram#

mobu.models.business.business_config_type Module#
Business config type helpers.
Variables#
A union type alias of all of all busines config types. |
mobu.models.business.empty Module#
Models for the EmptyLoop business.
Classes#
Configuration specialization for EmptyLoop. |
Class Inheritance Diagram#

mobu.models.business.gitlfs Module#
Base models for Git-LFS-related monkey business.
Classes#
Options for business that runs git LFS operations. |
|
Configuration specialization for GitLFS. |
Class Inheritance Diagram#

mobu.models.business.notebookrunner Module#
Shared models for different notebook runners.
Classes#
A set of patterns to filter the list of notebooks to run in a repo. |
|
Mixin for config to specify patterns for which notebooks to run. |
|
Valid notebooks and categories for invalid notebooks. |
|
Notebook metadata that we care about. |
|
Status of a running NotebookRunner business. |
|
Options for all types NotebookRunner monkey business. |
Class Inheritance Diagram#

mobu.models.business.notebookrunnercounting Module#
Models for the NotebookRunnerCounting monkey business.
Classes#
Configuration specialization for NotebookRunnerCounting. |
|
Options to specify a fixed number of notebooks to run per session. |
Class Inheritance Diagram#

mobu.models.business.notebookrunnerinfinite Module#
Models for the NotebookRunnerInfinite monkey business.
Classes#
Configuration specialization for NotebookRunner. |
Class Inheritance Diagram#

mobu.models.business.notebookrunnerlist Module#
Models for the NotebookRunnerList monkey business.
Classes#
Configuration specialization for NotebookRunnerList. |
Class Inheritance Diagram#

mobu.models.business.nublado Module#
Base models for Nublado-related monkey business.
Classes#
Status of a running Nublado business. |
|
Options for any business that runs code in a Nublado lab. |
|
Information about the running Jupyter lab image. |
Class Inheritance Diagram#

mobu.models.business.nubladopythonloop Module#
Models for the NubladoPythonLoop monkey business.
Classes#
Configuration specialization for NubladoPythonLoop. |
|
Options for NubladoPythonLoop monkey business. |
Class Inheritance Diagram#

mobu.models.business.siaquerysetrunner Module#
Models for the SIAQuerySetRunner monkey business.
Classes#
Status of a running SIA business. |
|
The parameters of an SIA (v2) query. |
|
Configuration specialization for SIAQuerySetRunner. |
|
Options for SIAQuerySetRunner monkey business. |
Class Inheritance Diagram#

mobu.models.business.tap Module#
Base models for TAP-related monkey business.
Classes#
Status of a running TAPQueryRunner business. |
|
Options for any business that runs TAP queries. |
Class Inheritance Diagram#

mobu.models.business.tapqueryrunner Module#
Models for the TAPQueryRunner monkey business.
Classes#
Configuration specialization for TAPQueryRunner. |
|
Options for TAPQueryRunner monkey business. |
Class Inheritance Diagram#

mobu.models.business.tapquerysetrunner Module#
Models for the TAPQuerySetRunner monkey business.
Classes#
Configuration specialization for TAPQuerySetRunner. |
|
Options for TAPQueryRunner monkey business. |
Class Inheritance Diagram#

mobu.services.flock Module#
A flock of monkeys doing business.
Classes#
|
Container for a group of monkeys all running the same business. |
Class Inheritance Diagram#

mobu.services.manager Module#
Manager for all the running flocks.
Classes#
|
Manages all of the running flocks. |
Class Inheritance Diagram#

mobu.services.monkey Module#
The monkey.
Classes#
|
Runs one business and manages its log and configuration. |
Class Inheritance Diagram#

mobu.services.notebook_finder Module#
Helpers to pick which notebooks in a repo to execute.
Classes#
|
A helper to select which notebooks to execute based on config. |
Class Inheritance Diagram#

mobu.services.repo Module#
Helpers for cloning and filtering notebook repos.
Classes#
|
A reference-counting caching repo cloner. |
Class Inheritance Diagram#

mobu.services.solitary Module#
Manager for a solitary monkey.
Classes#
|
Runs a single monkey to completion and reports its results. |
Class Inheritance Diagram#

mobu.services.business.base Module#
Base class for business logic for mobu.
Classes#
|
Base class for monkey business (one type of repeated operation). |
|
Commands sent over the internal control queue. |
Attributes on every event. |
Class Inheritance Diagram#

mobu.services.business.empty Module#
EmptyLoop business logic for mobu.
Classes#
|
Business class that does nothing, successfully. |
Class Inheritance Diagram#

mobu.services.business.gitlfs Module#
Class for executing Git-LFS tests.
Classes#
|
Test a Git-LFS service. |
Class Inheritance Diagram#

mobu.services.business.notebookrunner Module#
NotebookRunner logic for mobu.
This business pattern will clone a Git repo full of notebooks, iterate through the notebooks, and run them on the remote Nublado lab.
Classes#
|
Properties of a set of notebook executions. |
|
Start a Jupyter lab and run a sequence of notebooks. |
Class Inheritance Diagram#

mobu.services.business.notebookrunnercounting Module#
Execute notebooks in batches of a fixed number per JuypterLab session.
Classes#
|
A notebook runner that refreshes JupyterLab sessions (and optionally deletes the labs) after a configurable number of notebook executions. |
Class Inheritance Diagram#

mobu.services.business.notebookrunnerinfinite Module#
Execute all notebooks in a single JupyterLab session.
Classes#
|
A notebook runner that never refreshes JupyterLab sessions or deletes labs until mobu is shut down. |
Class Inheritance Diagram#

mobu.services.business.notebookrunnerlist Module#
Execute a list of notebooks in a single JupyterLab session.
Classes#
|
A notebook runner that refreshes JupyterLab sessions (and optionally deletes the labs) after a list of notebooks has been executed. |
Class Inheritance Diagram#

mobu.services.business.nublado Module#
Base class for executing code in a Nublado notebook.
Classes#
|
Base class for business that executes Python code in a Nublado notebook. |
|
A single log message with timestamp from spawn progress. |
Class Inheritance Diagram#

mobu.services.business.nubladopythonloop Module#
NubladoPythonLoop logic for mobu.
This business pattern will start a lab and run some code in a loop over and over again.
Classes#
|
Run simple Python code in a loop inside a lab kernel. |
Class Inheritance Diagram#

mobu.services.business.siaquerysetrunner Module#
Run a set of predefined queries against a SIA service.
Classes#
|
Run queries from a predefined set against SIA with random parameters. |
Class Inheritance Diagram#

mobu.services.business.tap Module#
Base class for executing TAP queries.
Classes#
|
Base class for business that executes TAP query. |
Class Inheritance Diagram#

mobu.services.business.tapqueryrunner Module#
Run queries against a TAP service.
Classes#
|
Run queries against TAP. |
Class Inheritance Diagram#

mobu.services.business.tapquerysetrunner Module#
Run a set of predefined queries against a TAP service.
Classes#
|
Run queries from a predefined set against TAP with random parameters. |
Class Inheritance Diagram#

mobu.services.github_ci.ci_manager Module#
Manager for background workers that process work from GitHub checks.
Classes#
|
Manages processing work for GitHub CI checks. |
|
States that a CI job can be in. |
Class Inheritance Diagram#

mobu.services.github_ci.ci_notebook_job Module#
GitHub CI checks for notebook repos.
Classes#
|
Runs changed notebooks and updates a GitHub CI check. |
Class Inheritance Diagram#

mobu.storage.gafaelfawr Module#
Manage Gafaelfawr users and tokens.
Classes#
|
Manage users and authentication tokens. |
Class Inheritance Diagram#

mobu.storage.git Module#
A very simple async replacement for GitPython.
GitPython is not thread- or async-safe because of a git quirk: current working directory is a per-process global, and “git add” requires that the cwd be inside a worktree.
Classes#
Class Inheritance Diagram#

mobu.storage.github Module#
Tools for interacting with the GitHub REST API.
Classes#
|
Manage GitHub check runs via the GitHub API. |
|
Tools to interact with the GitHub API. |
Class Inheritance Diagram#
