NubladoPythonLoopOptions#
- pydantic model mobu.models.business.nubladopythonloop.NubladoPythonLoopOptions#
Options for NubladoPythonLoop monkey business.
- Parameters:
data (
Any
)
Show JSON schema
{ "title": "NubladoPythonLoopOptions", "description": "Options for NubladoPythonLoop monkey business.", "type": "object", "properties": { "error_idle_time": { "$ref": "#/$defs/HumanTimedelta", "default": "PT1M", "examples": [ 600 ], "title": "How long to wait after an error before restarting" }, "idle_time": { "$ref": "#/$defs/HumanTimedelta", "default": "PT1M", "description": "After each loop executing monkey business, the monkey will pause for this long", "examples": [ 60 ], "title": "How long to wait between business executions" }, "log_level": { "$ref": "#/$defs/LogLevel", "default": "INFO", "title": "Log level for this monkey business" }, "delete_lab": { "default": true, "description": "By default, the lab is deleted and recreated after each iteration of monkey business. Set this to false to keep the same lab.", "examples": [ true ], "title": "Whether to delete the lab between iterations", "type": "boolean" }, "delete_timeout": { "$ref": "#/$defs/HumanTimedelta", "default": "PT1M", "examples": [ 60 ], "title": "Timeout for deleting a lab" }, "execution_idle_time": { "$ref": "#/$defs/HumanTimedelta", "default": "PT1S", "description": "Used by NubladoPythonLoop and NotebookRunner", "examples": [ 1 ], "title": "How long to wait between cell executions" }, "get_node": { "default": true, "description": "Used by NubladoPythonLoop and its subclasses. Requires the lab have lsst.rsp pre-installed.", "title": "Whether to get the node name for error reporting", "type": "boolean" }, "image": { "anyOf": [ { "$ref": "#/$defs/NubladoImageByClass" }, { "$ref": "#/$defs/NubladoImageByReference" }, { "$ref": "#/$defs/NubladoImageByTag" } ], "title": "Nublado lab image to use" }, "jitter": { "$ref": "#/$defs/HumanTimedelta", "default": "PT0S", "description": "If set to a non-zero value, pause for a random interval between 0 and that interval before logging in to JupyterHub, and between each iteration of the core execution loop. Use this when running lots of monkeys for load testing to spread their execution sequence out more realistically and avoid a thundering herd problem.", "examples": [ 60 ], "title": "Maximum random time to pause" }, "jupyter_timeout": { "$ref": "#/$defs/HumanTimedelta", "default": "PT1M", "description": "Used as the connect, read, and write timeout for talking to either JupyterHub or Jupyter lab.", "title": "HTTP client timeout for Jupyter requests" }, "max_websocket_message_size": { "anyOf": [ { "type": "integer" }, { "type": "null" } ], "default": 10485760, "description": "This has to be large enough to hold HTML and image output from executing notebook cells, even though we discard that data. Set to ``null`` for no limit.", "title": "Maximum length of WebSocket message (in bytes)" }, "spawn_settle_time": { "$ref": "#/$defs/HumanTimedelta", "default": "PT10S", "description": "Wait this long after triggering a lab spawn before starting to poll its progress. KubeSpawner 1.1.0 has a bug where progress queries prior to starting the spawn will fail with an exception that closes the progress EventStream.", "examples": [ 10 ], "title": "How long to wait before polling spawn progress" }, "spawn_timeout": { "$ref": "#/$defs/HumanTimedelta", "default": "PT10M10S", "examples": [ 610 ], "title": "Timeout for spawning a lab" }, "url_prefix": { "default": "/nb/", "title": "URL prefix for JupyterHub", "type": "string" }, "working_directory": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "default": null, "examples": [ "notebooks/tutorial-notebooks" ], "title": "Working directory when running code" }, "code": { "default": "print(2+2, end=\"\")", "examples": [ "print(2+2, end=\"\")" ], "title": "Python code to execute", "type": "string" }, "max_executions": { "default": 25, "description": "The number of code snippets to execute before restarting the lab.", "examples": [ 25 ], "minimum": 1, "title": "How much to execute in a given lab and session", "type": "integer" } }, "$defs": { "HumanTimedelta": { "format": "duration", "type": "string" }, "LogLevel": { "description": "Python logging level.\n\nAny case variation is accepted when converting a string to an enum value\nvia the class constructor.", "enum": [ "DEBUG", "INFO", "WARNING", "ERROR", "CRITICAL" ], "title": "LogLevel", "type": "string" }, "NubladoImageByClass": { "description": "Spawn the recommended image.", "properties": { "image_class": { "default": "recommended", "enum": [ "recommended", "latest-release", "latest-weekly", "latest-daily" ], "title": "Class of image to spawn", "type": "string" }, "size": { "$ref": "#/$defs/NubladoImageSize", "default": "Large", "description": "Must be one of the sizes understood by Nublado.", "title": "Size of image to spawn" }, "description": { "default": "", "title": "Human-readable image description", "type": "string" }, "debug": { "default": false, "title": "Whether to enable lab debugging", "type": "boolean" } }, "title": "NubladoImageByClass", "type": "object" }, "NubladoImageByReference": { "description": "Spawn an image by full Docker reference.", "properties": { "image_class": { "const": "by-reference", "default": "by-reference", "title": "Class of image to spawn", "type": "string" }, "size": { "$ref": "#/$defs/NubladoImageSize", "default": "Large", "description": "Must be one of the sizes understood by Nublado.", "title": "Size of image to spawn" }, "description": { "default": "", "title": "Human-readable image description", "type": "string" }, "debug": { "default": false, "title": "Whether to enable lab debugging", "type": "boolean" }, "reference": { "title": "Docker reference of lab image to spawn", "type": "string" } }, "required": [ "reference" ], "title": "NubladoImageByReference", "type": "object" }, "NubladoImageByTag": { "description": "Spawn an image by image tag.", "properties": { "image_class": { "const": "by-tag", "default": "by-tag", "title": "Class of image to spawn", "type": "string" }, "size": { "$ref": "#/$defs/NubladoImageSize", "default": "Large", "description": "Must be one of the sizes understood by Nublado.", "title": "Size of image to spawn" }, "description": { "default": "", "title": "Human-readable image description", "type": "string" }, "debug": { "default": false, "title": "Whether to enable lab debugging", "type": "boolean" }, "tag": { "title": "Tag of image to spawn", "type": "string" } }, "required": [ "tag" ], "title": "NubladoImageByTag", "type": "object" }, "NubladoImageSize": { "description": "Acceptable sizes of images to spawn.", "enum": [ "Fine", "Diminutive", "Tiny", "Small", "Medium", "Large", "Huge", "Gargantuan", "Colossal" ], "title": "NubladoImageSize", "type": "string" } }, "additionalProperties": false }
- Config:
extra: str = forbid
- Fields:
- field code: str = 'print(2+2, end="")'#
- field delete_lab: bool = True#
By default, the lab is deleted and recreated after each iteration of monkey business. Set this to false to keep the same lab.
- field delete_timeout: HumanTimedelta = datetime.timedelta(seconds=60)#
- field error_idle_time: HumanTimedelta = datetime.timedelta(seconds=60)#
- field execution_idle_time: HumanTimedelta = datetime.timedelta(seconds=1)#
Used by NubladoPythonLoop and NotebookRunner
- field get_node: bool = True#
Used by NubladoPythonLoop and its subclasses. Requires the lab have lsst.rsp pre-installed.
- field idle_time: HumanTimedelta = datetime.timedelta(seconds=60)#
After each loop executing monkey business, the monkey will pause for this long
- field image: NubladoImageByClass | NubladoImageByReference | NubladoImageByTag [Optional]#
- field jitter: HumanTimedelta = datetime.timedelta(0)#
If set to a non-zero value, pause for a random interval between 0 and that interval before logging in to JupyterHub, and between each iteration of the core execution loop. Use this when running lots of monkeys for load testing to spread their execution sequence out more realistically and avoid a thundering herd problem.
- field jupyter_timeout: HumanTimedelta = datetime.timedelta(seconds=60)#
Used as the connect, read, and write timeout for talking to either JupyterHub or Jupyter lab.
- field log_level: LogLevel = LogLevel.INFO#
- field max_executions: int = 25#
The number of code snippets to execute before restarting the lab.
- Constraints:
ge = 1
- field max_websocket_message_size: int | None = 10485760#
This has to be large enough to hold HTML and image output from executing notebook cells, even though we discard that data. Set to
null
for no limit.
- field spawn_settle_time: HumanTimedelta = datetime.timedelta(seconds=10)#
Wait this long after triggering a lab spawn before starting to poll its progress. KubeSpawner 1.1.0 has a bug where progress queries prior to starting the spawn will fail with an exception that closes the progress EventStream.
- field spawn_timeout: HumanTimedelta = datetime.timedelta(seconds=610)#
- field url_prefix: str = '/nb/'#
- field working_directory: str | None = None#