Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add start script for edge instance #1

Open
wants to merge 3 commits into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -231,4 +231,7 @@ io.openems.edge.controller.api.mqtt/edge0
io.openems.edge.application/c:/

### Debian ###
!tools/debian/**
!tools/debian/**

# Exclude config.d files which are generated by executing the start scripts
/config.d/
24 changes: 24 additions & 0 deletions scripts/start-edge.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
#!/usr/bin/zsh

echo "Starting OpenEMS Edge"

SCRIPTS_DIR="$( cd "$(dirname "$0")" ; pwd -P )"
WORK_DIR="$(dirname "$SCRIPTS_DIR")"
BUILD_DIR="$WORK_DIR/build"
PATH_TO_OPENEMS_EDGE_JAR="$BUILD_DIR/openems-edge.jar"
FELIX_CM_DIR="$WORK_DIR/config.d"

# check if openems-edge.jar exists
if [ ! -f "$PATH_TO_OPENEMS_EDGE_JAR" ]; then
echo "openems-edge.jar not found. Please run './gradlew buildEdge' first." >&2
exit 1
fi

# check if Java 17 is active
if [[ $(java -version 2>&1) != *"17"* ]]; then
echo "Java 17 is not active. Please run 'sdk use java 17'" >&2
exit 1
fi


java -agentlib:jdwp=transport=dt_socket,address=5005,server=y,suspend=n -XX:+ExitOnOutOfMemoryError -Dfelix.cm.dir="$FELIX_CM_DIR" -Djava.util.concurrent.ForkJoinPool.common.parallelism=100 -jar "$PATH_TO_OPENEMS_EDGE_JAR"
19 changes: 19 additions & 0 deletions scripts/start-ui.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
#!/usr/bin/zsh

echo "Starting OpenEMS UI"

SCRIPTS_DIR="$( cd "$(dirname "$0")" ; pwd -P )"
WORK_DIR="$(dirname "$SCRIPTS_DIR")"

cd "$WORK_DIR/ui"

# check if @angular/cli is installed globally
if ! command -v ng &> /dev/null
then
echo "@angular/cli is not installed globally. Please run 'npm install -g @angular/cli'" >&2
exit 1
fi

npm install
#Run OpenEMS UI
ng serve -c openems-edge-dev