【问题标题】:Google Cloud Run not streaming pipe | commandsGoogle Cloud Run 不是流式传输管道 |命令
【发布时间】:2021-12-13 10:55:22
【问题描述】:

我有一台 Google Cloud Run 服务器,将大型文件从 FTP 服务器下载到 Google 存储中。 这些文件不适合 Cloud Run 的内存,所以我尝试流式传输它们

wget -nv -O - --ftp-user=my_user --ftp-password=******* 
ftp://lotofdata.com//big_file.txt.gz 
| gzip -d
| mbfuffer -q  -m 50M
| gsutil cp - gs://my_bucket/big_file.txt.gz 

流在我的 MacBook 上完美运行,但在 Cloud Run 上失败。 从日志来看,管道似乎没有流在那里,它正在尝试按顺序执行命令。 Cloud Run 的操作系统有什么特别之处吗? 我正在使用 Docker python:3.7.4-slim-buster

【问题讨论】:

  • 容器是否在您的 MacBook 上运行?使用您的容器 Dockerfile 和应用程序编辑您的问题。如果您尝试使用 Cloud Run 运行批处理脚本,则会遇到问题。 Cloud Run 需要一个类似于简单网络服务器的 HTTP 请求/响应系统设置。看看像 Flask 这样的框架。

标签: python google-cloud-platform ftp streaming google-cloud-run


【解决方案1】:
  1. 如果您有来自 FTP 服务器的大文件,我认为您需要使用 根据您的要求,一个具有大内存大小的 VM 实例,然后运行您的脚本

  2. 或者可以将您的 FTP 服务器挂载到 VM,然后使用 gsutil

  3. 或者你需要增加云运行内存cloud run memory docs

  4. 如果您的 FTP 服务器托管在本地数据中心,请使用GCP storage transfer service

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2014-02-11
    • 2021-05-10
    • 2020-03-17
    • 2017-10-12
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多