Author: smohanty
Date: Thu Mar 19 18:20:56 2015
New Revision: 1667824

URL: http://svn.apache.org/r1667824
Log:
doc changes for packaging simplification

Added:
    incubator/slider/site/trunk/content/docs/slider_specs/simple_pkg.md
Modified:
    incubator/slider/site/trunk/content/docs/slider_specs/index.md

Modified: incubator/slider/site/trunk/content/docs/slider_specs/index.md
URL: 
http://svn.apache.org/viewvc/incubator/slider/site/trunk/content/docs/slider_specs/index.md?rev=1667824&r1=1667823&r2=1667824&view=diff
==============================================================================
--- incubator/slider/site/trunk/content/docs/slider_specs/index.md (original)
+++ incubator/slider/site/trunk/content/docs/slider_specs/index.md Thu Mar 19 
18:20:56 2015
@@ -38,7 +38,9 @@
 
 ##Specifications
 
-Refer to [Creating a Slider package for 
Memcached](hello_world_slider_app.html) for a quick over view of how to write a 
Slider app. 
+Refer to [Creating a Slider package for 
Memcached](hello_world_slider_app.html) for a quick over view of how to write a 
Slider app.
+
+Packaging enhancements: [Simplified Packaging](simple_pkg.html) describes a 
simplified version of packaging that Slider supports for applications that do 
not need full capability of a Slider application package. *The work is 
available in the develop branch and is targeted for the next relase.*
 
 The entry points to leverage Slider are:
 

Added: incubator/slider/site/trunk/content/docs/slider_specs/simple_pkg.md
URL: 
http://svn.apache.org/viewvc/incubator/slider/site/trunk/content/docs/slider_specs/simple_pkg.md?rev=1667824&view=auto
==============================================================================
--- incubator/slider/site/trunk/content/docs/slider_specs/simple_pkg.md (added)
+++ incubator/slider/site/trunk/content/docs/slider_specs/simple_pkg.md Thu Mar 
19 18:20:56 2015
@@ -0,0 +1,198 @@
+<!---
+   Licensed to the Apache Software Foundation (ASF) under one or more
+   contributor license agreements.  See the NOTICE file distributed with
+   this work for additional information regarding copyright ownership.
+   The ASF licenses this file to You under the Apache License, Version 2.0
+   (the "License"); you may not use this file except in compliance with
+   the License.  You may obtain a copy of the License at
+
+       http://www.apache.org/licenses/LICENSE-2.0
+
+   Unless required by applicable law or agreed to in writing, software
+   distributed under the License is distributed on an "AS IS" BASIS,
+   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+   See the License for the specific language governing permissions and
+   limitations under the License.
+-->
+
+# Simplified Application Packaging
+
+An application may be a simple command as all of its dependencies are 
pre-installed. In these cases creating a full application package zip file may 
be too much. Similarly, applications artifacts can be organized in a folder 
that the developer is continously editing while she is creating/debugging a 
package. The need to zip up the package and uploading to FS explicitly can be 
eliminated. The following simplifications are designed:
+
+* eliminate the need for a zip package
+* only mandate a metadata file (allow json structure as well)
+* allow reading an application definition from a local folder
+
+## Examples
+
+## A minimal application specified through metadata
+It is assummed that all binary dependencies are installed on the host machines.
+
+### Application specification
+**metainfo.json**
+
+    {
+    "schemaVersion": "2.1",
+    "application": {
+        "name": "MEMCACHED",
+        "components": [
+            {
+                "name": "MEMCACHED",
+                "commands": [
+                    {
+                        "exec": "/usr/jdk64/jdk1.7.0_67/bin/java -classpath 
/usr/myapps/memcached/*:/usr/hadoop/lib/* com.thimbleware.jmemcached.Main"
+                    }
+                ]
+             }
+        ]
+    }
+    }
+    
+*At this point a resources.json is required but there is a plan to eliminate 
it by introducing default resource requirements through slider-client.xml. A 
common resources.json file is specified [here](#sample_resources)*
+
+### create
+
+    slider create memcachedmin --metainfo metainfo.json --resources 
resources.json
+    
+## A minimal application with exports
+It is assummed that all binary dependencies are installed on the host 
machines. Application asks Slider to allocate a dynamic port and then export it 
to the registry. You can use the same syntax as specified in [specifying 
exports](specifying_exports.html).
+
+### Application specification
+**metainfo.json**
+
+    {
+    "schemaVersion": "2.1",
+    "application": {
+        "name": "MEMCACHED",
+        "exportGroups": [
+            {
+                "name": "Servers",
+                "exports": [
+                    {
+                        "name": "host_port",
+                        "value": "${MEMCACHED_HOST}:${site.global.port}"
+                    }
+                ]
+            }
+        ],
+        "components": [
+            {
+                "name": "MEMCACHED",
+                "compExports": "Servers-host_port",
+                "commands": [
+                    {
+                        "exec": "/usr/jdk64/jdk1.7.0_67/bin/java -classpath 
/usr/myapps/memcached/*:/usr/hdp/current/hadoop-client/lib/* 
com.thimbleware.jmemcached.Main --port={$conf:@//site/global/port}"
+                    }
+                ]
+             }
+        ]
+    }
+    }
+    
+**appConfig.json**
+The intent to get a dynamically allocated port is specified via appConfig.json 
file.
+
+    {
+      "schema": "http://example.org/specification/v2.0.0";,
+      "metadata": {
+      },
+      "global": {
+        "site.global.port": "${MEMCACHED.ALLOCATED_PORT}{PER_CONTAINER}"
+      }
+    }
+
+### create
+
+    slider create memcachedmin --metainfo metainfo.json --resources 
resources.json --template appConfig.json
+    
+
+## A application with libraries
+In this case, the application requires some jars to be uploaded and be made 
available locally. The application definition, in this case can be specified as 
a folder and *uploaded* jars can be referred to from the app_root. At this 
point, the layout is close to the .zip package except you do not need to 
explicitly package it up. Slider will package the content and upload it.
+
+### Application specification
+**metainfo.json**
+
+    {
+    "schemaVersion": "2.1",
+    "application": {
+        "name": "MEMCACHED",
+        "exportGroups": [
+            {
+                "name": "Servers",
+                "exports": [
+                    {
+                        "name": "host_port",
+                        "value": "${MEMCACHED_HOST}:${site.global.port}"
+                    }
+                ]
+            }
+        ],
+        "components": [
+            {
+                "name": "MEMCACHED",
+                "compExports": "Servers-host_port",
+                "commands": [
+                    {
+                        "exec": "/usr/jdk64/jdk1.7.0_67/bin/java -classpath 
{$conf:@//site/global/app_root}/*:/usr/hdp/current/hadoop-client/lib/* 
com.thimbleware.jmemcached.Main --port={$conf:@//site/global/port}"
+                    }
+                ]
+             }
+        ],
+        "packages": [
+            {
+                "type": "folder",
+                "name": "files/jmemcached-1.0.0"
+            }
+        ]
+
+    }
+    }
+    
+**appConfig.json**
+The intent to get a dynamically allocated port is specified via appConfig.json 
file.
+
+    {
+      "schema": "http://example.org/specification/v2.0.0";,
+      "metadata": {
+      },
+      "global": {
+        "site.global.port": "${MEMCACHED.ALLOCATED_PORT}{PER_CONTAINER}"
+      }
+    }
+
+**folder contents:**
+
+    ./package
+    ./package/files
+    ./package/files/jmemcached-1.0.0
+    ./package/files/jmemcached-1.0.0/jmemcached-cli-1.0.0.jar
+    ./package/files/jmemcached-1.0.0/jmemcached-core-1.0.0.jar
+    ./metainfo.json
+
+### create
+
+    slider create memcachedjar –appdef /usr/work/package --resources 
resources.json --template appConfig.json
+    
+    
+## <a name="sample_resources"></a> Common resources.json
+Here is the common resources json file for all samples.
+
+**resources.json**
+
+    {
+    "schema" : "http://example.org/specification/v2.0.0";,
+    "metadata" : {
+    },
+    "global" : {
+    },
+    "components": {
+      "slider-appmaster": {
+      },
+      "MEMCACHED": {
+        "yarn.role.priority": "1",
+        "yarn.component.instances": "1",
+        "yarn.memory": "256"
+      }
+    }
+
+


Reply via email to