无服务器容器和具有自定义运行时灵活性的 App Engine 之间有什么区别?
What is the difference between Serverless containers and App Engine flexible with custom runtimes?
我看到这篇文章:Bringing the best of serverless to you
在那里我了解到即将推出的名为 Cloud Functions 上的无服务器容器的产品,该产品目前处于 Alpha 阶段。
如文章所述:
Today, we’re also introducing serverless containers, which allow you
to run container-based workloads in a fully managed environment and
still only pay for what you use.
Serverless containers on Cloud Functions enables you to run your own containerized workloads on
GCP with all the benefits of serverless. And you will still pay only
for what you use. If you are interested in learning more about
serverless containers, please sign up for the alpha.
所以我的问题是 这个无服务器容器与自定义运行时灵活的应用引擎有何不同,它也使用 docker 文件?
我怀疑,因为提到的 named 是 Cloud Functions 上的无服务器容器,差异可能包括云函数的作用。如果是这样,云函数在无服务器容器中扮演什么角色?
请说明。
什么是云函数?
Google Cloud Functions is a serverless execution environment for building and connecting cloud services. With Cloud Functions you write simple, single-purpose functions that are attached to events emitted from your cloud infrastructure and services. Your function is triggered when an event being watched is fired. Your code executes in a fully managed environment. There is no need to provision any infrastructure or worry about managing any servers.
简单来说,Cloud Function 由某些事件(HTTP 请求、PubSub 消息、Cloud Storage 文件插入...)触发,运行函数代码,returns 结果,然后功能消亡。
目前有可用的 four runtime environments:
- Node.js 6
- Node.js 8(测试版)
- Python(测试版)
- Go(测试版)
借助 Cloud Functions 产品上的 Serverless 容器,您可以使用 Docker 映像提供您自己的自定义运行时环境。但是Cloud Function的生命周期是一样的:
It is triggered > Runs > Outputs Result > Dies
App Engine Flex 应用程序
App Engine flexible environment 中的应用程序 运行 已部署到虚拟机,即 Google 云计算引擎实例。您可以选择要使用的机器类型和资源(CPU、RAM、磁盘 space)。 App Engine 柔性环境在平衡负载的同时自动扩展和缩减您的应用程序。
与 Cloud Functions 的情况一样,Google 提供了运行时,但如果您想使用 Python、Java、[=55 的替代实现=], Go, Ruby, PHP, .NET 你可以使用 Custom Runtimes。或者甚至您可以使用其他语言,如 C++、Dart...,您只需要为您的应用程序提供 Docker 图片。
Cloud Functions 和 App Engine Flex 应用之间有什么区别?
它们之间的主要区别在于它的生命周期和用例。
正如上面评论的那样,云函数有一个定义的生命周期,它会在任务结束时消亡。他们应该被用来做一件事并且把它做好。
另一方面,GAE Flex 环境中的应用程序 运行 将始终至少有一个实例 运行。此应用程序的典型案例是为多个端点提供服务,用户可以在其中进行 REST API 调用。但是它们提供了更大的灵活性,因为您可以完全控制所提供的 Docker 图像。你可以在那里"almost"做任何你想做的事。
什么是无服务器容器?
如 official blog post(搜索无服务器容器)中所述,它基本上是 运行 在 Docker 文件定义的自定义环境中的云函数。
官博上说的post:
With serverless containers, we are providing the same underlying
infrastructure that powers Cloud Functions, but you’ll be able to
simply provide a Docker image as input.
因此,除了在 CF 上部署您的代码,您还可以只部署 Docker 映像以及 运行 时间和要执行的代码。
自定义 运行 次的 Cloud Functions 与 App Engine Flexible 有什么区别?
有 5 个基本区别:
网络:在 GAE Flexible 上,您可以自定义网络实例 运行。这让您可以添加防火墙规则来限制出口和入口流量,阻止特定端口或指定您希望 运行.
的 SSL
超时:云函数可以 运行 最多 9 minutes,另一方面灵活,可以 运行无限期。
只读环境:Cloud Functions 环境是只读的,而 Flexible 是可写的(这只是为了存储自发信息因为一旦 Flexible 实例重新启动或终止,所有存储的数据都会丢失).
冷启动:与 Flexible 相比,Cloud Functions 可以快速部署和启动。这是因为 VM 内部的 Flexible 运行s,因此需要额外的时间来启动 VM。
它们是如何工作的:云函数是事件驱动的(例如:将照片上传到云存储执行一个函数)另一方面灵活的是请求驱动的.(例如:处理来自浏览器的请求)
如您所见,能够部署少量代码而无需处理上面列出的所有事情是一项功能。
此外,考虑到无服务器容器仍处于 Alpha 阶段,因此,未来可能会发生很多变化,并且仍然没有很多文档深入解释它的行为。
我看到这篇文章:Bringing the best of serverless to you 在那里我了解到即将推出的名为 Cloud Functions 上的无服务器容器的产品,该产品目前处于 Alpha 阶段。
如文章所述:
Today, we’re also introducing serverless containers, which allow you to run container-based workloads in a fully managed environment and still only pay for what you use.
Serverless containers on Cloud Functions enables you to run your own containerized workloads on GCP with all the benefits of serverless. And you will still pay only for what you use. If you are interested in learning more about serverless containers, please sign up for the alpha.
所以我的问题是 这个无服务器容器与自定义运行时灵活的应用引擎有何不同,它也使用 docker 文件?
我怀疑,因为提到的 named 是 Cloud Functions 上的无服务器容器,差异可能包括云函数的作用。如果是这样,云函数在无服务器容器中扮演什么角色?
请说明。
什么是云函数?
Google Cloud Functions is a serverless execution environment for building and connecting cloud services. With Cloud Functions you write simple, single-purpose functions that are attached to events emitted from your cloud infrastructure and services. Your function is triggered when an event being watched is fired. Your code executes in a fully managed environment. There is no need to provision any infrastructure or worry about managing any servers.
简单来说,Cloud Function 由某些事件(HTTP 请求、PubSub 消息、Cloud Storage 文件插入...)触发,运行函数代码,returns 结果,然后功能消亡。
目前有可用的 four runtime environments:
- Node.js 6
- Node.js 8(测试版)
- Python(测试版)
- Go(测试版)
借助 Cloud Functions 产品上的 Serverless 容器,您可以使用 Docker 映像提供您自己的自定义运行时环境。但是Cloud Function的生命周期是一样的:
It is triggered > Runs > Outputs Result > Dies
App Engine Flex 应用程序
App Engine flexible environment 中的应用程序 运行 已部署到虚拟机,即 Google 云计算引擎实例。您可以选择要使用的机器类型和资源(CPU、RAM、磁盘 space)。 App Engine 柔性环境在平衡负载的同时自动扩展和缩减您的应用程序。
与 Cloud Functions 的情况一样,Google 提供了运行时,但如果您想使用 Python、Java、[=55 的替代实现=], Go, Ruby, PHP, .NET 你可以使用 Custom Runtimes。或者甚至您可以使用其他语言,如 C++、Dart...,您只需要为您的应用程序提供 Docker 图片。
Cloud Functions 和 App Engine Flex 应用之间有什么区别?
它们之间的主要区别在于它的生命周期和用例。
正如上面评论的那样,云函数有一个定义的生命周期,它会在任务结束时消亡。他们应该被用来做一件事并且把它做好。
另一方面,GAE Flex 环境中的应用程序 运行 将始终至少有一个实例 运行。此应用程序的典型案例是为多个端点提供服务,用户可以在其中进行 REST API 调用。但是它们提供了更大的灵活性,因为您可以完全控制所提供的 Docker 图像。你可以在那里"almost"做任何你想做的事。
什么是无服务器容器?
如 official blog post(搜索无服务器容器)中所述,它基本上是 运行 在 Docker 文件定义的自定义环境中的云函数。
官博上说的post:
With serverless containers, we are providing the same underlying infrastructure that powers Cloud Functions, but you’ll be able to simply provide a Docker image as input.
因此,除了在 CF 上部署您的代码,您还可以只部署 Docker 映像以及 运行 时间和要执行的代码。
自定义 运行 次的 Cloud Functions 与 App Engine Flexible 有什么区别?
有 5 个基本区别:
网络:在 GAE Flexible 上,您可以自定义网络实例 运行。这让您可以添加防火墙规则来限制出口和入口流量,阻止特定端口或指定您希望 运行.
的 SSL
超时:云函数可以 运行 最多 9 minutes,另一方面灵活,可以 运行无限期。
只读环境:Cloud Functions 环境是只读的,而 Flexible 是可写的(这只是为了存储自发信息因为一旦 Flexible 实例重新启动或终止,所有存储的数据都会丢失).
冷启动:与 Flexible 相比,Cloud Functions 可以快速部署和启动。这是因为 VM 内部的 Flexible 运行s,因此需要额外的时间来启动 VM。
它们是如何工作的:云函数是事件驱动的(例如:将照片上传到云存储执行一个函数)另一方面灵活的是请求驱动的.(例如:处理来自浏览器的请求)
如您所见,能够部署少量代码而无需处理上面列出的所有事情是一项功能。
此外,考虑到无服务器容器仍处于 Alpha 阶段,因此,未来可能会发生很多变化,并且仍然没有很多文档深入解释它的行为。