servers

data_server

class ochra.manager.lab.servers.data_server.DataServer(host, port, folderpath=None)

Bases: object

A class to represent the data server to handle results data.

Initializes the DataServer instance.

Parameters:
  • host (str) – The IP address to bind the server.

  • port (int) – The port number to listen on.

  • folderpath (str, optional) – Directory path for storing data. Defaults to None.

get_caller_variable_name()

Find the name of the variable that called this function

Returns:

filename:variable_name.app

Return type:

str

run()

launches the server on the initialized host and port

Return type:

None

lab_server

class ochra.manager.lab.servers.lab_server.LabServer(host, port, folderpath, template_path=None)

Bases: object

A class to represent the lab server.

Initialize the LabServer instance.

Parameters:
  • host (str) – The IP address to bind the server to.

  • port (int) – The port number to listen on.

  • folderpath (str) – Directory path for storing lab data and logs.

  • template_path (Path, optional) – Optional path for Jinja2 templates and static files. Default is None.

async auth_middleware(request, call_next)

Middleware to handle authentication for the web app.

Parameters:
  • request (Request) – The incoming HTTP request.

  • call_next (Callable) – Function to call the next middleware or route handler.

get_caller_variable_name()

Find the name of the variable that called this function

Returns:

filename:variable_name.app

Return type:

str

run()

launches the server on the initialized host and port

Return type:

None