serverless-python-requirements icon indicating copy to clipboard operation
serverless-python-requirements copied to clipboard

Redeploy doesn't work when using docker

Open misogihagi opened this issue 3 years ago • 2 comments

https://github.com/UnitedIncome/serverless-python-requirements/blob/master/lib/pip.js#L546 This skips docker-container image rebuilding process.

I will post the pull request that allows rebuild mechanism judging from modification time .

or adding rebuild force option should be good? like

custom:
    pythonRequirements:
     dockerRebuild: true

misogihagi avatar Dec 04 '20 08:12 misogihagi

@misogihagi Thank for for reporting this issue and providing a PR. I just wanted to add a bit more color to the situation, and provide a work around until issue is addressed.

When dockerizePip is enabled, it really only has effect on:

  • new builds
  • or when python requirements are modified

This is quite counter intuitive; as, when one makes altercation to Dockerfile one expects those changes to be deployed/packaged. However serverless-python-requirements will re-use previously build container image ignoring intents of the user.

Possible work-arounds until issue is resolve via an approach such as the one suggested by @misogihagi:

  • set useStaticCache to false. While this resolved the issue it also affects build performance.
  • modifying requirements on build to force it to re-build container

IlyaSukhanov avatar May 15 '21 20:05 IlyaSukhanov

dockerRebuild: true doesn't seem to be working for me... :(

shaunc avatar Feb 04 '22 04:02 shaunc