OpenStack Dashboard (Horizon)
Go to file
Timur Sufiev 93af461e40 [Django] Allow to upload the image directly to Glance service
Since large Glance images even temporarily stored on dashboard side
tend to fill up Web Server filesystem, it is desirable to route image
payload directly to Glance service (which usually streams it to
storage backend, which in turn has plenty of space).

To make it possible we need to trick Django into thinking that a file
was selected inside FileInput, while its contents are not actually
transferred to Django server. Then, once image is created client-side
code needs to know the exact url the image payload needs to be
transferred to. Both tasks are solved via using ExternalFileField /
ExternalUploadMeta classes which allow to work around the usual Django
form processing workflow with minimal changes to CreateImage form
business logic.

The client-side code relies on CORS being enabled for Glance service
(otherwise browser would forbid the PUT request to a location
different from the one form content came from). In a Devstack setup
you'll need to edit [cors] section of glance-api.conf file, setting
`allowed_origin` setting to the full hostname of the web server (say,
http://<HOST_IP>/dashboard) and restart glance-api process.

A progress bar is implemented to track the progress of a file upload,
in case a really huge image is transferred.

The new machinery could be easily switched on/off with a single
setting `HORIZON_IMAGES_UPLOAD_MODE` set to 'direct' / 'legacy'.

Related-Bug: #1467890
Closes-Bug: #1403129
Implements blueprint: horizon-glance-large-image-upload
Change-Id: I01d02f75268186b43066df6fd966aa01c08e01d7
2016-08-16 14:30:38 +03:00
doc Make 'switch' between legacy and Angular Images 2016-08-05 08:17:21 -06:00
horizon [Django] Allow to upload the image directly to Glance service 2016-08-16 14:30:38 +03:00
openstack_dashboard [Django] Allow to upload the image directly to Glance service 2016-08-16 14:30:38 +03:00
releasenotes [Django] Allow to upload the image directly to Glance service 2016-08-16 14:30:38 +03:00
tools Pre-test hook for integration tests/deprecated 2016-08-11 07:26:34 -06:00
.eslintignore bump eslint version to 1.10.3 2016-03-31 14:06:45 +00:00
.eslintrc Disabling warnings of 'quote-props' 2016-05-18 15:04:00 -06:00
.gitignore Add Apple OS X ".DS_Store" to ".gitignore" file 2016-08-08 06:05:39 +00:00
.gitreview Add .gitreview and rfc.sh. 2011-10-28 09:50:35 -04:00
.mailmap Update my mailmap 2013-10-25 14:49:23 +08:00
.pylintrc updating run_tests.sh to mimic other openstack projects, pep8, pylint, coverage 2011-08-31 14:41:36 -07:00
.testr.conf Add testr support 2015-12-10 09:45:41 +01:00
CONTRIBUTING.rst Workflow documentation is now in infra-manual 2014-12-05 03:30:36 +00:00
HACKING.rst Eliminate mutable default arguments 2015-12-17 09:58:46 +00:00
LICENSE Initial commit 2011-01-12 13:43:31 -08:00
MANIFEST.in Update MANIFEST for SCSS 2015-09-09 14:42:10 +01:00
Makefile Unifies the project packaging into one set of modules. 2012-02-29 00:20:13 -08:00
README.rst Add install guide for users and clean up README 2014-10-09 03:29:26 +09:00
babel-django.cfg Added a django extract for .csv files 2015-09-15 21:57:42 +00:00
babel-djangojs.cfg Angular translation via babel (singular only) 2015-07-02 11:13:45 +10:00
manage.py Gate on H102 Apache 2.0 license header not found for pep8 2013-11-19 13:55:04 -05:00
package.json Update devDependencies in package.json 2016-08-01 08:24:10 +01:00
requirements.txt Updated from global requirements 2016-08-11 18:11:18 +00:00
run_tests.sh Fix translation test 2016-05-07 10:36:05 +02:00
setup.cfg Enhances tox to not rely on run_tests 2016-04-20 12:56:53 +02:00
setup.py Updated from global requirements 2015-09-19 05:37:19 +00:00
test-requirements.txt Updated from global requirements 2016-07-21 13:24:52 +00:00
test-shim.js Fix bug where WEBROOT is not respected 2015-07-22 04:10:50 +00:00
tox.ini Update Django 1.10 tox env 2016-08-04 20:57:20 +00:00

README.rst

Horizon (OpenStack Dashboard)

Horizon is a Django-based project aimed at providing a complete OpenStack Dashboard along with an extensible framework for building new dashboards from reusable components. The openstack_dashboard module is a reference implementation of a Django site that uses the horizon app to provide web-based interactions with the various OpenStack projects.

Using Horizon

See doc/source/topics/install.rst about how to install Horizon in your OpenStack setup. It describes the example steps and has pointers for more detailed settings and configurations.

It is also available at http://docs.openstack.org/developer/horizon/topics/install.html.

Getting Started for Developers

doc/source/quickstart.rst or http://docs.openstack.org/developer/horizon/quickstart.html describes how to setup Horizon development environment and start development.

Building Contributor Documentation

This documentation is written by contributors, for contributors.

The source is maintained in the doc/source directory using reStructuredText and built by Sphinx

  • Building Automatically:

    $ ./run_tests.sh --docs
  • Building Manually:

    $ tools/with_venv.sh sphinx-build doc/source doc/build/html

Results are in the doc/build/html directory