GitHub user Cccccrystall added a comment to the discussion: Quickstart 
Deployment Mode

### **Purpose**
introduces a new docker-compose.quickstart.yml file and related configurations, 
aiming to streamline and enhance the user experience for quick project setups.
### **Solution**
**How to use Quickstart Deployment Mode**
1. Run Streampipes core
Use "mvn clean package" in the streampipes root folder
2. Start the UI of Streampipes
Enter the ui folder and use "npm install" and "npm run build"
3. Start docker in quick mode
Enter the installer/compose folder
Use "`docker-compose -f docker-compose.quickstart.yml build script-runner`" to 
build the docker
Use "`docker-compose -f docker-compose.quickstart.yml up -d`" to start all 
services!
4.After services are started, go to http://localhost/, you could see the defalt 
assets!

**New Docker Compose File:**
 
Introduced docker-compose.quickstart.yml, derived from the existing 
docker-compose.full.yml.
Added additional configuration for the script-runner service, detailing build 
context, volume mapping (including the mapping of zip_folder), network 
dependencies, and service dependencies.
 `
script-runner:
build:.
volumes:
-./zip_folder:/zip_folder
networks:
spnet:
depends_on:
-backend
`
**Dockerfile for Script-Runner:**
 
Created a Dockerfile specifying the base image as ubuntu:latest.
Installed necessary utilities: curl and jq.
Added and made executable two Bash scripts: upload.sh and wait-for-it.sh.
 
**Upload Script:**
 
The script checks environment variables for user credentials, logs in to obtain 
an access token, and processes and uploads ZIP configuration files located in 
/zip_folder to the backend service.

 
**ZIP Configuration Files and Folder Mapping:**
 
Included a new folder zip_folder containing ZIP configuration files to be used 
by the upload.sh script.
The zip_folder is mapped to the script-runner container, allowing direct access 
and processing of the ZIP files within the container.
The introduction of zip_folder mapping facilitates easy additions of default 
ZIP configurations. Whenever there is a need to introduce new default 
configurations, we can simply add the corresponding ZIP files to the 
zip_folder, making the process more efficient and user-friendly.
 
**Wait-for-it Script:**
 
Incorporated the wait-for-it.sh script, enhancing the container’s capability to 
wait for the availability of the dependent backend service before executing 
upload.sh. This script is from: 
https://github.com/vishnubob/wait-for-it/blob/master/wait-for-it.sh

**Usage Instructions:**

To utilize the new configurations, the user should build the script-runner 
service with the command: docker-compose -f docker-compose.quickstart.yml build 
script-runner.
Subsequently, to trigger the setup, the user should run: docker-compose -f 
docker-compose.quickstart.yml up -d.
 
**Future Plan:**
As part of our ongoing efforts to enhance user experience, we plan to package 
the script-runner service as a separate Docker image and upload it to Docker 
Hub. This step will allow users to skip the build step and trigger the service 
directly, thereby further simplifying the setup process.
 
These enhancements are designed to facilitate easier and more efficient project 
setups, especially beneficial for users seeking a quickstart option. By 
introducing the script-runner service with automated script executions and 
additional configurations, we are enabling seamless interactions and operations 
for different project use cases.

Here is the Demo:
![output](https://github.com/apache/streampipes/assets/133633007/309ecf69-1336-431f-8810-fc124db8cd8c)


GitHub link: 
https://github.com/apache/streampipes/discussions/1732#discussioncomment-7080886

----
This is an automatically sent email for [email protected].
To unsubscribe, please send an email to: [email protected]

Reply via email to