Skip to content

Commit

Permalink
Merge branch 'main' into jinser/connector-ssl
Browse files Browse the repository at this point in the history
  • Loading branch information
neverchanje authored Mar 28, 2024
2 parents a256b65 + 2e197e1 commit 1118b9f
Show file tree
Hide file tree
Showing 128 changed files with 2,141 additions and 1,759 deletions.
85 changes: 60 additions & 25 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

31 changes: 19 additions & 12 deletions Makefile.toml
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,8 @@ if ${is_not_ci}
set_env RUST_LOG "pgwire_query_log=info,${rust_log}"
end
end
set_env TMUX "tmux -L risedev"
''',
]

Expand Down Expand Up @@ -155,15 +157,15 @@ category = "Misc"
description = "List all nodes in the cluster"
script = '''
#!/usr/bin/env bash
tmux list-windows -t risedev | grep -v active | cut -d'(' -f1
${TMUX} list-windows -t risedev | grep -v active | cut -d'(' -f1
'''

[tasks.lsw]
category = "Misc"
description = "List --watch all nodes in the cluster"
script = '''
#!/usr/bin/env bash
watch -n 1 "tmux list-windows -t risedev | grep -v active | cut -d'(' -f1"
watch -n 1 "${TMUX} list-windows -t risedev | grep -v active | cut -d'(' -f1"
'''

[tasks.del]
Expand All @@ -176,7 +178,7 @@ script = '''
#!/usr/bin/env bash
risedev_ls () {
tmux list-windows -t risedev | grep -v active | cut -d'(' -f1
${TMUX} list-windows -t risedev | grep -v active | cut -d'(' -f1
}
err () {
Expand All @@ -195,7 +197,7 @@ if [[ -z $(risedev_ls | grep "$1" ) ]]; then
err
fi
tmux kill-window -t $1
${TMUX} kill-window -t $1
'''

[tasks.f]
Expand Down Expand Up @@ -695,26 +697,31 @@ kill_zookeeper() {
wait_zookeeper_exit
}
if ! ${TMUX} ls &>/dev/null ; then
echo "No risedev cluster to kill. Exiting..."
exit 0
fi
# Kill other components
tmux list-windows -t risedev -F "#{window_name} #{pane_id}" \
${TMUX} list-windows -F "#{window_name} #{pane_id}" \
| grep -v 'kafka' \
| grep -v 'zookeeper' \
| awk '{ print $2 }' \
| xargs -I {} tmux send-keys -t {} C-c C-d
| xargs -I {} ${TMUX} send-keys -t {} C-c C-d
if [[ -n $(tmux list-windows -t risedev | grep kafka) ]];
if [[ -n $(${TMUX} list-windows | grep kafka) ]];
then
echo "kill kafka"
kill_kafka || true
echo "kill zookeeper"
kill_zookeeper || true
# Kill their tmux sessions
tmux list-windows -t risedev -F "#{pane_id}" | xargs -I {} tmux send-keys -t {} C-c C-d
# Kill their ${TMUX} sessions
${TMUX} list-windows -t risedev -F "#{pane_id}" | xargs -I {} ${TMUX} send-keys -t {} C-c C-d
fi
tmux kill-session -t risedev
${TMUX} kill-server
test $? -eq 0 || { echo "Failed to stop all RiseDev components."; exit 1; }
'''

Expand Down Expand Up @@ -768,8 +775,8 @@ do
echo
done
echo "check: $(tput setaf 4)tmux >= v3.2a$(tput sgr0)"
tmux -V || echo "$(tput setaf 3)tmux$(tput sgr0) not found."
echo "check: $(tput setaf 4)${TMUX} >= v3.2a$(tput sgr0)"
${TMUX} -V || echo "$(tput setaf 3)tmux$(tput sgr0) not found."
echo
echo "check: $(tput setaf 4)psql >= 14$(tput sgr0)"
Expand Down
Loading

0 comments on commit 1118b9f

Please sign in to comment.