Closed IsmaelGSerrano closed 3 years ago
hey @IsmaelGSerrano I haven't been able to reproduce this yet, is it possible for you to push your sample broken function to a public github repo so that I can take a look at it? I know the sample is pretty simple, but perhaps there must be some step that we are doing differently and the shared repo will help reduce that.
hey @IsmaelGSerrano I haven't been able to reproduce this yet, is it possible for you to push your sample broken function to a public github repo so that I can take a look at it? I know the sample is pretty simple, but perhaps there must be some step that we are doing differently and the shared repo will help reduce that.
Hi @LucasRoesler, Thank you for answering, I created this repo: https://github.com/IsmaelGSerrano/hello-openfaas
Hi @IsmaelGSerrano i am a little confused, that repo you posted is not quite the pydatascience template, since you hacked in the basic auth stuff, (makes em wonder if there is a nice way to expose this kind of "add additional middlewares" without forking the template, but that is a side note/idea).
But I looked through it and the docker template is almost the same (one small extra conda install that I would love to know why it was required instead of adding it to the handler's requirements.txt)
I then built and ran the function without any issues
$ curl localhost:8080 -d "example.com"
Hi, you said: b'example.com'. Random number = [ 0.98218931 0.34564669 0.39562981 0.04804355 0.63363297 0.88951796
0.33120779 0.92167527 0.50666615 0.3265648 ]
So the image is fine, it seems.
I should note that I took the time to update the pydatascience template to add unit testing during builds, so there might be a few more tweaks you want port https://github.com/LucasRoesler/pydatascience-template the repo now includes two non-trivial functions that build and have tests that pass, so I feel pretty confident that the template is doing what it should.
So the next thing to look at is how your are deploying it. Can you share instructions for how you created your openfaas cluster so that I can try replicating that too? Thanks
Hi @LucasRoesler, yes you are right, I was using another fork of pydatascience. I did not notice that till now, a colleague used this code before me. Now, the function works fine with just the original pydatascience template and I have included the flask authorization feature with no issues. I really do not know what could be the initial problem, but it's solved. Thank you @LucasRoesler for your help.
What would you like to let us know?
I have a problem with dependencies.
function folder:
This is my configuration file:
handler.py:
requirements.txt:
This is the build output:
What's wrong?
When I run the function with invoke:
Why the module is not found?