You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@streampipes.apache.org by wi...@apache.org on 2020/08/14 14:45:21 UTC

[incubator-streampipes-installer] branch dev updated: update cli README.md

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

wiener pushed a commit to branch dev
in repository https://gitbox.apache.org/repos/asf/incubator-streampipes-installer.git


The following commit(s) were added to refs/heads/dev by this push:
     new af459fb  update cli README.md
af459fb is described below

commit af459fb4e8b9f1fbca9f3c563db21e341da58e68
Author: Patrick Wiener <wi...@fzi.de>
AuthorDate: Fri Aug 14 16:45:12 2020 +0200

    update cli README.md
---
 cli/README.md | 106 ++++++++++++++++++++++++++++++++++++++++++++++++++++------
 cli/sp        |   2 +-
 cli/sp.m4     |   2 +-
 3 files changed, 98 insertions(+), 12 deletions(-)

diff --git a/cli/README.md b/cli/README.md
index 914dc10..e3ac89d 100644
--- a/cli/README.md
+++ b/cli/README.md
@@ -16,20 +16,107 @@
   ~
   -->
 
-# CLI tool for StreamPipes
+# CLI for StreamPipes
+The StreamPipes CLI is focused on developer, either planning to write new extensions such as **connect adapters, processors, sinks**  or working on the core of StreamPipes, namely **backend** or **ui**. To provide more flexibility what services need to be running we provide the CLI to easily set up a suitable dev environment locally.
 
-All active services are defined in the system file.
+#### Structure & Description
+The CLI is written in [argbash](https://github.com/matejak/argbash) and basically is a wrapper around several docker-compose commands plus some additional sugar.
+
+```bash
+.
+├── README.md
+├── services/   # holds all docker-compose service descriptions
+├── sp          # CLI
+├── sp.m4       # argbash file    
+├── templates/  # holds all dev templates used to generate `system` file
+└── tmpl_env    # template env file used to generate `.env` file
+```
+
+<!-- ## TL;DR
+```bash
+# start StreamPipes standalone lite version including current Java processors
+./sp start
+``` -->
+
+## Prequisite
+* Docker
+* Docker-Compose
+* Free ports (see mapped ports of services under `services/<service>/docker-compose.yml`)
+
+> **NOTE**: By using the CLI, we explicitely map ports of services to the host system. Thus, it might happy that you run into port conflicts if any other service already binds to that address.
+
+## Template structure
+
+We provide necessary `service templates` for various development scenarios:
+
+```bash
+templates
+├── backend-dev # for core development
+├── full        # for developing distributed extensions (Flink processors)
+├── lite        # for developing standalone extensions (Java processors)
+└── ui-dev      # for ui development
+```
+
+## Usage along Dev cycle: set-template, start, stop, (clean), update
+
+**First**, we select a template - this copies the content of the template and creates a new `system` file in the root dir:
+```bash
+./sp set-template <TEMPLATE>
+
+# ./sp set-template lite
+# [INFO]  Set configuration for template: lite
+```
+
+**Second**, we start the setup - this parsed the system file and iterates through the services directory, and appends each docker-compose.yml file.
+> **Note**: Issuing this command also pull the necessary images
+
+```bash
+./sp start
+
+
+# ...
+#
+# INFO: StreamPipes 0.67.0-SNAPSHOT is now ready to be used on your system
+#       Check https://streampipes.apache.org/ for information on StreamPipes
+#
+#       Go to the UI and follow the instructions to get started: http://localhost/
+```
+
+**Third**, stopping the setup is as easy as follows:
+```bash
+./sp stop
+```
+
+**Fourth (Optional)**, stopping the service does not remove the created Docker volumes. In case you also want to clean this up use the following command.
+```bash
+./sp clean
+```
+
+Additionally, if you want to update the services specified in your current `system` file, you can run:
+
+```bash
+./sp update
+```
+
+## Update changes to CLI
+We leverage [argbash](https://github.com/matejak/argbash) to build this CLI. To include changes to `sp.m4` file we can generate a new version of `sp` using the following command.
+
+```bash
+${PATH_TO_ARGBASH}/bin/argbash sp.m4 -o sp
+```
+
+<!-- All active services are defined in the system file.
 All available services are in the services folder.
 
 ## Features Suggestion
 * start (service-name) (--hostname "valueHostName") (--defaultip)
   * Starts StreamPipes or service
-* stop (service-name) 
+* stop (service-name)
   * Stops StreamPipes and deletes containers
-* restart (service-name) 
+* restart (service-name)
   * Restarts containers
 * update (service-name) (--renew)
-  * Downloads new docker images 
+  * Downloads new docker images
   * --renew restart containers after download
 * set-template (template-name)
   * Replaces the systems file with file mode-name
@@ -43,12 +130,12 @@ All available services are in the services folder.
 * activate (service-name) (--all)
   * Adds service to system and starts
 * add (service-name) (--all)
-  * Adds service to system 
+  * Adds service to system
 * deactivate {remove} (service-name)  (--all)
   * Stops container and removes from system file
 * clean
   * Stops and cleans SP installation, remove networks
-* remove-settings: 
+* remove-settings:
   * Stops StreamPipes and deletes .env file
 * set-version:
   * Change the StreamPipes version in the tmpl_env file
@@ -63,12 +150,11 @@ All available services are in the services folder.
 * ARG_OPTIONAL_BOOLEAN([all],a, [Select all available StreamPipes services])
 
 
-## Usage
-~/argbash/argbash-2.7.0/bin/argbash sp.m4 -o sp
+
 
 
 ## Naming Files / Folders
 * active-services
 * services/
 * system-configurations -> templates/
-* tmpl_env
+* tmpl_env -->
diff --git a/cli/sp b/cli/sp
index 98e4e8e..e2fe7e5 100755
--- a/cli/sp
+++ b/cli/sp
@@ -254,7 +254,7 @@ startStreamPipes() {
 
 	if [ ! -f "$SP_HOME/system" ];
 	then
-		moveSystemConfig default
+		moveSystemConfig lite
 	fi
 
 	if [ ! -f "$SP_HOME/.env" ];
diff --git a/cli/sp.m4 b/cli/sp.m4
index 9c54385..f1e9115 100644
--- a/cli/sp.m4
+++ b/cli/sp.m4
@@ -124,7 +124,7 @@ startStreamPipes() {
 
 	if [ ! -f "$SP_HOME/system" ];
 	then
-		moveSystemConfig default
+		moveSystemConfig lite
 	fi
 
 	if [ ! -f "$SP_HOME/.env" ];