-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added python dh native build, start, and stop scripts
- Loading branch information
Showing
3 changed files
with
79 additions
and
54 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
#!/usr/bin/env bash | ||
|
||
set -o errexit | ||
set -o pipefail | ||
|
||
# Build and start the python native Deephaven Community Server | ||
|
||
MY_ID=DH_JETTY_BY_STAN | ||
ID_PATTERN="-DMY_ID=${MY_ID}" | ||
JAVA=temurin-17-jdk-amd64 | ||
ROOT=./tmp/dh-server-jetty | ||
VENV=${ROOT}/py-venv | ||
BIN=${ROOT}/bin | ||
LOGS=${ROOT}/logs | ||
|
||
rm -rf server/jetty-app/build/distributions | ||
rm -rf ${ROOT} | ||
mkdir -p ${BIN} ${LOGS} | ||
|
||
OLD_JAVA_HOME="${JAVA_HOME}" | ||
export JAVA_HOME=/usr/lib/jvm/${JAVA} | ||
./gradlew server-jetty-app:build | ||
tar xvf server/jetty-app/build/distributions/server-jetty-*.tar -C ${BIN} | ||
export JAVA_HOME="${OLD_JAVA_HOME}" | ||
|
||
rm -f $(find py/server/build/wheel -name "*py3-none-any.whl") | ||
./gradlew py-server:assemble | ||
rm -rf ${VENV} | ||
python3 -m venv ${VENV} | ||
source ${VENV}/bin/activate | ||
pip install "$(find py/server/build/wheel -name '*py3-none-any.whl')[autocomplete]" | ||
|
||
export DEBUG="${DEBUG:-"-agentlib:jdwp=transport=dt_socket,server=y,suspend=${SUSPEND:-"n"},address=*:5005"}" | ||
|
||
export CONSOLE_TYPE="-Ddeephaven.console.type=${CONSOLE:-"python"}" | ||
export STORAGE="${STORAGE:-"-Dstorage.path=./data/"}" | ||
|
||
export CYCLE_TM="${CYCLE_TM:-1000}" | ||
export BARRAGE="${BARRAGE:-"-Dbarrage.minUpdateInterval=${CYCLE_TM} -DPeriodicUpdateGraph.targetCycleDurationMillis=${CYCLE_TM}"}" | ||
|
||
export GC_APP="-Dio.deephaven.app.GcApplication.enabled=true" | ||
export GRPC_APP="-Dio.deephaven.server.grpc_api_app.GrpcApiApplication.enabled=true" | ||
export APPS="${APPS:-"$GRPC_APP $GC_APP"}" | ||
|
||
export AUTH="-DAuthHandlers=io.deephaven.auth.AnonymousAuthenticationHandler" | ||
export EXTRA_OPS="-Xmx24g ${ID_PATTERN}" | ||
|
||
cat redpanda-standalone/docker-compose.yml | sed 's/redpanda:29/localhost:29/g' | sed 's/redpanda:80/localhost:80/g' > ${ROOT}/redpanda-docker-compose.yml | ||
docker compose -f ${ROOT}/redpanda-docker-compose.yml up -d | ||
|
||
JAVA_OPTS="$DEBUG $STORAGE $APPS $CONSOLE_TYPE $BARRAGE $AUTH $EXTRA_OPS" ${BIN}/server-jetty-*/bin/start &> ${LOGS}/dh.log & | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
#!/usr/bin/env bash | ||
|
||
# set -o errexit | ||
# set -o pipefail | ||
# set -o nounset | ||
|
||
# Stop the native python Deephaven Community Server | ||
|
||
MY_ID=DH_JETTY_BY_STAN | ||
ID_PATTERN="-DMY_ID=${MY_ID}" | ||
ROOT=./tmp/dh-server-jetty | ||
KILL_FILE=${ROOT}/pkill.stop.count.txt | ||
|
||
echo "Shutting Down: ${MY_ID}" | ||
pkill -c -f -SIGTERM "^.*${ID_PATTERN}.*$" > ${KILL_FILE} | ||
|
||
STOP_COUNT=$(cat ${KILL_FILE}) | ||
if [[ ${STOP_COUNT} -ge 1 ]]; then | ||
echo "Shut Down: ${MY_ID}" | ||
else | ||
echo "Shut Down: Nothing to shut down" | ||
fi | ||
|
||
rm -f ${KILL_FILE} | ||
|
||
docker compose -f ${ROOT}/redpanda-docker-compose.yml down |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters