You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@sling.apache.org by an...@apache.org on 2020/05/29 23:12:17 UTC

[sling-org-apache-sling-kickstart] branch master updated (dbbce36 -> 88715de)

This is an automated email from the ASF dual-hosted git repository.

andysch pushed a change to branch master
in repository https://gitbox.apache.org/repos/asf/sling-org-apache-sling-kickstart.git.


    from dbbce36  SLING-9452 - Added support for Log File and Level settings through a temporary Feature Model
     new 38da092  Upgraded to the Sling Feature IO Merge
     add 515b26f  Created two scripts to launch a Composite Node Store where /apps and /libs are read only
     add a220766  Merge remote-tracking branch 'origin/master' into feature/composite-node-store
     add 9d9e120  Updated Script to merge with master
     new 5004bee  Merge branch 'feature/composite-node-store'
     new 88715de  Added support for Overrides (artifacts, configuration and variables), merged the shell script and FMs for the Composite Node Store into master

The 3 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 Readme.md                                          | 44 +++++++++++-
 bin/create_seed_fm.sh                              | 31 +++++++++
 bin/create_updated_seed_fm.sh                      | 36 ++++++++++
 bin/explore_repo.sh                                | 21 ++++++
 bin/run_composite_fm.sh                            | 29 ++++++++
 bin/run_updated_composite_fm.sh                    | 34 ++++++++++
 pom.xml                                            |  4 +-
 .../sling/kickstart/app/KickstartStarter.java      | 23 +++++--
 ...ling12.json => feature-sling12-two-headed.json} | 11 +--
 src/main/resources/feature-sling12.json            |  4 ++
 src/main/resources/feature-two-headed-runtime.json | 79 ++++++++++++++++++++++
 src/main/resources/feature-two-headed-seed.json    | 45 ++++++++++++
 12 files changed, 348 insertions(+), 13 deletions(-)
 create mode 100755 bin/create_seed_fm.sh
 create mode 100755 bin/create_updated_seed_fm.sh
 create mode 100755 bin/explore_repo.sh
 create mode 100755 bin/run_composite_fm.sh
 create mode 100755 bin/run_updated_composite_fm.sh
 copy src/main/resources/{feature-sling12.json => feature-sling12-two-headed.json} (99%)
 create mode 100644 src/main/resources/feature-two-headed-runtime.json
 create mode 100644 src/main/resources/feature-two-headed-seed.json


[sling-org-apache-sling-kickstart] 03/03: Added support for Overrides (artifacts, configuration and variables), merged the shell script and FMs for the Composite Node Store into master

Posted by an...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

andysch pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/sling-org-apache-sling-kickstart.git

commit 88715de6f106e863eeccaddc168ec3b483052093
Author: Andreas Schaefer <sc...@iMac.local>
AuthorDate: Fri May 29 16:11:57 2020 -0700

    Added support for Overrides (artifacts, configuration and variables), merged the shell script and FMs for the Composite Node Store into master
---
 Readme.md                                          | 44 +++++++++++++++++++++-
 bin/create_seed_fm.sh                              | 31 +++++++++++++++
 bin/create_updated_seed_fm.sh                      | 36 ++++++++++++++++++
 explore_repo.sh => bin/explore_repo.sh             |  0
 bin/run_composite_fm.sh                            | 29 ++++++++++++++
 bin/run_updated_composite_fm.sh                    | 34 +++++++++++++++++
 create_seed_fm.sh                                  | 14 -------
 pom.xml                                            |  2 +
 run-composite-fm.sh                                | 10 -----
 .../sling/kickstart/app/KickstartStarter.java      | 23 ++++++++---
 ...ling12.json => feature-sling12-two-headed.json} |  4 +-
 src/main/resources/feature-sling12.json            |  3 ++
 src/main/resources/feature-two-headed-runtime.json |  4 ++
 src/main/resources/feature-two-headed-seed.json    |  4 ++
 14 files changed, 205 insertions(+), 33 deletions(-)

diff --git a/Readme.md b/Readme.md
index f6738e2..4bad007 100644
--- a/Readme.md
+++ b/Readme.md
@@ -97,6 +97,9 @@ Apache Sling Kickstart
   -l, --logLevel=<logLevel> the initial loglevel (0..4, FATAL, ERROR, WARN, INFO,
                               DEBUG)
   -n, --noShutdownHook      don't install the shutdown hook
+  -O, --overrides=<overrides>
+                            Overrides in format <type>=<value>, type: C = artifact,
+                              CC = config, V = variable
   -p, --port=<port>         the port to listen to (default 8080)
   -r, --context=<contextPath>
                             the root servlet context path for the http service
@@ -116,4 +119,43 @@ which may or may not contain your own project FMs.
 
 **-af**: each parameter will have a path to a Feature Model (FM) that is
 added to the provided Sling FM (or its override). To add multiple FMs just
-use multiple *-af* parameter lines.
\ No newline at end of file
+use multiple *-af* parameter lines.
+
+### Composite Node Store
+
+The Kickstart project also comes with the Feature Models and the scripts to run
+a Sling Composite Node Store as well having the option to upgrade a Sling instance
+afterwards.
+
+#### Feature Models
+
+The Sling Feature Model of the Composite Node Store needs to have the Default Node
+Store removed which is available here: **src/main/resources/feature-sling12-two-headed.json**.
+Then we have to additional Feature Models:
+* feature-two-headed-seed.json: The setup to seed the initial **Libs** node store
+which will be later the **read-only** node store
+* feature-two-headed-runtime.json: This will create the Sling Instance with the composite
+node store
+
+#### Scripts
+
+There are two sets of two scripts available in the **bin** folder:
+
+* create_seed_fm.sh: creates the Seed Sling instance
+* run_composite_fm.sh: launches the Sling instance with a composite node store where **libs**
+is read-only
+* create_updated_seed_fm.sh: creates an update Seed Sling Instance
+* run_updated_composite_fm.sh: launches the Sling Instance with a composite node store
+which the updates available
+
+**Note**: the first two scripts support optionally additional features. Just add the path to the
+feature model file or feature archive as parameters to the script and they will be added when
+launched. It is important that both scripts get the same arguments, though.
+The last two scripts requires at least one additional feature as an update only makes sense
+when there is something to be updated.
+
+Example:
+```
+    ./bin/create_seed_fm.sh my-project-fm.json another-project.json
+    ./bin/run_composite_fm.sh my-project-fm.json another-project.json
+```
diff --git a/bin/create_seed_fm.sh b/bin/create_seed_fm.sh
new file mode 100755
index 0000000..79d25ee
--- /dev/null
+++ b/bin/create_seed_fm.sh
@@ -0,0 +1,31 @@
+#!/bin/sh -e
+
+echo "-----------------------------------"
+echo "| PLEASE SHUTDOWN SLING MANUALLY  |"
+echo "| AFTER STARTUP IS COMPLETE       |"
+echo "-----------------------------------"
+
+set +x
+sleep 3
+
+DIR=`pwd`
+FOLDER=`basename $DIR`
+if [ "$FOLDER" == "bin" ]; then
+  DIR=`cd ..;pwd`
+fi
+cd ${DIR}
+
+rm -rf launcher
+rm -rf sling
+
+additionalFeatures=""
+for features in "$@"; do
+  additionalFeatures="${additionalFeatures}-af ${features} "
+done
+
+java -jar \
+    target/org.apache.sling.kickstart-0.0.3-SNAPSHOT.jar \
+    -s src/main/resources/feature-sling12-two-headed.json \
+    -af src/main/resources/feature-two-headed-seed.json \
+    ${additionalFeatures} \
+    -c sling/sling-composite
diff --git a/bin/create_updated_seed_fm.sh b/bin/create_updated_seed_fm.sh
new file mode 100755
index 0000000..60ce699
--- /dev/null
+++ b/bin/create_updated_seed_fm.sh
@@ -0,0 +1,36 @@
+#!/bin/sh -e
+
+echo "-----------------------------------"
+echo "| PLEASE SHUTDOWN SLING MANUALLY  |"
+echo "| AFTER STARTUP IS COMPLETE       |"
+echo "-----------------------------------"
+
+set +x
+sleep 3
+
+DIR=`pwd`
+FOLDER=`basename $DIR`
+if [ "$FOLDER" == "bin" ]; then
+  DIR=`cd ..;pwd`
+fi
+cd ${DIR}
+
+rm -rf launcher
+rm -rf sling/sling-composite/repository-libs
+
+additionalFeatures=""
+for features in "$@"; do
+  additionalFeatures="${additionalFeatures}-af ${features} "
+done
+
+if [ "x${additionalFeatures}x" == "xx" ]; then
+    echo "For an Update a least one Feature needs to be added"
+    return
+fi
+
+java -jar \
+    target/org.apache.sling.kickstart-0.0.3-SNAPSHOT.jar \
+    -s src/main/resources/feature-sling12-two-headed.json \
+    -af src/main/resources/feature-two-headed-seed.json \
+    ${additionalFeatures} \
+    -c sling/sling-composite
diff --git a/explore_repo.sh b/bin/explore_repo.sh
similarity index 100%
rename from explore_repo.sh
rename to bin/explore_repo.sh
diff --git a/bin/run_composite_fm.sh b/bin/run_composite_fm.sh
new file mode 100755
index 0000000..89cc626
--- /dev/null
+++ b/bin/run_composite_fm.sh
@@ -0,0 +1,29 @@
+#!/bin/sh -ex
+
+DIR=`pwd`
+FOLDER=`basename $DIR`
+if [ "$FOLDER" == "bin" ]; then
+  DIR=`cd ..;pwd`
+fi
+cd ${DIR}
+
+rm -rf launcher
+
+# The name of the generated segment store is not matching the libs segment store as the role is added to its name
+# so we create a symbolic link here
+cd sling/sling-composite/repository-libs
+ln -s segmentstore segmentstore-composite-mount-libs
+cd ../../..
+
+additionalFeatures=""
+for features in "$@"; do
+  additionalFeatures="${additionalFeatures}-af ${features} "
+done
+
+java -jar \
+    target/org.apache.sling.kickstart-0.0.3-SNAPSHOT.jar \
+    -s src/main/resources/feature-sling12-two-headed.json \
+    -af src/main/resources/feature-two-headed-runtime.json \
+    ${additionalFeatures} \
+    -c sling/sling-composite
+
diff --git a/bin/run_updated_composite_fm.sh b/bin/run_updated_composite_fm.sh
new file mode 100755
index 0000000..87c0880
--- /dev/null
+++ b/bin/run_updated_composite_fm.sh
@@ -0,0 +1,34 @@
+#!/bin/sh -ex
+
+DIR=`pwd`
+FOLDER=`basename $DIR`
+if [ "$FOLDER" == "bin" ]; then
+  DIR=`cd ..;pwd`
+fi
+cd ${DIR}
+
+rm -rf launcher
+
+# The name of the generated segment store is not matching the libs segment store as the role is added to its name
+# so we create a symbolic link here
+cd sling/sling-composite/repository-libs
+ln -s segmentstore segmentstore-composite-mount-libs
+cd ../../..
+
+additionalFeatures=""
+for features in "$@"; do
+  additionalFeatures="${additionalFeatures}-af ${features} "
+done
+
+if [ "x${additionalFeatures}x" == "xx" ]; then
+    echo "For an Update a least one Feature needs to be added"
+    return
+fi
+
+java -jar \
+    target/org.apache.sling.kickstart-0.0.3-SNAPSHOT.jar \
+    -s src/main/resources/feature-sling12-two-headed.json \
+    -af src/main/resources/feature-two-headed-runtime.json \
+    ${additionalFeatures} \
+    -c sling/sling-composite
+
diff --git a/create_seed_fm.sh b/create_seed_fm.sh
deleted file mode 100755
index 40b3611..0000000
--- a/create_seed_fm.sh
+++ /dev/null
@@ -1,14 +0,0 @@
-#!/bin/sh -e
-
-echo "-----------------------------------"
-echo "| PLEASE SHUTDOWN SLING MANUALLY  |"
-echo "| AFTER STARTUP IS COMPLETE       |"
-echo "-----------------------------------"
-
-set +x
-sleep 3
-
-rm -rf launcher
-rm -rf sling
-java -jar target/org.apache.sling.kickstart-0.0.3-SNAPSHOT.jar -af src/main/resources/feature-two-headed-seed.json -c sling/sling-composite
-
diff --git a/pom.xml b/pom.xml
index f630fc9..f8eee9f 100644
--- a/pom.xml
+++ b/pom.xml
@@ -134,6 +134,7 @@
                         <exclude>src/main/resources/META-INF/services/**</exclude>
                         <exclude>**/*.properties</exclude>
                         <exclude>launcher/**</exclude>
+                        <exclude>bin/**.sh</exclude>
                     </excludes>
                 </configuration>
             </plugin>
@@ -211,6 +212,7 @@
                         <excludes combine.children="append">
                             <!-- Exclude sling instance -->
                             <exclude>sling/**</exclude>
+                            <exclude>*.sh</exclude>
                         </excludes>
                     </configuration>
                 </plugin>
diff --git a/run-composite-fm.sh b/run-composite-fm.sh
deleted file mode 100755
index 7e32393..0000000
--- a/run-composite-fm.sh
+++ /dev/null
@@ -1,10 +0,0 @@
-#!/bin/sh -ex
-
-# The name of the genrated segment store is not matching the libs segmentstore as the role is added to its name
-# so we create a symoblic link here
-cd sling/sling-composite/repository-libs
-ln -s segmentstore segmentstore-composite-mount-libs
-cd ../../..
-
-java -jar target/org.apache.sling.kickstart-0.0.3-SNAPSHOT.jar -af src/main/resources/feature-two-headed-runtime.json -c sling/sling-composite
-
diff --git a/src/main/java/org/apache/sling/kickstart/app/KickstartStarter.java b/src/main/java/org/apache/sling/kickstart/app/KickstartStarter.java
index 7b6f4d3..5786f7e 100644
--- a/src/main/java/org/apache/sling/kickstart/app/KickstartStarter.java
+++ b/src/main/java/org/apache/sling/kickstart/app/KickstartStarter.java
@@ -61,6 +61,9 @@ public class KickstartStarter implements Runnable, ControlTarget {
     @Option(names = { "-af", "--additionalFeature" }, description = "additional feature files", required = false)
     private List<String> additionalFeatureFile;
 
+    @Option(names = { "-O", "--overrides" }, description = "Overrides in format <type>=<value>, type: C = artifact, CC = config, V = variable", required = false)
+    private List<String> overrides;
+
     @Option(names = { "-j", "--control" }, description = "host and port to use for control connection in the format '[host:]port' (default 127.0.0.1:0)", required = false)
     private String controlAddress;
 
@@ -114,12 +117,6 @@ public class KickstartStarter implements Runnable, ControlTarget {
      */
     protected static final String PROP_CONTROL_SOCKET = "sling.control.socket";
 
