Development and testing on open technologies in the cloud on the example of Node.js, Riak, Ruby on Rails and dozens of others
Dear software developers and testers! We bring to your attention a series of articles on the organization of testing and application development in the cloud. The following articles are included in this cycle:
- Free Windows Azure Capabilities for MSDN Subscribers: How to Activate and Get Started?
- Application Development and Testing in Windows Azure Cloud
- Popular cloud development and testing scenarios
- Development and testing on open technologies in the cloud on the example of Node.js, Riak, Ruby on Rails and dozens of others
In this article, we will consider the possibilities for developing and testing applications built on open technologies and the Linux operating system in the Windows Azure cloud. In particular, we will consider working with a test environment of Riak and Erlang technologies, Node.js, Ruby on Rails.
Для изучения материала этой статьи вам потребуется Windows Azure. Бесплатный триал на 30 дней можно оформить по этой ссылке . Также можно активировать подписку Windows Azure в рамках BizSpark , MSDN или MPN .
VM Depot Community
Thanks to the open VM Depot community , today hundreds of ready-to-use virtual machine images using open technologies and the Linux operating system (Alt Linux, CentOS, Ubuntu, SUSE Linux, and others) have already been prepared for the Windows Azure cloud platform.
Among the environments available in VM Depot, the following can be distinguished: LAMP, Drupal, Jenkis, Magento, MongoDB, Neo4js, Redis, WordPress, Apache Solr, Cassandra, Coppermine, Discourse, Django, DokuWiki, GitLab, Gitorious, Horde, JBoss, Jetty, Joomla , JRuby, Mantis, MediaWiki, Moodle, Node.js, OpenERP, ownCloud, phpBB, Plone, Redmine, Riak, Spree, SugarCRM, Tomcat, XOOPS and dozens of others.
Deploying Node.JS Environment from VM Depot
Deploying the necessary environment for developing and testing open-source projects is as easy as using VM Depot and the Windows Azure portal .
In the Windows Azure administration portal, go to the Virtual Machines section and select the Images menu item. The list will list all previously created virtual machine images.
Choose Browse VM Depot. You will receive a list of hundreds of VM Depot virtual machine images that can be hosted.
Select the image you need for your development and testing environment (Node.js) and click the "Next" arrow.
Specify the region you prefer to host, select your subscription (if you have several), specify an existing one or create a new storage account to host the virtual machine image. Click the "Finish" checkbox.
The process of copying the virtual machine image from the VM Depot gallery to your specified location (blob storage in your subscription) will be launched. In a few seconds, you will already be able to register a virtual machine based on the downloaded file.
Select your image from the list and click "Register". You will be prompted to name the copied image in the storage and indicate the direct address to the VHD file.
Wait until the registration process is complete and begin the process of creating a virtual machine from the gallery. Now a new, just downloaded Node.js virtual machine image is available for you.
Select a new image and click Next. Complete all the steps in the wizard to create a virtual machine. Your development and testing environment will be created! After successfully creating a virtual machine, you can go to the control panel to configure, monitor, and manage endpoint parameters. For example, open a new endpoint to access the virtual machine's web server on port 80.
After that, you can follow the link of the cloud service associated with your virtual machine (the URL can be seen in the admin panel) in order to start developing and testing Node.js applications in the cloud!
If you follow the same steps with a ready-made virtual machine image built for the development environment and testing on Ruby On Rails, then in just a few minutes you can get a ready-made, pre-configured environment.
Work with VM Depot from the command line Linux, OSX, Windows
Важно! Для работы Windows Azure из командной строки, пожалуйста, установите кроссплатформенные инструменты для вашей операционной системы (руководство для Linux , для OSX , для Windows ).
Working with VM Depot from the command line is easy. Go to http://vmdepot.msopentech.com and enter the name of the technology you are interested in in the search field, for example, Riak .
In the list of search results you can see the official environment image created by the author of the Riak ( Basho ) repository for placement in Windows Azure. From the information to the image, you can find out that the environment is based on CentOS and, in addition to the pre-installed Riak database, also contains packages from Erlang and Riak Console, which allows you to get a ready-made environment for development and testing using Riak in a couple of clicks.
Choose a link Deployment Script opposite Riak for receiving a script (for Linux, OSX and Windows) for automatically downloading a VHD file from the VM Depot gallery to your cloud storage, creating a virtual machine based on the downloaded image and running it in a Windows Azure cloud environment.
Accept the conditions and in the next window select the Windows Azure data center (region) required for hosting.
You will be offered a ready-made line of script to execute it in bash on Linux, OSX or in PowerShell on Windows. Thanks to cross-platform command line tools, the syntax and work with the command line are the same for all OSs.
Copy the line of the script and change a number of your personal parameters: DNS prefix, username and password, and also allow SSH access to the virtual machine. You will get a command line similar to the following:
azure vm create RiakVMDepot -o vmdepot-66-3-16 -l "North Europe" vyunev mypassword –ssh
Open a command line interface (bash for Linux and OSX or PowerShell for Windows) and run the resulting command.
The process of copying a virtual machine’s disk from the VM Depot gallery to your account’s blob, creating a disk-based machine and starting it will start. The whole procedure will take several minutes, you will be informed about the progress in the command line terminal.
The created machine will be available via SSH.
We examined several options for working with virtual machines in Windows Azure based on open technologies for development and testing. Now you know how you can easily deploy a test or production environment in the cloud for development using the Windows Azure management portal or command-line tools.