<p>Does anyone have experience using Managed VMs with Go on the Google Cloud Platform? I was wondering how it compared to GAE. My reasons for being interested are:</p>
<ul>
<li>Compatibility with the normal go tooling (no more import "appengine") </li>
<li>Increased portability of the code</li>
<li>Use of Docker</li>
</ul>
<hr/>**评论:**<br/><br/>JohnGB: <pre><p>I looked into this about a year ago, and the limiting factor for me, was poor datastore support on Compute Engine. It's theoretically possible, but at the time there were no decent libraries to handle it.</p></pre>loganjspears: <pre><p>Check out <a href="https://github.com/golang/appengine" rel="nofollow">https://github.com/golang/appengine</a>. Its what prompted me to think about switching. It uses the JSON or Protobuff APIs to talk to datastore so you can use it at least from Managed VMs. </p>
<p>Edit: It explicitly says its for Managed VMs but you could use <a href="https://cloud.google.com/datastore/docs/apis/v1beta2/" rel="nofollow">https://cloud.google.com/datastore/docs/apis/v1beta2/</a></p></pre>JohnGB: <pre><p>Last year I knew that Google was working on Go APIs for all their cloud services, but at the time it wasn't complete. I just had a look at the repo for it, and it seems to be a complete package, even if it's in Beta (we all know how Google are about that).</p>
<p>You can check it out here: <a href="https://github.com/GoogleCloudPlatform/gcloud-golang" rel="nofollow">https://github.com/GoogleCloudPlatform/gcloud-golang</a></p></pre>albmin: <pre><p>You definitely need to check out <a href="http://kubernetes.io/">http://kubernetes.io/</a> if you're thinking about migrating over. Kubernetes will make life extremely easy if you're using a mircroservice-style architecture, as it will handle scaling, scheduling, failover, etc.. Docker/Container-based systems are also what's 'hot' right now (and for good reason), and are essentially a requirement for kubernetes. </p>
<p>Depending on what you're utilizing with GAE (datastore, etc..), it may make the transition a little more challenging, but being PaaS agnostic is extremely nice..</p>
<p>Good luck.</p></pre>slimmyp: <pre><p><a href="http://blog.circleci.com/its-the-future/">http://blog.circleci.com/its-the-future/</a></p>
<p>About Docker/LCX/K8s</p></pre>afrobee: <pre><p>Make questioning if I should trust the word of some people around here.</p></pre>akcom: <pre><p>I'd like to piggy back off this for a moment, but do you have any good resources you'd recommend to get a grasp on why Docker/container type systems are so popular and sort of "best practices" when using them?</p>
<p>Thanks!</p></pre>loganjspears: <pre><p>Unfortunately I do use datastore and memcached. Memcached isn't that big of a switch, but I do rely on datastore's "infinite scaling" when it comes to storing data. </p></pre>zond: <pre><p>You can use datastore from anywhere on the internet: <a href="https://cloud.google.com/datastore/docs/concepts/overview" rel="nofollow">https://cloud.google.com/datastore/docs/concepts/overview</a></p>
<p>Edit: Right, you already know this :)</p></pre>dahlma: <pre><p>I've launched Go apps on a variety of services: GAE, Heroku, Linode, Rackspace, Digital Ocean, etc.</p>
<p>GAE is by and large the biggest pain in the ass.</p>
<p>I see you're locked into datastore which is a shame, because Heroku has been the easiest. There is a simple build pack to implement, you use <code>godep</code> to save dependencies and then it will build and roll out for you.</p>
<p>Heroku infinitely makes your code more portable, because it's router is just listening to your code over a proxy pass and is setting a PORT environment variable to tell your application how to broadcast. With GAE you need to wrap the code in it's own function, it doesn't use <code>main()</code> to initialize the application.</p>
<p>I've never had any luck with writing Go applications with Docker, which is funny considering what Docker was written in. Luckily I write my apps on OS X and deploy on Linux, so have never ran into issues that were platform specific since.</p></pre>
这是一个分享于 的资源,其中的信息可能已经有所发展或是发生改变。
入群交流(和以上内容无关):加入Go大咖交流群,或添加微信:liuxiaoyan-s 备注:入群;或加QQ群:692541889
- 请尽量让自己的回复能够对别人有帮助
- 支持 Markdown 格式, **粗体**、~~删除线~~、
`单行代码`
- 支持 @ 本站用户;支持表情(输入 : 提示),见 Emoji cheat sheet
- 图片支持拖拽、截图粘贴等方式上传