Introduction openstack horizon

Post on 02-Jul-2015

433 views 0 download

description

Introduction openstack horizon

transcript

Introduction Openstack Horizon

Jim

About

I am Jim.

A web developer.

Interested in automation

Outline

Packages

Create a dashboard

What is Horizon?

A dashboard for managing Openstack Services

Powered by Django

Key Packages

openstack_dashboard

horizon

openstack_auth

openstack/horizon

openstack/django_openstack_auth

openstack_auth

A Django authentication backend

Form a User object after an identity is verified by Keystone

Define permission instantly according to the role of a user

No database

horizonDefine a singleton of Horizon

Provide all base components that are used in dashboard

table

workflow

form

tab

openstack_dashboard

The actual django project for Horizon

dashboards and panels

api

Dashaboard

Dashaboard

DashaboardRegister

urls

Horizon App

Discover urls from dashboards

class Dashboardclass Panel

horizon openstack_dashboard(django project)

urls.py

horizon

horizon.base

Core of horizon app

Class of Dashboard and Panel

manage urls for registered dashboards and panels

Flow of a View

View Class - Handle request, collect data for component

Component Class - Render

View Class Component Class

Request Data

RenderResponse

horizon.tables

The most commonly-used component in Horizon

Every element in a table is a class

Components of a table

Table

Row

Column

Cell

Actions

horizon.workflowIt’s a form with multiple step

There are four classes in a workflow:

Workflow

Step

Action

WorkflowView

Modal

Step

Form

openstack_dashboard

openstack_dashboard.api

Wrapper for openstack-xxxxclient

openstack_dashboard.dashboards

Default Dashboard

Project

Admin

Identity (Move out from Admin)

How to Hack

Ubuntu / MacOS

A controller server (keystone, glance, nova)

Setup Environment

1.Clone the source code

2.Create a virtual environment (Optional)

3.Install pip requirements

4.Copy and update local_settings.py

Update local_settings.py

OPENSTACK_HOST = “controller"

Create a dashboard

python manage.py startdash mydashboard --target openstack_dashboard/dashboards/mydashboard

Create a panel

python manage.py startpanel mypanel --dashboard=openstack_dashboard.dashboards.mydashboard --target=openstack_dashboard/dashboards/mydashboard/mypanel

Add to enabled

Add a config file in openstack_dashboard/enabled

openstack_dashboard/enabled/mydashboard.py

Set the default panel

Add default panel

Hack

Q & A