如何为AWS Lambda层安装Python软件包

本文介绍了如何使用Docker简化在AWS Lambda层中安装Python软件包,如Pandas和Numpy的过程。文章通过五个简单步骤:建立、运行、安装、包装和上传,详细阐述了如何避免在非Amazon Linux环境下编译C或C++扩展的复杂性,以创建和上传Lambda层。
摘要由CSDN通过智能技术生成

Lambda及其层 (Lambda and its Layers)

When I first heard about AWS Lambda I was quite confused about what it was and tried to use it to train a simple ML model but was hit with a hard 5 minutes execution limit. Fast-forward a few years, I believe Lambda has evolved a lot and so have people’s understanding of event-driven systems and serverless compute. It has become part of many modern applications and data architects.

当我第一次听说AWS Lambda时,我对它的含义感到非常困惑,并试图使用它来训练一个简单的ML模型,但是受到5分钟硬执行限制的打击。 几年过去了,我相信Lambda取得了长足的发展,人们对事件驱动系统无服务器计算的理解也是如此。 它已成为许多现代应用程序和数据架构师的一部分。

At re:Invent 2018, Lambda was heavily buffed with custom runtime and an increase in execution runtime limit to 15 minutes. Lambda Layers was also released which allowed you to share common dependencies to ease lambda deployment size and updates. However, AWS still hasn’t addressed the needs of friendly steps to bring in non-native python packages such as Pandas.

re:Invent 2018上 ,Lambda大量沉迷于自定义运行时并将执行时运行时间限制增加到15分钟。 Lambda Layers也已发布,它使您可以共享常见的依赖项,以简化lambda部署的大小和更新。 但是,AWS仍未解决引入非本地python软件包(例如Pandas) 的友好步骤需求

引入外部软件包的麻烦方法… (The troublesome approaches to bringing in external packages…)

Currently, you either have to zip up your Lambda function and Linux compatible dependencies, or upload your dependencies as a Lambda Layers. If you’ve played around with Google Cloud Functions and Azure Function before then you would know that it can be as easy as to writing a wish list in the requirements.txt.

当前,您要么压缩您的Lambda函数和与Linux兼容的依赖项,要么将您的依赖项作为Lambda图层上载。 如果您以前玩过Google Cloud Functions和Azure Func

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值