简体   繁体   English

Cloud Run 的存储触发功能

[英]Storage trigger function with Cloud Run

I have written a Cloud Storage trigger in python.我用 python 编写了一个云存储触发器。 Due to conflicts in the version of certain packages, I need a way to add a timeseries model to the Cloud Storage trigger function.由于某些包的版本冲突,我需要一种方法将时间序列模型添加到 Cloud Storage 触发器函数。

Is it possible to add a docker image in a cloud storage trigger function written in python?是否可以在用python编写的云存储触发函数中添加docker镜像? The tutorials state that the containers can be triggered using service URL which is basically like a HTTP trigger.教程指出可以使用服务 URL 触发容器,这基本上类似于 HTTP 触发器。 Can be it be a Cloud Storage trigger?它可以是云存储触发器吗?

Cloud Functions doesn't support the deployment of custom docker images. Cloud Functions 不支持部署自定义 docker 映像。 Cloud Functions will internally build a docker image based on the code you deploy, and you can't influence how that image is built. Cloud Functions 将根据您部署的代码在内部构建一个 docker 镜像,您无法影响该镜像的构建方式。

If you want to handle a Cloud Storage event in a docker image, you will have to do something like this:如果要在 docker 映像中处理 Cloud Storage 事件,则必须执行以下操作:

  • Write a Storage trigger which forwards the event data to a Cloud Run endpoint编写将事件数据转发到 Cloud Run 端点的存储触发器
  • Build and deploy a docker image to Cloud Run which receives the event data from the function and does what you want构建一个 docker 镜像并将其部署到 Cloud Run,它从函数接收事件数据并执行您想要的操作

Or perhaps you just want to deploy a Cloud Run image that subscribes to a pubsub topic that delivers the Cloud Storage pubsub notification events to process.或者,您可能只想部署一个Cloud Run 映像,该映像订阅了一个发布订阅主题,该主题提供要处理的Cloud Storage 发布订阅通知事件

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

相关问题 如何使用云 function 触发数据流? (Python SDK) - How to trigger a dataflow with a cloud function? (Python SDK) 使用 pubsub 推送触发器运行云 function - Running a cloud function with a pubsub push trigger 使用云 function -python 在云存储中移动 object - moving object in cloud storage using cloud function -python 使用云存储中的云功能重写 csv 文件并将其发送到 BigQuery - Rewriting a csv file with cloud function from cloud Storage and send it to BigQuery Google-Cloud-Scheduler 因 http 触发 Cloud Function 失败 - Google-Cloud-Scheduler fail with http trigger Cloud Function 如何通过谷歌云函数触发云存储中的特定扩展文件 - How to Trigger particular extension file in cloud storage through google cloud functions 如何在谷歌云构建中运行 REST API 来构建触发器 - How to run REST API to build trigger in google cloud build 如何在特定文件集从谷歌云到达云存储时启动云数据流管道 function - how to launch a cloud dataflow pipeline when particular set of files reaches Cloud storage from a google cloud function 如何在 Google Cloud Function 中运行子进程? - How to run a subprocess inside Google Cloud Function? 将 json 密钥文件从云存储传递到 ServiceAccountCredentials 函数 - Pass json keyfile from cloud storage to ServiceAccountCredentials function
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM