From 2a2f8f24e218287f829a22faebc039b09b1ec33d Mon Sep 17 00:00:00 2001 From: Eugene Rakhmatulin Date: Thu, 18 Dec 2025 23:02:58 -0800 Subject: [PATCH] Allow launch-cluster.sh to be executed in non-TTY environment --- launch-cluster.sh | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/launch-cluster.sh b/launch-cluster.sh index ae1e857..09e8b85 100755 --- a/launch-cluster.sh +++ b/launch-cluster.sh @@ -415,7 +415,15 @@ wait_for_cluster() { if [[ "$ACTION" == "exec" ]]; then start_cluster echo "Executing command on head node: $COMMAND_TO_RUN" - docker exec -it "$CONTAINER_NAME" bash -i -c "$COMMAND_TO_RUN" + + # Check if running in a TTY to avoid "input device is not a TTY" error + if [ -t 0 ]; then + DOCKER_EXEC_FLAGS="-it" + else + DOCKER_EXEC_FLAGS="-i" + fi + + docker exec $DOCKER_EXEC_FLAGS "$CONTAINER_NAME" bash -i -c "$COMMAND_TO_RUN" elif [[ "$ACTION" == "start" ]]; then start_cluster if [[ "$DAEMON_MODE" == "true" ]]; then