在S3上部署Go二进制文件

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

deploying Go binary on S3

问题

最近的《纽约时报》关于使用Go语言的文章描述了将二进制文件放在S3上的部署过程。

由于程序编译成单个二进制文件,我们可以包含所有需要的第三方库,部署只需要将二进制文件放在S3上,无需引导操作。

要在S3上设置什么类型的环境,并如何将二进制文件放在S3上并运行它?是否有人可以提供详细信息?

英文:

This recent NYTimes article about using Go lang describes deployment as a simple process of putting a binary on S3.

Since programs compile down to a single binary, we can include all the third-party libraries we want and deployment is just a matter of putting our binary on S3, no bootstrap actions required.

What type of environment would one need to setup on S3 and how would you put a binary on S3 and run it? Is someone able to fill in the details

答案1

得分: 3

他的意思是,S3是用来存储单个二进制文件的地方,部署基本上是下载并运行它。

我也是这样做的 在S3上部署Go二进制文件

英文:

What he means is that S3 is where you store a single binary, and deployment is basically downloading it and running it.

That's how I do it as well 在S3上部署Go二进制文件

答案2

得分: 3

S3代表“简单存储服务”,就是这样。它是一个可以放置文件的地方,可以通过一些简单的配置选项(如权限/标头等)在网络上提供服务。它没有运行已编译二进制文件的能力。

那篇文章的作者所指的是,他可以通过将应用程序放在S3上与运维人员或其他人共享。优点在于部署过程大大简化,因为它只是一个单独的文件(与需要同时部署所有单独的源文件的Ruby/PHP应用程序形成对比)。

你可以将S3在他的文章中替换为Dropbox/电子邮件或任何其他文件共享方式。

他提到S3的原因可能是因为它是自动化流水线的一部分。例如:

  • 将Go源代码编译/交叉编译为所有支持的平台的二进制文件
  • 将编译后的二进制文件上传到S3
  • 所有服务器下载相关的二进制文件并启动/重启进程

正如其他人在评论中提到的,你可以使用部署自动化工具(如fabric或capistrano)来自动化所有这些过程。

简而言之,你不能在S3上运行Go二进制文件(或任何代码/可执行文件),他的意思是他使用S3来共享构建产物。

英文:

S3 stands for Simple Storage Service and that's all it is. It's a place to put files where they can be served on the web with some simple configuration options (for permission/headers etc). It doesn't have the ability to run a compiled binary.

What the author of that article is referring to is that he can share the application (with ops or anyone really) by putting it on S3. The advantage being a greatly simplified deployment process, as it's just a single file (contrast to a ruby/PHP app where you would need to deploy all the individual source files together).

You could substitute S3 in his article with Dropbox/email or any way of sharing files.

The reason he mentions S3 is probably because it forms part of a automated pipeline. e.g.

  • Compile/cross-compile Go source code into binaries for all supported platforms
  • Upload compiled binaries to S3
  • Have all servers pull down the relevant binary and start/restart the process

As someone else mentioned in comments, you could use a deployment automation tool like fabric or capistrano to automate all of this for you.

TL;DR You can't run the go binary on S3 (or any code/executables), he means he uses S3 to share the build artifact.

huangapple
  • 本文由 发表于 2014年7月25日 02:53:40
  • 转载请务必保留本文链接:https://go.coder-hub.com/24941767.html
匿名

发表评论

匿名网友

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

确定