chalice icon indicating copy to clipboard operation
chalice copied to clipboard

Suggestion: key for rebuilding package on "deploy"

Open vfilimonov opened this issue 3 years ago • 4 comments

Often on the deploy chalice uses existing package:

Creating deployment package.
Reusing existing deployment package.
Updating lambda function: ....

What are the conditions on which the package is reused? I presume that it checks if the requirements.txt is changed?

It is possible to have local package in the requirements.txt, which is installed internally in editable mode (pip install -e .). In this case when the code of the library is changed, chalice will still reuse existing package on deployment. Same would happen if requirements.txt points to a branch in git repo.

It would be great if there was an option to force-rebuild package on deploy to cope with such cases.

vfilimonov avatar Dec 28 '20 09:12 vfilimonov

What are the conditions on which the package is reused?

It'll depend on if you're using automatic layers or not. If you're using the default of a single combined layer, then it's a combined has of the requirements.txt file along with all the app.py, chalicelib/ and vendor/. Otherwise, it's requirements.txt and vendor/ for the base layer and app.py and chalice/ for the app layer.

I agree a force option would be nice, I thought we had an existing feature request for it, but I'm not able to find it.

jamesls avatar Jan 07 '21 21:01 jamesls

Thanks, @jamesls

On those files/directories - Do I understand correctly that chalice compares actual hashes of the content and not modification times?

vfilimonov avatar Jan 08 '21 07:01 vfilimonov

@jamesls Chiming in here, as I'm getting this message a lot, even when I've made changes to app.py. Did the --force idea come to anything?

tdwright avatar Feb 27 '23 22:02 tdwright

Thanks, @jamesls

On those files/directories - Do I understand correctly that chalice compares actual hashes of the content and not modification times?

I think yes. By modifying a file I am able to rebuild the package without issue.

BPDanek avatar Dec 28 '23 14:12 BPDanek