Horizon deep dive - matthias-runge.de · Horizon deep dive Matthias Runge Software Engineer May...
Transcript of Horizon deep dive - matthias-runge.de · Horizon deep dive Matthias Runge Software Engineer May...
![Page 1: Horizon deep dive - matthias-runge.de · Horizon deep dive Matthias Runge Software Engineer May 18th, 2015. Agenda 1 Overview ... Let’s talk about hats Horizon core contributor](https://reader030.fdocuments.us/reader030/viewer/2022041102/5edd86c3ad6a402d6668a64c/html5/thumbnails/1.jpg)
Horizon deep dive
Matthias Runge
Software Engineer
May 18th, 2015
![Page 2: Horizon deep dive - matthias-runge.de · Horizon deep dive Matthias Runge Software Engineer May 18th, 2015. Agenda 1 Overview ... Let’s talk about hats Horizon core contributor](https://reader030.fdocuments.us/reader030/viewer/2022041102/5edd86c3ad6a402d6668a64c/html5/thumbnails/2.jpg)
Agenda
1 Overview and introduction
2 Going deeper . . .
3 Configuration
4 Extending Horizon
5 Troubleshooting
![Page 3: Horizon deep dive - matthias-runge.de · Horizon deep dive Matthias Runge Software Engineer May 18th, 2015. Agenda 1 Overview ... Let’s talk about hats Horizon core contributor](https://reader030.fdocuments.us/reader030/viewer/2022041102/5edd86c3ad6a402d6668a64c/html5/thumbnails/3.jpg)
Section 1Overview and introduction
![Page 4: Horizon deep dive - matthias-runge.de · Horizon deep dive Matthias Runge Software Engineer May 18th, 2015. Agenda 1 Overview ... Let’s talk about hats Horizon core contributor](https://reader030.fdocuments.us/reader030/viewer/2022041102/5edd86c3ad6a402d6668a64c/html5/thumbnails/4.jpg)
Let’s talk about hats
Horizon core contributor
Fedora, RDO, and Red Hat OpenStack Platform package maintainer
Open Source enthusiast
![Page 5: Horizon deep dive - matthias-runge.de · Horizon deep dive Matthias Runge Software Engineer May 18th, 2015. Agenda 1 Overview ... Let’s talk about hats Horizon core contributor](https://reader030.fdocuments.us/reader030/viewer/2022041102/5edd86c3ad6a402d6668a64c/html5/thumbnails/5.jpg)
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
![Page 6: Horizon deep dive - matthias-runge.de · Horizon deep dive Matthias Runge Software Engineer May 18th, 2015. Agenda 1 Overview ... Let’s talk about hats Horizon core contributor](https://reader030.fdocuments.us/reader030/viewer/2022041102/5edd86c3ad6a402d6668a64c/html5/thumbnails/6.jpg)
Project featuresinstancesimages, volumesprojects network configurationstacks, databases, hadoop
![Page 7: Horizon deep dive - matthias-runge.de · Horizon deep dive Matthias Runge Software Engineer May 18th, 2015. Agenda 1 Overview ... Let’s talk about hats Horizon core contributor](https://reader030.fdocuments.us/reader030/viewer/2022041102/5edd86c3ad6a402d6668a64c/html5/thumbnails/7.jpg)
Admin features
identity (organized in a additional dashboard)
quotas, flavors
hypervisor
metering data
networks and router configuration
![Page 8: Horizon deep dive - matthias-runge.de · Horizon deep dive Matthias Runge Software Engineer May 18th, 2015. Agenda 1 Overview ... Let’s talk about hats Horizon core contributor](https://reader030.fdocuments.us/reader030/viewer/2022041102/5edd86c3ad6a402d6668a64c/html5/thumbnails/8.jpg)
Features not included in Horizoncloud infrastructure configuration
setup related options
deployment of nodes, storages, . . .
hardware vendor specific additions
![Page 9: Horizon deep dive - matthias-runge.de · Horizon deep dive Matthias Runge Software Engineer May 18th, 2015. Agenda 1 Overview ... Let’s talk about hats Horizon core contributor](https://reader030.fdocuments.us/reader030/viewer/2022041102/5edd86c3ad6a402d6668a64c/html5/thumbnails/9.jpg)
Section 2Going deeper . . .
![Page 10: Horizon deep dive - matthias-runge.de · Horizon deep dive Matthias Runge Software Engineer May 18th, 2015. Agenda 1 Overview ... Let’s talk about hats Horizon core contributor](https://reader030.fdocuments.us/reader030/viewer/2022041102/5edd86c3ad6a402d6668a64c/html5/thumbnails/10.jpg)
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
![Page 11: Horizon deep dive - matthias-runge.de · Horizon deep dive Matthias Runge Software Engineer May 18th, 2015. Agenda 1 Overview ... Let’s talk about hats Horizon core contributor](https://reader030.fdocuments.us/reader030/viewer/2022041102/5edd86c3ad6a402d6668a64c/html5/thumbnails/11.jpg)
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
![Page 12: Horizon deep dive - matthias-runge.de · Horizon deep dive Matthias Runge Software Engineer May 18th, 2015. Agenda 1 Overview ... Let’s talk about hats Horizon core contributor](https://reader030.fdocuments.us/reader030/viewer/2022041102/5edd86c3ad6a402d6668a64c/html5/thumbnails/12.jpg)
django openstack authpluggable authentication backendauthenticates a user against Keystonecreates a user object from keystone provided dataretrieves an initial tokenused for permission checks
![Page 13: Horizon deep dive - matthias-runge.de · Horizon deep dive Matthias Runge Software Engineer May 18th, 2015. Agenda 1 Overview ... Let’s talk about hats Horizon core contributor](https://reader030.fdocuments.us/reader030/viewer/2022041102/5edd86c3ad6a402d6668a64c/html5/thumbnails/13.jpg)
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
![Page 14: Horizon deep dive - matthias-runge.de · Horizon deep dive Matthias Runge Software Engineer May 18th, 2015. Agenda 1 Overview ... Let’s talk about hats Horizon core contributor](https://reader030.fdocuments.us/reader030/viewer/2022041102/5edd86c3ad6a402d6668a64c/html5/thumbnails/14.jpg)
![Page 15: Horizon deep dive - matthias-runge.de · Horizon deep dive Matthias Runge Software Engineer May 18th, 2015. Agenda 1 Overview ... Let’s talk about hats Horizon core contributor](https://reader030.fdocuments.us/reader030/viewer/2022041102/5edd86c3ad6a402d6668a64c/html5/thumbnails/15.jpg)
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
![Page 16: Horizon deep dive - matthias-runge.de · Horizon deep dive Matthias Runge Software Engineer May 18th, 2015. Agenda 1 Overview ... Let’s talk about hats Horizon core contributor](https://reader030.fdocuments.us/reader030/viewer/2022041102/5edd86c3ad6a402d6668a64c/html5/thumbnails/16.jpg)
Section 3Configuration
![Page 17: Horizon deep dive - matthias-runge.de · Horizon deep dive Matthias Runge Software Engineer May 18th, 2015. Agenda 1 Overview ... Let’s talk about hats Horizon core contributor](https://reader030.fdocuments.us/reader030/viewer/2022041102/5edd86c3ad6a402d6668a64c/html5/thumbnails/17.jpg)
Most likely to configure for horizon
keystone(s) to contact
ALLOWED HOSTS
![Page 18: Horizon deep dive - matthias-runge.de · Horizon deep dive Matthias Runge Software Engineer May 18th, 2015. Agenda 1 Overview ... Let’s talk about hats Horizon core contributor](https://reader030.fdocuments.us/reader030/viewer/2022041102/5edd86c3ad6a402d6668a64c/html5/thumbnails/18.jpg)
ALLOWED HOSTS setting
Warning
ALLOWED HOSTS = [’*’, ]
Better
ALLOWED_HOSTS = ['.example.com', 'horizon.corp.com',]
What?
performs checks on host header
![Page 19: Horizon deep dive - matthias-runge.de · Horizon deep dive Matthias Runge Software Engineer May 18th, 2015. Agenda 1 Overview ... Let’s talk about hats Horizon core contributor](https://reader030.fdocuments.us/reader030/viewer/2022041102/5edd86c3ad6a402d6668a64c/html5/thumbnails/19.jpg)
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
![Page 20: Horizon deep dive - matthias-runge.de · Horizon deep dive Matthias Runge Software Engineer May 18th, 2015. Agenda 1 Overview ... Let’s talk about hats Horizon core contributor](https://reader030.fdocuments.us/reader030/viewer/2022041102/5edd86c3ad6a402d6668a64c/html5/thumbnails/20.jpg)
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'
![Page 21: Horizon deep dive - matthias-runge.de · Horizon deep dive Matthias Runge Software Engineer May 18th, 2015. Agenda 1 Overview ... Let’s talk about hats Horizon core contributor](https://reader030.fdocuments.us/reader030/viewer/2022041102/5edd86c3ad6a402d6668a64c/html5/thumbnails/21.jpg)
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
![Page 22: Horizon deep dive - matthias-runge.de · Horizon deep dive Matthias Runge Software Engineer May 18th, 2015. Agenda 1 Overview ... Let’s talk about hats Horizon core contributor](https://reader030.fdocuments.us/reader030/viewer/2022041102/5edd86c3ad6a402d6668a64c/html5/thumbnails/22.jpg)
Section 4Extending Horizon
![Page 23: Horizon deep dive - matthias-runge.de · Horizon deep dive Matthias Runge Software Engineer May 18th, 2015. Agenda 1 Overview ... Let’s talk about hats Horizon core contributor](https://reader030.fdocuments.us/reader030/viewer/2022041102/5edd86c3ad6a402d6668a64c/html5/thumbnails/23.jpg)
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
![Page 24: Horizon deep dive - matthias-runge.de · Horizon deep dive Matthias Runge Software Engineer May 18th, 2015. Agenda 1 Overview ... Let’s talk about hats Horizon core contributor](https://reader030.fdocuments.us/reader030/viewer/2022041102/5edd86c3ad6a402d6668a64c/html5/thumbnails/24.jpg)
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
![Page 25: Horizon deep dive - matthias-runge.de · Horizon deep dive Matthias Runge Software Engineer May 18th, 2015. Agenda 1 Overview ... Let’s talk about hats Horizon core contributor](https://reader030.fdocuments.us/reader030/viewer/2022041102/5edd86c3ad6a402d6668a64c/html5/thumbnails/25.jpg)
Customizing Look
using the new theming feature
customizing by adding a theme dashboard
![Page 26: Horizon deep dive - matthias-runge.de · Horizon deep dive Matthias Runge Software Engineer May 18th, 2015. Agenda 1 Overview ... Let’s talk about hats Horizon core contributor](https://reader030.fdocuments.us/reader030/viewer/2022041102/5edd86c3ad6a402d6668a64c/html5/thumbnails/26.jpg)
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
![Page 27: Horizon deep dive - matthias-runge.de · Horizon deep dive Matthias Runge Software Engineer May 18th, 2015. Agenda 1 Overview ... Let’s talk about hats Horizon core contributor](https://reader030.fdocuments.us/reader030/viewer/2022041102/5edd86c3ad6a402d6668a64c/html5/thumbnails/27.jpg)
Section 5Troubleshooting
![Page 28: Horizon deep dive - matthias-runge.de · Horizon deep dive Matthias Runge Software Engineer May 18th, 2015. Agenda 1 Overview ... Let’s talk about hats Horizon core contributor](https://reader030.fdocuments.us/reader030/viewer/2022041102/5edd86c3ad6a402d6668a64c/html5/thumbnails/28.jpg)
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
![Page 29: Horizon deep dive - matthias-runge.de · Horizon deep dive Matthias Runge Software Engineer May 18th, 2015. Agenda 1 Overview ... Let’s talk about hats Horizon core contributor](https://reader030.fdocuments.us/reader030/viewer/2022041102/5edd86c3ad6a402d6668a64c/html5/thumbnails/29.jpg)
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
![Page 30: Horizon deep dive - matthias-runge.de · Horizon deep dive Matthias Runge Software Engineer May 18th, 2015. Agenda 1 Overview ... Let’s talk about hats Horizon core contributor](https://reader030.fdocuments.us/reader030/viewer/2022041102/5edd86c3ad6a402d6668a64c/html5/thumbnails/30.jpg)
The end.Thanks for listening.