gpt4 book ai didi

google-app-engine - 部署在 Google App Engine 上的应用程序的/healthz 路由返回 404

转载 作者:行者123 更新时间:2023-12-03 21:10:20 24 4
gpt4 key购买 nike

/healthz 的 HTTP 请求部署在 Google App Engine 上的应用程序上的路由似乎没有到达 /healthz应用程序内的端点。
相反,一个 404页面被提供,显然来自 GCP 基础设施。
我可以知道如何覆盖此行为并使这些请求到达我的应用程序吗?
谢谢你。
enter image description here .
多一点背景:
我正在部署一个 Streamlit Google App Engine 上的应用程序。
Streamlit Web UI 似乎正在向 /healthz 发送请求端点定期,当这些请求失败时,Streamlit 应用程序停止工作并显示如下错误消息。
enter image description here

最佳答案

我设法以一种相当讨厌的方式解决了 healthz 冲突。我还启用了 session_affinity帮助处理 websocket 连接。
这是我的 app.yaml ,我将在下面解释 healthz 修复:

runtime: python
env: flex
# This is a horrible workaround to get streamlit working on app engine
# https://discuss.streamlit.io/t/has-anyone-deployed-to-google-cloud-platform/931/20
entrypoint: find ${VIRTUAL_ENV}/lib/python3.6/site-packages/streamlit -type f \( -iname \*.py -o -iname \*.js \) -print0 | xargs -0 sed -i 's/healthz/health-check/g' && streamlit run sim_v3.py --server.port $PORT --server.enableCORS=false

runtime_config:
python_version: 3

manual_scaling:
instances: 1

network:
session_affinity: true
入侵发生在入口点命令中。我在 python virtualenv 依赖文件夹中找到所有文件, site-packages ,即 .py.js并替换 healthzhealth-check如果您打算支持已部署的 Streamlit 应用程序,我建议您避免使用此解决方案。如果它会破裂
  • google python 运行时的python 版本变化
  • streamlit 进行更改以破坏此内联替换
  • google 决定更改其文件夹命名约定
  • 关于google-app-engine - 部署在 Google App Engine 上的应用程序的/healthz 路由返回 404,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/64237850/

    24 4 0
    Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
    广告合作:1813099741@qq.com 6ren.com