Skip to content

Commit

Permalink
Merge pull request #10 from GRIDAPPSD/develop
Browse files Browse the repository at this point in the history
Develop
  • Loading branch information
tdtalbot authored Jan 25, 2024
2 parents 1fe15fc + caf817d commit d615f4a
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 7 deletions.
11 changes: 8 additions & 3 deletions entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,14 @@ if [ "$1" = "gridappsd" ]; then
sudo pip install -q --disable-pip-version-check -r $reqfile
done

# Run tail -f /dev/null to keep the container running and waiting for connection
echo "[Entrypoint] Waiting for connection"
tail -f /dev/null

if [ "${AUTOSTART:-0}" != "0" ]; then
/gridappsd/run-gridappsd.sh
else
# Run tail -f /dev/null to keep the container running and waiting for connection
echo "[Entrypoint] Waiting for connection"
tail -f /dev/null
fi
elif [ "$1" = "version" -o "$1" = "-v" -o "$1" = "--version" ]; then
echo -n "version: "
cat /gridappsd/dockerbuildversion.txt
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package gov.pnnl.goss.gridappsd.distributed;
package gov.pnnl.goss.gridappsd.distributed;

import java.io.Serializable;
import java.util.ArrayList;
Expand Down Expand Up @@ -133,6 +133,8 @@ public Serializable handleRequest(String request_queue, Serializable request) {
RequestFieldContext requestFieldContext = RequestFieldContext.parse(request.toString());
if (requestFieldContext.areaId == null)
return topology.root.feeders;
else if(requestFieldContext.areaId.equals(topology.root.feeders.message_bus_id))
return topology.root.feeders;
else {
for (SwitchArea switchArea : topology.root.feeders.switch_areas) {
if (requestFieldContext.areaId.equals(switchArea.message_bus_id))
Expand Down Expand Up @@ -383,4 +385,4 @@ public void getFieldMeasurementIds(String fieldModelMrid) {

}

}
}
9 changes: 7 additions & 2 deletions run-gridappsd.sh
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,15 @@ if [ -d /gridappsd/log ]; then
/bin/rm -rf /gridappsd/log/* 2 > /dev/null
fi

JAVA_OPTIONS=""
if [ "${AUTOSTART:-0}" != "0" ]; then
JAVA_OPTIONS=" -Dgosh.args=--nointeractive "
fi

# If the DEBUG environmental variable is set and is not 0
# then expose the port for remote debugging.
if [ "${DEBUG:-0}" != "0" ]; then
java -agentlib:jdwp=transport=dt_socket,server=y,address=8000,suspend=n -jar lib/run.bnd.jar
java ${JAVA_OPTIONS} -agentlib:jdwp=transport=dt_socket,server=y,address=8000,suspend=n -jar lib/run.bnd.jar
else
java -jar lib/run.bnd.jar
java ${JAVA_OPTIONS} -jar lib/run.bnd.jar
fi

0 comments on commit d615f4a

Please sign in to comment.