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

[cli] refactor the LambdaPackage to use setuptools for function management #1156

Open
ryandeivert opened this issue Feb 22, 2020 · 0 comments

Comments

@ryandeivert
Copy link
Contributor

related to: #1153

Background

The current LambdaPackage class has a fairly janky method of managing dependencies and creating deployment packages.

Proposal

  • Add a setuptools setup.pyto each streamalert/<function>/ directory (where <function> is a directory for any lambda function code)
    • Note: this might require a change to the folder structure. Alternatively, we could create a lambdas directory or something similar that just implements the handlers and imports code from other packages (?)
  • Have the setup.py for each lambda function define the required libraries needed. We would also specify data_files for setuptools to include config/etc. This all is currently done in a jank way here:
    package_files = {
    'conf',
    'streamalert/__init__.py',
    'streamalert/classifier',
    'streamalert/shared',
    }
    package_name = 'classifier'
    package_libs = {'jmespath', 'jsonlines'}
  • Use pip to install from each function's setup.py to target install to a directory.
  • Remove the "zipping" logic we currently have for creating the archive in favor of using the archive_file feature in Terraform.

Note

This would require(?) the use of vagrant for installing via pip. See #1153

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant