STATUS: Draft
Problem description
With the launchpad and provisioning model Sling Starter (or Launchpad) we always had a single deliverable - the executable jar. With the feature model this becomes more complicated, as we have multiple options for delivery and execution. We should make clear recommendations to our users, consumers of the Sling Starter, on how to obtain and launch it.
Requirements
The Sling Starter serves two major purposes:
- Be an example for Sling users regarding how a Sling application can be structured
- Allow Sling users to quickly start up a Sling application and experiment with it
It is not an objective for the Sling Starter to be extended for production applications.
Available options
Feature Launcher
The Sling Feature Launcher launches feature model files ( defined as JSON ) or feature archives. It support various low-level options that control OSGi and Feature Model level configurations.
To launch the Sling Starter, the following requirements must be met:
- A suitable version of the JRE is present locally
- The feature launcher is present locally
Then, the user should execute the feature launcher and pass it the relevant arguments. These can be either feature files or feature models, and can either be present locally or accessed from a Maven repository.
Examples:
$ java -jar org.apache.sling.feature.launcher-1.2.0.jar -f org.apache.sling.starter-oak_tar.json $ java -jar org.apache.sling.feature.launcher-1.2.0.jar -f org.apache.sling.starter-oak_tar.json $ java -jar org.apache.sling.feature.launcher-1.2.0.jar -f https://repo1.maven.org/maven2/org/apache/sling/org.apache.sling.starter/12/org.apache.sling.starter-oak_tar.json
Kickstart Launcher
The Kickstart Launcher creates an executable jar that wraps a feature model archive. It exposes various high-level options controlling the behaviour of the Sling Starter.
To launch the Sling Starter, the following requirements must be met:
- A suitable version of the JRE is present locally
- The kickstart launcher is present locally
Examples:
$ java -jar org.apache.sling.kickstart-12.jar
Feature Launcher container
The Sling Feature Launcher is also able to produce a Docker image ( apache/sling-feature-launcher
) during build time. This image can be used to launch feature-based applications. It is similar to the Feature Launcher option, but does not require a locally installed JVM.
To launch the Sling Starter, the only requirement is a container engine.
Examples:
$ docker run -e FEATURE_FILES="https://repo1.maven.org/maven2/org/apache/sling/org.apache.sling.starter/12/org.apache.sling.starter-oak_tar.json" --rm apache/sling-feature-launcher $ podman run -e FEATURE_FILES="https://repo1.maven.org/maven2/org/apache/sling/org.apache.sling.starter/12/org.apache.sling.starter-oak_tar.json" --rm apache/sling-feature-launcher
Sling Starter containers
We publish a Sling container image that exposes the full functionality of the Sling Starter at https://hub.docker.com/r/apache/sling . This image can be launched via Docker (or another compatible runtime like Podman ). The configuration must be done using the environment variables accepted by the Sling Starter.
To launch the Sling Starter, the only requirement is a container engine.
Examples
$ docker run -e MONGODB_HOST=mongo apache/sling:12 oak_mongo $ podman run -p 8080 apache/sling:12 oak_tar