Engine Yard Local allows you to develop and test, locally on your own computer, using a virtual machine with an Engine Yard environment. Engine Yard Local allows you to:
Simplify your test and development process by running a fast, fully functional Engine Yard VM, wherever you need it.
Improve productivity by deploying locally - without committing to remote repositories or launching instances in the cloud.
Test Chef recipes before deploying to production or staging environments.
Leverage local compute resources for free, during development iterations.
The Engine Yard Local VM includes the same kernel, with the same Gentoo OS, and the same Chef provisioning as one of our cloud instances. Engine Yard Local provides the most recent version of the Engine Yard Gentoo stable-v2 stack (cookbooks) and the CLI warns you when your cookbooks are not up to date. The tool is built using Vagrant and VirtualBox. Engine Yard Local runs from your project root directory.
The following commands create a new Rails project, myapp, within the existing Sites directory. Because this is the first time, ey-local up boots a VirtualBox, configures it, installs the cookbook recipes onto the VM, creates a DNA file based on the Git project settings for the app, executes the recipes, runs bundler, and invokes the migrations.
$ cd ~/Sites/ $ rails new myapp $ cd myapp $ ey-local up
Note: You might want to run one Engine Yard Local application at a time. To switch to another project, power off the VM, change directories, and run ey-local up in the new project directory.
Or, if you don't mind some manual editing, you can edit the Vagrantfile. The boilerplate Vagrantfile puts everything on the same IP. So in order to have more than one VM running at the same time, edit the Vagrantfile and resolve the IP conflicts manually.
Run Engine Yard Local using the todo app
You can use the Engine Yard sample todo app to test your Engine Yard Local installation. For example:
$ cd ~/Sites/ $ git clone git://github.com/engineyard/todo.git $ cd todo
Note: Engine Yard Local defaults to PostgreSQL; If you want to use MySQL, see this known issue for a workaround.
These commands will help you navigate your virtual machine.
View VM status
To see the status of your Engine Yard Local virtual machine, use the following command:
$ ey-local status
Log in via ssh
You can customize your development environment by logging in to a running Engine Yard Local virtual machine.
$ ey-local ssh
On an Engine Yard Local server and any Vagrant box, the /vagrant directory is shared with the local file system. Once logged in, change to that folder and you can see that it is the directory in which Engine Yard Local was started.
Note: That same path is also linked to /data/PROJECTNAME/current, so changes on the local file system in the project will be reflected inside the ey-local VM, and vice versa.
vagrant $ cd /vagrant vagrant $ ls -l
Custom Chef cookbooks on the VM
The /vagrant directory is mounted from the application directory outside of the VM, generally where the ey-local command is invoked. So if you create a sub-directory called cookbooks within your app directory, then the VM will see it as vagrant/cookbooks/ and have access to the contents. If you put custom Chef recipes in that directory, then as part of the ey-local up process, those recipes are run to install and configure software on the VM.
Would be seen by an Engine Yard Local VM started from myapp/ as: