Using google cloud function to spawn a python scri

2019-01-14 19:19发布

问题:

I need to execute some python machine learning code and was hoping to execute it from a node process within a Google Cloud Function.

I want to use node because I have some firebase admin tasks I want to run afterwards. I also have a deployment workflow with node that I'm content with.

Is this possible? If so, can you point me to an example?

回答1:

Yes, this would be possible, you probably need to use http://www.pyinstaller.org/ to package the python code. Have a look at my python library for actually writing your functions in python to do it, or just copy paste whatever parts you need to do it yourself: https://github.com/MartinSahlen/cloud-functions-python/