Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id 6229B200C85 for ; Tue, 30 May 2017 16:16:54 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id 60F9A160BC9; Tue, 30 May 2017 14:16:54 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id 8120F160BC1 for ; Tue, 30 May 2017 16:16:53 +0200 (CEST) Received: (qmail 51993 invoked by uid 500); 30 May 2017 14:16:52 -0000 Mailing-List: contact commits-help@aries.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@aries.apache.org Delivered-To: mailing list commits@aries.apache.org Received: (qmail 51982 invoked by uid 99); 30 May 2017 14:16:52 -0000 Received: from Unknown (HELO svn01-us-west.apache.org) (209.188.14.144) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 30 May 2017 14:16:52 +0000 Received: from svn01-us-west.apache.org (localhost [127.0.0.1]) by svn01-us-west.apache.org (ASF Mail Server at svn01-us-west.apache.org) with ESMTP id ECD693A0460 for ; Tue, 30 May 2017 14:16:51 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r1013158 - in /websites/staging/aries/trunk/content: ./ modules/containers.html Date: Tue, 30 May 2017 14:16:51 -0000 To: commits@aries.apache.org From: buildbot@apache.org X-Mailer: svnmailer-1.0.9 Message-Id: <20170530141651.ECD693A0460@svn01-us-west.apache.org> archived-at: Tue, 30 May 2017 14:16:54 -0000 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 }

Aries Containers

-

Aries Containers is a project to manage container deployment, such as docker containers, from a Java API.

+

Aries Containers is an Apache Aries subproject to manage container deployments, such as docker-based microservices, from a Java API.

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.

Benefits:

    -
  • Requirements change - container users may find that they need to change target platforms at short notice. Using an abstraction API +
  • 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.
  • 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 docker.local 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.
  • +development difficult. Aries Containers also contains a docker.local binding which makes it possible to run the same code with using +a local docker installation on the developer's machine.
-

Current modules:

+

Current Aries Containers modules:

  • containers-api - the API implemented by the various bindings.
  • containers-docker-local - Binding that uses the local docker installation.
  • @@ -308,7 +308,7 @@ binding on a local developer machine, as
  • containers-examples - Examples.
  • ...
-

This project may be used as input to the design process of the OSGi RFP 179.

+

This project could influence the design process of the OSGi RFP 179.

Source

The Aries RSA source is in a separate git repository aries-containers there is also a mirror on github.

To build the source, just run:

@@ -319,13 +319,12 @@ binding on a local developer machine, as environment where bindings are provided as OSGi services.

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.

-

This quick start focuses on a number of examples to suit your environment.

OSGi example

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.

The servlet is written using OSGi Declarative Service annotations and OSGi Http Whiteboard annotations and can be found here: ServiceManagerServlet.java

-

Main part of the functionality of the servlet can be summarized as follows:

+

Main functionality of the servlet can be summarized as follows:

@Component(service = Servlet.class,
     property = {HttpWhiteboardConstants.HTTP_WHITEBOARD_SERVLET_PATTERN + "=/manager"})
 public class ServiceManagerServlet extends HttpServlet {
@@ -348,7 +347,7 @@ protected void doGet(HttpServletRequest
 

In short - an OSGi Declarative Service Component is registered as a HTTP Whiteboard Servet. The Aries Containers Service Manager is injected into the serviceManager field and then used in the servlet to manage services.

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:

+with the Apache Felix OSGi framework, add:

-

Finally add the OSGI demo bundle itself. The resulting bundle list will look like this:

+

Finally add the OSGi demo bundle itself. The resulting bundle list will look like this:

lb
 START LEVEL 1
    ID|State      |Level|Name
@@ -386,11 +385,18 @@ Apache Felix, add:

-

Now you can access the servlet at http://localhost:8080/containers/manager

+

Now you can access the servlet at http://localhost:8080/containers/manager

screenshot

+

After adding a container you can inspect its result by querying docker for its running containers:

+
$ docker ps
+CONTAINER ID        IMAGE               COMMAND              STATUS              PORTS                   NAMES
+7cc5c753777e        httpd               "httpd-foreground"   Up 4 seconds        0.0.0.0:51467->80/tcp   myapache
+
+ +

Plain Java example

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.

+modify the number of replicas from within the application.

The code can be found here: Main.java

The main functionality is:

        ServiceManager sm = new LocalDockerServiceManager();
@@ -417,7 +423,7 @@ modify the number of replicas using the
 

Docker Local

This binding works by issuing docker commands on the local machine and is very useful for testing. Make sure the environment variables normally provided via docker-machine env <myenv> are set.

-

OSGi ServiceManager identifier: container.factory.binding = docker.local

+

OSGi ServiceManager identifier property: container.factory.binding = docker.local

Constructor, for use outside of OSGi: org.apache.aries.containers.docker.local.impl.LocalDockerServiceManager

Marathon

This binding uses Marathon as the underlying container manager. It requires the following configuration to be set:

@@ -426,8 +432,8 @@ variables normally provided via do
-

Once configured, the Marathon binding will register its OSGi service. -OSGi ServiceManager identifier: container.factory.binding = marathon

+

Once configured, the Marathon binding will register its OSGi service.

+

OSGi ServiceManager identifier property: container.factory.binding = marathon

Constructors, for use outside of OSGi: org.apache.aries.containers.marathon.impl.MarathonServiceManager

/**
  * Create the Marathon Service Manager.