-
Notifications
You must be signed in to change notification settings - Fork 293
Issue with serverless deploy, requirements.txt not found #106
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
Comments
You should keep your |
im using mac os x |
Check your shared drives in the docker for Mac settings.
|
I'm having the exact same issue as @manav95. I'm using default docker image on debian jeesie |
Just thought of something it might be.. Add this to your RUN mkdir /var/task
WORKDIR /var/task |
I'm hitting this too. Runs perfectly locally (OSX) but when using Codeship and the following Dockerfile:
Then when I run |
I have the same problem. Also when I am trying to pull image inside the
I got:
I am running via |
I get this error too when I try using the plugin on CircleCI to automate deployment. I don't use any custom Docker images but circleci/python:3.6.4. The plugin configuration I use is as follows: plugins:
- serverless-python-requirements
custom:
pythonRequirements:
dockerizePip: true And yes, everything runs perfectly on my local machine which runs macOS. |
I've been playing with this a bit more and there's definitely something about running the pip install through docker, from within another docker. I guess one way to get around this would be to run the pip install command without docker, given we're already within a docker container - as long as the host docker is the right kind to build the package for lambda. If there was an extended version of https://github.com/lambci/docker-lambda/tree/master/python3.6 that we could use to run |
@thesmith Yes, this is the current workaround I use. Thank you for posting it – can be useful for other users who are hitting this issue. |
So this Dockerfile seems to be working, obviously dockerizePip has to be false:
Annoyingly this means you have to flip dockerizePip between deploying via CI and locally. |
Ah. yeah I'll ahve to check docker-in-docker out at some point. Re this @thesmith:
You an do something like: custom:
pythonRequirements:
dockerizePip: ${self:custom.isCI.${env:CI}, self:custom.isCI.false}
isCI:
true: true
false: non-linux (this assumes you have a |
@thesmith How do you use this Dockerfile in order to have circleci working ? I am a bit lost... thanks ! |
@tgensol FWIW it's Codeship, not CircleCI. On Codeship Pro, the install / deploy process is itself run in a docker image built using that Dockerfile (with dockerizePip set to false). |
We have the same problem. I can package and deploy from Mac but the build fails on AWS.
Error log on AWS:
Our
And our dependencies defined in
I also tried appending the following config to the
UpdateAdding a Pipfile and Pipfile.lock to the root of my repository along with installation of |
@mehdisadeghi no clue. but to be honest I wouldn't expect serverless-package-python-functions & serverless-python-requirements to work together. I don't think serverless-package-python-functions is necessary since this plugin gained the same functionality. |
@dschep thanks for the tip! I'll give it a try and if it works without |
I had this issue as well - or a similar one, anyway - running inside Gitlab CI (docker-in-docker) with
and I accidentally stumbled upon a workaround. I was already going to start using download and static caching, and I wanted the cache dir to be inside my custom:
pythonRequirements:
dockerizePip: true
useDownloadCache: true
useStaticCache: true
cacheLocation: ./.serverless/.requirements_cache And, lo and behold, that also fixed the packaging issue. If you notice above, the plugin is trying to map a
My guess is that the Gitlab CI runner disallows this or interferes with it somehow, because when I set
which works perfectly. This could also be because the |
@brettdh the cache location shouldn’t be inside of the .serverless folder as that folder is temporary in nature and nothing would ever cache there. It might work I’ve never actually tested in there but that’s my first gut instinct. Can you maybe pastebin more of your full serverless config and your gitlabci file and I’ll take a look? |
What does this mean? Is the folder cleared out before every deploy? I can just as easily (I think) put it in my project's root dir alongside
So far so good :) But like I said, I'm curious as to what the danger might be. I'll try to put together a minimal repro project on gitlab.com when I get a chance. |
The serverless framework deletes that folder and recreates it every time you deploy, defeating the purpose of cache completely is what I mean. |
Yep, that'd be a good reason to move it out 😅 Thanks for the tip! |
Update: |
I think the fix would be an option to use |
@thesmith or @avli When I try dockerizePip false I run into the lambda limit error, which is not good. Even when I use slimming. Any clarification would be great here. |
Getting the same issue to @chubzor, any news on a fix. |
@alexcallow I ended up using this: We abandoned deploying via local dev machines, and this worked for us when deploying with circleCI. I think we are hanging by inside of some size limit so this is not sustainable, but could be helpful for you. |
If you have
Related code: |
I'm encounter this as well when trying to use CircleCi, my executor is
which I belive means im doing docker-in-docker. It seems this command is mounting "It's not possible to use volume mounting with the docker executor, but using the machine executor it's possible to mount local directories to your running Docker containers. " I switched from docker-in-docker:
to Machine:
And it ran successfully. Note: CircleCi warns that machine executors may become a premium feature in the future. |
This thing! pyproject.toml... |
I bumped to this issue as well with macOS and minikube as docker platform. The problem was that the
And after that the plugin was able to generate the requirements and the build worked. |
I have the following serverless.yml:
and the requirements.txt:
I am using this Dockerfile to compile dlib and boost:
When I run serverless deploy, I get the following error:
I have no idea why this is happening. I have the requirements.txt under .serverless in my local directory and it looks fine. Does anyone know why this is happening?
The text was updated successfully, but these errors were encountered: