135 points · by purephase · 9y ago · 100 comments
The number of issues we're dealing with daily with Vagrant is rising. The productivity boost it provided is entirely gone and the support is taking a substantial amount of time.
We love Hashicorp and, I don't mean this to be a slight against them, but I'm curious what alternatives people are using to:
- Automate building dev environments (Linux-based) with dependencies etc. - Ensure that your development environment is similar enough to production to reduce/eliminate potential issues moving to production.
I have done some googling around, but it still appears that Vagrant is the top dog in this space. Willing to accept that it's us and not the tool, but issues with NFS sharing, port collisions, support for Fusion, deprecations with legacy Chef setups and more is just more than we can handle right now.
Bonus points for tools that can be re-purposed for automating deployment as well (Terraform). Parity between development and other environments is important.
I won't attempt to hijack this thread or use it for personal motives to convince you to stick with it. I understand technologies change, requirements change, and choices change. The only thing I ask is if you can find the time to email me (mitchell@hashicorp.com) with your pain points so we can look to see how we can improve things in the future.
And the only other comment I'll make is that at HashiCorp we have full time staff on Vagrant and have continued to drill down issue counts through the year. So if you are a Vagrant user: fear not, it is something we continue to deeply care about.
Thank you!
It may not have been obvious in the original question but, believe me, I wholly appreciate the work that has gone into Vagrant and it truly is a great piece of software that we have happily supported over the years (with the Fusion plugin).
I believe that some of the challenges are not necessarily with Vagrant, but the combination of distros, build tools (Chef / Ansible -- we're still with Chef) various cookbooks / versions vs. roll your own and, perhaps most important, supporting Fusion/Parallels and Virtualbox with all of their idiosyncrasies. Add to that the introduction of "new" technologies such as containers etc.
The question was not in any intended as a slight against Vagrant, but more of a question of how people are handling their development environments today and if Vagrant is still a big part of their processes or not.
We still love Vagrant and it's promise as well as other Hashicorp products (we use Terraform and are in the process of switching to Vault) so we believe in the tools. Just had a rough 6 months or so of supporting Vagrant in our development processes (for some reason -- could be us!) and thought I'd ask the community.
That brings me to this: I wish I could pay for Vagrant - not just the VMWare Fusion plugin, but a fully supported configuration of your choosing. I would happily migrate our dev environment to that configuration, and spend spend several hundred dollars per user per year year on Vagrant if I thought it would work more reliably as a result.
I don't docker for my actual code , but it's handy for the local DB and redis type problems.
Actual language changes best way I think. Java and Python I tend to just run from jetbra ins with docker having all the dependencies up.
https://jakob.gillich.me/post/2016-03-22-self-contained-deve...
https://ariya.io/2016/06/isolated-development-environment-us...
You can easily automate provisioning and deployment with Nixops:
http://container-solutions.com/step-towards-future-configura...
But if you need to share/deploy what you worked on, in some place where you might not have Nix available, you can just as easily create Docker containers out of your Nix expression:
http://lethalman.blogspot.co.uk/2016/04/cheap-docker-images-...
Enforcing NixOS to a team in my view will lead to a severe productivity downturn in the short-medium run.
Nix is much older than people think, I am not it will be around in 5-10 years though. I believe that Ansible, Puppet, Chef, etc are way simpler and more valuable market-wise if you are not into Haskell already...
I've been following Nix for a while, and don't yet have an arena where I can play with it, but the concept is exactly what I think the industry needs. The biggest challenge that I see with nix is that it is basically a new OS and will require a while before many people are comfortable adopting it.
Also, it's not Haskell, it's got it's own minimal functional language, Nix, right?
That being said, Nix sucks. Documentation is scattered, deprecated, and incomplete. I still don't understand some of the most basic things with NixOS, because I cannot find documentation.
Take nix-shell for example: You can make a shell.nix file in a directory to describe the environment you need, then simply nix-shell in that directory to get a working environment. It's great! I understand the concept, and use it regularly, but apart from some very tailored examples, I don't even know how to describe a simple environment with one package!
The whole reason we migrated to VMware, about 3 years ago, was that we were using Virtualbox and being really bothered by the issues with it, things like corruption of files accessed through the shared folder mounts, that weren't being addressed. It's exasperating how brittle this VM stuff is.
Personally, I'd love a slimmer Linux-only solution based on Xhyve or Apple's Hypervisor.framework. I don't really want a Vagrantfile, I just want a low-level tool that I can drive from a wrapper, which we need anyway. Both Docker for Mac and Minikube now uses Xhyve, with great results.
We're slowly migrating our stack over to Kubernetes. Building with Docker for Mac is great, and Minikube seems really promising.
Moral of the story I moved to linux.
docker/for-mac#77 is related to "bind mount" performance but docker/for-mac#668 is virtual block device performance. Have you posted a reproduction workload that demonstrates the performance problems you are having?
Docker 17.04 includes a `cached` bind mount flag that relaxes consistency of the mount in exchange for significantly reducing guest-host roundtrips especially for inefficient workloads that repeatedly access the same files.
There's a case for keeping the Docker environment stateless and expendable (wipe to restart), and keep certain things (PostgreSQL databases, for example) on the host machine. Currently, that's impossible because of the aforementioned issue.
I haven't tried the "cached" flag since it's still in beta, however.
Typically with locally-built (dev) images rather than those from the registry that CI writes to, but other than that the k8s manifests are the same.
I think LXC has some really excellent advantages of both being super easy to create/destroy quickly (and containers being very easy on resources), while at the same time running a full system in the container with an init and everything (as opposed to Docker where it's typically just one application). The command line tools are pretty simple and straightforward (at least for LXC 1.0), and I find it a lot less fuss than using VMWare or VirtualBox in a similar role.
The biggest difference is Docker does not run the init in the container, LXC does so it behaves more like a lightweight VM. LXC also has proper support for standard networking and storage in the container. It's self contained.
This isn't something that's a huge use-case applicable everywhere, but man the flexibility is super super handy, and I haven't seen many tools out there provide the same amount of possibilities LXC does (like all of the a la carte cgroups functionality).
So we have to keep using VirtualBox which is slower.
Another consequence of this is that in order to use VirtualBox you need to completely disable Hyper-V, so on Windows machines our devs are forced to use Docker Toolbox (instead of Docker for Windows which is faster but based on Hyper-V).
(Note: we are a small team with little experience both in Docker and Vagrant so we welcome suggestions: if you thing we're doing something wrong please leave a comment).
If it takes more than 20m to get a new dev machine setup from a fresh OS, you probably haven't pushed enough of your environment into images.
Don't be afraid to ignore the rules about what and how much goes into a container as those are for production images (eg: customer facing). It's prefectly fine for this usecase to treat it more as a mini-vm than the 'process on steroids' you use for production.
I am struggling with slow image builds, but that's more of a problem of "not having a build server", "not having a Docker registry set up" and "using a lot of 3rd party online build dependencies".
Setup: Win10 host and 6 vagrant guests (mix of internally produced jessie and xenial64 boxes with Packer). Terraform on AWS infra in staging & production with ansible for config/provisioning and Consul for node discovery.
[Edit] some tips to make dev work pleasant on Win10: Use cmder, mRemoteNg and configure samba to expose your git working dir back to the host (so file change hot reloading works reliably if you want to do your coding on the host with something like VSCode or Sublime).
I wish Vagrant would work on bringing xhyve, Hyper-V and KVM to the same level of support as VirtualBox.
VirtualBox is the biggest source of issues in our Vagrant environment and there is no indication that's going to change.
Unfortunately, it doesn't seem to be fully baked yet, I haven't had much success trying to use it, and there may not be many public base boxes available for it, as tools like Packer don't support it yet.
Edit:
Another option on macOS is Parallels. You need the "Pro" or "Business" licence to use with Vagrant, but it works reasonably well for my needs.
VMware would be ideal since it works on all three platforms we care about and has great performance, even with the added costs.
We eventually wrote our own tool that duplicates the smallest possible Vagrant featureset.
We use SSH for control, Unison for real-time file syncing, and Chef for "provisioning" configuration of the remote developer environment. Our tool requires only SSH access to some host -- so we provision an EC2 instance for every engineer, and then connect it to our tool; but we could use local Docker or even a Vagrant-managed VM. We reimplemented Chef Solo provisioning, with 100% backwards compatibility with our existing Vagrant Chef recipes, which was really easy! We leverage SSH's ControlMaster for persistent connections.
Our tool does the same things that we were using Vagrant for, but takes 1/3 of the time for typical tasks. Where Vagrant would take ~6 minutes to provision a host, our tool takes ~2 minutes using the exact same Chef recipes. We managed to shave a full 30 seconds of mystery time off between when `vagrant provision` would start, and when Chef would begin it's run.
I encourage you to think about cloud developer environments in general. We got big wins in dev productivity by moving our devenvs off engineer laptops.
If your commuting employee size is low, I guess it's not important enough problem to solve. I (and a few others here) would love to see a blog (or repo) showing off your tool!
Also, I enjoy what I do at work, and love the company I work at. I don't really care about where I do that work from, or if I worked 2 hours (a week) over my working hours. Actually I make it a point to read code from other parts of the company over the weekend because I find that more useful than pointless side projects.
It's just really nice to be able to build code on my dev box and have it run in production or any other machine without any fuss. It even has tools to help you scale to multiple hosts. Really, it's a complete tool set to take you from development to production.
If you're interested I launched a Docker learning platform[0] last week. It happens to contain a 5 hour course that will take you from "What is Docker?" all the way to "I'm super comfortable using Docker / Docker Compose on my own projects".
You can watch the first 20 videos for free. The free videos cover topics like understanding what Docker is, how it works, and getting it installed.
Your comment would be: "not having all the tools available is a symptom of using linux as a desktop os".
All of the development-specific tools are cross-platform. I have yet to use a tool that isn't available on Linux, and our entire development staff are running OSX full-time.
I'm a developer, but I also talk at community groups and conferences. I know there are alternatives (Inkscape, Impress, Postman) but they're all missing one or more features I use frequently, or are just not as polished.
That being said I'll probably make the change to Linux for my many development machine at some point and keep an Air or something lightweight as a conference/presentation machine.
compare the versions from your brew list with the packages in your vagrant box for the most popular Linux distributions..
i always find it funny that on BSD's i use latest versions of software developed on Linux, while on Linux (Ubuntu, mint, Debian, centos) they are years behind.
I'd personally strongly miss Tower (for Git), Transmit (SFTP/AWS S3), Sequel Pro, Postico, and the iOS Simulator.
How about considering a change in paradigm? Instead of trying to spin everything up locally you instead have a shared development environment and bridge to it from your local laptop or desktop. Consider a large microservices environment with twenty or hundreds of services and the need to develop not only against those services but ones your coworkers are working on as well. Telepresence (http://telepresence.io) allows you to develop locally on your laptop and expose a process locally that can talk to Kubernetes resources in a remote cluster and vice versa.
Check it out: http://www.telepresence.io/
Che's only dependency is Docker. It uses Docker engine to both launch its infrastructure and to create developer environments. There will be a version of Che that runs on Kubernetes released shortly.
Note (I am project lead for Che).
It unifies both the development environment setup and the system integration testing setup/execution into the same set of tools. It's also helpful in setting up esoteric environments through QEMU like QNX on ARM during much of the testing before extending it to getting real hardware in the loop.
We also use the Ansible Python API to keep from having to re-implement a bunch of orchestration primitives from scratch.
The worst time I had with Vagrant was due to an authentication bug in v1.8.5. That was compounded by the previous release (1.8.4) being incompatible with the latest VirtualBox (5.1). Hashicorp was slow to release the fix, and we had to tell users to downgrade both tools. That sucked. This was late summer 2016.
It's been smooth since then, and I haven't had to think much about the VM aspect of our tooling in 6 months.
It'll get you a very productive and fast Linux setup based on Arch Linux and Xmonad, letting you automate the setup process by auto-linking your dotfiles and running post-install.sh if exists. This way you can spin up development environments really fast. For example, I turned an old desktop computer to a ready-to-use development machine in 30 minutes :)
It doesn't have any editor features though, it probably only makes sense for vim/emacs/etc. users. Docker is also pretty nice, but if you're not using it in production it might not solve your problem.
Much easier than vagrant or running everything manually.
I have been playing around with minikube for a couple of weeks, but the added ceremony of using Kubernetes isn't quite worth it yet for my pet projects, so it's mostly to keep up to date.
automate all setup with ansible and scripts
- Automate building dev environments (Linux-based) with dependencies
Use CI to build automatically artifacts. Provide tools for developers to ship their app to servers.
Ultimately, delete the development environment, it's always a hassle and it's always differing from prod. Only use prod machines.
By that, I mean that you give prod machines to devs who needs them, plus tooling to deploy anything they want anywhere, on any of their machines.
[1] https://github.com/cytopia/devilbox/blob/master/README.md
Here's a little demo designed for editing+testing a PHP library even if your local machine doesn't have anything more than Bash, Docker, and a text editor.
test kitchen supports a lot of various platforms, including vagrant, AWS, and openstack.
I wrote a Java program that composes a shell script that gets passed into the user data of a cloud instance. That script sets up a Dev or production system and builds a machine image if that is what you want. Then it sends a message to a queue when it is all said and done.
Go lang seems like a good fit to build such a tool (for no dependencies, just drop a singe binary). Or a Ansible alternative with a C-like-syntax.