lambda-packs Precompiled packages for AWS Lambda开源项目

我要开发同款
匿名用户2021年12月02日
166阅读

技术信息

行业分类
云计算
开源地址
https://gitee.com/baidu/Quanlse
授权协议
MIT License

作品详情

lambda-packs

PrecompiledpackagesforAWSlambda

Howtostarthttps://aws.amazo.com/lambda/adcreate/sigiitoaccoutLambda>Fuctios-CreatelambdafuctioBlakfuctioCofiguretriggers-NextCofigurefuctioRutime-Pytho2.7LambdafuctiohadleradroleHadler-service.hadlerRole-Createewrolefromtemplate(s)Roleame-testPolicytemplates-SimpleMicroservicePermissiosAdvacedsettigsMemory(MB)128Timeout1mi0secCodeetrytype-Uploada.ZIPfile-choosePack.zipfromrepTest->SaveadtestHowtomodifyModifyservice.pyfilefromsourcesfolderChooseallfilesisourcesfolderwhecompressig,do'tputitioefolderUploadzipfileofuctiopageCurretpacksSeleiumPhatomJSItro

SeleiumoPhatomJS.Ifact-aready-madetoolforwebscrapig.Forexample,thedemoowopesaradompageiWikipediaadsedsitsheader.(PhatomJSatthesametimedisguisesitselfasaormalbrowser,kowshowtologi,clickadfilloutforms)Alsoaddedrequests,soyoucadoAPIrequestsfordifferetresourcestodiscard/takeawaytheiformatio.

Usefulforwebtestigadscrapig.

Demo

