News for hackers. Stuff that matters.
Re:DigitalOcean launches its container service by rfinney on Tuesday December 11, 2018 @01:30PM (#18657505)
Serious question: Is there an emerging cross platform workflow language to just write stuff to run on any cloud/container hosting setup?

The idea would be to be portable, avoid vendor lock-in and take advantage price differences or quickly route around a system failure in one of the providers.

Re:DigitalOcean launches its container service by mark-ruwt on Tuesday December 11, 2018 @02:34PM (#18658111)
We rely on bash.

Each machine that's spun up is built from scratch via one command-line call. The first half of the process interacts with each hosting API (we rely on DigitalOcean, Linode, and Vultr primarily), to build a clean slate machine with all of the packages and libraries that we expect.

The second half of the process runs the actual build process, building the instance step-by-step on top of the clean slate, blissfully unaware of which hosting provider it lives on.

This model allows us to be portable and avoid vendor-lock in, and a cross-provider infrastructure lets us gracefully handle system failures while keeping costs down.

Re:DigitalOcean launches its container service by wise_young_man on Tuesday December 11, 2018 @09:42PM (#18660969)
I made something similar and turned it into a service [1] focused on WordPress, but unfortunately there hasn't been much interest from people as I thought there would be, though that could be due to my lack of marketing.

My goal was the same, to make hosting more portable with features like snapshotting and restoration of WP sites across servers and to even eventually expand beyond just servers, to bring in domain registrars and cloud storage to be able to move things around easier. For example: you have a site hosted on AWS EC2 with DNS at Namecheap and nightly backups at Dropbox and let's say the AWS Virginia region goes down. You create a new server in Digital Ocean and restore the snapshot from Dropbox and the linked DNS at Namecheap is auto updated.

The more I thought about this though, I began to realize that maybe these features wouldn't be useful to the audience I wanted to target, which was people who wanted to grow from shared hosting and have something reliable and less noisy neighbors, but still more affordable than managed WP hosts and lastly more control (bring your cloud/server provider).

[1]: http://pagefog.com

Re:DigitalOcean launches its container service by kkarakk on Wednesday December 12, 2018 @06:54AM (#18663127)
some unsolicited feedback: your name is terrible(unrelated to your product in any way) and your website doesn't communicate the problem you say you're solving all i get from your sites landing page is "wordpress hosting" which is not exactly uncommon scrolling to the bottom shows me some cloud providers. makes me think you just help people host wordpress in the cloud
Re:DigitalOcean launches its container service by suls on Wednesday December 12, 2018 @01:52AM (#18661872)
Wondering how what you did compares to cloudinit? https://cloudinit.readthedocs.io/en/latest/
Re:DigitalOcean launches its container service by _kyran on Tuesday December 11, 2018 @03:43PM (#18658661)
Any chance you've got an open source version of this script that you could share?
Re:DigitalOcean launches its container service by mark-ruwt on Tuesday December 11, 2018 @04:35PM (#18659146)
No, unfortunately, open-sourcing it has been on my to-do list for an embarrassingly long time.

But, building one is easier than it sounds! Think of the problem in two parts. First, find a distro used by multiple providers (we're on CentOS) and craft one script that uses each provider's API to spin up a clean machine.

Once you have that done, it's a matter of understanding your own build process, writing a script that you'll pass into each instance on creation that will fetch your source control, install libraries, and put all the pieces together.

Lots of if/else, lots of curl, lots of yum, lots of jq, but all of it is really straightforward.

Re:DigitalOcean launches its container service by lotyrin on Tuesday December 11, 2018 @05:52PM (#18659739)
Also if your providers + OS support cloud-init, then you can express a fleet of instances which run this sort of script at boot time in something like Terraform pretty easily. Switching clouds becomes "uh... what does <provider> call their <size> instance again?"

Alternatively, pre-baking cloud images that have already run such a script and are ready to boot becomes pretty easy with a tool like Packer.

Though, as the underlying OS changes, you'll need something to validate your scripts' functionality against, and a tool that's a little more declarative might make them less fragile to those changes.

Re:DigitalOcean launches its container service by mark-ruwt on Tuesday December 11, 2018 @06:13PM (#18659878)
I started using this model in '15 and it's not fragile. At all. The less I'm relying on outside frameworks, the better I sleep at night.
Re:DigitalOcean launches its container service by lotyrin on Tuesday December 11, 2018 @08:58PM (#18660758)
Certainly understandable -- I'd prefer to keep things simple and just have some kind of validation in place rather than rely on an abstraction if I can get away with it.

Having maintained various automation over the course of the past decade and a half, I can say things do change around. Over the course of only a few years though, obviously you can stick to some LTS release of whatever you're using and be pretty confident that e.g. "some-package" does not get renamed to "some-package-version" or split into "some-core" and "some-utils", or have a package get upgraded to a version with some less-than-backward-compatible configuration options, etc.

Re:DigitalOcean launches its container service by lugg on Tuesday December 11, 2018 @05:53PM (#18659754)
Is this a cookie cutter stack or do you have different models? Be curious to hear more about your application stack.
Re:DigitalOcean launches its container service by mark-ruwt on Tuesday December 11, 2018 @06:10PM (#18659867)
There's nothing special about our stack. We have four different instance types (static, api, db, proxy), and we rely on a lot of the usual suspects: Apache, Tomcat, MySQL, Varnish, and HAProxy.
Re:DigitalOcean launches its container service by MuffinFlavored on Tuesday December 11, 2018 @11:50PM (#18661484)
Why/what benefit?
Re:DigitalOcean launches its container service by JacobHenner on Tuesday December 11, 2018 @01:34PM (#18657547)
Re:DigitalOcean launches its container service by hinkley on Tuesday December 11, 2018 @01:46PM (#18657673)
Is there a good way to sandbox terraform configurations? I'm not directly involved (just hear the screaming) but everything I'm hearing is that making modifications is a test of willpower.

For us it's been about as transparent as a brick wall and I'm not clear if that's down to our bureaucracy or built into the design. Both are anathema to the goal of making complex deployments straightforward and self-describing (you can't manage something this complicated unless big parts of it are as obvious as can be).

Re:DigitalOcean launches its container service by matwood on Tuesday December 11, 2018 @03:33PM (#18658601)
The recommended way, at least for AWS, is to have multiple accounts. One for production, and then however many more for test and development. Separate accounts let you run TF changes and know you will not impact production.

TF can be tricky to grok at first especially if you don't have everything in TF. But, I couldn't imagine managing more than a server or 2 without it or something similar at this point. Once you get into VPCs, IAMs, etc..., some type of tool is really required.

I'm also a little confused about your transparency comment. IME, tf is very clear what it is going to do in a plan. The current state files are also just json, and easy to read/search if you're not sure about something.

Re:DigitalOcean launches its container service by hinkley on Wednesday December 12, 2018 @12:44PM (#18665943)
Declarative syntax is notoriously hard to debug, especially for newbies.

As a general rule, if you're giving someone a tool that uses declarative syntax, you also need to provide them a private (not shared) sandbox in which to test out theories, try new things, and reproduce errors seen in production.

Since we don't have that, TF is pretty much the worst solution for our problems. Kube or even Docker Swarm would serve us much better.

Re:DigitalOcean launches its container service by driverdan on Tuesday December 11, 2018 @02:28PM (#18658050)
Terraform requires separate config for each provider.
Re:DigitalOcean launches its container service by djsumdog on Tuesday December 11, 2018 @04:16PM (#18658963)
There's no way around that really. I wrote my own provisioner and each provider is so different:

https://github.com/sumdog/bee2

Vultr allows floating IPs for IPv4 and IPv6, but Digital Ocean only has floating IPv4. Vultr will start a machine with a floating v4, but you have to add a floating v6 address (giving you two v6 addresses). Digital Ocean does the same thing with v4 (giving you two v4 addresses). They both have different network adapter names, so you've got to configure those per provider as well.

Terraform and my own thing help in easing the transition if you ever need to move, but modifications will still have to be made.

Re:DigitalOcean launches its container service by segmondy on Tuesday December 11, 2018 @01:38PM (#18657584)
Yes, kubernetes
Re:DigitalOcean launches its container service by mindfulmonkey on Tuesday December 11, 2018 @02:19PM (#18657967)
yeah, but your configs aren't fully portable between cloud providers when you look at things like LBs, storage, etc..
Re:DigitalOcean launches its container service by erulabs on Tuesday December 11, 2018 @03:47PM (#18658697)
Yes and No. For example, "type: LoadBalancer" works fine on almost every cloud, but various annotations need to be added for SSL termination on an AWS ALB, for example. The annotations don't collide tho, so you can have a load balancer with both AWS and Google Cloud annotations, and it will work fine on either cloud.

Volume classes are probably the best example of being cloud-specific, but this problem is solved by having a different volume class for each cloud provider, named the same, such that the deployment can always grab a disk regardless of which cloud its living in.

Re:DigitalOcean launches its container service by praseodym on Tuesday December 11, 2018 @03:53PM (#18658741)
They are. Kubernetes has abstractions at exactly the right layers (e.g. Service to create a load balancer) so that you can exchange configs between cloud providers.

There can of course be some difference in the capabilities that each cloud provider supports (e.g. not all load balancer implementations may support UDP) but the abstraction is definitely there.

Re:DigitalOcean launches its container service by movedx on Tuesday December 11, 2018 @03:38PM (#18658630)
I thought load balancers popped out the end of Services and it was plugins that handled the specific cloud environment? I'd say that still constitutes cross platform.
Re:DigitalOcean launches its container service by alexeldeib on Tuesday December 11, 2018 @01:35PM (#18657563)
Some newer candidates besides Terraform are Portable Service Definitions and Crossplane.

https://github.com/kubernetes/enhancements/blob/master/keps/...

https://crossplane.io

Re:DigitalOcean launches its container service by djsumdog on Tuesday December 11, 2018 @04:18PM (#18658978)
Huh .. It only supports the big three providers. No Digital Ocean or Vultr.
Re:DigitalOcean launches its container service by autechr3 on Tuesday December 11, 2018 @01:54PM (#18657751)
Re:DigitalOcean launches its container service by fantispug on Tuesday December 11, 2018 @03:38PM (#18658631)
Apache libcloud works well for more basic services (e.g. storand and compute) and is extending into container management services.
Re:DigitalOcean launches its container service by juddlyon on Tuesday December 11, 2018 @04:57PM (#18659320)
Terraform/Packer/Ansible is a popular combo.