← Back to team overview

yahoo-eng-team team mailing list archive

[Bug 1403129] Re: Glance with swift backend - upload of an image from horizon is not streaming

 

Reviewed:  https://review.openstack.org/230434
Committed: https://git.openstack.org/cgit/openstack/horizon/commit/?id=93af461e40fca76eae58066cc1f9de83d7b716ea
Submitter: Jenkins
Branch:    master

commit 93af461e40fca76eae58066cc1f9de83d7b716ea
Author: Timur Sufiev <tsufiev@xxxxxxxxxxxx>
Date:   Tue May 17 13:16:15 2016 +0300

    [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


** Changed in: horizon
       Status: In Progress => Fix Released

-- 
You received this bug notification because you are a member of Yahoo!
Engineering Team, which is subscribed to OpenStack Dashboard (Horizon).
https://bugs.launchpad.net/bugs/1403129

Title:
  Glance with swift backend - upload of an image from horizon is not
  streaming

Status in OpenStack Dashboard (Horizon):
  Fix Released

Bug description:
  Glance is configured to use swift as its backend.
  While creating image from horizon using image source as image file, the image is uploaded in the controller occupying the disk space of the controller instead of streaming. A tmp file is created in /tmp directory and the owner of this file horizon user.
  Image create fails if there is no enough space in controller to hold the full image.
  But when the same image is uploaded using glance CLI (from a remote Linux macine) streaming happens as - remote machine to glance to swift.
  Streaming also happens in the case of upload using URL from Horizon.
  Horizon should stream in the case of image source as image file

To manage notifications about this bug go to:
https://bugs.launchpad.net/horizon/+bug/1403129/+subscriptions


References