The OpenStack project was launched by Rackspace and NASA in July 2010. Since then it has gained considerable momentum, with over 200 companies joining the project.
Horizon is OpenStack’s web-based user interface. It is constructed in two parts: 1) a core set of libraries for implementing a dashboard; 2) a reference dashboard implementation that uses the core set of libraries. Customization is key to the Horizon framework. It allows developers to construct their own dashboards, panel groups, and panels, and assemble them via a common navigation/presentation framework.
In this presentation, David will provide a brief introduction to OpenStack and Horizon. Then he will review Horizon’s architecture, explain how it integrates with other OpenStack services, examine its most interesting features, and describe how to start developing with it.
40. Dashboards & Panels
● Horizon provides a flexible framework for
creating Dashboards and Panels
● Panels grouped into PanelGroups
● PanelGroups into Dashboards
41. Dashboard App
● Dashboards created as Django Applications
● Dashboard modules partitioned into:
o static
o templates
o python modules
46. Panel
● Panels are created as Python Modules
● Panel modules partitioned into:
o static/
o templates/
o python modules:
urls.py, views.py, panel.py
tables.py, forms.py, tabs.py, tests.py
48. panel.py
from django.utils.translation import ugettext_lazy as _
import horizon
from openstack_dashboard.dashboards.cloudopen import dashboard
class Hypervisors(horizon.Panel):
name = _(”Hypervisors")
slug = 'hypervisors'
dashboard.CloudOpen.register(Hypervisors)
50. View Module
● View module ties together everything:
o Tables, Templates, API Calls
● Horizon base views:
o APIView, LoginView, MultiTableView,
DataTableView, MixedDataTableView,
TabView, TabbedTableView, WorkflowView
51. views.py
from horizon import tables
class HypervisorsIndexView(tables.DataTableView):
table_class = hv_tables.AdminHypervisorsTable
template_name = ’cloudopen/hypervisors/index.html’
def get_data(self):
hypervisors = []
states = {}
hypervisors = api.nova.hypervisor_list(self.request)
…
return hypervisors
52. Table Module
● Table classes provide framework for tables:
o consistent look and feel
o configurable table_actions and row_actions
o select/multi-select column
o sorting
o pagination
● Functionality is split server- and client-side
62. Customization Hooks
● Change Site Title, Logo, Brand Links
● Modify Dashboards and Panels
● Change Button Styles
● Use Custom Stylesheets
● Use Custom Javascript
63. Custom Overrides Module
● For site-wide customization, Horizon allows for a
user-defined python customization module
● Customizations can include:
o Registering/unregistering panels
o Modifying dashboard or panel attributes
o Moving panels between dashboards
o Modifying attributes of existing UI elements
65. overrides.py
from openstack_dashboard.dashboards.cloudopen.test import panel
as test_panel
from openstack_dashboard.dashboards.cloudopen import dashboard
as cloudopen_dashboard
from django.conf import settings
import horizon
CLOUDOPEN_DASHBOARD_SETTINGS = horizon.get_dashboard('cloudopen')
if settings.HORIZON_CONFIG.get('test_enabled'):
CLOUDOPEN_DASHBOARD_SETTINGS .register(test_panel.Tests)
69. Pluggable Settings
● Since Icehouse release, Horizon enables
pluggable settings to control structure
o Enable/Disable new Dashboards
o Add new PanelGroups
o Add/Remove Panels to/from PanelGroups
● Settings all live in:
o openstack_dashboard/local/enabled
79. Custom CSS and Javascript
● Horizon templates provides blocks for custom
CSS and Javascript
● To add custom CSS/JS, can either extend existing
templates, or replace with your own custom
templates
93. Devstack and Contributing
● Devstack:
o “A documented shell script to build complete
OpenStack development environments.”
o http://devstack.org
● Contributing to Horizon:
– http://docs.openstack.org/developer/horizo
n/contributing.html
94. OPENSTACK THAT JUST WORKS
Thank You
David Lapsley
@devlaps, david.lapsley@metacloud.com
Editor's Notes
Add client-side…
Orchestration engine to launch multiple cloud applications based on templates in the form of text files that can be treated like code.
Compatible with AWS Cloud Formation
----- Meeting Notes (8/20/14 20:59) -----
30 mins
----- Meeting Notes (8/20/14 20:59) -----
30 mins
Old way of customizing v. new way..
Server provides data over RESTful API – json data
Client responsible for rendering and presenting
Much more interactive, client can now take immediate action on data it knows about instead of round tripping to server
Faster feature velocity, server and client can be developed in parallel
Simpler code
Instrument each node with livestastd
Controllers and Hypervisors
Pull information about processes, network, disk, cpu
Updates every 5 seconds
Using the same client-side rendering pattern as before
Aggregating real-time data
Greatly increases visibility into platform..
Our customers also wanted to see more historical data.
We instrumented all of our nodes and push data into Graphite
Very high performance and flexiblie time series tool
Evolution of RRD Tool
Graphite provides data over RESTful API, so we just pull that data and use it to populate these charts..
Easy access for the user (simply click on controller or hypervisor row and chart will drop down)
Data from 1 hour range to 1 year range..