Security/Projects/Minion/TaskEngine

From MozillaWiki
Jump to: navigation, search

Minion Task Engine

Overview

The Task Engine is responsible for:

  • Providing a REST based API
  • Handling requests from trusted components (eg the Web UI)
  • Scheduling work across the available resources (ie plugins)
  • Persisting data

API

This is at a very early stage, so is still fairly fluid.

Op URL Method Notes
GET /pluginservices get_plugin_services() List all of the installed plugin services
GET /plugins get_all_plugins() List all of the plugins across all of the plugin services
PUT /pluginservice/create/<ps> add_plugin_service(ps) Register a plugin service
DELETE /pluginservice/<ps> remove_plugin_service(ps) Remove a plugin service
GET /plugin/<plugin>/<version>/template get_plugin_template(plugin, version) Get the template for the specified plugin
GET /pluginservice/<ps>/info get_plugin_service_info(service_name) Get the info about the plugin service
PUT /plugin/session/create/<plugin>/<version> create_plugin_session(plugin, version) Create the specified plugin on any suitable plugin service
PUT /pluginservice/<ps>/session/create/<plugin> TODO create_plugin_service_session(service_name, plugin_name) Create the specified plugin on the specified plugin service
GET /pluginservice/<ps>/sessions TODO get_plugin_service_sessions(service_name) Get the sessions for the plugin service
DELETE /pluginservice/<service_name>/session/<session> TODO terminate_plugin_service_session(service_name, session) Terminate the session on the plugin service
GET /pluginservice/<service_name>/session/<session>/status get_plugin_service_session_status(service_name, session) Get the plugin status
GET /pluginservice/<service_name>/session/<session>/states get_plugin_service_session_states(service_name, session) Get the valid plugin states
PUT /pluginservice/<service_name>/session/<session>/state/<state> set_plugin_service_session_state(service_name, session, state) Set the plugin state
TBA /pluginservice/<service_name>/session/<session>/config/<config> set_plugin_service_session_config(service_name, session, config) Set the full config
GET /pluginservice/<service_name>/session/<session>/config get_plugin_service_session_config(service_name, session) Get the plugin config
PUT /pluginservice/<service_name>/session/<session>/value?key=<key>&value=<value> set_plugin_service_session_value(service_name, session, key, value) Set the key and value specified in the query string
GET /pluginservice/<service_name>/session/<session>/results get_plugin_service_session_results(service_name, session) Get the plugin results

Main Classes

TaskEngine

This is the guts of the task engine, and will implement (or control) all of the functionality.

It can be run 'inline' for testing / development purposes.

TaskEngineRestApi

This is a wrapper around the TaskEngine, and provides a simple REST API.

At some point this will become a 'proper' stand alone service.

TaskEngineClient

This provides the same interface as the TaskEngine, but communicates with a separate task engine process via the REST API.

Clients should be able to switch between the TaskEngine and the TaskEngineClient without having to make any changes.

Notes

  • It should persist all data to a db and maintain as little data in memory as possible.
    • This will allow us to run multiple Task Engine servers for one service, with all of the synchronization happening via the db (which would probably be clustered).
  • To start with we'll probably implement the minimum necessary functionality to get the basics working
  • In future phases there will be significant functionality to implement here :)