You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@jclouds.apache.org by na...@apache.org on 2016/08/22 07:26:42 UTC

svn commit: r1757114 - in /jclouds/site-content/blog: 2016/08/15/ 2016/08/22/ 2016/08/22/arbitrary-cpu-ram/ 2016/08/22/arbitrary-cpu-ram/index.html atom.xml index.html

Author: nacx
Date: Mon Aug 22 07:26:42 2016
New Revision: 1757114

URL: http://svn.apache.org/viewvc?rev=1757114&view=rev
Log:
deploy jclouds site content

Added:
    jclouds/site-content/blog/2016/08/22/
    jclouds/site-content/blog/2016/08/22/arbitrary-cpu-ram/
    jclouds/site-content/blog/2016/08/22/arbitrary-cpu-ram/index.html
Removed:
    jclouds/site-content/blog/2016/08/15/
Modified:
    jclouds/site-content/blog/atom.xml
    jclouds/site-content/blog/index.html

Added: jclouds/site-content/blog/2016/08/22/arbitrary-cpu-ram/index.html
URL: http://svn.apache.org/viewvc/jclouds/site-content/blog/2016/08/22/arbitrary-cpu-ram/index.html?rev=1757114&view=auto
==============================================================================
--- jclouds/site-content/blog/2016/08/22/arbitrary-cpu-ram/index.html (added)
+++ jclouds/site-content/blog/2016/08/22/arbitrary-cpu-ram/index.html Mon Aug 22 07:26:42 2016
@@ -0,0 +1,346 @@
+<!DOCTYPE html>
+<html lang="en">
+    <head>
+        <meta charset="utf-8">
+<title>Apache jclouds&reg; :: Arbitrary CPU and RAM supported in the ComputeService</title>
+<meta name="viewport" content="width=device-width, initial-scale=1.0">
+<meta name="description" content="">
+<meta name="author" content="">
+
+<!--link rel="stylesheet/less" href="less/bootstrap.less" type="text/css" /-->
+<!--link rel="stylesheet/less" href="less/responsive.less" type="text/css" /-->
+<!--script src="js/less-1.3.3.min.js"></script-->
+<!--append ‘#!watch’ to the browser URL, then refresh the page. -->
+
+<link href="/css/bootstrap.min.css" rel="stylesheet">
+<link href="/css/style.css" rel="stylesheet">
+<link href="/css/syntax.css" rel="stylesheet">
+
+<!-- HTML5 shim, for IE6-8 support of HTML5 elements -->
+<!--[if lt IE 9]>
+<script src="js/html5shiv.js"></script>
+<![endif]-->
+
+<!-- Fav and touch icons -->
+<!--
+<link rel="apple-touch-icon-precomposed" sizes="144x144" href="/img/apple-touch-icon-144-precomposed.png">
+<link rel="apple-touch-icon-precomposed" sizes="114x114" href="/img/apple-touch-icon-114-precomposed.png">
+<link rel="apple-touch-icon-precomposed" sizes="72x72" href="/img/apple-touch-icon-72-precomposed.png">
+<link rel="apple-touch-icon-precomposed" href="/img/apple-touch-icon-57-precomposed.png">
+-->
+<link rel="shortcut icon" href="/favicon.ico">
+
+<link rel="alternate" type="application/atom+xml" href="/blog/atom.xml" title="Blog Posts Feed">
+<link rel="alternate" type="application/atom+xml" href="/releasenotes/atom.xml" title="Release Notes Feed">
+
+<script type="text/javascript" src="/js/jquery.min.js"></script>
+<script type="text/javascript" src="/js/bootstrap.min.js"></script>
+<script type="text/javascript" src="/js/toc.js"></script>
+
+<script type="text/javascript">
+    var _gaq = _gaq || [];
+    _gaq.push(['_setAccount', 'UA-8638379-1']);
+    _gaq.push(['_trackPageview']);
+
+    (function() {
+     var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
+     ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
+     var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
+     })();
+</script>
+<script type="text/javascript">
+    (function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
+     (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
+     m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
+     })(window,document,'script','//www.google-analytics.com/analytics.js','ga');
+
+    ga('create', 'UA-47106724-1', 'jclouds.apache.org');
+    ga('send', 'pageview');
+</script>
+
+    </head>
+    <body>
+        <nav class="navbar navbar-default navbar-fixed-top" role="navigation">
+    <div class="container">
+        <div class="navbar-header">
+            <button type="button" class="navbar-toggle" data-toggle="collapse" data-target="#bs-example-navbar-collapse-1">
+                <span class="sr-only">Toggle navigation</span>
+                <span class="icon-bar"></span>
+                <span class="icon-bar"></span>
+                <span class="icon-bar"></span>
+            </button>
+            <a class="navbar-brand" href="/">Apache jclouds &reg;</a>
+        </div>
+
+        <div class="collapse navbar-collapse" id="bs-example-navbar-collapse-1">
+            <ul class="nav navbar-nav">
+                <li class="dropdown">
+                    <a href="#" class="dropdown-toggle" data-toggle="dropdown">Getting Started<strong class="caret"></strong></a>
+                    <ul class="dropdown-menu">
+                        <li><a href="/start/what-is-jclouds/">What Is Apache jclouds?</a></li>
+                        <li><a href="/start/install/">Installation Guide</a></li>
+                        <li class="divider"></li>
+                        <li><a href="/start/concepts/">Core Concepts</a></li>
+                        <li><a href="/start/compute/">ComputeService</a></li>
+                        <li><a href="/start/blobstore/">BlobStore</a></li>
+                        <li><a href="http://github.com/jclouds/jclouds-examples">Examples</a></li>
+                    </ul>
+                </li>
+                <li class="dropdown">
+                    <a href="#" class="dropdown-toggle" data-toggle="dropdown">Documentation<strong class="caret"></strong></a>
+                    <ul class="dropdown-menu">
+                        <li><a href="/reference/providers/">Cloud Providers</a></li>
+                        <li><a href="/guides">User Guides</a></li>
+                        <li><a href="/reference/troubleshooting/">Troubleshooting</a></li>
+                        <li><a href="/reference/configuration/">Configuration</a></li>
+                        <li><a href="/reference/logging/">Logging</a></li>
+                        <li><a href="/reference/javadoc/">Javadoc</a></li>
+                        <li class="divider"></li>
+                        <li class="dropdown-header">Developer Guides</li>
+                        <li><a href="https://cwiki.apache.org/confluence/display/JCLOUDS/">Wiki</a></li>
+                    </ul>
+                </li>
+                <li class="dropdown">
+                    <a href="#" class="dropdown-toggle" data-toggle="dropdown">Community<strong class="caret"></strong></a>
+                    <ul class="dropdown-menu">
+                        <li><a href="/community/">Get In Touch!</a></li>
+                        <li><a href="http://www.meetup.com/jclouds/">Attend An Event</a></li>
+                        <li><a href="/community/users/">Who Is Using jclouds?</a></li>
+                        <li class="divider"></li>
+                        <li class="dropdown-header">Contribute</li>
+                        <li><a href="/reference/report-a-bug/">Report a Bug</a></li>
+                        <li><a href="http://jclouds.ci.cloudbees.com">Continuous Integration</a></li>
+                        <li><a href="https://cwiki.apache.org/confluence/display/JCLOUDS/How+to+Contribute">How To Contribute Code</a></li>
+                        <li><a href="https://cwiki.apache.org/confluence/display/JCLOUDS/How+to+Contribute+Documentation">How To Contribute Documentation</a></li>
+                    </ul>
+                </li>
+                <li class="dropdown">
+                    <a href="#" class="dropdown-toggle" data-toggle="dropdown">About Apache<strong class="caret"></strong></a>
+                    <ul class="dropdown-menu">
+                        <li><a href="http://www.apache.org">The Apache Software Foundation</a></li>
+                        <li><a href="http://www.apache.org/foundation/contributing.html">Donations</a></li>
+                        <li><a href="http://www.apache.org/foundation/sponsorship.html">Sponsorship</a></li>
+                        <li><a href="http://www.apache.org/security/">Report a Vulnerability</a></li>
+                        <li><a href="http://www.apache.org/foundation/thanks.html">Thanks</a></li>
+                    </ul>
+                </li>
+                <li><a href="/blog">Blog</a></li>
+            </ul>
+            <ul class="nav navbar-nav navbar-right">
+                <li class="dropdown">
+                    <a href="#" class="dropdown-toggle" data-toggle="dropdown">Release Notes<strong class="caret"></strong></a>
+                    <ul class="dropdown-menu">
+                        <!-- only keep the release notes for supported versions in this list -->
+                        <li><a href="/releasenotes/1.9.2">1.9.2</a></li>
+                        <li><a href="/releasenotes/1.9.1">1.9.1</a></li>
+                        <li><a href="/releasenotes/1.9.0">1.9.0</a></li>
+                        <li><a href="/releasenotes/1.8.1">1.8.1</a></li>
+                        <li><a href="/releasenotes/1.8.0">1.8.0</a></li>
+                        <li class="divider"></li>
+                        <li class="dropdown-header">Previous releases</li>
+                        <li><a href="/releasenotes">Release archive</a></li>
+                    </ul>
+                </li>
+                <li>
+                    <div>
+                        <a class="btn btn-success navbar-btn" href="/start/install/">
+                            <span class="glyphicon glyphicon-download"></span>
+                            Install
+                        </a>
+                    </div>
+                </li>
+            </ul>
+        </div>
+    </div>
+</nav>
+
+        <div class="container">
+            <div class="page-header">
+                <h1>Arbitrary CPU and RAM supported in the ComputeService</h1>
+                <span class="text-muted">22 August 2016, by <a href="https://github.com/ivanlomba">Iván Lomba</a></span>
+            </div>
+            <p>As part of a <a href="https://developers.google.com/open-source/gsoc/">Google Summer of Code</a> project has been added a feature to allow users to set manually specific values of CPU and RAM.</p>
+
+<!--more-->
+
+
+<p>The previous Compute Service abstraction assumed that all providers had hardware profiles, a list of profiles describing different cpu, memory and disk configurations that can be used to run a node. Some providers, such as <a href="https://www.profitbricks.com/">ProfitBricks</a> or <a href="https://www.elastichosts.com/">ElasticHosts</a>, do not have the hardware profiles concept and the previous implementation provides a fixed configuration with a fixed (hardcoded) list just to conform the interface. The new implementation allows to use custom hardwares or both (when supported) hardware profiles and custom hardwares.</p>
+
+<p>Note that using hardware profiles provides hardware optimization or in some cases cheaper pricings.</p>
+
+<h3>How to use custom hardwares</h3>
+
+<p>There are two ways to use a custom hardware: setting in on the hardwareId or specifying cores and ram values using minCores and minRam.</p>
+
+<h4>Custom hardware using hardwareId</h4>
+
+<p>When user set the hardwareId, the Template Builder first check if the provided hardwareId corresponds with an existent hardware profile, and if it corresponds, it would use it. In case that the provided hardwareId do not match with an existing hardware profile and have the automatic hardwareId format, it would use a custom hardware.</p>
+
+<p>To set CPU and RAM with hardwareId you have to set the hardwareId using template builder with the format:</p>
+
+<p><code>automatic:cores=2;ram=4096</code></p>
+
+<p>as you can see in the following example:</p>
+
+<div class="highlight"><pre><code class="java"><span class="n">Template</span> <span class="n">template</span> <span class="o">=</span> <span class="n">templateBuilder</span>
+    <span class="o">.</span><span class="na">hardwareId</span><span class="o">(</span><span class="s">&quot;automatic:cores=2;ram=4096&quot;</span><span class="o">)</span>
+    <span class="o">.</span><span class="na">build</span><span class="o">()</span>
+<span class="n">compute</span><span class="o">.</span><span class="na">createNodesInGroup</span><span class="o">(</span><span class="s">&quot;jclouds&quot;</span><span class="o">,</span> <span class="mi">1</span><span class="o">,</span> <span class="n">template</span><span class="o">);</span>
+</code></pre></div>
+
+
+<p>In providers that configure disks based on the volume information provided in the hardware profile you have to specify also the disk size, like in ProfitBricks, where disk is mandatory, you need to specify it to use custom machines:</p>
+
+<div class="highlight"><pre><code class="java"><span class="n">Template</span> <span class="n">template</span> <span class="o">=</span> <span class="n">templateBuilder</span>
+    <span class="o">.</span><span class="na">hardwareId</span><span class="o">(</span><span class="s">&quot;automatic:cores=2;ram=4096;disk=100&quot;</span><span class="o">)</span>
+    <span class="o">.</span><span class="na">build</span><span class="o">()</span>
+<span class="n">compute</span><span class="o">.</span><span class="na">createNodesInGroup</span><span class="o">(</span><span class="s">&quot;jclouds&quot;</span><span class="o">,</span> <span class="mi">1</span><span class="o">,</span> <span class="n">template</span><span class="o">);</span>
+</code></pre></div>
+
+
+<p>To help building the automatic hardwareId, the <code>automaticHardwareIdSpecBuilder</code> utility creates an automaticHardwareId string with the provided values of cores, ram and optional disk size.</p>
+
+<div class="highlight"><pre><code class="java"><span class="n">Template</span> <span class="n">template</span> <span class="o">=</span> <span class="n">templateBuilder</span>
+    <span class="o">.</span><span class="na">hardwareId</span><span class="o">(</span><span class="n">AutomaticHardwareIdSpec</span>
+        <span class="o">.</span><span class="na">automaticHardwareIdSpecBuilder</span><span class="o">(</span><span class="mf">2.0</span><span class="o">,</span> <span class="mi">4096</span><span class="o">,</span> <span class="n">Optional</span><span class="o">.&lt;</span><span class="n">Float</span><span class="o">&gt;</span><span class="n">absent</span><span class="o">())</span>
+        <span class="o">.</span><span class="na">toString</span><span class="o">()))</span>
+    <span class="o">.</span><span class="na">build</span><span class="o">()</span>
+<span class="n">compute</span><span class="o">.</span><span class="na">createNodesInGroup</span><span class="o">(</span><span class="s">&quot;jclouds&quot;</span><span class="o">,</span> <span class="mi">1</span><span class="o">,</span> <span class="n">template</span><span class="o">);</span>
+</code></pre></div>
+
+
+<h4>Custom hardware using minCores and minRam</h4>
+
+<p>When user set minCores and minRam, first the template builder checks if a hardware profile matches with the provided minRam and minCores. If not, the templateBuilder will use the automatic hardware.</p>
+
+<p>To set up custom hardwares using minRam and minCores you have to set them using template builder.</p>
+
+<div class="highlight"><pre><code class="java"><span class="n">Template</span> <span class="n">template</span> <span class="o">=</span> <span class="n">templateBuilder</span>
+    <span class="o">.</span><span class="na">minCores</span><span class="o">(</span><span class="mi">2</span><span class="o">)</span>
+    <span class="o">.</span><span class="na">minRam</span><span class="o">(</span><span class="mi">4096</span><span class="o">)</span>
+    <span class="o">.</span><span class="na">build</span><span class="o">();</span>
+<span class="n">compute</span><span class="o">.</span><span class="na">createNodesInGroup</span><span class="o">(</span><span class="s">&quot;jclouds&quot;</span><span class="o">,</span> <span class="mi">1</span><span class="o">,</span> <span class="n">template</span><span class="o">);</span>
+</code></pre></div>
+
+
+<p>In providers that need to specify disk, set also minDisk:</p>
+
+<div class="highlight"><pre><code class="java"><span class="n">Template</span> <span class="n">template</span> <span class="o">=</span> <span class="n">templateBuilder</span>
+    <span class="o">.</span><span class="na">minCores</span><span class="o">(</span><span class="mi">2</span><span class="o">)</span>
+    <span class="o">.</span><span class="na">minRam</span><span class="o">(</span><span class="mi">4096</span><span class="o">)</span>
+    <span class="o">.</span><span class="na">minDisk</span><span class="o">(</span><span class="mi">100</span><span class="o">)</span>
+    <span class="o">.</span><span class="na">build</span><span class="o">();</span>
+<span class="n">compute</span><span class="o">.</span><span class="na">createNodesInGroup</span><span class="o">(</span><span class="s">&quot;jclouds&quot;</span><span class="o">,</span> <span class="mi">1</span><span class="o">,</span> <span class="n">template</span><span class="o">);</span>
+</code></pre></div>
+
+
+<h3>Providers supported</h3>
+
+<p>There are several providers that support arbitrary values of CPU and RAM like Docker, ElasticHosts, Google Compute Engine, etc. The first available providers supported by the new feature are:</p>
+
+<ul>
+<li><a href="https://cloud.google.com/compute/">Google Compute Engine</a></li>
+<li><a href="https://www.profitbricks.com/">ProfitBricks</a></li>
+</ul>
+
+
+<p>To configure the new feature in other providers add a bind() to the <code>ArbitraryCpuRamTemplateBuilderImpl</code> class at the provider's context module:</p>
+
+<div class="highlight"><pre><code class="java"><span class="n">bind</span><span class="o">(</span><span class="n">TemplateBuilderImpl</span><span class="o">.</span><span class="na">class</span><span class="o">).</span><span class="na">to</span><span class="o">(</span><span class="n">ArbitraryCpuRamTemplateBuilderImpl</span><span class="o">.</span><span class="na">class</span><span class="o">);</span>
+</code></pre></div>
+
+
+<p>Also is necessary to modify the function that transform a node from the provider model to the portable model of jclouds, to include the new automatic hardwareId (if apply).</p>
+
+<h3>Further development</h3>
+
+<ul>
+<li><strong>Support other providers</strong>: add support for other providers such as <a href="https://www.elastichosts.com/">ElasticHosts</a> and <a href="https://www.docker.com/">Docker</a>.</li>
+<li><strong>Improve AutomaticHardwareSpec</strong>: improve the AutomaticHardwareSpec with specific parsers for every parameter in order to support more custom parameters and some fields, like bootDisk and durable (part of volumes), that are currently hardcoded to true.</li>
+<li><strong>Usage examples of the new features</strong>: create examples of the new features in the jclouds-examples repo.</li>
+<li><strong>Custom TemplateBuilderImpl for ProfitBricks</strong>: add a custom implementation of the TemplateBuilderImpl to fail early when users don't set the minDisk.</li>
+</ul>
+
+
+<h3>Special thanks</h3>
+
+<p>Special thanks to <a href="https://github.com/nacx">Ignasi Barrera</a> for all the help, <a href="https://github.com/demobox">Andrew Phillips</a> for code reviews and the rest of jclouds comunity.</p>
+
+<p>Of course, also thanks to Google for running GSoC.</p>
+
+            
+            <div id="comments">
+                <hr/>
+                <div id="disqus_thread"></div>
+<script type="text/javascript">
+var disqus_shortname = 'jclouds';
+/* * * DON'T EDIT BELOW THIS LINE * * */
+(function() {
+    var dsq = document.createElement('script'); dsq.type = 'text/javascript'; dsq.async = true;
+    dsq.src = '//' + disqus_shortname + '.disqus.com/embed.js';
+    (document.getElementsByTagName('head')[0] || document.getElementsByTagName('body')[0]).appendChild(dsq);
+})();
+</script>
+<noscript>Please enable JavaScript to view the <a href="http://disqus.com/?ref_noscript">Comments powered by Disqus.</a></noscript>
+<a href="http://disqus.com" class="dsq-brlink">Comments powered by <span class="logo-disqus">Disqus</span></a>
+
+            </div>
+            
+            <div class="row clearfix">
+                <div id="footer" class="col-md-12 column">
+                    <div id="footer">
+    <hr/>
+    <div class="row clearfix">
+        <div class="col-md-2 column">
+            <p class="text-center">
+                <a class="text-primary" href="/start/">Getting Started</a>
+            </p>
+        </div>
+        <div class="col-md-2 column">
+            <p class="text-center">
+                <a class="text-primary" href="/reference/report-a-bug/">Report a Bug</a>
+            </p>
+        </div>
+        <div class="col-md-2 column">
+            <p class="text-center">
+                <a href="https://github.com/jclouds/jclouds-site/edit/master/_posts/2016-08-22-arbitrary-cpu-ram.md">Fix This Page</a><a class="text-primary" href="https://cwiki.apache.org/confluence/display/JCLOUDS/How+to+Contribute+Documentation"><sup>*</sup></a>
+            </p>
+        </div>
+        <div class="col-md-2 column">
+            <p class="text-center">
+                <a class="text-primary" href="https://cwiki.apache.org/confluence/display/JCLOUDS/How+to+Contribute">Contribute Code</a>
+            </p>
+        </div>
+        <div class="col-md-2 column">
+            <p class="text-center">
+                <a class="text-primary" href="/community/">Contact Us</a>
+            </p>
+        </div>
+        <div class="col-md-2 column">
+            <p class="text-center">
+                <a class="text-primary" href="https://twitter.com/jclouds">Follow Us</a>
+            </p>
+        </div>
+    </div>
+    <hr style="margin-top: 10px"/>
+    <div class="row clearfix">
+        <div class="col-md-12 column">
+            <p class="text-center">
+              Copyright &copy; 2011-2014 <a href="http://www.apache.org">The Apache Software Foundation</a>. All Rights Reserved.
+            </p>
+            <p class="text-center">
+              Apache, jclouds, Apache jclouds, the jclouds logo, and the Apache feather logos are registered trademarks or trademarks of the Apache Software Foundation.
+            </p>
+            <p class="text-center">
+              <img src="/img/Apache_Logo.png" height="120" />
+            </p>
+            <br/>
+        </div>
+    </div>
+</div>
+
+                </div>
+            </div>
+        </div>
+    </body>
+</html>

