Cloud Scheduler 调用的 GCP Cloud 运行 应用程序的当前最大超时是多少

What is the current maximum timeout for a GCP Cloud Run app invoked by Cloud Scheduler

我正在考虑使用 Cloud Scheduler 触发 Cloud 运行 上 python 应用程序的日常执行。该应用从第三方 API 提取数据并将其插入 BigQuery。唯一的问题是,根据我读过的许多文章,Cloud 运行 有 15 分钟的执行时间限制,这可能太短了。

查看 Cloud 运行 文档:https://cloud.google.com/run/quotas#cloud_run_limits 似乎建议最长执行时间为 60 分钟。

哪个是正确的?云 运行 事实上 运行 最多可以处理 60 分钟吗?如果该过程花费的时间超过 30 分钟,我使用 Cloud Schedular 触发 Cloud 运行 时可能会遇到任何问题吗?

写入:

Which is correct?

目前它在这里说:https://cloud.google.com/run/docs/configuring/request-timeout那个:

 The timeout is set by default to 5 minutes and can be extended up to 60 minutes.

写入:

Can cloud run in fact run processes up to 60 minutes? and am I likely to have any issues using Cloud Schedular to trigger Cloud run if the process takes longer than 30 minutes?

目前它在这里说:https://cloud.google.com/run/docs/configuring/request-timeout那个:

 Important: For a timeout longer than 15 minutes, Google recommends implementing retries and making sure the service is tolerant to clients re-connecting in case the connection is lost (either by ensuring requests are idempotent, or by designing request handlers in such a way that they can resume from the point where they left off). The longer the timeout is, the more likely the connection can be lost due to failures on the client side or the Cloud Run side. When a client re-connects, a new request is initiated and the client isn't guaranteed to connect to the same container instance of the service.

这是一个常见问题:您可以使用云 运行,它可以 运行 最多 60 分钟的超时作业,但可以触发它的无服务器产品限制更多(云为 30 分钟调度程序,PubSub 需要 10 分钟)。

如果您不想使用 Cloud Scheduler 执行重试,您可以简单地调用您的 Cloud 运行 服务,仅此而已。 Cloud Scheduler 将认为调度失败(超时),但 Cloud 运行 上的进程将继续(如果 Cloud Scheduler 客户端停止侦听应答)。

如果您想要处理错误和重试,或者如果您想要在 Cloud Scheduler UI 中显示“成功”状态,解决方案是使用 Cloud Workflow。工作流程非常简单:使用参数调用 API(如果适用)。那么这里的过程:

终于,你有了它,没有优化,但它有效。

  1. Cloud 运行 默认超时为 5 分钟

  2. 您可以通过在 gcloud run deploy

    中指定 --timeout 标志来增加它
  3. 如果超时时间超过 15 分钟,则必须使用 gcloud beta run deploy

如果您尝试使用 gcloud run deploy 超时超过 15m,您将收到以下错误 - Timeout duration must be less than 15m. Timeouts above 15m are in Beta. Use "gcloud beta run ..."