aries-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From build...@apache.org
Subject svn commit: r1013106 - in /websites/staging/aries/trunk/content: ./ modules/containers.html
Date Mon, 29 May 2017 15:40:25 GMT
Author: buildbot
Date: Mon May 29 15:40:25 2017
New Revision: 1013106

Log:
Staging update by buildbot for aries

Modified:
    websites/staging/aries/trunk/content/   (props changed)
    websites/staging/aries/trunk/content/modules/containers.html

Propchange: websites/staging/aries/trunk/content/
------------------------------------------------------------------------------
--- cms:source-revision (original)
+++ cms:source-revision Mon May 29 15:40:25 2017
@@ -1 +1 @@
-1796648
+1796650

Modified: websites/staging/aries/trunk/content/modules/containers.html
==============================================================================
--- websites/staging/aries/trunk/content/modules/containers.html (original)
+++ websites/staging/aries/trunk/content/modules/containers.html Mon May 29 15:40:25 2017
@@ -315,7 +315,37 @@ binding on a local developer machine, as
 <p><code>mvn install</code></p>
 <p>Java 1.8 or higher is required. Maven 3.3.9+ is recommended.</p>
 <h1 id="quick-start">Quick Start<a class="headerlink" href="#quick-start" title="Permanent
link">&para;</a></h1>
-<p>TODO</p>
+<p>The easiest way to get started is with the examples and the local docker binding.
Aries Containers work well in an OSGi 
+environment where bindings are provided as OSGi services.</p>
+<p>As an alternative, Aries Containers can also be used in a plain Java environment.
Instead of obtaining the bindings
+from the service registry, they need to be instantiated directly in this case.</p>
+<p>This quick start focuses on a number of examples to suit your environment.</p>
+<h2 id="osgi-example">OSGi example<a class="headerlink" href="#osgi-example" title="Permanent
link">&para;</a></h2>
+<h2 id="plain-java-example">Plain Java example<a class="headerlink" href="#plain-java-example"
title="Permanent link">&para;</a></h2>
+<p>This example launches a small Java Application to create a service deployment. Initially
a single container is deployed. The user can 
+modify the number of replicas using the application.</p>
+<p>The code can be found here: <a href="https://git-wip-us.apache.org/repos/asf?p=aries-containers.git;a=blob;f=containers-examples/containers-example-javaapp/src/main/java/org/apache/aries/containers/examples/javaapp/Main.java;h=0f06a304fc5ec96ce3f50e6af338b5b320d901d1;hb=HEAD">Main.java</a></p>
+<p>The main functionality is:</p>
+<div class="codehilite"><pre>        <span class="n">ServiceManager</span>
<span class="n">sm</span> <span class="p">=</span> <span class="n">new</span>
<span class="n">LocalDockerServiceManager</span><span class="p">();</span>
+
+        <span class="o">//</span> <span class="n">If</span> <span
class="n">you</span> <span class="n">want</span> <span class="n">to</span>
<span class="n">run</span> <span class="n">with</span> <span class="n">Marathon</span><span
class="p">,</span> <span class="n">use</span> <span class="n">the</span>
<span class="n">following</span> <span class="n">line</span>
+        <span class="o">//</span> <span class="n">ServiceManager</span>
<span class="n">sm</span> <span class="p">=</span> <span class="n">new</span>
<span class="n">MarathonServiceManager</span><span class="p">(</span>&quot;<span
class="n">http</span><span class="p">:</span><span class="o">//</span>192<span
class="p">.</span>168<span class="p">.</span>99<span class="p">.</span>100<span
class="p">:</span>8080<span class="o">/</span>&quot;<span class="p">);</span>
+
+        <span class="n">ServiceConfig</span> <span class="n">sc</span>
<span class="p">=</span> <span class="n">ServiceConfig</span><span
class="p">.</span><span class="n">builder</span><span class="p">(</span>&quot;<span
class="n">mytesthttpd</span>&quot;<span class="p">,</span> &quot;<span
class="n">httpd</span>&quot;<span class="p">).</span>
+            <span class="n">cpu</span><span class="p">(</span>0<span
class="p">.</span>2<span class="p">).</span><span class="n">memory</span><span
class="p">(</span>32<span class="p">).</span><span class="n">port</span><span
class="p">(</span>80<span class="p">).</span><span class="n">build</span><span
class="p">();</span>
+        <span class="n">Service</span> <span class="n">svc</span>
<span class="p">=</span> <span class="n">sm</span><span class="p">.</span><span
class="n">getService</span><span class="p">(</span><span class="n">sc</span><span
class="p">);</span>
+        <span class="o">//</span> <span class="n">The</span> <span
class="n">service</span> <span class="n">is</span> <span class="n">now</span>
<span class="n">created</span>
+</pre></div>
+
+
+<p>If you are running this the Docker local binding, you can see the docker container
created:</p>
+<div class="codehilite"><pre>$ <span class="n">docker</span> <span
class="n">ps</span>
+<span class="n">CONTAINER</span> <span class="n">ID</span>      
 <span class="n">IMAGE</span>               <span class="n">COMMAND</span>
             <span class="n">STATUS</span>              <span class="n">PORTS</span>
                  <span class="n">NAMES</span>
+7<span class="n">cc5c753777e</span>        <span class="n">httpd</span>
              &quot;<span class="n">httpd</span><span class="o">-</span><span
class="n">foreground</span>&quot;   <span class="n">Up</span> 4 <span
class="n">seconds</span>        0<span class="p">.</span>0<span class="p">.</span>0<span
class="p">.</span>0<span class="p">:</span>51467<span class="o">-&gt;</span>80<span
class="o">/</span><span class="n">tcp</span>   <span class="n">mytesthttpd</span>
+</pre></div>
+
+
+<p>The example also allows scaling up and down of replica containers for this service.</p>
 <h1 id="bindings">Bindings<a class="headerlink" href="#bindings" title="Permanent
link">&para;</a></h1>
 <h2 id="docker-local">Docker Local<a class="headerlink" href="#docker-local" title="Permanent
link">&para;</a></h2>
 <p>This binding works by issuing <code>docker</code> commands on the local
machine and is very useful for testing. Make sure the environment 



Mime
View raw message