Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Package size over limit #2234

Open
afcode123 opened this issue Dec 17, 2021 · 0 comments
Open

Package size over limit #2234

afcode123 opened this issue Dec 17, 2021 · 0 comments

Comments

@afcode123
Copy link

Context

I haven't deployed or built my zappa project in a while and now that I tried to deploy it yesterday the package size was three times larger than before (before: 33MB, and now 91MB), even though I had not made any changes to the project. I am deploying the project with bitbucket pipelines. The only change was that previously I was using virtualenv<=20.7.2 and now I used 20.10.0 so if I change the pipeline's virtualenv install to
pip install virtualenv==20.7.2 everything works correctly again.
I am thinking that it may be because zappa includes .virtualenv folder, since the package contains packages such as panda and numpy which are not in my requirements file.

using image: python:3.7.3
My pipeline looks the following:

pipelines:
  custom:
    dev:
      - step:
          deployment: Dev
          caches:
            - pip
          script: 
            - pip install virtualenv
            - virtualenv --python=python3 env
            - source env/bin/activate
            - pip install -r requirements.txt
            - zappa update dev

Expected Behavior

Serverless package should be a lot smaller and not contain packages from .virtualenv/

Actual Behavior

Serverless package inlcudes packages that are not in requirements file such as panda and numpy. (Maybe because of virtualenv is included?). Did not happen when using virtualenv==20.7.2 but happens in 20.10.0

Possible Fix

Your Environment

  • Zappa version used:-0.52.0 but happens also in 0.54.1
  • Operating System and Python version: image: python:3.7.3 in bitbucket pipelines
  • Your zappa_settings.json:
{
  "dev": {
    "aws_region": "us-east-1",
    "django_settings": "project.settings",
    "profile_name": "default",
    "project_name": "<name>",
    "runtime": "python3.7",
    "s3_bucket": "<bucket>",
    "timeout_seconds": 360,
    "api_key_required": true,
    "api_key": "<api key>",
    "cors": true,
    "events": [
      {
        "function": "<function>",
        "expression": "rate(1 hour)"
      }
    ]
  }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant