Skip to content

Commit 68f65e4

Browse files
committed
Fixup start_manager.sh script.
- Support running with a regular Postgres server instead of `pg-embed` - Don't run `git submodule update` -- use whatever version of the SQL compiler the user has checked out.
1 parent 7e3b911 commit 68f65e4

File tree

1 file changed

+13
-9
lines changed

1 file changed

+13
-9
lines changed

scripts/start_manager.sh

Lines changed: 13 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -10,13 +10,8 @@ MANAGER_DIR="${ROOT_DIR}/crates/pipeline_manager"
1010
# exit 1
1111
# fi
1212

13-
if [[ ! -e ${SQL_COMPILER_DIR}/.git || -z $(cd ${SQL_COMPILER_DIR} && git branch --show-current) ]]
14-
then
15-
git submodule update --init
16-
fi
1713
cd "${SQL_COMPILER_DIR}/SQL-compiler" && mvn -DskipTests package
1814

19-
2015
WORKING_DIR="${1:-${HOME}/.dbsp}"
2116

2217
# This is the most portable way to get an absolute path since
@@ -31,13 +26,22 @@ pkill dbsp_pipeline_
3126
# Wait for manager process to exit.
3227
while ps -p $(pgrep dbsp_pipeline_) > /dev/null; do sleep 1; done
3328

34-
set -e
29+
set -ex
30+
31+
# If $WITH_POSTGRES is defined, manager should use a real Postgres server
32+
# instead of pg-embed.
33+
if [ -z "$WITH_POSTGRES" ]; then
34+
PG_EMBED="--features pg-embed"
35+
DB_CONNECTION_STRING="--db-connection-string=postgres-embed"
36+
else
37+
DB_CONNECTION_STRING="--db-connection-string=postgresql://${PGUSER}@localhost"
38+
fi
3539

36-
cd "${MANAGER_DIR}" && ~/.cargo/bin/cargo build --release --features pg-embed
37-
cd "${MANAGER_DIR}" && ~/.cargo/bin/cargo run --release --features pg-embed -- \
40+
cd "${MANAGER_DIR}" && ~/.cargo/bin/cargo build --release $PG_EMBED
41+
cd "${MANAGER_DIR}" && ~/.cargo/bin/cargo run --release $PG_EMBED -- \
3842
--bind-address="${BIND_ADDRESS}" \
3943
--working-directory="${WORKING_DIR_ABS}" \
4044
--sql-compiler-home="${SQL_COMPILER_DIR}" \
4145
--dbsp-override-path="${ROOT_DIR}" \
4246
--unix-daemon \
43-
--db-connection-string="postgres-embed"
47+
${DB_CONNECTION_STRING}

0 commit comments

Comments
 (0)