Skip to content

Commit

Permalink
Give each tmux pane in start-airflow a title to make it clear what …
Browse files Browse the repository at this point in the history
…is running (#46931)
  • Loading branch information
ashb authored Feb 20, 2025
1 parent 9877491 commit dddcebc
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions scripts/in_container/bin/run_tmux
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,9 @@ export TMUX_SESSION="Airflow"
# Start New Session with our name
tmux new-session -d -s "${TMUX_SESSION}"

tmux set -g pane-border-format "#{pane_index}: #{@airflow_component}"
tmux set -g pane-border-status "top"

# Enable mouse interaction with tmux. This allows selecting between the panes
# by clicking with the mouse and also allows scrolling back through terminal
# output with the mouse wheel.
Expand All @@ -54,10 +57,12 @@ tmux send-keys -t 'Main' 'bash' C-m 'clear' C-m

tmux split-window -v
tmux select-pane -t 1
tmux set-option -p @airflow_component Scheduler
tmux send-keys 'airflow scheduler' C-m

tmux split-window -h
tmux select-pane -t 2
tmux set-option -p @airflow_component FastAPI

if [[ ! ${USE_AIRFLOW_VERSION=} =~ ^2\..* ]]; then
if [[ ${DEV_MODE=} == "true" ]]; then
Expand All @@ -69,6 +74,7 @@ fi

tmux split-window -h
tmux select-pane -t 3
tmux set-option -p @airflow_component Webserver
if [[ ${DEV_MODE=} == "true" ]]; then
tmux send-keys 'airflow webserver -d' C-m
else
Expand All @@ -77,21 +83,25 @@ fi

tmux select-pane -t 0
tmux split-window -h
tmux set-option -p @airflow_component Triggerer
tmux send-keys 'airflow triggerer' C-m

if [[ ${INTEGRATION_CELERY} == "true" ]]; then
tmux select-pane -t 0
tmux split-window -h
tmux set-option -p @airflow_component "Celery Worker"
tmux send-keys 'airflow celery worker' C-m
fi
if [[ ${INTEGRATION_CELERY} == "true" && ${CELERY_FLOWER} == "true" ]]; then
tmux select-pane -t 3
tmux split-window -h
tmux set-option -p @airflow_component Flower
tmux send-keys 'airflow celery flower' C-m
fi
if [[ ${AIRFLOW__CORE__EXECUTOR} == "airflow.providers.edge.executors.edge_executor.EdgeExecutor" ]]; then
tmux select-pane -t 0
tmux split-window -h
tmux set-option -p @airflow_component EdgeExec

# Ensure we are not leaking any DB connection information to Edge Worker process
tmux send-keys 'unset AIRFLOW__DATABASE__SQL_ALCHEMY_CONN' C-m
Expand All @@ -109,6 +119,7 @@ fi
if [[ ${STANDALONE_DAG_PROCESSOR} == "true" ]]; then
tmux select-pane -t 3
tmux split-window -h
tmux set-option -p @airflow_component "DAG Pocessor"
tmux send-keys 'airflow dag-processor' C-m
fi

Expand Down

0 comments on commit dddcebc

Please sign in to comment.