Ruby Development Environment (OS X vs Ubuntu)

I am a developer who uses RoR-CoffeeScript-Sass-Passenger-Apache. We use EC2 for our deployment, and we have Macbook Airs for development. Although the rails community is very Mac friendly, due to the difference in the deployment stack in dev and prod, I use virtual boxing + ubuntu, while my peers are developing on OS X native.

OS X Native adds more problems since we have more dependencies on the stack (Solr, Beanstalk, Mongodb, and more, which works well in Ubuntu)

I am looking for suggestions on how Rails developers using Mac and Amazon EC2 can create their own settings for developers and prod.

I would also like to receive feedback on the use of strollers to distribute the development environment for this use case.

+4
source share
2 answers

Our team has been developing on Mac computers and has been running Ubuntu on EC2 for three years now, with very few problems. Several things helped make this a smooth process:

  • We can run the entire application stack ** on a Mac. Between macports, homebrew, and source creation, when necessary, we managed to get every piece of technology that we run in prod while working on our dev blocks. The way the parts are arranged and their match is different locally (in prod, for example, we automatically detect our memcached instance, whereas locally it is hardcoded), but each integration can be tested on Mac computers first before going to prod.

  • Our continuous assembly system is on the same installation as our crates. This means that if you check some kind of code that depends on some part of the local magic, it is quickly detected.

  • We run a soak (some people call this stack or integrated) stack, which is configured identically to production. This sometimes leads to some development overhead, but has so many advantages that it is worth it. All code goes through this stack before being pushed to prod.

This setting works well enough that over time we have allowed the spread of parts of the system. Previously, we traveled by passenger transport (for example, in prod), but now we use Pow. We regularly experiment with new versions of ruby ​​in development for some time before updating the rest of the stack.

I had to develop using a virtualized environment for other projects (OSX + CentOS in VirtualBox), and definitely found it more painful than the native one. Firstly, it was like driving two cars instead of one. Everyone also felt stupid.

If there is a piece of the stack that is painful to run on a Mac, I would definitely prefer to use the hit: a) spend time trying to get it to work locally or b) abstract this part, rather than pay tax on the virtual environment.

** In this discussion, I include only the Rails application and direct dependencies. For example, we use a puppet to configure our EC2 fleet, but we do not launch it in our dev blocks.

+2
source

It is common practice to copy your stack as an "intermediate" environment. With EC2, you can simply create AMIs for your existing machines and duplicate them by including them only for deployment testing and run your tests to make sure everything is working properly before deploying it for production. Or often you can leave it on an ongoing basis so developers can quickly deploy updates or patches for testing as needed.

Performing this method ensures that you have an exact copy of your production system for testing before deployment, thereby eliminating any (catastrophic) problems associated with deployments creeping into production.

+3
source

Source: https://habr.com/ru/post/1397283/


All Articles