Curretdemoopesradompagefromwiki(https://e.wikipedia.org/wiki/Special:Radom)adpritstitle.

Serverlessstartgitcloehttps://github.com/ryfeus/lambda-packs.gitcdlambda-packs/Seleium_PhatomJS/source/serverlessdeployserverlessivoke--fuctiomai--log

YoucaalsoseetheresultsfromtheAPIGatewayedpoitiawebbrowser.

Documetatio

https://seleium-pytho.readthedocs.io/

Pyresttest+WRKItro

Whatdoesthelambdahavetodowithit?IautshelloAWSioeregioyoucasimultaeouslyru200lambdas(moreifyouwritetosupport).Lambdaworksi11regios.Soyoucaruiparallelmoretha2000lambdas,eachofwhichwillcoductloadtestigofyourservice.Fivemiutesofsuchtestigwillcostjustoedollar.

Demo

Demoithispackagetriestosedrequeststogithub.comfor5secodswith1coectioadalsocoductpyresttestdummytest.

ToolsWRK(https://github.com/wg/wrk)-themaitoolforloadtestig.Itworkswithmultiplethreads,youcaspecifytheumberofcoectiosadlegthoftheload.Formorefie-tuig,youcauseLuaJITscripts(https://www.lua.org/).Pyrestest(https://github.com/svaoort/pyresttest)isahadytoolfortestigthefullpipelieoftheAPI.Forexample,theuserregisters,theusestheapikeytocreatetasks/makeotes/dowloadsfiles,thereadsthem,thedeletesthem.Documetatio

https://github.com/wg/wrk

https://github.com/svaoort/pyresttest

Lxml+requestsItro

PackageforparsigstaticHTMLpages.DifferecehereisthatitworksfasteradcosumeslessmemorythaPhatomJSbutislimiteditermswebsitesitcaparseadotherfeatures.

Serverlessstartserverlessistall-uhttps://github.com/ryfeus/lambda-packs/tree/master/Lxml_requests/source-lxml-requestscdlxml-requestsserverlessdeployserverlessivoke--fuctiomai--logBuildpackwgethttps://github.com/ryfeus/lambda-packs/blob/master/Lxml_requests/buildPack.shdockerpullamazoliux:latestdockerru-v$(pwd):/outputs--amelambdapackge-damazoliux:latesttail-f/dev/ulldockerexec-i-tlambdapackge/bi/bash/outputs/buildPack.shTools

Lxml3.7.1

Documetatio

https://lxml.de/

TesorflowItro

OpesourcelibraryforMachieItelligece.BasicallyrevolutioizedAIadmadeitmoreaccessible.Usigtesorflowolambdaisotasbadasitmaysoud-forsomesimplemodelsitisthesimplestadthecheapestwaytodeploy.

Demo

AshelloworldcodeIusedrecogitioofimagestraiedoimageet(https://www.tesorflow.org/tutorials/image_recogitio).Givethepricetaglambdaoeru(recogitioofoepicture)willcost$0.00005.Thereforeforadollaryoucarecogize20,000images.Itismuchcheaperthaalmostayalteratives,thoughcompletelyscalable(200fuctioscaberuiparallel),adcabeeasilyitegrateditocloudifrastructure.Curretdemodowloadsimagefromlik'imagelik'fromevetsource(ifempty-thedowloadshttps://s3.amazoaws.com/ryfeuslambda/tesorflow/imageet/cropped_pada.jpg)

Tools

Tesorflow1.4.0

Documetatio

https://www.tesorflow.org/tutorials/image_recogitio

Nightlyversio

Nightlyversioarchiveismoretha50MBisizebutitisstilleligibleforusigwithAWSLambda(thoughyoueedtouploadpackthroughS3).Formorereadhere:

https://hackeroo.com/explorig-the-aws-lambda-deploymet-limits-9a8384b0bec3

Serverlessstartserverlessistall-uhttps://github.com/ryfeus/lambda-packs/tree/master/tesorflow/source-tesorflowcdtesorflowserverlessdeployserverlessivoke--fuctiomai--logBuildpack

forPytho2:

wgethttps://raw.githubusercotet.com/ryfeus/lambda-packs/master/Tesorflow/buildPack.shwgethttps://raw.githubusercotet.com/ryfeus/lambda-packs/master/Tesorflow/idex.pydockerpullamazoliux:latestdockerru-v$(pwd):/outputs--amelambdapackge-damazoliux:latesttail-f/dev/ulldockerexec-i-tlambdapackge/bi/bash/outputs/buildPack.sh

forPytho3:

wgethttps://raw.githubusercotet.com/ryfeus/lambda-packs/master/Tesorflow/buildPack_py3.shwgethttps://raw.githubusercotet.com/ryfeus/lambda-packs/master/Tesorflow/idex_py3.pydockerpullamazoliux:latestdockerru-v$(pwd):/outputs--amelambdapackge-damazoliux:latesttail-f/dev/ulldockerexec-i-tlambdapackge/bi/bash/outputs/buildPack_py3.sh

Note:RememberYoushouldsetpytho3.6forAWSLambdafuctioeviromet.

LayerARN

ar:aws:lambda:us-east-1:339543757547:layer:tesorflow-pack

SklearItro

Packageforfasofmachielearig,buildigmodelsadthelike.Idoubtthatthereisamorecoveietwaytodeploymodeltotherealworld.

ToolsScikit-lear0.17.1Scipy0.17.0Documetatio

https://scikit-lear.org/

SkimageItro

Packageofimageprocessigtools,adotolytostyleimage,butalsoalargesetofcomputervisioalgorithms.

Therearecurretlytwozippedpacksavailable,Pack.zipadPack_omatplotlib.zip,youprobablywattousePack_omatplotlib.zip.Seehttps://github.com/ryfeus/lambda-packs/issues/5formoreiformatio.

Tools

Scikit-image0.12.3

Documetatio

https://scikit-image.org/

OpeCV+PILItro

Aotherpackageofimageprocessigtools,adotolytostyleimage,butalsoalargesetofComputervisioalgorithms.

ToolsOpeCV3.1.0PIL4.0.0Documetatio

https://pillow.readthedocs.io/

https://docs.opecv.org/3.0-beta/doc/py_tutorials/py_tutorials.html

PadasItro

Packageforfasofstatistics,datascietistsaddataegieers.RAMatlambdais1.5gigabytes,adthemaximumoperatigtime-5miutes.Iamsurethatwillbeeoughformosttasks.

Tools

Padas0.19.0

Documetatio

https://padas.pydata.org/

SpacyItro

OpesourcelibraryforNaturalLaguageProcessigipytho.

ToolsSpacy2.0.11Documetatio

https://spacy.io/

Example

ExamplecodeloadslaguagemodelfromS3adusesittoaalyzesetece.

TesseractItro

OCR(opticalcharacterrecogitio)libraryfortextrecogitiofromtheimage.

Documetatio

https://github.com/tesseract-ocr/tesseract

PDFgeerator+Microsoftofficefilegeerator(docx,xlsx,pptx)+imagegeerator(jpg,pg)+bookgeerator(epub)Itro

"Helloworld"codeipackagecreatesexampleofeverydocumet.Basicallytheselibsarelowmemory(lesstha128MB)adhighspeed(lesstha0.5secods)soit'ssomethiglike~1mdocumetsgeeratedper1$itermsofAWSLambdapricig.

Toolsdocx(pytho-docx-https://pypi.pytho.org/pypi/pytho-docx)xlsx(XlsxWriter-https://pypi.pytho.org/pypi/XlsxWriter)pptx(pytho-pptx-https://pypi.pytho.org/pypi/pytho-pptx)pdf(Reportlab-https://pypi.pytho.org/pypi/reportlab)epub(EbookLib-https://pypi.pytho.org/pypi/EbookLib)pg/jpg/...(Pillow-https://pypi.pytho.org/pypi/Pillow)Satelliteimageryprocessig(rasterio+OSGEO+pyproj+shapely+PIL)Itro

AWSLambdapackiPythoforprocessigsatelliteimagery.Basicallyiteablestodeploypythocodeiaeasyadcheapwayforprocessigsatelliteimageryorpolygos.I“helloworld”codeofthepackIdowloadred,gree,blueLadsat8badsfromAWS,makeTrueColorimageoutofitaduploadittoS3.Ittakes35secodsad824MBofRAMforitso~2500sceescabeprocessedfor1$.

ToolsRasterio(https://github.com/mapbox/rasterio0.36)OSGEO(https://trac.osgeo.org/gdal/wiki/GdalOgrIPytho)Pyproj(https://github.com/jswhit/pyproj)Shapely(https://github.com/Toblerity/Shapely)PIL(https://pillow.readthedocs.io/)PyTorch

Pytho3.6basedPyTorch

ToolsPyTorch1.0.1(CPU)torchvisio0.2.1IstalledPackages(deps)umpy-1.16.1pillow-5.4.1six-1.12.0torchvisio-0.2.1BuildPack#Youeed`docker`beforeru./build-with-docker.sh

功能介绍

lambda-packs Precompiled packages for AWS lambda How to start https://aws.amazon.com/lambda/ and ...

声明:本文仅代表作者观点,不代表本站立场。如果侵犯到您的合法权益,请联系我们删除侵权资源!如果遇到资源链接失效,请您通过评论或工单的方式通知管理员。未经允许,不得转载,本站所有资源文章禁止商业使用运营!
下载安装【程序员客栈】APP
实时对接需求、及时收发消息、丰富的开放项目需求、随时随地查看项目状态

评论