Running Flows
The engine script
You can run flows on the command line using the engine
script. You need to use the appropriate script for your platform.
Running on macOS
Use the Tweakstreet.app/Contents/bin/engine.sh
script to run flows on the command line.
Use the --help
switch for extended help information:
λ:~ $ cd /Applications/Tweakstreet.app/Contents
λ:Contents $ bin/engine.sh --help
engine.sh [OPTION]... FLOW_FILE
engine.sh script options:
-v, --verbose Output debug information in startup script.
-d, --debug Runs startup script in BASH
debug mode (set -x).
-h, --help Display this help and exit.
--version Output version information and exit.
...
λ:Contents $
Running from Linux tar distribution
Use the tweakstreet/bin/engine.sh
script to run flows on the command line.
Use the --help
switch for extended help information:
λ:~ $ cd /path/to/tweakstreet
λ:tweakstreet $ bin/engine.sh --help
engine.sh [OPTION]... FLOW_FILE
engine.sh script options:
-v, --verbose Output debug information in startup script.
-d, --debug Runs startup script in BASH
debug mode (set -x).
-h, --help Display this help and exit.
--version Output version information and exit.
...
λ:tweakstreet $
Linux from Linux AppImage
The AppImage is mountable as a file system. Once it is mounted you can access the bin/engine.sh
script, just like with the tar distribution.
See https://docs.appimage.org/ for details on mounting App Images.
Running on Windows
Use the bin\engine.bat
script to run flows on the windows command line.
Use the --help
switch for extended help information:
C:\path\to\tweakstreet> bin\engine.bat --help
engine.bat [OPTION]... FLOW_FILE
engine.bat script options:
-v, --verbose Output debug information in startup script.
-h, --help Display this help and exit.
--version Output version information and exit.
...
C:\path\to\tweakstreet>
Running a flow
To run a flow, pass the file name as the argument to the engine script.
λ:tweakstreet $ bin/engine.sh ~/Desktop/tweakstreet/csv/generate.dfl
20:11:38 INFO [main] tweakstreet on OpenJDK 64-Bit Server VM 1.8.0_202-b08 (AdoptOpenJdk)
20:11:38 INFO [main] loading flow /Users/slawo/Desktop/tweakstreet/csv/generate.dfl
20:11:38 INFO [generate.dfl] initializing flow
20:11:53 INFO [generate.dfl] flow finished successfully
20:11:53 INFO [main] /Users/slawo/Desktop/tweakstreet/csv/generate.dfl finished in 00:00:14
λ:tweakstreet $
Passing parameters
You use the -p
switch to pass a parameter value to the flow. The general syntax is -p NAME VALUE
. The value is treated as a string and assigned to the given parameter. If the declared parameter is not a string, the value will be cast to the target type as per tweakflow language rules.
λ:tweakstreet $ bin/engine.sh -p p1 value1 -p p2 value2 flow.cfl
Passing complex parameters
You use the -ep
switch to pass a tweakflow expression parameter to the flow that cannot be represented by a string. The general syntax is -ep NAME VALUE
. The value is treated as a tweakflow expression, and evaluated in empty scope first, before being assigned to the parameter. The evaluated value is cast to the type of the declared parameter in the flow.
# example passing tweakflow values
λ:tweakstreet $ bin/engine.sh -ep f '(x)->x*x' flow.cfl
Passing config modules
You use the -g <filename>
switch to pass a config module to the flow.
λ:tweakstreet-app $ bin/engine.sh -g conf/dev.tsm flow.cfl
15:31:39 ¦ INFO ¦ main ¦ loading flow flow.cfl
15:31:40 ¦ INFO ¦ flow.cfl ¦ initializing
15:31:40 ¦ INFO ¦ Logger.0 ¦ data path from $config: /var/incoming/data/
15:31:40 ¦ INFO ¦ flow.cfl ¦ flow finished successfully
Allocating memory
Specify the memory available to a flow using the -m
switch. Use [num]M
or [num]G
to specify the heap size in megabytes or gigabytes respectively.
# run small flow with 16 MB limit
λ:tweakstreet $ bin/engine.sh -m 16M ~/Desktop/tiny_flow.cfl
# run big flow with 4 GB limit
λ:tweakstreet $ bin/engine.sh -m 4G ~/Desktop/big_flow.cfl