horizon deep dive - matthias-runge.de · horizon deep dive matthias runge software engineer may...

30
Horizon deep dive Matthias Runge Software Engineer May 18th, 2015

Upload: others

Post on 02-Jun-2020

13 views

Category:

Documents


0 download

TRANSCRIPT

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

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

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

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

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

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

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

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

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

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

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

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

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

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
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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

The end.Thanks for listening.