<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Decrypt &#187; Ruby</title>
	<atom:link href="http://decrypt.ysance.com/tag/ruby/feed/" rel="self" type="application/rss+xml" />
	<link>http://decrypt.ysance.com</link>
	<description>Le site de decryptage des technologies de l&#039;informatique</description>
	<lastBuildDate>Fri, 03 Feb 2012 08:25:47 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.1.3</generator>
		<item>
		<title>Automation on AWS with Ruby and Puppet</title>
		<link>http://decrypt.ysance.com/2011/06/automation-on-aws-with-ruby-and-puppet/</link>
		<comments>http://decrypt.ysance.com/2011/06/automation-on-aws-with-ruby-and-puppet/#comments</comments>
		<pubDate>Wed, 08 Jun 2011 15:33:57 +0000</pubDate>
		<dc:creator>Frédéric Faure</dc:creator>
				<category><![CDATA[Architecture]]></category>
		<category><![CDATA[Automatisation]]></category>
		<category><![CDATA[Cloud Computing]]></category>
		<category><![CDATA[Infrastructure]]></category>
		<category><![CDATA[Scalability]]></category>
		<category><![CDATA[Amazon Web Services]]></category>
		<category><![CDATA[Capistrano]]></category>
		<category><![CDATA[IaaS]]></category>
		<category><![CDATA[Puppet]]></category>
		<category><![CDATA[Ruby]]></category>
		<category><![CDATA[UrbanDive]]></category>
		<category><![CDATA[XTR-Lucid]]></category>

		<guid isPermaLink="false">http://decrypt.ysance.com/?p=2459</guid>
		<description><![CDATA[<img class="size-full wp-image-2465 alignright" title="Logo UrbanDive" src="http://decrypt.ysance.com/wp-content/uploads/2011/06/urbandive.png" alt="Logo UrbanDive" width="141" height="141" />

<a title="UrbanDive" href="http://www.urbandive.com">Urbandive</a> is an immersive view service launched by the <a title="Groupe Pages Jaunes" href="http://www.pagesjaunesgroupe.com/">French YellowPages</a> which allows you to travel in cities in France thanks to a 360° view. Urbandive focuses on providing high definition pictures and accurate professional and social content. One of the biggest jobs was to enable a fast scalable architecture, because it was really difficult to forecast the traffic load at production time. Traffic load may be influenced if the service receives attention from users as a result of advertising.

Below you will find a summary of the goals we achieve by using a Ruby scheduler built on top of <a title="Puppet Labs" href="http://www.puppetlabs.com/">Puppet</a> on <a title="Amazon Web Services" href="http://aws.amazon.com/">AWS</a> to create a complete infrastructure.

<strong><em>Workflow &#38; XTR-Lucid</em></strong>
Our scalability combo is : a home-made Ruby scheduler (<em>XTR-Lucid</em>) to deal with AWS APIs + the Puppet Master to install services and configure EC2 instances and keep them up-to-date during all the production time. This leads to full automation.

Here is the workflow (for the <span style="text-decoration: underline;">creation step</span>, there are other workflows for stop/reboot/health-check/...) of our automation tool. The dashboard allows you to select a template (which contains the following informations : AMI id, instance type, availability zone, key, list of security groups, list of EBS - from snapshots or not -, ...) and to set a name for the instance in the "create" workflow.

[...]]]></description>
			<content:encoded><![CDATA[<p><img class="size-full wp-image-2465 alignright" title="Logo UrbanDive" src="http://decrypt.ysance.com/wp-content/uploads/2011/06/urbandive.png" alt="Logo UrbanDive" width="141" height="141" /></p>
<p><a title="UrbanDive" href="http://www.urbandive.com">Urbandive</a> is an immersive view service launched by the <a title="Groupe Pages Jaunes" href="http://www.pagesjaunesgroupe.com/">French YellowPages</a> which allows you to travel in cities in France thanks to a 360° view. Urbandive focuses on providing high definition pictures and accurate professional and social content. One of the biggest jobs was to enable a fast scalable architecture, because it was really difficult to forecast the traffic load at production time. Traffic load may be influenced if the service receives attention from users as a result of advertising.</p>
<p>Below you will find a summary of the goals we achieve by using a Ruby scheduler built on top of <a title="Puppet Labs" href="http://www.puppetlabs.com/">Puppet</a> on <a title="Amazon Web Services" href="http://aws.amazon.com/">AWS</a> to create a complete infrastructure.</p>
<p><strong><em>Workflow &amp; XTR-Lucid</em></strong><br />
Our scalability combo is : a home-made Ruby scheduler (<em>XTR-Lucid</em>) to deal with AWS APIs + the Puppet Master to install services and configure EC2 instances and keep them up-to-date during all the production time. This leads to full automation.</p>
<p>Here is the workflow (for the <span style="text-decoration: underline;">creation step</span>, there are other workflows for stop/reboot/health-check/&#8230;) of our automation tool. The dashboard allows you to select a template (which contains the following informations : AMI id, instance type, availability zone, key, list of security groups, list of EBS &#8211; from snapshots or not -, &#8230;) and to set a name for the instance in the &laquo;&nbsp;create&nbsp;&raquo; workflow.</p>
<p><img class="size-full wp-image-2472" title="Automatisation AWS XTR-Lucid Puppet" src="http://decrypt.ysance.com/wp-content/uploads/2011/06/Automatisation-AWS-PuppetLabs.png" alt="Automatisation AWS XTR-Lucid Puppet" width="960" height="720" /></p>
<p>This schema gives the general idea of how it works.</p>
<p>To be more accurate and to explain the workflow just a bit :</p>
<ul>
<li>The scheduler can be outside or inside of AWS.</li>
<li>First an <em>action file</em> is put into the <em>TODO </em>directory, by the web application (simple <em>rhtml </em>dashboard) or by the monitoring tool directly. For posting files from the monitoring tool, we will have to define thresholds after some weeks of use of the application. At this time, we have not enough data feedback as we just commenced production.</li>
<li>The action file is then processed by the scheduler :</li>
</ul>
<ol>
<li>Connection to AWS and request to start an EC2 instance from the AMI.</li>
<li>Scheduler checks that instance is running, EBS (Elastic Block Store) are <em>available</em>, then <em>in-use</em>, and eventually that EC2 TCP stack is up and SSH is OK. Then it connects to the brand-new instance.</li>
<li>Puppet client is installed and started, so it sends a certificate request to the master.</li>
<li>Puppet client is stopped to avoid any interaction.</li>
<li>Connection to the PuppetMaster : update the main files (nodes files of PuppetMaster, &laquo;&nbsp;/etc/hosts&nbsp;&raquo; file, roles file of Capistrano) and then accept the certificate request of the client.</li>
<li>Capistrano updates the &laquo;&nbsp;/etc/hosts&nbsp;&raquo; file on all instances of our infrastructure as soon as a new EC2 instance comes up (or down), without having to trigger (<em>puppetrun</em>) the simultaneous &laquo;&nbsp;pull configuration&nbsp;&raquo; of all the Puppet clients.</li>
<li>Connection to the new instance.</li>
<li>Puppet client is started.</li>
<li>Puppet client connects to the master and authenticate. Then it gets what it needs to install and configure the new instance.</li>
<li>The installation occurs on the new instance that will be soon available.</li>
</ol>
<ul>
<li>The scheduler doesn&#8217;t wait until the instance is fully configured to end the task : installation by Puppet is asynchronous. The scheduler just ends by updating its repository and the monitoring tool.</li>
</ul>
<p><span style="text-decoration: underline;">Technical note 1 :</span> we use <a title="Capistrano" href="http://www.capify.org/">Capistrano</a> mainly for application deployment. In the above case (<em>create instance</em>), we use it to update the &laquo;&nbsp;/etc/hosts&nbsp;&raquo; file on all instances of our infrastructure as soon as a new EC2 instance comes up (or down &#8211; it is the same use for <em>stop instance</em>), without having to trigger (<em>puppetrun</em>) the simultaneous &laquo;&nbsp;pull configuration&nbsp;&raquo; of all the Puppet clients (bad idea ;ob). That&#8217;s just a little tip for this workflow.</p>
<p><span style="text-decoration: underline;">Technical note 2 :</span> the Ruby scheduler works in asynchronous mode (for security reasons &amp; to be called by other tools &#8211; like a monitoring one) by creating <em>action files</em> from the web application in the <em>TODO </em>directory (which can be filled by the monitoring tool for auto-scalability) checked every minute by a CRON which calls the heart of the automation tool.</p>
<p><strong><em>Technical facts</em></strong></p>
<ul>
<li>We have actually 40 &#8211; 50 servers, that&#8217;s our base, but we probably will go higher when the traffic will come with marketing campaigns.</li>
<li>We use Lucid Lynx Ubuntu OS (from a standard AMI powered by <a title="Canonical" href="http://www.canonical.com/">Canonical</a>).</li>
<li>We use the PuppetMaster installed on <a title="Apache" href="http://httpd.apache.org/">Apache</a> with <a title="Phusion Passenger" href="http://www.modrails.com/">Phusion Passenger</a> to increase performances.</li>
<li>We took Puppet (standard version) right from the Ubuntu repositories packaged in the AMI.</li>
</ul>
<p><strong><em>Why using Puppet (and especially on AWS) ?</em></strong><br />
<span style="text-decoration: underline;"> Consistency &amp; Flexibility</span><br />
We have multiple services, so we need to be sure that each group of servers is consistent in terms of configuration. If we need to push a quick change on all nodes of a type at a given time, we can even push (trigger &laquo;&nbsp;pull&nbsp;&raquo;, to be more accurate, with <em>puppetrun</em>) this new setting from the PuppetMaster without waiting the pull of Puppet client (30min period) and we are sure that this one is pushed everywere it is needed.<br />
AWS offer AMIs to &laquo;&nbsp;snapshot&nbsp;&raquo; an instance and clone this one as many as we want. This is very good for developpement, load tests, .. But when we come into production, we cannot build another AMI each time we do a change on a setting and deploy again EC2 instances from the new AMI. We need something flexible to patch our configurations quickly, keeping consistency at all times.</p>
<p><span style="text-decoration: underline;">Scalability &amp; Ease</span><br />
This is a new Internet service which can have a load peak at anytime depending on marketing campaigns. But we have to deal with financial things too. So we keep a base and have to start quickly full configured up-to-date instances within a few minutes. We achieve this by writing a home-made ruby-script-based scheduler (<em>XTR-Lucid</em>) that deals with AWS APIs to launch/stop EC2, add EBS (empty or from snapshot), add/remove to/from ELB, add/delete the new/old host to/from our monitoring tool, &#8230; AWS EC2 instances are kept in a repository on our Ruby scheduler. Then our tool lets Puppet take over which ensures for each brand-new instance started from a standard Lucid Lynx AMI that all services, configurations, security rules are installed/applied. So with the feedback of our monitoring tool, the infrastructure can grow and decrease alone (depending on the thresholds set) or we can deploy and stop instances in just one click on our web dashboard.</p>
<p><span style="text-decoration: underline;">Operating</span><br />
In such a project, there is a lot of various services to monitor for the Ops team (And&#8230; Yes ! Ops team is always essential, even with automated infrastructure ! :o)). So this is important to capitalize upon knowledge in Puppet descriptors and XTR-Lucid repository and templates, so that by simply reading the descriptors/repository/templates, the whole team knows all what it needs to know at a glance (no need to look everywhere). Things become a lot easier.</p>
<p><span style="text-decoration: underline;">Portable Infrastructure</span><br />
Because of the diversity of services run in the project, maybe not all will fit into AWS in a long term experience (over one year). Once we have real-life feedback on traffic, some services will stay on AWS, others, maybe, will migrate into our physical datacenter. So it will be easier to migrate because all the configuration is concentrated in Puppet descriptors. This enables us to re-deploy easily a brand-new infrastructure on another plateform (even if it is not in the Cloud).</p>
<p>I hope you enjoyed this. You can find here some more information on the way the Ops job is evolving, based on this experience (among others) : <a title="Decrypt, Solutions Linux / Open Source 2011 – Le métier de l’Administration Système avec le Cloud Computing" href="http://decrypt.ysance.com/2011/05/solutions-linux-open-source-2011-le-metier-de-l-administration-systeme-avec-le-cloud-computing/">Solutions Linux / Open Source 2011 – Le métier de l’Administration Système avec le Cloud Computing</a> (FR). These slides are the ones used for a talk I gave at Solution Linux 2011 (France).</p>
<p><em><strong>Frédéric FAURE</strong></em> <a title="Frédéric FAURE @Twitter" href="http://twitter.com/fredericfaure">@Twitter</a> <a title="Ysance, Simplifions les projets informatiques" href="http://www.ysance.com/">@Ysance</a></p>
]]></content:encoded>
			<wfw:commentRss>http://decrypt.ysance.com/2011/06/automation-on-aws-with-ruby-and-puppet/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Puppet et Capistrano : la clé de l&#8217;automatisation</title>
		<link>http://decrypt.ysance.com/2009/07/automatisation-puppet-capistrano/</link>
		<comments>http://decrypt.ysance.com/2009/07/automatisation-puppet-capistrano/#comments</comments>
		<pubDate>Thu, 30 Jul 2009 16:02:49 +0000</pubDate>
		<dc:creator>Frédéric Faure</dc:creator>
				<category><![CDATA[Automatisation]]></category>
		<category><![CDATA[Infrastructure]]></category>
		<category><![CDATA[Capistrano]]></category>
		<category><![CDATA[Puppet]]></category>
		<category><![CDATA[Ruby]]></category>

		<guid isPermaLink="false">http://decrypt.ysance.com/?p=425</guid>
		<description><![CDATA[<a href="http://reductivelabs.com/" title="Site de Puppet">Puppet</a> est un produit open source qui permet de gérer à moindre frais une infrastructure importante en centralisant la gestion de la configuration des machines : il permet de maintenir la configuration des différents types de machines d’une infrastructure iso entre elles et de démarrer rapidement une instance en l’associant à un type de nœud Puppet. Il capitalise également les connaissances sur les composants/paramétrages de chaque type de machines via ses descripteurs.

<a href="http://www.capify.org/" title="Site de Capistrano">Capistrano</a> est produit open source qui permet d’associer des machines à des rôles (exemple : role :web, « frontal1 », « frontal2 ») et d’exécuter une tâche donnée en parallèle sur toutes les machines d’un ou plusieurs rôles. Il permet également de capitaliser les connaissances sur les différentes tâches de l’infrastructure et les rend reproductibles et centralisées, donc fiables. il se connecte en SSH et donc assure un niveau de sécurité minimum.

[...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://reductivelabs.com/" title="Site de Puppet">Puppet</a> est un produit open source qui permet de gérer à moindre frais une infrastructure importante en centralisant la gestion de la configuration des machines : il permet de maintenir la configuration des différents types de machines d’une infrastructure iso entre elles et de démarrer rapidement une instance en l’associant à un type de nœud Puppet. Il capitalise également les connaissances sur les composants/paramétrages de chaque type de machines via ses descripteurs.</p>
<p><a href="http://www.capify.org/" title="Site de Capistrano">Capistrano</a> est un produit open source qui permet d’associer des machines à des rôles (exemple : role :web, « frontal1 », « frontal2 ») et d’exécuter une tâche donnée en parallèle sur toutes les machines d’un ou plusieurs rôles. Il permet également de capitaliser les connaissances sur les différentes tâches de l’infrastructure et les rend reproductibles et centralisées, donc fiables. Il se connecte en SSH et donc assure un niveau de sécurité minimum.</p>
<div id="media"><object id="csSWF" classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" width="640" height="498" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0"><param name="src" value="http://www.labdecisionnel.fr/decrypt-content/Web/Ysance-Automatisation-Puppet-Capistrano.swf" /><param name="bgcolor" value="#1a1a1a" /><param name="quality" value="best" /><param name="allowScriptAccess" value="always" /><param name="allowFullScreen" value="true" /><param name="scale" value="showall" /><param name="flashVars" value="autostart=false" /><param name="name" value="csSWF" /><param name="flashvars" value="autostart=false" /><param name="allowfullscreen" value="true" /><embed id="csSWF" type="application/x-shockwave-flash" width="640" height="498" src="http://www.labdecisionnel.fr/decrypt-content/Web/Ysance-Automatisation-Puppet-Capistrano.swf" flashvars="autostart=false" allowfullscreen="true" allowscriptaccess="always" scale="showall" quality="best" bgcolor="#1a1a1a" name="csSWF"></embed></object></div>
<div> </div>
<div><img class="size-full wp-image-430" title="Logo Puppet" src="http://decrypt.ysance.com/wp-content/uploads/2009/07/puppet2.png" alt="Logo Puppet" width="96" height="108" /> <img class="size-medium wp-image-429" title="Logo Capistrano" src="http://decrypt.ysance.com/wp-content/uploads/2009/07/capistrano-logo-big-300x114.png" alt="Logo Capistrano" width="300" height="114" /></div>
<div> </div>
<div class="mceTemp">Vous pouvez également accéder aux versions <strong>IPhone</strong> et <strong>IPod</strong> de ce webcast :</div>
<p><a href="http://www.labdecisionnel.fr/decrypt-content/IPhone/Ysance-Automatisation-Puppet-Capistrano.m4v">Version IPhone</a><br />
<a href="http://www.labdecisionnel.fr/decrypt-content/IPod/Ysance-Automatisation-Puppet-Capistrano.m4v">Version IPod</a></p>
<p> </p>
<p>Puppet et Capistrano sont 2 outils ayant pour but de capitaliser les connaissances sur le fonctionnement d’une infrastructure et de l’automatiser de façon à l’homogénéiser et la fiabiliser.</p>
<p>Chacun des outils à son propre rôle et utiliser les 2 est une très bonne solution, Puppet étant attaché au maintient d’une configuration iso à tout moment entre chaque machine d’un même type et Capistrano permettant d’exécuter des tâches plus ou moins complexes en parallèle sur des groupes de machines assignées à des rôles.</p>
<p>Il est également possible en poussant le fonctionnement un peu plus loin, dans un environnement virtualisé par exemple, d’avoir un script qui démarre des machines, installe le client Puppet sur celles-ci, référence les nouvelles machines et accepte les certificats au niveau du Puppet Master, puis redémarre le client, avant de lancer une tâche Capistrano qui déploie la dernière version de l’application à partir de SVN sur les serveurs ne possédant pas encore l’application. En un clic, il est possible de multiplier le nombre de ses frontaux pour absorber un pic de charge par exemple.</p>
<p>Le mot clé est : « automatisation ! »</p>
<p><em><strong>Frédéric FAURE</strong></em></p>
]]></content:encoded>
			<wfw:commentRss>http://decrypt.ysance.com/2009/07/automatisation-puppet-capistrano/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
	</channel>
</rss>

