Horizon deep dive
Matthias Runge
Software Engineer
May 18th, 2015
Agenda
1 Overview and introduction
2 Going deeper . . .
3 Configuration
4 Extending Horizon
5 Troubleshooting
Section 1Overview and introduction
Let’s talk about hats
Horizon core contributor
Fedora, RDO, and Red Hat OpenStack Platform package maintainer
Open Source enthusiast
Horizon
key facts
wsgi application running in Apache httpd
implemented in python using Django framework
part of OpenStack since the early days
end user interface for OpenStack cloud platform
stateless, doesn’t use a database
Project featuresinstancesimages, volumesprojects network configurationstacks, databases, hadoop
Admin features
identity (organized in a additional dashboard)
quotas, flavors
hypervisor
metering data
networks and router configuration
Features not included in Horizoncloud infrastructure configuration
setup related options
deployment of nodes, storages, . . .
hardware vendor specific additions
Section 2Going deeper . . .
Horizon requirements
Django
describes itself as web framework for perfectionists with deadlines
implemented in Python
very active upstream
releases about every 9 months
announces deprecations two releases in advance in general
Static file handling
django-compressor
combines and compresses static files
uses {% compress %} and {% endcompress %}filters or translates files
pluggable
django static files
./manage.py collectstatic
./manage.py compress
python-XStatic-foo
django openstack authpluggable authentication backendauthenticates a user against Keystonecreates a user object from keystone provided dataretrieves an initial tokenused for permission checks
OpenStack related libraries
OpenStack API clients
python-*client
provide an client to access related rest API
using the same ways as cli tools interact with underlying services
What’s new in Kilo?
about 34 blueprints implemented
in default install: 3 visible changes
Heat UI improvementWizards for Data processing UIGlance metadata definitions Admin UI
under the hood, more changes
Client-side re-implementation ⇒ session on Thursday
Section 3Configuration
Most likely to configure for horizon
keystone(s) to contact
ALLOWED HOSTS
ALLOWED HOSTS setting
Warning
ALLOWED HOSTS = [’*’, ]
Better
ALLOWED_HOSTS = ['.example.com', 'horizon.corp.com',]
What?
performs checks on host header
Other config options
/etc/openstack-dashboard/local settings
WEBROOT = ’/dashboard’
OPENSTACK API VERSIONS
OPENSTACK SSL NO VERIFY, OPENSTACK SSL CACERT
LOGGING
HORIZON CONFIG
service specific options like for keystone: can edit user
Cache and session store
Cache
CACHES = {
'default': {
'BACKEND': 'django.core.cache.backends.memcached.MemcachedCache',
'LOCATION': '127.0.0.1:11211',
}
}
Session
# SESSION_ENGINE = 'django.contrib.sessions.backends.signed_cookies'
SESSION_ENGINE = 'django.contrib.sessions.backends.cached_db'
Policy files
Allowing or forbidding. . .
e.g allow or disallow users to upload images to glance
even works for single projects
policy checked separately from service policy config
http://docs.openstack.org/developer/horizon/topics/policy.html
Section 4Extending Horizon
Extending or customizing Horizon
Several ways
fork the repo and change source code directly
add a customized panel or dashboard
Useful info
templates, templatetags
styles
django static file handling
python-XStatic-foo
Adding a new dashboard or panel
mkdir openstack_dashboard/dashboards/mydashboard
./run_tests.sh -m startdash mydashboard \
--target openstack_dashboard/dashboards/mydashboard
mkdir openstack_dashboard/dashboards/mydashboard/mypanel
./run_tests.sh -m startpanel mypanel \
--dashboard=openstack_dashboard.dashboards.mydashboard \
--target=openstack_dashboard/dashboards/mydashboard/mypanel
http://docs.openstack.org/developer/horizon/topics/tutorial.html
Customizing Look
using the new theming feature
customizing by adding a theme dashboard
Configuration based changes
adding or removing dashboards and panels
adding panels to different dashboards
examples in openstack dashboard/enabled
Example: Disabling panels or dashboards
# The slug of the panel to be added to HORIZON_CONFIG. Required.
PANEL = 'info'
# The slug of the dashboard the PANEL associated with. Required.
PANEL_DASHBOARD = 'admin'
# The slug of the panel group the PANEL is associated with.
PANEL_GROUP = 'admin'
REMOVE_PANEL = True
Section 5Troubleshooting
Troubleshooting
First steps
1 does it work in nova?
2 set DEBUG = True
3 enable debugging for specific services
4 if it’s a bug: we need a reproducer
5 if possible, catch a stack trace
Horizon upstream
#horizon on freenode
tag emails with [Horizon] when contacting openstack-dev@lists. . .
bugs: please report them!
new features are implemented via blueprint process
launchpad, but not for questions
weekly meetings, alternating times, Wed, either 12 UTC or 20 UTC
watch for announcements
The end.Thanks for listening.
Top Related