简体   繁体   English

使用谷歌云函数生成python脚本

[英]Using google cloud function to spawn a python script

I need to execute some python machine learning code and was hoping to execute it from a node process within a Google Cloud Function. 我需要执行一些python机器学习代码,并希望从Google Cloud Function中的节点进程执行它。

I want to use node because I have some firebase admin tasks I want to run afterwards. 我想使用node,因为我有一些稍后要运行的firebase管理任务。 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? 如果是这样,您能指出一个例子吗?

Yes, this would be possible, you probably need to use http://www.pyinstaller.org/ to package the python code. 是的,这是可能的,您可能需要使用http://www.pyinstaller.org/来打包python代码。 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/ 看看我的python库,它实际上是用python编写函数来实现的,或者只是复制粘贴自己需要完成的任何部分: https : //github.com/MartinSahlen/cloud-functions-python/

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 在作为 Google Cloud Function 运行的 Python 脚本中使用 gcloud 命令时出错 - Error using gcloud command in Python script running as Google Cloud Function 在 Google Cloud Platform 上的 Google Cloud Function 中执行 Python 脚本时出错 - Error on executing Python script in Google Cloud Function on Google Cloud Platform 每当在谷歌云存储上创建指定文件时,我想使用云 function 触发 python 脚本 - I want to trigger a python script using a cloud function whenever a specified file is created on the google cloud storage 在 Python 中使用 API 创建 Google Cloud Function - Create Google Cloud Function using API in Python 如何使用 python 脚本提取多部分的 zip 文件以在 Google Cloud Function 中运行 - How to extract zip files with multi parts using python script to run in Google Cloud Function Python 谷歌云 Function - Python Google Cloud Function 使用 Python 和 SQLAlchemy 从谷歌云 Function 连接到云 SQL - Connecting to Cloud SQL from Google Cloud Function using Python and SQLAlchemy 如何在 Google Cloud Function 中将 Python 脚本作为子进程运行 - How to run a python script as a subprocess inside Google Cloud Function Google Cloud Function - Python 从 Webhook 获取数据的脚本 - Google Cloud Function - Python script to get data from Webhook 谷歌云上的 Python 脚本调度 - Python script scheduling on google cloud
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM