schrodinger.seam.viz.watcher module¶
This module provides a webserver that serves a webapp that displays the pipeline graph of a seam pipeline. The webapp is served at http://localhost:8000.
Usage:
$SCHRODINGER/run python3 -m schrodinger.seam.viz.server start $SCHRODINGER/run python3 -m schrodinger.seam.viz.server start path/to/local/seam
- exception schrodinger.seam.viz.watcher.InvalidResponseError¶
Bases:
Exception
- schrodinger.seam.viz.watcher.get_dot(pipeline_id: str, viewType: str, expandedTransforms: List, colorBy: str) str ¶
Given a pipeline id and view options, return the dot representation of the pipeline as a string.
- schrodinger.seam.viz.watcher.get_events_file_from_pipeline_id(pipeline_id: str) pathlib.Path ¶
Given a pipeline id, return the path to the .events file for that pipeline.
- schrodinger.seam.viz.watcher.get_dot_from_events_file(events_file, viewType, expandedTransforms: list, colorBy: str)¶
Given a path to a .events file, return the dot representation of the pipeline as a string.
- schrodinger.seam.viz.watcher.get_logs(pipeline_id: str, sanitize=False)¶
- class schrodinger.seam.viz.watcher.ResponseType(value, names=None, *, module=None, qualname=None, type=None, start=1, boundary=None)¶
Bases:
enum.Enum
- TEXT = 'text/plain'¶
- JSON = 'application/json'¶
- HTML = 'text/html'¶
- ZIP = 'application/zip'¶
- class schrodinger.seam.viz.watcher.EndpointInfo(path: str, request_schema: Dict[str, Any], response_type: schrodinger.seam.viz.watcher.ResponseType)¶
Bases:
object
- path: str¶
- request_schema: Dict[str, Any]¶
- response_type: schrodinger.seam.viz.watcher.ResponseType¶
- __init__(path: str, request_schema: Dict[str, Any], response_type: schrodinger.seam.viz.watcher.ResponseType) None ¶
- exception schrodinger.seam.viz.watcher.InvalidRequestError¶
Bases:
Exception
- schrodinger.seam.viz.watcher.endpoint(endpoint_name: str, request_schema: dict = None, response_type: schrodinger.seam.viz.watcher.ResponseType = ResponseType.JSON, accepts_sessiontoken: bool = False)¶
Decorator to add an endpoint to the server.
- Parameters
endpoint_name – the name of the endpoint
request_schema – the schema for the request parameters
response_type – the type of the response
accepts_sessiontoken – whether the endpoint accepts a session token
- Returns
the decorated function
- class schrodinger.seam.viz.watcher.WatcherWebServer¶
Bases:
schrodinger.seam.viz.watcher._BaseServer
- SERVER_ROOT = '/'¶
- sessiontokenHasAccess(sessiontoken: Optional[str], pipeline_id: str) bool ¶
Check if a session token has access to a pipeline. By default, all session tokens have access to all pipelines. Subclasses can override this method to implement access control.
- Parameters
sessiontoken – the session token to check
pipeline_id – the pipeline id to check
- dot_endpoint(params, sessiontoken=None)¶
- logs_endpoint(params, sessiontoken=None)¶
- pipelines_endpoint(params, sessiontoken=None)¶
- pipeline_info_endpoint(params, sessiontoken=None)¶
- index_endpoint(params)¶
- static start_simple_http_server(local_seamdir: Optional[str] = None)¶
Start a simple HTTP server that serves the watcher webapp. Only intended for local use, not for production servers that might require more security.
- Parameters
local_seamdir – the path to a local seam directory. If set, the server will make the local seamdir available to the webapp.
- schrodinger.seam.viz.watcher.get_parser() argparse.ArgumentParser ¶
- schrodinger.seam.viz.watcher.main(args: Optional[List[str]] = None)¶