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
Improve Lambda packaging #986
Improve Lambda packaging #986
Conversation
What do you think of this approach, @kapilt? |
Blorg. Drone why u no like? Marking wip ... 😞 |
i sanity checked the server (was curious about memory error raised), but it does appear to be specific to this pr. |
Rebased, was 35e03a769e6bb876c37c5d0bd8e1152cca99c8e5. |
Ready for review, @kapilt ... |
c7n/mu.py
Outdated
f_path = os.path.join(root, f) | ||
dest_path = os.path.join(arc_prefix, f) | ||
self.add_file(f_path, dest_path) | ||
venv_lib_path = os.path.dirname(ipaddress.__file__) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this should not be hacked into the middle of an generic function, let's try to localize this to custodian_archive
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done in 691592f.
Rather than guessing where library dependencies reside, just sniff an actual dependency. Hopefully this provides the greatest portability?
This test manually creates a `PythonPackageArchive`, and thus it benefiteth not from the "aggressive shrinking" of `custodian_archive`. Here we can be even more aggressive.
We want to keep mu decoupled from custodian as much as we can. This commit replaces the virtualenv_dir parameter of PythonPackageArchive with lib_paths, since the former was only used for computing venv_lib_paths anyway. Effectively then we are pushing the responsibility for computing lib_paths up to the caller.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm, thanks
looks like this ended up breaking other library users of mu including mailer. |
😞 |
Proposed fix for #193. Rather than guessing where library dependencies reside, just sniff an actual dependency. Hopefully this provides the greatest portability?