OverView
SageWorks Plugins
The SageWorks toolkit provides a flexible plugin architecture to expand, enhance, or even replace the Dashboard. Make custom UI components, views, and entire pages with the plugin classes described here.
The SageWorks Plugin system allows clients to customize how their AWS Machine Learning Pipeline is displayed, analyzed, and visualized. Our easy to use Python API enables developers to make new Dash/Plotly components, data views, and entirely new web pages focused on business use cases.
Concept Docs
Many classes in SageWorks need additional high-level material that covers class design and illustrates class usage. Here's the Concept Docs for Plugins:
Make a plugin
Each plugin class inherits from the SageWorks PluginInterface class and needs to set two attributes and implement two methods. These requirements are set so that each Plugin will conform to the Sageworks infrastructure; if the required attributes and methods aren’t included in the class definition, errors will be raised during tests and at runtime.
Note: For full code see Model Plugin Example
class ModelPlugin(PluginInterface):
"""MyModelPlugin Component"""
"""Initialize this Plugin Component """
auto_load_page = PluginPage.MODEL
plugin_input_type = PluginInputType.MODEL
def create_component(self, component_id: str) -> dcc.Graph:
"""Create the container for this component
Args:
component_id (str): The ID of the web component
Returns:
dcc.Graph: The EndpointTurbo Component
"""
self.component_id = component_id
self.container = dcc.Graph(id=component_id, ...)
# Fill in plugin properties
self.properties = [(self.component_id, "figure")]
# Return the container
return self.container
def update_properties(self, model: Model, **kwargs) -> list:
"""Update the properties for the plugin.
Args:
model (Model): An instantiated Model object
**kwargs: Additional keyword arguments
Returns:
list: A list of the updated property values
"""
# Create a pie chart with the endpoint name as the title
pie_figure = go.Figure(data=..., ...)
# Return the updated property values for the plugin
return [pie_figure]
Required Attributes
The class variable plugin_page determines what type of plugin the MyPlugin class is. This variable is inspected during plugin loading at runtime in order to load the plugin to the correct artifact page in the Sageworks dashboard. The PluginPage class can be DATA_SOURCE, FEATURE_SET, MODEL, or ENDPOINT.
S3 Bucket Plugins (Work in Progress)
Note: This functionality is coming soon
Offers the most flexibility and fast prototyping. Simple set your config/env for blah to an S3 Path and SageWorks will load the plugins from S3 directly.
Helpful Tip
You can copy files from your local system up to S3 with this handy AWS CLI call
Additional Resources
Need help with plugins? Want to develop a customized application tailored to your business needs?
- Consulting Available: SuperCowPowers LLC