You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I've recently switched from using Zappa to handle the entire deployment, to using a Docker container.
The documentation links to https://ianwhitestone.work/zappa-serverless-docker/ for further details of how this works and how to use it. That article says "Our zappa_settings.json is pretty minimal, and no different from the zappa_settings you’re used to. The only thing worth mentioning is you don’t need to specify a Python runtime since that will be set in the Docker image."
What I have discovered, however, is that if the Zappa settings file specifies slim_handler then the exported Python settings file includes a value for ARCHIVE_PATH which, in turn, means that when the Lambda fires up, the handler checks for ARCHIVE_PATH and, if it is defined, tries to load the archive from S3.
That archive is left behind if you undeploy/deploy ... and it also means that the handler loads what could be old code.
I only discovered this by undeploying, completely wiping everything out, re-deploying and then getting handler errors in CloudWatch because it couldn't load the archive. I then had to dig into the source code to figure out why there was an ARCHIVE_PATH being set.
There are a couple of improvements I would suggest:
When deploying/updating with -d, check the settings file for any settings that could get in the way of a Docker deployment.
When undeploying, remove the archive from the S3 bucket.
Update the documentation to make it clearer which settings should NOT be used if deploying with Docker.
Thank you :)
The text was updated successfully, but these errors were encountered:
Hi there! Unfortunately, this Issue has not seen any activity for at least 90 days. If the Issue is still relevant to the latest version of Zappa, please comment within the next 10 days if you wish to keep it open. Otherwise, it will be automatically closed.
I've recently switched from using Zappa to handle the entire deployment, to using a Docker container.
The documentation links to https://ianwhitestone.work/zappa-serverless-docker/ for further details of how this works and how to use it. That article says "Our zappa_settings.json is pretty minimal, and no different from the zappa_settings you’re used to. The only thing worth mentioning is you don’t need to specify a Python runtime since that will be set in the Docker image."
What I have discovered, however, is that if the Zappa settings file specifies
slim_handler
then the exported Python settings file includes a value forARCHIVE_PATH
which, in turn, means that when the Lambda fires up, the handler checks forARCHIVE_PATH
and, if it is defined, tries to load the archive from S3.That archive is left behind if you undeploy/deploy ... and it also means that the handler loads what could be old code.
I only discovered this by undeploying, completely wiping everything out, re-deploying and then getting handler errors in CloudWatch because it couldn't load the archive. I then had to dig into the source code to figure out why there was an
ARCHIVE_PATH
being set.There are a couple of improvements I would suggest:
-d
, check the settings file for any settings that could get in the way of a Docker deployment.Thank you :)
The text was updated successfully, but these errors were encountered: