|
3 | 3 | # Runs a backbone pipeline locally on a computer using an embedded flink cluster |
4 | 4 | # GCP or Spark options are recommended for production and/or large-scale use cases |
5 | 5 |
|
6 | | -BACKBONE_CONFIG=NAME_OF_CONFIG_TO_USE.json |
7 | 6 |
|
8 | 7 | BACKBONEDIR=$(cd `dirname $0` && pwd) |
9 | 8 | cd $BACKBONEDIR |
10 | 9 |
|
| 10 | +echo "Repackaging Backbone with Current Configs, Modules, and Resources" |
| 11 | +java -cp bin/Plugin-Manager.jar org.ohnlp.backbone.pluginmanager.PluginManager Flink |
| 12 | + |
11 | 13 | FLINK_DIR=flink-1.14.3/bin |
12 | 14 | FLINK_EXECUTABLE=$FLINK_DIR/flink |
13 | 15 | if [ -f "$FLINK_EXECUTABLE" ]; then |
|
17 | 19 | wget https://dlcdn.apache.org/flink/flink-1.14.3/flink-1.14.3-bin-scala_2.11.tgz -O flink.tgz |
18 | 20 | tar -xf flink.tgz |
19 | 21 | echo "***Important***: Please adjust default flink settings located at flink-1.14.3/conf/flink-conf.yaml to match your hardware" |
20 | | - echo "Particularly taskmanager.numberOfTaskSlots (generally number of cores * .8 rounded down), " |
| 22 | + echo "Particularly taskmanager.numberOfTaskSlots (generally number of cores available for use, good starting point is CPU * .8 rounded down), " |
21 | 23 | echo "parallelism.default (set equal to number of task slots), " |
22 | 24 | echo "and taskmanager.memory.process.size (good start is 2GB * number of task slots)" |
23 | 25 | read -p "When done, press [ENTER] to continue" |
24 | 26 | fi |
25 | 27 |
|
| 28 | +if [ $# -eq 0 ]; then |
| 29 | + cd configs |
| 30 | + echo "No configuration parameter supplied, scanning for Available Configurations..." |
| 31 | + options=( $(find -mindepth 1 -maxdepth 1 -print0 -type f | xargs -0) ) |
| 32 | + select opt in "${options[@]}" "Quit" ; do |
| 33 | + if (( REPLY == 1 + ${#options[@]} )) ; then |
| 34 | + exit |
| 35 | + |
| 36 | + elif (( REPLY > 0 && REPLY <= ${#options[@]} )) ; then |
| 37 | + BACKBONE_CONFIG=${opt#\./} |
| 38 | + break |
| 39 | + |
| 40 | + else |
| 41 | + echo "Invalid option. Try another one." |
| 42 | + fi |
| 43 | + done |
| 44 | + cd .. |
| 45 | +else |
| 46 | + BACKBONE_CONFIG=$1 |
| 47 | +fi |
| 48 | + |
| 49 | +echo "Running Job with Configuration $BACKBONE_CONFIG" |
| 50 | + |
| 51 | + |
26 | 52 | BACKBONE_PACKAGED_FILE=bin/Backbone-Core-Flink-Packaged.jar |
27 | 53 | if [ -f "$BACKBONE_PACKAGED_FILE" ]; then |
28 | 54 | echo "Starting Embedded Flink Cluster..." |
|
0 commit comments