gpt4 book ai didi

google-app-engine - 访问生产中的 Google App Engine Python 应用程序代码

转载 作者:行者123 更新时间:2023-12-01 17:11:55 24 4
gpt4 key购买 nike

(背景:我是 Google App Engine 的新手,熟悉其他云提供商的服务)

我正在寻找类似于对生产节点的 shell 访问的访问/ View 。

使用基于 Python/Django 的 Google App Engine 应用程序,我想查看生产中的代码。

我能找到的一个 View 是 StackDriver“调试” View 。但是,显然“调试” View 中显示的代码并不反射(reflect)更新的生产代码(基于生产站点上显示的内容,例如主页上的文本不同)。

Google App Engine 是否允许我通过 ssh 进入运行应用程序/代码的虚拟机?如果没有,如何检查生产中运行的代码?

谢谢。

最佳答案

根据Comparing environments中的SSH调试行弹性环境应用程序支持表 SSH 访问,但标准环境应用程序不支持。

来自Connecting to the instance :

If a VM instance is in debug mode, you can connect to its host by using SSH in the console or with gcloud.

To connect to an instance in the console:

  1. Visit the Cloud Platform Console instances page for your project: Go to the instances page

  2. Click SSH in the far right of the row containing the instance you want to access:

    This puts the instance into debug mode, and opens an SSH session for the instance in a terminal window.

    You can also select different options to start an SSH session from the drop-down list.

  3. At this point you are in the instance host, which has several containers running in it. See Understanding common containers next for more information about these.

  4. In the terminal window, list the containers running in the instance:

    sudo docker ps
  5. The output of the sudo docker ps command lists each container by row; locate the row that contains your project ID: this is the container running your code. Note the NAME of this container.

  6. Optionally, list logging information for your application by invoking:

    sudo docker logs [CONTAINER-NAME]
  7. Start a shell in the container that is running your code:

    container_exec [CONTAINER-NAME] /bin/bash
  8. When finished debugging, enter exit to exit the container, then exit again to exit the SSH session.

  9. Disable debugging for your instance to allow it to resume normal operation.

关于google-app-engine - 访问生产中的 Google App Engine Python 应用程序代码,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/41253187/

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