API reference#

rubin.nublado.client Package#

Client for Nublado, not including JupyterHub plugins.

Functions#

mock_jupyter(respx_mock, base_url, user_dir, *)

Set up a mock JupyterHub and JupyterLab.

mock_jupyter_websocket(url, headers, jupyter)

Create a new mock ClientWebSocketResponse that simulates a lab.

Classes#

CodeContext([image, notebook, path, cell, ...])

Optional context for exception reporting during code execution.

CodeExecutionError(*, user[, code, ...])

Error generated by code execution in a notebook on JupyterLab.

ExecutionAPIError(*, url, username, status, ...)

An HTTP request to the execution endpoint failed.

JupyterLabSession(*, username, base_url[, ...])

Represents an open session with a Jupyter Lab.

JupyterOutput(content[, done])

Output from a Jupyter lab kernel.

JupyterProtocolError(msg[, user, ...])

Some error occurred when talking to JupyterHub or JupyterLab.

JupyterSpawnError(log, user[, message, ...])

The Jupyter Lab pod failed to spawn.

JupyterTimeoutError(msg, user[, log, ...])

Timed out waiting for the lab to spawn.

JupyterWebError(message, *[, failed_at, ...])

An error occurred when talking to JupyterHub or a Jupyter lab.

JupyterWebSocketError(msg, *, user[, code, ...])

An error occurred talking to the Jupyter lab WebSocket.

MockJupyter(base_url, user_dir, *[, ...])

A mock Jupyter state machine.

MockJupyterAction(value[, names, module, ...])

Possible actions on the Jupyter lab state machine.

MockJupyterState(value[, names, module, ...])

Possible states the Jupyter lab can be in.

MockJupyterWebSocket(user, session_id, parent)

Simulate the WebSocket connection to a Jupyter Lab.

NotebookExecutionErrorModel

The error from the /user/:username/rubin/execution endpoint.

NotebookExecutionResult

The result of the /user/:username/rubin/execution endpoint.

NubladoClient(*, username, token[, ...])

Client for talking to JupyterHub and Jupyter labs that use Nublado.

NubladoClientSlackException(msg[, user, ...])

Represents an exception that can be reported to Slack or Sentry.

NubladoClientSlackWebException(message, *[, ...])

Represents an exception that can be reported to Slack.

NubladoDiscoveryError(msg[, user, ...])

Error finding a required service in service discovery.

NubladoImage

Base class for different ways of specifying the lab image to spawn.

NubladoImageByClass

Spawn the recommended image.

NubladoImageByReference

Spawn an image by full Docker reference.

NubladoImageByTag

Spawn an image by image tag.

NubladoImageClass(value[, names, module, ...])

Possible ways of selecting an image.

NubladoImageSize(value[, names, module, ...])

Acceptable sizes of images to spawn.

SpawnProgressMessage(progress, message, ready)

A progress message from lab spawning.

Class Inheritance Diagram#

Inheritance diagram of rubin.nublado.client._models.CodeContext, rubin.nublado.client._exceptions.CodeExecutionError, rubin.nublado.client._exceptions.ExecutionAPIError, rubin.nublado.client._client.JupyterLabSession, rubin.nublado.client._models.JupyterOutput, rubin.nublado.client._exceptions.JupyterProtocolError, rubin.nublado.client._exceptions.JupyterSpawnError, rubin.nublado.client._exceptions.JupyterTimeoutError, rubin.nublado.client._exceptions.JupyterWebError, rubin.nublado.client._exceptions.JupyterWebSocketError, rubin.nublado.client._mock.MockJupyter, rubin.nublado.client._mock.MockJupyterAction, rubin.nublado.client._mock.MockJupyterState, rubin.nublado.client._mock.MockJupyterWebSocket, rubin.nublado.client._models.NotebookExecutionErrorModel, rubin.nublado.client._models.NotebookExecutionResult, rubin.nublado.client._client.NubladoClient, rubin.nublado.client._exceptions.NubladoClientSlackException, rubin.nublado.client._exceptions.NubladoClientSlackWebException, rubin.nublado.client._exceptions.NubladoDiscoveryError, rubin.nublado.client._models.NubladoImage, rubin.nublado.client._models.NubladoImageByClass, rubin.nublado.client._models.NubladoImageByReference, rubin.nublado.client._models.NubladoImageByTag, rubin.nublado.client._models.NubladoImageClass, rubin.nublado.client._models.NubladoImageSize, rubin.nublado.client._models.SpawnProgressMessage