[英]Google Cloud Platform : How to develop on my local environment with GCP resources
I'm using Google App Engine Flex to develop an angularjs/php-rest backend application. 我正在使用Google App Engine Flex开发angularjs / php-rest后端应用程序。 I've a successful port from regular servers to AppEngine, and I now want to integrate more with GCP services like : StackDriver, Cloud Storage and so on. 我已经成功地从常规服务器移植到AppEngine,现在我想与GCP服务(如StackDriver,Cloud Storage等)进行更多集成。
StackDriver to have logging & monitoring. StackDriver具有日志记录和监视功能。 Cloud Storage: to store export data files and zip them before sending it to browser. 云存储:用于存储导出数据文件并压缩它们,然后再将其发送到浏览器。
My question is how do I develop locally on my laptop (which can be online & offline) ? 我的问题是如何在笔记本电脑(可以在线和离线)上进行本地开发?
I didn't find in the documentation "the way" of local development : 我没有在本地开发的“方式”文档中找到:
Any hint appreciated :) 任何提示表示赞赏:)
App Engine Flexible doesn't come with a development server or service emulators for use during development so you may use the services directly. App Engine Flexible不附带开发服务器或服务仿真器,以供在开发期间使用,因此您可以直接使用服务。
One common practice is to create different GCP projects for prod, staging and dev purposes. 一种常见的做法是为生产,暂存和开发目的创建不同的GCP项目。 This allows you to create specific resources for a given environment. 这使您可以为给定环境创建特定资源。 Taking logging as example, you'll be able to see logs and troubleshoot any issue with it within the dev project, without polluting your prod project's logs. 以日志记录为例,您将能够在开发项目中查看日志并对其进行任何故障排除,而不会污染生产项目的日志。 That'd be true with CloudSQL, Datastore, etc... CloudSQL,数据存储区等都是如此。
You don't need to configure any proxy for those services. 您无需为这些服务配置任何代理。 The cloud_sql_proxy is a convenient method to enforce secure connections and ease authentication with CloudSQL instances without the need to whitelist IP addresses. cloud_sql_proxy是一种方便的方法,用于强制进行安全连接并简化与CloudSQL实例的身份验证,而无需将IP地址列入白名单。
Regarding the offline situation now, of course those calls from your local app to those services will fail if you don't have internet connection at that time (intermittent disconnections may actually help you to test your retries and error handling mechanisms). 对于当前的离线情况,如果您当时没有Internet连接,那么从本地应用程序到这些服务的调用当然会失败(间歇性断开实际上可以帮助您测试重试和错误处理机制)。 If you expect to develop with no internet connection at all though, you'll need to write stub services to mimic the expected behavior locally. 如果您希望在没有互联网连接的情况下进行开发,则需要编写存根服务以在本地模拟预期的行为。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.