Ask HN: Alternatives to Vagrant for development environments?
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.
106 comments
[ 2.8 ms ] story [ 138 ms ] threadHere'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.
https://github.com/DHager/docker-php-library-demo
test kitchen supports a lot of various platforms, including vagrant, AWS, and openstack.
[1] https://vagga.readthedocs.io/
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.
Anyway, I have read a lot about those problems and I hope it gets better at some point - especially for Docker on Windows, which is a pain in the neck for our developers (who now work with a Linux VM running Docker; ...)
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.
http://docker-sync.io/
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.
http://www.webmhs.com/2017/04/prediksi-real-madrid-vs-barcel...
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'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 :)
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".
Much easier than vagrant or running everything manually.
[1] https://github.com/cytopia/devilbox/blob/master/README.md
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.
I have seen awesome talks and it didn't matter if the slides were not pretty.
A Google doc outline and some demo is enough for most dev presos.
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.
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.
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!
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.
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.