官术网_书友最值得收藏!

Package

Zappa provides a command to generate a build package archive locally without deploying the application:

$ zappa package production

When you run this command, Zappa automatically packages your active virtual environment into an AWS Lambda compatible package.

Internally, it replaces any local dependencies with AWS Lambda compatible, precompiled versions. These dependencies are included in the following order:

  • Lambda compatible many Linux wheels from the local cache
  • Lambda compatible many Linux wheels from PyPi
  • Lambda-specific versions from Lambda packages (https://github.com/Miserlou/lambda-packages)
  • Archive the active virtual environment
  • Archive the project directory

While processing, packaging, and packing, Zappa ignores some unnecessary files such as .pyc files. If they are available, then .py will get ignored. Zappa also sets the correct execution permissions, configures package settings, and creates a unique, auditable package manifest file.

The generated package archive will be Lambda compatible. You can set a callback function that will be invoked once the archive is created:

{
"production": {
"callbacks": {
"zip": "my_app.zip_callback"
}
}
}

Here, production is your stage name and under callback, you can set the callback method by mapping to "zip". This can help you write your own custom deployment automation.

We have seen the basic uses of Zappa. Now it's time to do some practical work. We are going to build some Python application developments with Zappa, so stay tuned!

主站蜘蛛池模板: 宝坻区| 西充县| 博客| 金山区| 鄱阳县| 聊城市| 德保县| 五华县| 札达县| 昭通市| 仁怀市| 宜都市| 青田县| 仁布县| 那坡县| 香港 | 遂昌县| 兴山县| 贵德县| 永新县| 武威市| 唐海县| 灵山县| 临洮县| 北票市| 宜阳县| 宽甸| 隆德县| 梅河口市| 凌云县| 临沭县| 岳阳市| 珠海市| 通山县| 武乡县| 沙河市| 邯郸市| 昭苏县| 武汉市| 淮安市| 翁牛特旗|