Skip to content

Add support for packed modules to keep deployments <250mb #38

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

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

sean-r-williams
Copy link

@sean-r-williams sean-r-williams commented Jun 24, 2025

Issue #, if available:
Related to #37.

Description of changes:
This PR adds support for customers to deploy compressed archives of modules, then unpack them at runtime. This provides a compelling option for customers with large sets of dependent modules, who would otherwise be constrained to 250MB minus the size of the PowerShell runtime (currently ~172 MB runtime size --> 78 MB dependency size).

Two forms of compressed dependencies are supported:

  1. Module archives: A ZIP file, named modules.zip. The contents of this archive are unpacked to a subdirectory of /tmp as-is. This format assumes someone's zipping a folder in $env:PSModulePath (or somewhere they saved several modules into) and trades layer support/reproducability for better compression ratios.
  2. Module packages: A collection of .nupkg files, in a subdirectory named module-nupkgs. These packages are "saved" (installed) to a subdirectory of /tmp via PSResourceGet. This should broadly align with the ideas behind Lambda's layer architecture, and allows for direct package usage (as a binary, without unpacking/etc.) off a given NuGet feed.

Both forms of dependencies:

  • Can be used interchangeably or simultaneously.
  • Pull from /opt/ (for layers) or $env:LAMBDA_TASK_ROOT (for function packages).
    • The latter should take precedence.
  • Extract to separate subdirectories of /tmp, to minimize chances of module packaging formats conflicting with each other.

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

@sean-r-williams
Copy link
Author

N.B.: Marking this as draft while I run some tests locally - definitely open to feedback/review while I'm doing this, however.

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

Successfully merging this pull request may close these issues.

1 participant