-//    /** The Sling configuration property name setting the initial log level */
-//    private static final String PROP_LOG_LEVEL = "org.apache.sling.commons.log.level";
-//
-//    /** The Sling configuration property name setting the initial log file */
-//    private static final String PROP_LOG_FILE = "org.apache.sling.commons.log.file";
-
     /**
      * The configuration property setting the port on which the HTTP service
      * listens
@@ -196,6 +193,20 @@ public class KickstartStarter implements Runnable, ControlTarget {
                 argumentList.add("-CC");
                 argumentList.add("\"org.apache.sling.commons.log.LogManager=MERGE_LATEST\"");
             }
+            if(overrides != null) {
+                for (String override : overrides) {
+                    int index = override.indexOf('=');
+                    if (index > 0 && index < (override.length() - 1)) {
+                        String type = override.substring(0, index);
+                        String value = override.substring(index + 1);
+                        //TODO: Check the type like 'CC' to avoid wrong types
+                        argumentList.add('-' + type);
+                        argumentList.add(value);
+                    } else {
+                        System.out.println("Wrong Override format: " + override + " -> ignored");
+                    }
+                }
+            }
             if(StringUtils.isNotEmpty(port)) {
                 addArgument(argumentList, PROP_PORT, port);
             }
diff --git a/src/main/resources/feature-sling12.json b/src/main/resources/feature-sling12-two-headed.json
similarity index 99%
copy from src/main/resources/feature-sling12.json
copy to src/main/resources/feature-sling12-two-headed.json
index 33eaba7..0f82354 100644
--- a/src/main/resources/feature-sling12.json
+++ b/src/main/resources/feature-sling12-two-headed.json
@@ -1,7 +1,7 @@
 {
   "id":"org.apache.sling:org.apache.sling.kickstart.conversion:slingosgifeature:sling12:0.0.1-SNAPSHOT",
-  "title":"Sling 12 Feature Model",
-  "description":"Complete Sling 12 Feature Model",
+  "title":"Sling 12 Feature Model for Composite Nodestore",
+  "description":"Complete Sling 12 Feature Model w/o Default Node Store",
   "vendor":"The Apache Software Foundation",
   "license":"Apache License, Version 2.0",
   "variables":{
diff --git a/src/main/resources/feature-sling12.json b/src/main/resources/feature-sling12.json
index 33eaba7..eb1bccc 100644
--- a/src/main/resources/feature-sling12.json
+++ b/src/main/resources/feature-sling12.json
@@ -1054,6 +1054,9 @@
       "jaas.classname":"org.apache.jackrabbit.oak.security.authentication.token.TokenLoginModule",
       "jaas.ranking:Integer":200
     },
+    "org.apache.jackrabbit.oak.segment.SegmentNodeStoreService":    {
+      "name":"Default NodeStore"
+    },
     "org.apache.sling.scripting.core.impl.ScriptCacheImpl":    {
       "org.apache.sling.scripting.cache.additional_extensions":[
         "js"
diff --git a/src/main/resources/feature-two-headed-runtime.json b/src/main/resources/feature-two-headed-runtime.json
index 1b81513..283f807 100644
--- a/src/main/resources/feature-two-headed-runtime.json
+++ b/src/main/resources/feature-two-headed-runtime.json
@@ -1,6 +1,10 @@
 {
   "id": "org.apache.sling:org.apache.sling.feature.model.starter:slingosgifeature:two-headed:12-SNAPSHOT",
   "configurations": {
+    "org.apache.jackrabbit.oak.segment.SegmentNodeStoreService":    {
+      "name":"Default NodeStore",
+      "standby": true
+    },
     "org.apache.sling.commons.log.LogManager.factory.config~oak.log": {
       "org.apache.sling.commons.log.pattern": "%-4r [%t] %-5p %c %x - %m%n",
       "org.apache.sling.commons.log.names": [
diff --git a/src/main/resources/feature-two-headed-seed.json b/src/main/resources/feature-two-headed-seed.json
index 4820bf0..904c2dc 100644
--- a/src/main/resources/feature-two-headed-seed.json
+++ b/src/main/resources/feature-two-headed-seed.json
@@ -1,6 +1,10 @@
 {
   "id": "org.apache.sling:org.apache.sling.feature.model.starter:slingosgifeature:two-headed:12-SNAPSHOT",
   "configurations": {
+    "org.apache.jackrabbit.oak.segment.SegmentNodeStoreService":    {
+      "name":"Default NodeStore",
+      "standby": true
+    },
     "org.apache.sling.commons.log.LogManager.factory.config~oak.log": {
       "org.apache.sling.commons.log.pattern": "%-4r [%t] %-5p %c %x - %m%n",
       "org.apache.sling.commons.log.names": [


[sling-org-apache-sling-kickstart] 01/03: Upgraded to the Sling Feature IO Merge

Posted by an...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

andysch pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/sling-org-apache-sling-kickstart.git

commit 38da092cd7c0749a13723707a5ee02827aa10d6b
Author: Andreas Schaefer <sc...@iMac.local>
AuthorDate: Tue May 19 10:54:28 2020 -0700

    Upgraded to the Sling Feature IO Merge
---
 pom.xml | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/pom.xml b/pom.xml
index b6390ce..f630fc9 100644
--- a/pom.xml
+++ b/pom.xml
@@ -42,7 +42,7 @@
         <sling-kickstart-maven-plugin.version>0.0.2</sling-kickstart-maven-plugin.version>
 
         <picocli.version>3.9.6</picocli.version>
-        <org.apache.sling.feature.launcher.version>1.1.2</org.apache.sling.feature.launcher.version>
+        <org.apache.sling.feature.launcher.version>1.1.3-SNAPSHOT</org.apache.sling.feature.launcher.version>
         <org.apache.sling.feature.extension.content.version>1.0.6</org.apache.sling.feature.extension.content.version>
         <org.apache.felix.framework.version>6.0.3</org.apache.felix.framework.version>
         <commons-io.version>2.6</commons-io.version>


[sling-org-apache-sling-kickstart] 02/03: Merge branch 'feature/composite-node-store'

Posted by an...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

andysch pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/sling-org-apache-sling-kickstart.git

commit 5004bee56a5a5bd1f1a997837c79a2d0cdb1aedd
Merge: 38da092 9d9e120
Author: Andreas Schaefer <sc...@iMac.local>
AuthorDate: Tue May 19 10:55:08 2020 -0700

    Merge branch 'feature/composite-node-store'

 create_seed_fm.sh                                  | 14 ++++
 explore_repo.sh                                    | 21 ++++++
 run-composite-fm.sh                                | 10 +++
 src/main/resources/feature-sling12.json            |  7 +-
 src/main/resources/feature-two-headed-runtime.json | 75 ++++++++++++++++++++++
 src/main/resources/feature-two-headed-seed.json    | 41 ++++++++++++
 6 files changed, 165 insertions(+), 3 deletions(-)