File tree Expand file tree Collapse file tree 4 files changed +51
-9
lines changed
Expand file tree Collapse file tree 4 files changed +51
-9
lines changed Original file line number Diff line number Diff line change @@ -28,7 +28,26 @@ pip3 install websockets
2828
2929[tasks .start_manager ]
3030script = '''
31- ../../scripts/start_manager.sh
31+ old_manager_pid=$(pgrep "pipeline-mana" || echo "")
32+ echo "Old manager: " $old_manager_pid
33+ if [ -n "$old_manager_pid" ]; then
34+ echo "Previous manager instance is running"
35+ exit 1
36+ fi
37+ ../../scripts/start_manager.sh &
38+ manager_pid=$!
39+ while true; do
40+ if curl --output /dev/null --silent --head --fail http://localhost:8080; then
41+ echo "Pipeline manager is up and running"
42+ break
43+ else
44+ if ! ps -p $manager_pid > /dev/null; then
45+ echo "Manager process has terminated unexpectedly"
46+ exit 1
47+ fi
48+ sleep 1
49+ fi
50+ done
3251'''
3352
3453[tasks .python_api_test ]
Original file line number Diff line number Diff line change @@ -4,15 +4,31 @@ THIS_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )"
44ROOT=" ${THIS_DIR} /../"
55SERVER_DIR=" ${ROOT} /crates/pipeline_manager/"
66
7- set -e
8-
97export REDPANDA_BROKERS=localhost:9092
108
11- docker kill redpanda || true
12- docker rm redpanda || true
13- docker run --name redpanda -p 9092:9092 --rm -itd docker.redpanda.com/vectorized/redpanda:v23.1.13
9+ docker kill redpanda
10+ docker rm redpanda
11+ docker run --name redpanda -p 9092:9092 --rm -itd docker.redpanda.com/vectorized/redpanda:v23.2.3 || { echo ' Failed to start RedPanda container' ; exit 1; }
12+
13+ # Kill the entire process group (including processes spawned by prepare_demo_data.sh) on shutdown.
14+ trap " trap - SIGTERM && kill -- -$$ " SIGINT SIGTERM EXIT
15+
16+ (
17+ # wait for the manager
18+ while true ; do
19+ if curl --output /dev/null --silent --head --fail http://localhost:8080; then
20+ echo " Pipeline manager is up and running"
21+ break
22+ else
23+ sleep 1
24+ fi
25+ done
26+ DBSP_MANAGER=" http://localhost:8080" ${THIS_DIR} /create_demo_projects.sh
27+ DBSP_MANAGER=" http://localhost:8080" ${THIS_DIR} /prepare_demo_data.sh
28+ ) &
29+
30+ prepare_subshell_pid=$!
1431
1532${ROOT} /scripts/start_manager.sh ${THIS_DIR} /pipeline_data
1633
17- DBSP_MANAGER=" http://localhost:8080" ${THIS_DIR} /create_demo_projects.sh
18- DBSP_MANAGER=" http://localhost:8080" ${THIS_DIR} /prepare_demo_data.sh
34+ # kill -9 $prepare_subshell_pid
Original file line number Diff line number Diff line change 1717 # TimeSeriesEnrich data is the same as we loaded in SimpleSelect
1818 if [ " $project_name " != " demo01-TimeSeriesEnrich" ]
1919 then
20- python3 " ${project_dir} /run.py" --dbsp_url ${DBSP_MANAGER} --actions prepare
20+ python3 " ${project_dir} /run.py" --dbsp_url ${DBSP_MANAGER} --actions prepare &
2121 fi
2222done
Original file line number Diff line number Diff line change 3434 DB_CONNECTION_STRING=" --db-connection-string=postgresql://${PGUSER} @localhost"
3535fi
3636
37+ manager_pid=$( pgrep " pipeline-mana" || echo " " )
38+
39+ if [ -n " $manager_pid " ]; then
40+ echo " Previous manager instance is running"
41+ exit 1
42+ fi
43+
3744cd " ${MANAGER_DIR} " && ~ /.cargo/bin/cargo build $RUST_BUILD_PROFILE $PG_EMBED
3845cd " ${MANAGER_DIR} " && ~ /.cargo/bin/cargo run --bin pipeline-manager $RUST_BUILD_PROFILE $PG_EMBED -- \
3946 --bind-address=" ${BIND_ADDRESS} " \
You can’t perform that action at this time.
0 commit comments