新手使用Go语言 – AppEngine – 部署

huangapple go评论92阅读模式
英文:

Newbe on Go - AppEngine - Deploy

问题

我是你的中文翻译助手,以下是翻译好的内容:

我是新手使用App Engine,我希望有人能够解答我的疑问:

我如何确保云端的App Engine有我需要的正确版本的Go语言?

我已经阅读了一些关于在本地机器上安装和下载Google SDK的文章(当然,我可以在我的机器上安装我需要的版本);但是一旦我用Go语言生成了我的应用程序,并且我想将其部署到云端的App Engine上,我如何确保Google基础设施有正确的版本?

我想安装Iris Web框架作为堆栈的一部分,但它要求Go语言版本为1.14或更高。Google App Engine标准版只支持Google 1.11和1.12+,所以我认为我需要选择Google App Engine弹性选项,如果是这种情况,我如何确保它有或支持我需要的Go语言版本?或者是否有一些安装的步骤需要遵循?

提前感谢你的支持。

英文:

I'm new using App Engine, and I would appreciate if someone can clarify this doubt:

How can I be sure that AppEngine in the cloud have the correct version of go I need to have in the cloud?

I have read some articles about installing and downloading the SDK for google on my local machine (and of course, I am able to install the version I need on my machine); but once I have generated my app in Go and I want to deploy it to App Engine in the cloud, how can I be sure Google infrastructure has the correct version?

I want to install Iris Web framework as part of the stack but it requires to go vers 1.14 or superior, Google App Engine standard only provides support for Google 1.11 and 1.12+ so I think I would need to go for the Google App Engine Flexible option, if that were the case, how can I be sure it has or support the Go version I need?... Or Is there some procedure to follow to install it ?

Thanks in advance for your support

答案1

得分: 1

你可以使用标准环境。标准环境的文档中提到:

Go 1.12+ 运行时支持以下主要版本:Go 1.12、Go 1.13、Go 1.14、Go 1.15 和 Go 1.16。你的应用程序使用在 app.yaml 文件中指定的最新稳定版本。App Engine 会自动更新到新的补丁版本,但不会自动更新主要版本。

以下是 app.yaml 中的一个版本规范示例:

runtime: go115
英文:

You can use the standard environment. The documentation for the standard environment says:

> The Go 1.12+ runtime supports the following major versions: Go 1.12, Go 1.13, Go 1.14, Go 1.15, and Go 1.16. Your app uses the latest stable release of the version that is specified in your app.yaml file. App Engine automatically updates to new patch revisions, but will not automatically update the major version.

Here's an example version spec in app.yaml:

runtime: go115 

答案2

得分: 0

使用灵活环境,您可以固定一个版本,而不是使用最新可用/支持的版本。为了做到这一点,您需要在您的 app.yaml 文件中指定您想要的确切版本:

runtime: go1.14

如果您只指定 runtime: go,它将拉取适用于 Go 语言的最新版本(似乎是 1.19)。

有关更多信息,请参阅此文档:https://cloud.google.com/appengine/docs/flexible/go/reference/app-yaml#general

英文:

With the Flexible environment you have the ability to pin a version rather than using the latest available/supported. In order to do that, you will have to specify in your app.yaml file the exact version you would like it to be:

runtime: go1.14

If you specify only runtime: go it will pull the latest release available for Go language (which seems to be 1.19).

For more information, please refer to this documentation: https://cloud.google.com/appengine/docs/flexible/go/reference/app-yaml#general

huangapple
  • 本文由 发表于 2022年1月4日 05:20:28
  • 转载请务必保留本文链接:https://go.coder-hub.com/70571576.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定