[Kimchi-devel] [PATCH v2 0/4] UI: Download Remote Image Feature

Aline Manera alinefm at linux.vnet.ibm.com
Mon Sep 15 19:48:51 UTC 2014


On 09/15/2014 06:47 AM, Hongliang Wang wrote:
>
> On 09/14/2014 10:09 PM, Aline Manera wrote:
>>
>> On 09/12/2014 05:55 PM, Aline Manera wrote:
>>>
>>> Hi Hongliang,
>>>
>>> Most of issues I commented in this patch set are fixed in 
>>> "[Kimchi-devel] [PATCH] Adjustments on upload/download UI"
>>>
>>> We still need to fix the upload to do not freeze the UI and crash 
>>> browser when uploading big files.
>>> To fix it, I think, we will need to send the file part by part, 
>>> let's say 5MB per request. It will also require changes on backend 
>>> but it can solve our problems.
>>>
>>> Regards,
>>> Aline Manera
>>
>> I forgot to mention you also need to apply the same Kimchi style to 
>> the input box and the browser button.
> ACK.
> The file selector button styling is somewhat different. Let me do some 
> investigation.
>> You can merge this patch set with mine and do the style changes. And 
>> to do not block the UI patch, disable the upload option by now until 
>> we get the backend updated.
>>
>> Royce,
>>
>> For the backend I imagine we can allow receive multiple POST request 
>> to get the whole file while uploading it.
>> Example:
>>
>> POST /storagepools/<pool>/storagevolumes/ {file: fd}
>>
>> this fd object will have :
>>
>> - fd.file: a part of 10MB of the file to be uploaded
>> - fd.part: the correspond part number
>> - fd.total: total number of parts to be received
>>
>> The UI will do something like:
>>
>> fd.total = round(fd.size / 10MB)
>> transfered = 0
>> part = 0
>>
>> while part < fd.total:
>>     fd.file = read more 10MB of the file
>>     fd.part = part
>>     POST POST /storagepools/<pool>/storagevolumes/ {file: fd}
>>     fd.part++
>>
>> On backend:
>> if os.path.exists(filepath) and fd.part = 0:
>>     raise InvalidParemeter("file already exists")
>>
>> localfile = open(filepath, a)
>> localfile.seek(fd.part * 10MB)
>> localfile.write(fd.file)
> What's the problem here for large files? 

I wouldn't say 900MB is a large file.

> Seems your solution will introduce lots of requests. I tried a large 
> ISO file and the window was not closed and finally the request timed out.

Yes - it will require more requests but I can't see other solution on it.
Ideas?

>>
>>>
>>> On 09/12/2014 06:42 AM, Hongliang Wang wrote:
>>>> Implemented download remote image feature.
>>>>
>>>> v1 -> v2:
>>>>    2a) Disabled add volume for inactive and iscsi/scsi pools
>>>>        (Aline's comment)
>>>>
>>>>    2b) Removed progress bar after upload/download finished
>>>>        (Aline & Cristian's comment)
>>>>
>>>>    2c) Changed the button label to "Add" from "OK"
>>>>        (Cristian's comment)
>>>>
>>>>    2d) Made add volume button behave correctly (enabled/disabled)
>>>>        (Cristian's comment)
>>>>
>>>>    2e) Removed some code redundent
>>>>        (Aline & Cristian's comment)
>>>>
>>>> Hongliang Wang (4):
>>>>    Storage Pool Add Volume UI: Add APIs to kimchi.api.js
>>>>    Storage Pool Add Volume UI: Add i18n Strings
>>>>    Storage Pool Add Volume UI: Implement Download/Upload Volume 
>>>> Function
>>>>    Storage Pool Add Volume UI: Connect the Feature in Storage Tab
>>>>
>>>>   ui/css/theme-default/storage.css                |  31 ++-
>>>>   ui/css/theme-default/storagepool-add-volume.css |  36 ++++
>>>>   ui/js/src/kimchi.api.js                         |  37 ++++
>>>>   ui/js/src/kimchi.storage_main.js                | 116 ++++++++++-
>>>>   ui/js/src/kimchi.storagepool_add_volume_main.js | 243 
>>>> ++++++++++++++++++++++++
>>>>   ui/pages/i18n.json.tmpl                         |   4 +
>>>>   ui/pages/storagepool-add-volume.html.tmpl       |  80 ++++++++
>>>>   ui/pages/tabs/storage.html.tmpl                 |  12 +-
>>>>   8 files changed, 549 insertions(+), 10 deletions(-)
>>>>   create mode 100644 ui/css/theme-default/storagepool-add-volume.css
>>>>   create mode 100644 ui/js/src/kimchi.storagepool_add_volume_main.js
>>>>   create mode 100644 ui/pages/storagepool-add-volume.html.tmpl
>>>>
>>>
>>> _______________________________________________
>>> Kimchi-devel mailing list
>>> Kimchi-devel at ovirt.org
>>> http://lists.ovirt.org/mailman/listinfo/kimchi-devel
>>>
>>
>




More information about the Kimchi-devel mailing list