Description
The python with packages example demonstrates using sam local with a bundle.zip. Hot-reloading still "works" in that if the bundle.zip changes it will reload the contents, but there's still a lengthy build time for each change.
If I simply delete the bundle.zip hot reload of the python files appears to work. I haven't tracked down why, but I assume it has to do with the default value from --static-dir pointing at where my functions live.
I'd be satisfied with putting logic into the template like CodeUri: !If [EnvRunningLocal, ., bundle.zip], but #194 documents how that's failing for me. I can imagine other ways to solve this, but I know very little about this project so I'm hesitant to ask for specific implementations. I'd just like to have some way of having hot reload work on python files even when the final target is a zip.
#featurerequest
Activity
heitorlessa commentedon Nov 13, 2017
Hey,
I haven't used this example yet but I've been primarily using a similar Makefile and making use of "hard links" and
"/dev"sub-folder with all dependencies installed in order to allow for hot-reloading, so I don't have to create a task runner for this.Cons is that at the moment it's only linking *.py files in the
servicefolder and not taking into account sub-folders/python local packages - Something that can be addressed with some shell script.If that helps here's an
excerpt of the Makefileuntil I do have more time to invest in this and test some edge cases:Folder struct
. ├── Makefile ├── setup.cfg ├── template.yaml └── users ├── devtedbrandston commentedon Nov 15, 2017
hmm, that's interesting. I might try to set that up here, though at this point I'm not feeling too bothered by the 're-bundle then test' workflow. I feel like I've spent more time trying to configure this for 'efficient local testing' than I have actually building my application.
heitorlessa commentedon Dec 4, 2017
@tedbrandston I put that one up here: https://github.com/heitorlessa/sam-local-python-hot-reloading
I still need to write some proper README but you'll get the idea quickly - If you simply try "make" you'll be given a common usage that should deal with most use cases.
Once I worked on that Makefile I simply spend no more time in the configuration piece now as that even includes my local packages (e.g. vendor/something).
sanathkr commentedon May 31, 2018
#435 started an excellent discussion/PR around this feature
[-]Hot reloading is less useful when dealing with bundle.zip[/-][+]Hot reloading for Python Lambda functions[/+]sriram-mv commentedon Oct 5, 2020
@tedbrandston Is this the same case as of today? Are you running into similar issues today. I'm going to close this issue for now, but feel free to open a new issue with latest steps to reproduce this.
Thanks!