Modified: jclouds/site-content/blog/atom.xml
URL: http://svn.apache.org/viewvc/jclouds/site-content/blog/atom.xml?rev=1757114&r1=1757113&r2=1757114&view=diff
==============================================================================
--- jclouds/site-content/blog/atom.xml (original)
+++ jclouds/site-content/blog/atom.xml Mon Aug 22 07:26:42 2016
@@ -8,10 +8,10 @@
 
   
   <entry>
-    <id>http://jclouds.apache.org/blog/2016/08/15/arbitrary-cpu-ram</id>
+    <id>http://jclouds.apache.org/blog/2016/08/22/arbitrary-cpu-ram</id>
     <title type="html"><![CDATA[Arbitrary CPU and RAM supported in the ComputeService]]></title>
-    <link href="http://jclouds.apache.org/blog/2016/08/15/arbitrary-cpu-ram"/>
-    <updated>2016-08-15T00:00:00Z</updated>
+    <link href="http://jclouds.apache.org/blog/2016/08/22/arbitrary-cpu-ram"/>
+    <updated>2016-08-22T00:00:00Z</updated>
     <content type="html"><![CDATA[<p>As part of a <a href="https://developers.google.com/open-source/gsoc/">Google Summer of Code</a> project has been added a feature to allow users to set manually specific values of CPU and RAM.</p>
 
 <!--more-->

Modified: jclouds/site-content/blog/index.html
URL: http://svn.apache.org/viewvc/jclouds/site-content/blog/index.html?rev=1757114&r1=1757113&r2=1757114&view=diff
==============================================================================
--- jclouds/site-content/blog/index.html (original)
+++ jclouds/site-content/blog/index.html Mon Aug 22 07:26:42 2016
@@ -161,8 +161,8 @@
             <p><a href="https://cwiki.apache.org/confluence/display/JCLOUDS/How+to+Contribute+Documentation">Write a guest post!</a></p>
 
 
-<h3><a class="text-primary" href="/blog/2016/08/15/arbitrary-cpu-ram">Arbitrary CPU and RAM supported in the ComputeService</a></h3>
-<span class="text-muted">15 August 2016, by <a href="https://github.com/ivanlomba">Iván Lomba</a></span>
+<h3><a class="text-primary" href="/blog/2016/08/22/arbitrary-cpu-ram">Arbitrary CPU and RAM supported in the ComputeService</a></h3>
+<span class="text-muted">22 August 2016, by <a href="https://github.com/ivanlomba">Iván Lomba</a></span>
 <p>As part of a Google Summer of Code project has been added a feature to allow users to set manually specific values of CPU and RAM.