You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@aries.apache.org by bu...@apache.org on 2017/05/30 14:16:51 UTC
svn commit: r1013158 - in /websites/staging/aries/trunk/content: ./
modules/containers.html
Author: buildbot
Date: Tue May 30 14:16:51 2017
New Revision: 1013158
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 Tue May 30 14:16:51 2017
@@ -1 +1 @@
-1796869
+1796872
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 Tue May 30 14:16:51 2017
@@ -287,19 +287,19 @@ h2:hover > .headerlink, h3:hover > .head
}
h2:hover > .headerlink, h3:hover > .headerlink, h1:hover > .headerlink, h6:hover > .headerlink, h4:hover > .headerlink, h5:hover > .headerlink, dt:hover > .elementid-permalink { visibility: visible }</style>
<h1 id="aries-containers">Aries Containers<a class="headerlink" href="#aries-containers" title="Permanent link">¶</a></h1>
-<p>Aries Containers is a project to manage container deployment, such as docker containers, from a Java API.</p>
+<p>Aries Containers is an Apache Aries subproject to manage container deployments, such as docker-based microservices, from a Java API.</p>
<p>Many technologies exist to manage container deployments. Examples include Kubernetes, Marathon/Mesos, Docker Swarm, Amazon ECS
and others. While each technology provides specific features, many of these management technologies share common behaviour.
Aries Containers provides an abstraction that allows users to easily switch between these technologies. </p>
<p>Benefits:</p>
<ul>
-<li>Requirements change - container users may find that they need to change target platforms at short notice. Using an abstraction API
+<li>Requirements change - container deployers may find that they need to change target platforms at short notice. Using an abstraction API
helps making such changes without too much additional work.</li>
<li>Testing - many container management systems require cluster of machines or otherwise large setup which may make testing during
-development difficult. Aries Containers also contains a <code>docker.local</code> binding which makes it possible to run the same code with a different
-binding on a local developer machine, as long as docker is installed there.</li>
+development difficult. Aries Containers also contains a <code>docker.local</code> binding which makes it possible to run the same code with using
+a local docker installation on the developer's machine.</li>
</ul>
-<p>Current modules:</p>
+<p>Current Aries Containers modules:</p>
<ul>
<li><code>containers-api</code> - the API implemented by the various bindings.</li>
<li><code>containers-docker-local</code> - Binding that uses the local docker installation.</li>
@@ -308,7 +308,7 @@ binding on a local developer machine, as
<li><code>containers-examples</code> - Examples.</li>
<li>...</li>
</ul>
-<p>This project may be used as input to the design process of the <a href="https://github.com/osgi/design/blob/master/rfps/rfp-0179-ComputeManagementService.pdf">OSGi RFP 179</a>.</p>
+<p>This project could influence the design process of the <a href="https://github.com/osgi/design/blob/master/rfps/rfp-0179-ComputeManagementService.pdf">OSGi RFP 179</a>.</p>
<h1 id="source">Source<a class="headerlink" href="#source" title="Permanent link">¶</a></h1>
<p>The Aries RSA source is in a separate <a href="https://git-wip-us.apache.org/repos/asf/aries-containers.git">git repository aries-containers</a> there is also a <a href="https://github.com/apache/aries-containers">mirror on github</a>.</p>
<p>To build the source, just run:</p>
@@ -319,13 +319,12 @@ binding on a local developer machine, as
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">¶</a></h2>
<p>The OSGi example uses the Felix SCR implementation to get the currently active ServiceManager injected into a simple servlet.
The servlet provides a simple UI to perform some of the management operations.</p>
<p>The servlet is written using OSGi Declarative Service annotations and OSGi Http Whiteboard annotations and 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-osgiservlet/src/main/java/org/apache/aries/containers/examples/osgiservlet/ServiceManagerServlet.java;h=5783718d0ba80a612cf44a331a45aefeb6e71ebf;hb=HEAD">ServiceManagerServlet.java</a></p>
-<p>Main part of the functionality of the servlet can be summarized as follows:</p>
+<p>Main functionality of the servlet can be summarized as follows:</p>
<div class="codehilite"><pre>@Component(service = Servlet.class,
property = {HttpWhiteboardConstants.HTTP_WHITEBOARD_SERVLET_PATTERN + "=/manager"})
public class ServiceManagerServlet extends HttpServlet {
@@ -348,7 +347,7 @@ protected void doGet(HttpServletRequest
<p>In short - an OSGi Declarative Service Component is registered as a HTTP Whiteboard Servet. The Aries Containers Service Manager is
injected into the <code>serviceManager</code> field and then used in the servlet to manage services.</p>
<p>This demo can be launched in any OSGi framework that supports Declarative Services and the HTTP Whiteboard. For example, to run this demo
-Apache Felix, add:</p>
+with the Apache Felix OSGi framework, add:</p>
<ul>
<li><a href="http://www-us.apache.org/dist//felix/org.apache.felix.scr-2.0.10.jar">The Felix SCR Declarative Services Implementation</a></li>
<li><a href="http://www-us.apache.org/dist//felix/org.apache.felix.configadmin-1.8.14.jar">Felix Configuration Admin Service Implementation</a></li>
@@ -361,7 +360,7 @@ Apache Felix, add:</p>
<li>Aries Containers Docker Local</li>
<li><a href="http://repo2.maven.org/maven2/org/slf4j/slf4j-api/1.7.25/slf4j-api-1.7.25.jar">SLF4J API</a> and <a href="http://repo2.maven.org/maven2/org/slf4j/slf4j-simple/1.7.25/slf4j-simple-1.7.25.jar">implementation</a>.</li>
</ul>
-<p>Finally add the OSGI demo bundle itself. The resulting bundle list will look like this:</p>
+<p>Finally add the OSGi demo bundle itself. The resulting bundle list will look like this:</p>
<div class="codehilite"><pre><span class="n">lb</span>
<span class="n">START</span> <span class="n">LEVEL</span> 1
<span class="n">ID</span><span class="o">|</span><span class="n">State</span> <span class="o">|</span><span class="n">Level</span><span class="o">|</span><span class="n">Name</span>
@@ -386,11 +385,18 @@ Apache Felix, add:</p>
</pre></div>
-<p>Now you can access the servlet at http://localhost:8080/containers/manager</p>
+<p>Now you can access the servlet at <a href="http://localhost:8080/containers/manager">http://localhost:8080/containers/manager</a></p>
<p><img alt="screenshot" src="containers/osgidemo.png" /></p>
+<p>After adding a container you can inspect its result by querying <code>docker</code> for its running containers:</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> "<span class="n">httpd</span><span class="o">-</span><span class="n">foreground</span>" <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">-></span>80<span class="o">/</span><span class="n">tcp</span> <span class="n">myapache</span>
+</pre></div>
+
+
<h2 id="plain-java-example">Plain Java example<a class="headerlink" href="#plain-java-example" title="Permanent link">¶</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>
+modify the number of replicas from within 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>
@@ -417,7 +423,7 @@ modify the number of replicas using the
<h2 id="docker-local">Docker Local<a class="headerlink" href="#docker-local" title="Permanent link">¶</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
variables normally provided via <code>docker-machine env <myenv></code> are set.</p>
-<p>OSGi ServiceManager identifier: <code>container.factory.binding = docker.local</code></p>
+<p>OSGi ServiceManager identifier property: <code>container.factory.binding = docker.local</code></p>
<p>Constructor, for use outside of OSGi: <code>org.apache.aries.containers.docker.local.impl.LocalDockerServiceManager</code></p>
<h2 id="marathon">Marathon<a class="headerlink" href="#marathon" title="Permanent link">¶</a></h2>
<p>This binding uses Marathon as the underlying container manager. It requires the following configuration to be set:</p>
@@ -426,8 +432,8 @@ variables normally provided via <code>do
</pre></div>
-<p>Once configured, the Marathon binding will register its OSGi service.
-OSGi ServiceManager identifier: <code>container.factory.binding = marathon</code></p>
+<p>Once configured, the Marathon binding will register its OSGi service. </p>
+<p>OSGi ServiceManager identifier property: <code>container.factory.binding = marathon</code></p>
<p>Constructors, for use outside of OSGi: <code>org.apache.aries.containers.marathon.impl.MarathonServiceManager</code></p>
<div class="codehilite"><pre><span class="cm">/**</span>
<span class="cm"> * Create the Marathon Service Manager.</span>