Zappa icon indicating copy to clipboard operation
Zappa copied to clipboard

[Migrated] No way to override ZIP_EXCLUDES

Open jneves opened this issue 4 years ago • 2 comments

Originally from: https://github.com/Miserlou/Zappa/issues/1754 by youcandanch

Context

For some libraries like nltk, additional assets are required in order to run them. In this specific use case, we're using the wordnet resource for nltk, which requires a wordnet.zip file to be located somewhere in the filesystem. Ideally, we'd be able to download this dependency in CI, and include it with our zappa-deployed package, but ZIP_EXCLUDES automatically excludes anything with a .zip extension. This means that on every lambda creation, we'll need to download this file, as opposed to being able to do it once in CI.

Expected Behavior

There should be a way to override ZIP_INCLUDES with either specific file names or extensions.

Actual Behavior

There's no way to include a .zip file in the zappa package at the moment.

Possible Fix

Could go a couple different ways. This line in particular is where the problem is. The easiest way to handle this, I think, is to add a new property in zappa_settings.json, but I'm hung up on naming and implementation.

Steps to Reproduce

  1. Create a zappa project that has a .zip file as a dependency.
  2. Try to do zappa deploy.
  3. .zip file won't be present in the package.

Your Environment

  • Zappa version used: 0.47.1
  • Operating System and Python version: Debian Buster
  • The output of pip freeze:
#
# This file is autogenerated by pip-compile
# To update, run:
#
#    pip-compile --output-file requirements/development.txt requirements/development.in
#
argcomplete==1.9.3
atomicwrites==1.2.1       # via pytest
attrs==18.2.0             # via pytest
blinker==1.4
boto3==1.9.57
botocore==1.12.57
certifi==2018.11.29
cfn-flip==1.1.0.post1
chardet==3.0.4
click==7.0
coverage==4.5.2           # via pytest-cov
docutils==0.14
durationpy==0.5
flake8==3.6.0
flask==1.0.2
future==0.16.0
hjson==3.0.1
idna==2.7
itsdangerous==1.1.0
jinja2==2.10
jmespath==0.9.3
kappa==0.6.0
lambda-packages==0.20.0
markupsafe==1.1.0
mccabe==0.6.1             # via flake8
more-itertools==4.3.0     # via pytest
nltk==3.4
pip-tools==3.1.0
placebo==0.8.2
pluggy==0.8.0             # via pytest
py==1.7.0                 # via pytest
pycodestyle==2.4.0        # via flake8
pyflakes==2.0.0           # via flake8
pymysql==0.9.3
pytest-cov==2.6.0
pytest==4.0.1
python-dateutil==2.6.1
python-dotenv==0.10.0
python-slugify==1.2.4
pyyaml==3.13
requests==2.20.1
s3transfer==0.1.13
sentry-sdk[flask]==0.6.6
singledispatch==3.4.0.3
six==1.11.0
toml==0.10.0
tqdm==4.19.1
troposphere==2.3.4
unidecode==1.0.23
urllib3==1.24.1
werkzeug==0.14.1
wheel==0.32.3
wsgi-request-logger==0.4.6
zappa==0.47.1
  • Link to your project (optional):
  • Your zappa_settings.json:
{
    "staging": {
        "app_function": "application.app",
        "project_name": "my_project",
        "runtime": "python3.6",
        "s3_bucket": "our-zappa",
        "aws_region": "us-east-1",
    }
}

jneves avatar Feb 20 '21 12:02 jneves

Hi @jneves , any update on this? I desperately need to include a zip file in my deployment package but Zappa doesn't allow me to do so.

UsamaMehmood avatar Nov 25 '21 08:11 UsamaMehmood

You may want to try callbacks to define a custom function to pull your required zip from s3.

monkut avatar Jul 21 '22 07:07 monkut

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.

github-actions[bot] avatar Apr 03 '24 15:04 github-actions[bot]

Hi there! Unfortunately, this Issue was automatically closed as it had not seen any activity in at least 100 days. If the Issue is still relevant to the latest version of Zappa, please open a new Issue.

github-actions[bot] avatar Apr 13 '24 18:04 github-actions[bot]