Generating ZIP files in azure blob storage

▼魔方 西西 提交于 2021-01-29 08:46:08

问题


What is the best method to zip large files present in AZ blob storage and download them to the user in an archive file (zip/rar) does using azure batch can help ? currently we implement this functions in a traditionally way , we read stream generate zip file and return the result but this take many resources on the server and time for users. i'am asking about the best technical and technologies solution (preferred way using Microsoft techs)


回答1:


There are few ways you can do this **from azure-batch only point of view**: (for the initial part user code should own whatever zip api they use to zip their files but once it is in blob and user want to use in the nodes then there are options mentioned below.)

For initial part of your question I found this which could come handy: https://microsoft.github.io/AzureTipsAndTricks/blog/tip141.html (but this is mainly from idea sake and you will know better + need to design you solution space accordingly)

In option 1 and 3 below you need to make sure you user code handle the unzip or unpacking the zip file. Option 2 is the batch built-in feature for *.zip file both at pool and task level.

  • Option 1: You could have your *rar or *zip file added as azure batch resource files and then unzip them at the start task level, once resource file is downloaded. Azure Batch Pool Start up task to download resource file from Blob FileShare

  • Option 2: The best opiton if you have zip but not rar file in the play is this feature named Azure batch applicaiton package link here : https://docs.microsoft.com/en-us/azure/batch/batch-application-packages

The application packages feature of Azure Batch provides easy management of task applications and their deployment to the compute nodes in your pool. With application packages, you can upload and manage multiple versions of the applications your tasks run, including their supporting files. You can then automatically deploy one or more of these applications to the compute nodes in your pool.

  • https://docs.microsoft.com/en-us/azure/batch/batch-application-packages#application-packages

An application package is a .zip file that contains the application binaries and supporting files that are required for your tasks to run the application. Each application package represents a specific version of the application.

  • With regards to the size: refer to the max allowed in blob link in the document above.

  • Option 3: (Not sure if this will fit your scenario) Long shot for your specific scenario but you could also mount virtual blob to the drive at join pool via mount feature in azure batch and you need to write code at start task or some thing to unzip from the mounted location.

Hope this helps :)



来源:https://stackoverflow.com/questions/58435521/generating-zip-files-in-azure-blob-storage

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!