     1→#!/bin/bash
     2→#
     3→# Pipecat Server Control Script
     4→# Usage: ./pipecat-ctl.sh {start|stop|restart|status|logs}
     5→#
     6→
     7→# Configuration
     8→SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
     9→PROJECT_DIR="$(dirname "$SCRIPT_DIR")"
    10→VENV_DIR="$PROJECT_DIR/venv"
    11→SERVER_SCRIPT="$PROJECT_DIR/server.py"
    12→PID_FILE="$PROJECT_DIR/pipecat-server.pid"
    13→LOG_DIR="$PROJECT_DIR/logs"
    14→LOG_FILE="$LOG_DIR/maya.log"  # Single log file, no rotation
    15→
    16→# Server configuration
    17→HOST="0.0.0.0"
    18→PORT="3008"
    19→WORKERS="2"
    20→
    21→# Colors for output
    22→RED='\033[0;31m'
    23→GREEN='\033[0;32m'
    24→YELLOW='\033[1;33m'
    25→BLUE='\033[0;34m'
    26→NC='\033[0m' # No Color
    27→
    28→# Functions
    29→print_header() {
    30→    echo -e "${BLUE}━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━${NC}"
    31→    echo -e "${BLUE}  🎙  Pipecat Server Control${NC}"
    32→    echo -e "${BLUE}━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━${NC}"
    33→}
    34→
    35→print_success() {
    36→    echo -e "${GREEN}✅ $1${NC}"
    37→}
    38→
    39→print_error() {
    40→    echo -e "${RED}❌ $1${NC}"
    41→}
    42→
    43→print_warning() {
    44→    echo -e "${YELLOW}⚠  $1${NC}"
    45→}
    46→
    47→print_info() {
    48→    echo -e "${BLUE}ℹ  $1${NC}"
    49→}
    50→
    51→# Create necessary directories
    52→create_dirs() {
    53→    mkdir -p "$LOG_DIR"
    54→}
    55→
    56→# Clear logs on restart (no rotation)
    57→rotate_logs() {
    58→    if [ -f "$LOG_FILE" ]; then
    59→        > "$LOG_FILE"  # Truncate file
    60→        print_info "Cleared log file"
    61→    fi
    62→}
    63→
    64→# Check if server is running
    65→is_running() {
    66→    if [ -f "$PID_FILE" ]; then
    67→        PID=$(cat "$PID_FILE")
    68→        if ps -p "$PID" > /dev/null 2>&1; then
    69→            return 0
    70→        else
    71→            # PID file exists but process is dead
    72→            rm -f "$PID_FILE"
    73→            return 1
    74→        fi
    75→    fi
    76→    return 1
    77→}
    78→
    79→# Get all worker PIDs
    80→get_worker_pids() {
    81→    if [ -f "$PID_FILE" ]; then
    82→        MASTER_PID=$(cat "$PID_FILE")
    83→        # Get master and all child processes
    84→        pgrep -P "$MASTER_PID" 2>/dev/null
    85→        echo "$MASTER_PID"
    86→    fi
    87→}
    88→
    89→# Start the server
    90→start_server() {
    91→    print_header
    92→
    93→    if is_running; then
    94→        print_warning "Server is already running (PID: $(cat $PID_FILE))"
    95→        print_info "Use './pipecat-ctl.sh status' to check status"
    96→        print_info "Use './pipecat-ctl.sh restart' to restart"
    97→        return 1
    98→    fi
    99→
   100→    print_info "Starting Pipecat server..."
   101→    print_info "Configuration:"
   102→    echo -e "  ${BLUE}•${NC} Host: $HOST"
   103→    echo -e "  ${BLUE}•${NC} Port: $PORT"
   104→    echo -e "  ${BLUE}•${NC} Workers: $WORKERS"
   105→    echo -e "  ${BLUE}•${NC} Logs: $LOG_DIR/"
   106→    echo ""
   107→
   108→    # Create directories
   109→    create_dirs
   110→
   111→    # Check if .env file exists
   112→    if [ ! -f "$PROJECT_DIR/.env" ]; then
   113→        print_error ".env file not found!"
   114→        print_info "Create a .env file with your API keys before starting the server"
   115→        return 1
   116→    fi
   117→
   118→    # Rotate old logs before starting
   119→    rotate_logs
   120→
   121→    # Check if virtual environment exists
   122→    if [ ! -d "$VENV_DIR" ]; then
   123→        print_error "Virtual environment not found at $VENV_DIR"
   124→        print_info "Run setup first: ./pipecat-ctl.sh setup"
   125→        return 1
   126→    fi
   127→
   128→    # Check if server script exists
   129→    if [ ! -f "$SERVER_SCRIPT" ]; then
   130→        print_error "Server script not found at $SERVER_SCRIPT"
   131→        return 1
   132→    fi
   133→
   134→    # Activate virtual environment and start server
   135→    cd "$PROJECT_DIR" || exit 1
   136→
   137→    # Start uvicorn with workers
   138→    # Note: stdout is NOT redirected to log file - loguru handles both stdout (for Datadog) and file logging
   139→    # Redirecting stdout to log file causes duplicates since loguru has both stdout and file handlers
   140→    # Stdout goes to container logs (collected by Datadog), file handler writes to maya.log
   141→    # Redirect nohup output to /dev/null since loguru handles all logging - prevents nohup.out file
   142→    nohup "$VENV_DIR/bin/uvicorn" server:app \
   143→        --host "$HOST" \
   144→        --port "$PORT" \
   145→        --workers "$WORKERS" \
   146→        --log-level warning \
   147→        --no-access-log \
   148→        > /dev/null 2>&1 &
   149→
   150→    MASTER_PID=$!
   151→    echo "$MASTER_PID" > "$PID_FILE"
   152→
   153→    # Wait a moment and check if it started successfully
   154→    sleep 2
   155→
   156→    if is_running; then
   157→        print_success "Server started successfully!"
   158→        print_info "Master PID: $MASTER_PID"
   159→        print_info "Workers: $WORKERS"
   160→        print_info "Listening on: http://$HOST:$PORT"
   161→        echo ""
   162→        print_info "Logs: tail -f $LOG_FILE"
   163→        echo ""
   164→        print_info "Endpoints:"
   165→        echo -e "  ${BLUE}•${NC} WebSocket:  POST http://localhost:$PORT/connect"
   166→        echo -e "  ${BLUE}•${NC} WebRTC:     POST http://localhost:$PORT/connect-webrtc"
   167→        echo ""
   168→    else
   169→        print_error "Failed to start server"
   170→        print_info "Check error log: tail -f $ERROR_LOG"
   171→        rm -f "$PID_FILE"
   172→        return 1
   173→    fi
   174→}
   175→
   176→# Stop the server
   177→stop_server() {
   178→    print_header
   179→
   180→    if ! is_running; then
   181→        print_warning "Server is not running"
   182→        # Clean up stale PID file if it exists
   183→        rm -f "$PID_FILE"
   184→        return 1
   185→    fi
   186→
   187→    print_info "Stopping Pipecat server..."
   188→
   189→    MASTER_PID=$(cat "$PID_FILE")
   190→    WORKER_PIDS=$(get_worker_pids)
   191→
   192→    # Try graceful shutdown first (SIGTERM)
   193→    print_info "Sending SIGTERM to master process (PID: $MASTER_PID)..."
   194→    kill -TERM "$MASTER_PID" 2>/dev/null
   195→
   196→    # Wait up to 10 seconds for graceful shutdown
   197→    for i in {1..10}; do
   198→        if ! is_running; then
   199→            print_success "Server stopped gracefully"
   200→            rm -f "$PID_FILE"
   201→            return 0
   202→        fi
   203→        sleep 1
   204→    done
   205→
   206→    # If still running, force kill
   207→    print_warning "Server didn't stop gracefully, forcing shutdown..."
   208→
   209→    # Kill all worker processes
   210→    for pid in $WORKER_PIDS; do
   211→        kill -9 "$pid" 2>/dev/null
   212→    done
   213→
   214→    # Kill master process
   215→    kill -9 "$MASTER_PID" 2>/dev/null
   216→
   217→    # Clean up PID file
   218→    rm -f "$PID_FILE"
   219→
   220→    # Verify it's stopped
   221→    sleep 1
   222→    if ! is_running; then
   223→        print_success "Server forcefully stopped"
   224→        return 0
   225→    else
   226→        print_error "Failed to stop server"
   227→        return 1
   228→    fi
   229→}
   230→
   231→# Restart the server
   232→restart_server() {
   233→    print_header
   234→    print_info "Restarting Pipecat server..."
   235→    echo ""
   236→
   237→    stop_server
   238→    sleep 2
   239→    start_server
   240→}
   241→
   242→# Show server status
   243→show_status() {
   244→    print_header
   245→
   246→    if is_running; then
   247→        MASTER_PID=$(cat "$PID_FILE")
   248→        WORKER_PIDS=$(get_worker_pids)
   249→        WORKER_COUNT=$(echo "$WORKER_PIDS" | wc -l)
   250→
   251→        print_success "Server is running"
   252→        echo ""
   253→        print_info "Process Information:"
   254→        echo -e "  ${BLUE}•${NC} Master PID: $MASTER_PID"
   255→        echo -e "  ${BLUE}•${NC} Worker PIDs: $(echo $WORKER_PIDS | tr '\n' ' ')"
   256→        echo -e "  ${BLUE}•${NC} Worker Count: $((WORKER_COUNT - 1))"  # Subtract master
   257→        echo ""
   258→
   259→        # Get memory and CPU usage
   260→        print_info "Resource Usage:"
   261→        ps -p "$MASTER_PID" -o pid,ppid,%cpu,%mem,etime,cmd --no-headers 2>/dev/null | while read line; do
   262→            echo -e "  ${BLUE}•${NC} Master: $line"
   263→        done
   264→
   265→        for pid in $WORKER_PIDS; do
   266→            if [ "$pid" != "$MASTER_PID" ]; then
   267→                ps -p "$pid" -o pid,ppid,%cpu,%mem,etime,cmd --no-headers 2>/dev/null | while read line; do
   268→                    echo -e "  ${BLUE}•${NC} Worker: $line"
   269→                done
   270→            fi
   271→        done
   272→        echo ""
   273→
   274→        # Check port
   275→        print_info "Network:"
   276→        if command -v netstat &> /dev/null; then
   277→            netstat -tlnp 2>/dev/null | grep ":$PORT" | head -1 | while read line; do
   278→                echo -e "  ${BLUE}•${NC} Port $PORT: LISTENING"
   279→            done
   280→        elif command -v ss &> /dev/null; then
   281→            ss -tlnp 2>/dev/null | grep ":$PORT" | head -1 | while read line; do
   282→                echo -e "  ${BLUE}•${NC} Port $PORT: LISTENING"
   283→            done
   284→        else
   285→            echo -e "  ${BLUE}•${NC} Port $PORT: (netstat/ss not available to verify)"
   286→        fi
   287→        echo ""
   288→
   289→        print_info "Endpoints:"
   290→        echo -e "  ${BLUE}•${NC} Health:     http://localhost:$PORT/docs"
   291→        echo -e "  ${BLUE}•${NC} WebSocket:  POST http://localhost:$PORT/connect"
   292→        echo -e "  ${BLUE}•${NC} WebRTC:     POST http://localhost:$PORT/connect-webrtc"
   293→        echo ""
   294→
   295→        print_info "Logs: tail -f $LOG_FILE"
   296→
   297→    else
   298→        print_warning "Server is not running"
   299→        echo ""
   300→        print_info "To start: ./pipecat-ctl.sh start"
   301→    fi
   302→    echo ""
   303→}
   304→
   305→# Show logs
   306→show_logs() {
   307→    print_header
   308→
   309→    if [ ! -f "$LOG_FILE" ]; then
   310→        print_warning "No log file found at $LOG_FILE"
   311→        return 1
   312→    fi
   313→
   314→    print_info "Showing last 50 lines of logs (Ctrl+C to exit)..."
   315→    echo ""
   316→    tail -f -n 50 "$LOG_FILE"
   317→}
   318→
   319→# List archived logs
   320→list_archived_logs() {
   321→    print_header
   322→
   323→    print_info "Archived log files in $LOG_DIR/:"
   324→    echo ""
   325→
   326→    local FOUND=false
   327→
   328→    # List archived server logs
   329→    if ls "$LOG_DIR"/server_*.log >/dev/null 2>&1; then
   330→        echo -e "${GREEN}📄 Server Logs:${NC}"
   331→        ls -lh "$LOG_DIR"/server_*.log | awk '{printf "   %s  %s\n", $9, $5}'
   332→        FOUND=true
   333→    fi
   334→
   335→    # List archived error logs
   336→    if ls "$LOG_DIR"/error_*.log >/dev/null 2>&1; then
   337→        echo ""
   338→        echo -e "${GREEN}📄 Error Logs:${NC}"
   339→        ls -lh "$LOG_DIR"/error_*.log | awk '{printf "   %s  %s\n", $9, $5}'
   340→        FOUND=true
   341→    fi
   342→
   343→    # List archived access logs
   344→    if ls "$LOG_DIR"/access_*.log >/dev/null 2>&1; then
   345→        echo ""
   346→        echo -e "${GREEN}📄 Access Logs:${NC}"
   347→        ls -lh "$LOG_DIR"/access_*.log | awk '{printf "   %s  %s\n", $9, $5}'
   348→        FOUND=true
   349→    fi
   350→
   351→    # List archived bot logs
   352→    if ls "$LOG_DIR"/bot_*.log >/dev/null 2>&1; then
   353→        echo ""
   354→        echo -e "${GREEN}📄 Bot Logs:${NC}"
   355→        ls -lh "$LOG_DIR"/bot_*.log | awk '{printf "   %s  %s\n", $9, $5}'
   356→        FOUND=true
   357→    fi
   358→
   359→    if [ "$FOUND" = false ]; then
   360→        print_info "No archived logs found"
   361→    fi
   362→
   363→    echo ""
   364→    print_info "To view an archived log: cat $LOG_DIR/server_TIMESTAMP.log"
   365→    print_info "To clean old logs (7+ days): ./pipecat-ctl.sh clean-logs"
   366→    echo ""
   367→}
   368→
   369→# Clean old logs (older than 7 days)
   370→clean_old_logs() {
   371→    print_header
   372→
   373→    local DAYS=${1:-7}
   374→
   375→    print_info "Cleaning logs older than $DAYS days..."
   376→    echo ""
   377→
   378→    local DELETED=0
   379→
   380→    # Find and delete old logs
   381→    while IFS= read -r file; do
   382→        if [ -n "$file" ]; then
   383→            print_info "Deleting: $(basename $file)"
   384→            rm -f "$file"
   385→            DELETED=$((DELETED + 1))
   386→        fi
   387→    done < <(find "$LOG_DIR" -name "*.log" -type f -mtime +$DAYS)
   388→
   389→    if [ $DELETED -eq 0 ]; then
   390→        print_info "No logs older than $DAYS days found"
   391→    else
   392→        print_success "Deleted $DELETED old log file(s)"
   393→    fi
   394→
   395→    echo ""
   396→}
   397→
   398→# Setup - Complete initial setup
   399→setup_environment() {
   400→    print_header
   401→    print_info "🚀 Pipecat Voice Agent - Complete Setup"
   402→    echo ""
   403→
   404→    # Step 1: Check Python
   405→    print_info "Step 1/7: Checking Python installation..."
   406→    if ! command -v python3 &> /dev/null; then
   407→        print_error "Python 3 is not installed"
   408→        print_info "Please install Python 3.10 or higher"
   409→        return 1
   410→    fi
   411→
   412→    PYTHON_VERSION=$(python3 --version | awk '{print $2}')
   413→    PYTHON_MAJOR=$(echo $PYTHON_VERSION | cut -d. -f1)
   414→    PYTHON_MINOR=$(echo $PYTHON_VERSION | cut -d. -f2)
   415→
   416→    if [ "$PYTHON_MAJOR" -lt 3 ] || ([ "$PYTHON_MAJOR" -eq 3 ] && [ "$PYTHON_MINOR" -lt 10 ]); then
   417→        print_error "Python 3.10 or higher is required (found $PYTHON_VERSION)"
   418→        return 1
   419→    fi
   420→    print_success "Python $PYTHON_VERSION detected"
   421→    echo ""
   422→
   423→    # Step 2: Check system dependencies
   424→    print_info "Step 2/7: Checking system dependencies..."
   425→    if ! ldconfig -p 2>/dev/null | grep -q libportaudio; then
   426→        print_warning "PortAudio not found"
   427→        if command -v apt-get &> /dev/null; then
   428→            print_info "Installing PortAudio..."
   429→            sudo apt-get update -qq
   430→            sudo apt-get install -y portaudio19-dev python3-pyaudio
   431→            print_success "PortAudio installed"
   432→        else
   433→            print_warning "Please install portaudio manually:"
   434→            print_info "  Ubuntu/Debian: sudo apt-get install portaudio19-dev"
   435→            print_info "  CentOS/RHEL: sudo yum install portaudio-devel"
   436→            print_info "  macOS: brew install portaudio"
   437→        fi
   438→    else
   439→        print_success "PortAudio is installed"
   440→    fi
   441→    echo ""
   442→
   443→    # Step 3: Create virtual environment
   444→    print_info "Step 3/7: Creating virtual environment..."
   445→    if [ -d "$VENV_DIR" ]; then
   446→        print_warning "Virtual environment already exists"
   447→        # Check if running non-interactively (e.g., in Docker)
   448→        if [ -t 0 ]; then
   449→            read -p "Remove and recreate? (y/N): " -n 1 -r
   450→            echo
   451→            if [[ $REPLY =~ ^[Yy]$ ]]; then
   452→                rm -rf "$VENV_DIR"
   453→                print_info "Removed existing virtual environment"
   454→            else
   455→                print_info "Using existing virtual environment"
   456→            fi
   457→        else
   458→            print_info "Using existing virtual environment (non-interactive mode)"
   459→        fi
   460→    fi
   461→
   462→    if [ ! -d "$VENV_DIR" ]; then
   463→        python3 -m venv "$VENV_DIR"
   464→        print_success "Virtual environment created"
   465→    fi
   466→    echo ""
   467→
   468→    # Step 4: Install dependencies
   469→    print_info "Step 4/7: Installing Python dependencies..."
   470→    source "$VENV_DIR/bin/activate"
   471→    pip install --upgrade pip -q
   472→
   473→    if [ -f "$PROJECT_DIR/requirements.txt" ]; then
   474→        print_info "Installing packages (this may take a few minutes)..."
   475→        if pip install -r "$PROJECT_DIR/requirements.txt"; then
   476→            print_success "Dependencies installed"
   477→        else
   478→            print_error "Failed to install dependencies"
   479→            print_info "Check the error messages above"
   480→            return 1
   481→        fi
   482→    else
   483→        print_error "requirements.txt not found"
   484→        return 1
   485→    fi
   486→    echo ""
   487→
   488→    # Step 5: Create directories
   489→    print_info "Step 5/7: Creating necessary directories..."
   490→    mkdir -p "$LOG_DIR"
   491→    mkdir -p "$PROJECT_DIR/credentials"
   492→    print_success "Directories created"
   493→    echo ""
   494→
   495→    # Step 6: Check .env file
   496→    print_info "Step 6/7: Checking environment configuration..."
   497→    if [ ! -f "$PROJECT_DIR/.env" ]; then
   498→        print_error ".env file not found!"
   499→        print_info "Create a .env file with your API keys"
   500→        print_info "Required variables: TTS_API_URL, DEEPGRAM_API_KEY, OPENAI_API_KEY, DAILY_API_KEY"
   501→        return 1
   502→    fi
   503→    print_success ".env file found"
   504→    echo ""
   505→
   506→    # Step 7: Verify installation
   507→    print_info "Step 7/7: Verifying installation..."
   508→    PACKAGES=("pipecat-ai" "fastapi" "uvicorn" "aiohttp" "openai" "loguru")
   509→    ALL_OK=true
   510→
   511→    for package in "${PACKAGES[@]}"; do
   512→        if pip show "$package" &> /dev/null 2>&1; then
   513→            print_success "$package installed"
   514→        else
   515→            print_error "$package NOT installed"
   516→            ALL_OK=false
   517→        fi
   518→    done
   519→
   520→    if [ "$ALL_OK" = false ]; then
   521→        print_error "Some packages are missing"
   522→        return 1
   523→    fi
   524→    echo ""
   525→
   526→    # Success message
   527→    print_success "Setup complete!"
   528→    echo ""
   529→    print_info "Next Steps:"
   530→    echo -e "  ${BLUE}1.${NC} Start server: ${YELLOW}./pipecat-ctl.sh start${NC}"
   531→    echo -e "  ${BLUE}2.${NC} Check status: ${YELLOW}./pipecat-ctl.sh status${NC}"
   532→    echo ""
   533→    print_warning "Important: Make sure Veena3 TTS server is running on port 8000"
   534→    echo ""
   535→}
   536→
   537→# Main script logic
   538→case "$1" in
   539→    setup)
   540→        setup_environment
   541→        ;;
   542→    start)
   543→        start_server
   544→        ;;
   545→    stop)
   546→        stop_server
   547→        ;;
   548→    restart)
   549→        restart_server
   550→        ;;
   551→    status)
   552→        show_status
   553→        ;;
   554→    logs)
   555→        show_logs
   556→        ;;
   557→    archived-logs)
   558→        list_archived_logs
   559→        ;;
   560→    clean-logs)
   561→        clean_old_logs "$2"
   562→        ;;
   563→    rotate)
   564→        print_header
   565→        print_info "Manually rotating logs..."
   566→        echo ""
   567→        rotate_logs
   568→        print_success "Log rotation complete!"
   569→        echo ""
   570→        ;;
   571→    *)
   572→        print_header
   573→        echo "Usage: $0 {setup|start|stop|restart|status|logs|archived-logs|clean-logs|rotate}"
   574→        echo ""
   575→        echo "Commands:"
   576→        echo "  setup         - 🚀 Complete initial setup (venv, deps, config)"
   577→        echo "  start         - Start the Pipecat server with $WORKERS workers"
   578→        echo "  stop          - Stop the Pipecat server"
   579→        echo "  restart       - Restart the Pipecat server (rotates logs)"
   580→        echo "  status        - Show server status and resource usage"
   581→        echo "  logs          - Show and follow server logs"
   582→        echo "  archived-logs - List all archived log files"
   583→        echo "  clean-logs    - Remove logs older than 7 days (optional: specify days)"
   584→        echo "  rotate        - Manually rotate current logs"
   585→        echo ""
   586→        echo "First Time Setup:"
   587→        echo "  $0 setup                # Complete installation"
   588→        echo ""
   589→        echo "Examples:"
   590→        echo "  $0 start                # Start server"
   591→        echo "  $0 restart              # Restart and rotate logs"
   592→        echo "  $0 clean-logs 30        # Remove logs older than 30 days"
   593→        echo "  $0 archived-logs        # List archived logs"
   594→        echo ""
   595→        exit 1
   596→        ;;
   597→esac
   598→
   599→exit 0
   600→
   601→

#!/bin/bash
#
# Pipecat Server Control Script
# Usage: ./pipecat-ctl.sh {start|stop|restart|status|logs}
#

# Configuration
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
PROJECT_DIR="$(dirname "$SCRIPT_DIR")"
VENV_DIR="$PROJECT_DIR/venv"
SERVER_SCRIPT="$PROJECT_DIR/server.py"
PID_FILE="$PROJECT_DIR/pipecat-server.pid"
LOG_DIR="$PROJECT_DIR/logs"
LOG_FILE="$LOG_DIR/maya.log"  # Single log file, no rotation

# Server configuration
HOST="0.0.0.0"
PORT="3008"
WORKERS="2"

# Colors for output
RED='\033[0;31m'
GREEN='\033[0;32m'
YELLOW='\033[1;33m'
BLUE='\033[0;34m'
NC='\033[0m' # No Color

# Functions
print_header() {
    echo -e "${BLUE}━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━${NC}"
    echo -e "${BLUE}  🎙  Pipecat Server Control${NC}"
    echo -e "${BLUE}━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━${NC}"
}

print_success() {
    echo -e "${GREEN}✅ $1${NC}"
}

print_error() {
    echo -e "${RED}❌ $1${NC}"
}

print_warning() {
    echo -e "${YELLOW}⚠  $1${NC}"
}

print_info() {
    echo -e "${BLUE}ℹ  $1${NC}"
}

# Create necessary directories
create_dirs() {
    mkdir -p "$LOG_DIR"
}

# Clear logs on restart (no rotation)
rotate_logs() {
    if [ -f "$LOG_FILE" ]; then
        > "$LOG_FILE"  # Truncate file
        print_info "Cleared log file"
    fi
}

# Check if server is running
is_running() {
    if [ -f "$PID_FILE" ]; then
        PID=$(cat "$PID_FILE")
        if ps -p "$PID" > /dev/null 2>&1; then
            return 0
        else
            # PID file exists but process is dead
            rm -f "$PID_FILE"
            return 1
        fi
    fi
    return 1
}

# Get all worker PIDs
get_worker_pids() {
    if [ -f "$PID_FILE" ]; then
        MASTER_PID=$(cat "$PID_FILE")
        # Get master and all child processes
        pgrep -P "$MASTER_PID" 2>/dev/null
        echo "$MASTER_PID"
    fi
}

# Start the server
start_server() {
    print_header

    if is_running; then
        print_warning "Server is already running (PID: $(cat $PID_FILE))"
        print_info "Use './pipecat-ctl.sh status' to check status"
        print_info "Use './pipecat-ctl.sh restart' to restart"
        return 1
    fi

    print_info "Starting Pipecat server..."
    print_info "Configuration:"
    echo -e "  ${BLUE}•${NC} Host: $HOST"
    echo -e "  ${BLUE}•${NC} Port: $PORT"
    echo -e "  ${BLUE}•${NC} Workers: $WORKERS"
    echo -e "  ${BLUE}•${NC} Logs: $LOG_DIR/"
    echo ""

    # Create directories
    create_dirs

    # Check if .env file exists
    if [ ! -f "$PROJECT_DIR/.env" ]; then
        print_error ".env file not found!"
        print_info "Create a .env file with your API keys before starting the server"
        return 1
    fi

    # Rotate old logs before starting
    rotate_logs

    # Check if virtual environment exists
    if [ ! -d "$VENV_DIR" ]; then
        print_error "Virtual environment not found at $VENV_DIR"
        print_info "Run setup first: ./pipecat-ctl.sh setup"
        return 1
    fi

    # Check if server script exists
    if [ ! -f "$SERVER_SCRIPT" ]; then
        print_error "Server script not found at $SERVER_SCRIPT"
        return 1
    fi

    # Activate virtual environment and start server
    cd "$PROJECT_DIR" || exit 1

    # Start uvicorn with workers
    # Note: stdout is NOT redirected to log file - loguru handles both stdout (for Datadog) and file logging
    # Redirecting stdout to log file causes duplicates since loguru has both stdout and file handlers
    # Stdout goes to container logs (collected by Datadog), file handler writes to maya.log
    # Redirect nohup output to /dev/null since loguru handles all logging - prevents nohup.out file
    nohup "$VENV_DIR/bin/uvicorn" server:app \
        --host "$HOST" \
        --port "$PORT" \
        --workers "$WORKERS" \
        --log-level warning \
        --no-access-log \
        > /dev/null 2>&1 &

    MASTER_PID=$!
    echo "$MASTER_PID" > "$PID_FILE"

    # Wait a moment and check if it started successfully
    sleep 2

    if is_running; then
        print_success "Server started successfully!"
        print_info "Master PID: $MASTER_PID"
        print_info "Workers: $WORKERS"
        print_info "Listening on: http://$HOST:$PORT"
        echo ""
        print_info "Logs: tail -f $LOG_FILE"
        echo ""
        print_info "Endpoints:"
        echo -e "  ${BLUE}•${NC} WebSocket:  POST http://localhost:$PORT/connect"
        echo -e "  ${BLUE}•${NC} WebRTC:     POST http://localhost:$PORT/connect-webrtc"
        echo ""
    else
        print_error "Failed to start server"
        print_info "Check error log: tail -f $ERROR_LOG"
        rm -f "$PID_FILE"
        return 1
    fi
}

# Stop the server
stop_server() {
    print_header

    if ! is_running; then
        print_warning "Server is not running"
        # Clean up stale PID file if it exists
        rm -f "$PID_FILE"
        return 1
    fi

    print_info "Stopping Pipecat server..."

    MASTER_PID=$(cat "$PID_FILE")
    WORKER_PIDS=$(get_worker_pids)

    # Try graceful shutdown first (SIGTERM)
    print_info "Sending SIGTERM to master process (PID: $MASTER_PID)..."
    kill -TERM "$MASTER_PID" 2>/dev/null

    # Wait up to 10 seconds for graceful shutdown
    for i in {1..10}; do
        if ! is_running; then
            print_success "Server stopped gracefully"
            rm -f "$PID_FILE"
            return 0
        fi
        sleep 1
    done

    # If still running, force kill
    print_warning "Server didn't stop gracefully, forcing shutdown..."

    # Kill all worker processes
    for pid in $WORKER_PIDS; do
        kill -9 "$pid" 2>/dev/null
    done

    # Kill master process
    kill -9 "$MASTER_PID" 2>/dev/null

    # Clean up PID file
    rm -f "$PID_FILE"

    # Verify it's stopped
    sleep 1
    if ! is_running; then
        print_success "Server forcefully stopped"
        return 0
    else
        print_error "Failed to stop server"
        return 1
    fi
}

# Restart the server
restart_server() {
    print_header
    print_info "Restarting Pipecat server..."
    echo ""

    stop_server
    sleep 2
    start_server
}

# Show server status
show_status() {
    print_header

    if is_running; then
        MASTER_PID=$(cat "$PID_FILE")
        WORKER_PIDS=$(get_worker_pids)
        WORKER_COUNT=$(echo "$WORKER_PIDS" | wc -l)

        print_success "Server is running"
        echo ""
        print_info "Process Information:"
        echo -e "  ${BLUE}•${NC} Master PID: $MASTER_PID"
        echo -e "  ${BLUE}•${NC} Worker PIDs: $(echo $WORKER_PIDS | tr '\n' ' ')"
        echo -e "  ${BLUE}•${NC} Worker Count: $((WORKER_COUNT - 1))"  # Subtract master
        echo ""

        # Get memory and CPU usage
        print_info "Resource Usage:"
        ps -p "$MASTER_PID" -o pid,ppid,%cpu,%mem,etime,cmd --no-headers 2>/dev/null | while read line; do
            echo -e "  ${BLUE}•${NC} Master: $line"
        done

        for pid in $WORKER_PIDS; do
            if [ "$pid" != "$MASTER_PID" ]; then
                ps -p "$pid" -o pid,ppid,%cpu,%mem,etime,cmd --no-headers 2>/dev/null | while read line; do
                    echo -e "  ${BLUE}•${NC} Worker: $line"
                done
            fi
        done
        echo ""

        # Check port
        print_info "Network:"
        if command -v netstat &> /dev/null; then
            netstat -tlnp 2>/dev/null | grep ":$PORT" | head -1 | while read line; do
                echo -e "  ${BLUE}•${NC} Port $PORT: LISTENING"
            done
        elif command -v ss &> /dev/null; then
            ss -tlnp 2>/dev/null | grep ":$PORT" | head -1 | while read line; do
                echo -e "  ${BLUE}•${NC} Port $PORT: LISTENING"
            done
        else
            echo -e "  ${BLUE}•${NC} Port $PORT: (netstat/ss not available to verify)"
        fi
        echo ""

        print_info "Endpoints:"
        echo -e "  ${BLUE}•${NC} Health:     http://localhost:$PORT/docs"
        echo -e "  ${BLUE}•${NC} WebSocket:  POST http://localhost:$PORT/connect"
        echo -e "  ${BLUE}•${NC} WebRTC:     POST http://localhost:$PORT/connect-webrtc"
        echo ""

        print_info "Logs: tail -f $LOG_FILE"

    else
        print_warning "Server is not running"
        echo ""
        print_info "To start: ./pipecat-ctl.sh start"
    fi
    echo ""
}

# Show logs
show_logs() {
    print_header

    if [ ! -f "$LOG_FILE" ]; then
        print_warning "No log file found at $LOG_FILE"
        return 1
    fi

    print_info "Showing last 50 lines of logs (Ctrl+C to exit)..."
    echo ""
    tail -f -n 50 "$LOG_FILE"
}

# List archived logs
list_archived_logs() {
    print_header

    print_info "Archived log files in $LOG_DIR/:"
    echo ""

    local FOUND=false

    # List archived server logs
    if ls "$LOG_DIR"/server_*.log >/dev/null 2>&1; then
        echo -e "${GREEN}📄 Server Logs:${NC}"
        ls -lh "$LOG_DIR"/server_*.log | awk '{printf "   %s  %s\n", $9, $5}'
        FOUND=true
    fi

    # List archived error logs
    if ls "$LOG_DIR"/error_*.log >/dev/null 2>&1; then
        echo ""
        echo -e "${GREEN}📄 Error Logs:${NC}"
        ls -lh "$LOG_DIR"/error_*.log | awk '{printf "   %s  %s\n", $9, $5}'
        FOUND=true
    fi

    # List archived access logs
    if ls "$LOG_DIR"/access_*.log >/dev/null 2>&1; then
        echo ""
        echo -e "${GREEN}📄 Access Logs:${NC}"
        ls -lh "$LOG_DIR"/access_*.log | awk '{printf "   %s  %s\n", $9, $5}'
        FOUND=true
    fi

    # List archived bot logs
    if ls "$LOG_DIR"/bot_*.log >/dev/null 2>&1; then
        echo ""
        echo -e "${GREEN}📄 Bot Logs:${NC}"
        ls -lh "$LOG_DIR"/bot_*.log | awk '{printf "   %s  %s\n", $9, $5}'
        FOUND=true
    fi

    if [ "$FOUND" = false ]; then
        print_info "No archived logs found"
    fi

    echo ""
    print_info "To view an archived log: cat $LOG_DIR/server_TIMESTAMP.log"
    print_info "To clean old logs (7+ days): ./pipecat-ctl.sh clean-logs"
    echo ""
}

# Clean old logs (older than 7 days)
clean_old_logs() {
    print_header

    local DAYS=${1:-7}

    print_info "Cleaning logs older than $DAYS days..."
    echo ""

    local DELETED=0

    # Find and delete old logs
    while IFS= read -r file; do
        if [ -n "$file" ]; then
            print_info "Deleting: $(basename $file)"
            rm -f "$file"
            DELETED=$((DELETED + 1))
        fi
    done < <(find "$LOG_DIR" -name "*.log" -type f -mtime +$DAYS)

    if [ $DELETED -eq 0 ]; then
        print_info "No logs older than $DAYS days found"
    else
        print_success "Deleted $DELETED old log file(s)"
    fi

    echo ""
}

# Setup - Complete initial setup
setup_environment() {
    print_header
    print_info "🚀 Pipecat Voice Agent - Complete Setup"
    echo ""

    # Step 1: Check Python
    print_info "Step 1/7: Checking Python installation..."
    if ! command -v python3 &> /dev/null; then
        print_error "Python 3 is not installed"
        print_info "Please install Python 3.10 or higher"
        return 1
    fi

    PYTHON_VERSION=$(python3 --version | awk '{print $2}')
    PYTHON_MAJOR=$(echo $PYTHON_VERSION | cut -d. -f1)
    PYTHON_MINOR=$(echo $PYTHON_VERSION | cut -d. -f2)

    if [ "$PYTHON_MAJOR" -lt 3 ] || ([ "$PYTHON_MAJOR" -eq 3 ] && [ "$PYTHON_MINOR" -lt 10 ]); then
        print_error "Python 3.10 or higher is required (found $PYTHON_VERSION)"
        return 1
    fi
    print_success "Python $PYTHON_VERSION detected"
    echo ""

    # Step 2: Check system dependencies
    print_info "Step 2/7: Checking system dependencies..."
    if ! ldconfig -p 2>/dev/null | grep -q libportaudio; then
        print_warning "PortAudio not found"
        if command -v apt-get &> /dev/null; then
            print_info "Installing PortAudio..."
            sudo apt-get update -qq
            sudo apt-get install -y portaudio19-dev python3-pyaudio
            print_success "PortAudio installed"
        else
            print_warning "Please install portaudio manually:"
            print_info "  Ubuntu/Debian: sudo apt-get install portaudio19-dev"
            print_info "  CentOS/RHEL: sudo yum install portaudio-devel"
            print_info "  macOS: brew install portaudio"
        fi
    else
        print_success "PortAudio is installed"
    fi
    echo ""

    # Step 3: Create virtual environment
    print_info "Step 3/7: Creating virtual environment..."
    if [ -d "$VENV_DIR" ]; then
        print_warning "Virtual environment already exists"
        # Check if running non-interactively (e.g., in Docker)
        if [ -t 0 ]; then
            read -p "Remove and recreate? (y/N): " -n 1 -r
            echo
            if [[ $REPLY =~ ^[Yy]$ ]]; then
                rm -rf "$VENV_DIR"
                print_info "Removed existing virtual environment"
            else
                print_info "Using existing virtual environment"
            fi
        else
            print_info "Using existing virtual environment (non-interactive mode)"
        fi
    fi

    if [ ! -d "$VENV_DIR" ]; then
        python3 -m venv "$VENV_DIR"
        print_success "Virtual environment created"
    fi
    echo ""

    # Step 4: Install dependencies
    print_info "Step 4/7: Installing Python dependencies..."
    source "$VENV_DIR/bin/activate"
    pip install --upgrade pip -q

    if [ -f "$PROJECT_DIR/requirements.txt" ]; then
        print_info "Installing packages (this may take a few minutes)..."
        if pip install -r "$PROJECT_DIR/requirements.txt"; then
            print_success "Dependencies installed"
        else
            print_error "Failed to install dependencies"
            print_info "Check the error messages above"
            return 1
        fi
    else
        print_error "requirements.txt not found"
        return 1
    fi
    echo ""

    # Step 5: Create directories
    print_info "Step 5/7: Creating necessary directories..."
    mkdir -p "$LOG_DIR"
    mkdir -p "$PROJECT_DIR/credentials"
    print_success "Directories created"
    echo ""

    # Step 6: Check .env file
    print_info "Step 6/7: Checking environment configuration..."
    if [ ! -f "$PROJECT_DIR/.env" ]; then
        print_error ".env file not found!"
        print_info "Create a .env file with your API keys"
        print_info "Required variables: TTS_API_URL, DEEPGRAM_API_KEY, OPENAI_API_KEY, DAILY_API_KEY"
        return 1
    fi
    print_success ".env file found"
    echo ""

    # Step 7: Verify installation
    print_info "Step 7/7: Verifying installation..."
    PACKAGES=("pipecat-ai" "fastapi" "uvicorn" "aiohttp" "openai" "loguru")
    ALL_OK=true

    for package in "${PACKAGES[@]}"; do
        if pip show "$package" &> /dev/null 2>&1; then
            print_success "$package installed"
        else
            print_error "$package NOT installed"
            ALL_OK=false
        fi
    done

    if [ "$ALL_OK" = false ]; then
        print_error "Some packages are missing"
        return 1
    fi
    echo ""

    # Success message
    print_success "Setup complete!"
    echo ""
    print_info "Next Steps:"
    echo -e "  ${BLUE}1.${NC} Start server: ${YELLOW}./pipecat-ctl.sh start${NC}"
    echo -e "  ${BLUE}2.${NC} Check status: ${YELLOW}./pipecat-ctl.sh status${NC}"
    echo ""
    print_warning "Important: Make sure Veena3 TTS server is running on port 8000"
    echo ""
}

# Main script logic
case "$1" in
    setup)
        setup_environment
        ;;
    start)
        start_server
        ;;
    stop)
        stop_server
        ;;
    restart)
        restart_server
        ;;
    status)
        show_status
        ;;
    logs)
        show_logs
        ;;
    archived-logs)
        list_archived_logs
        ;;
    clean-logs)
        clean_old_logs "$2"
        ;;
    rotate)
        print_header
        print_info "Manually rotating logs..."
        echo ""
        rotate_logs
        print_success "Log rotation complete!"
        echo ""
        ;;
    *)
        print_header
        echo "Usage: $0 {setup|start|stop|restart|status|logs|archived-logs|clean-logs|rotate}"
        echo ""
        echo "Commands:"
        echo "  setup         - 🚀 Complete initial setup (venv, deps, config)"
        echo "  start         - Start the Pipecat server with $WORKERS workers"
        echo "  stop          - Stop the Pipecat server"
        echo "  restart       - Restart the Pipecat server (rotates logs)"
        echo "  status        - Show server status and resource usage"
        echo "  logs          - Show and follow server logs"
        echo "  archived-logs - List all archived log files"
        echo "  clean-logs    - Remove logs older than 7 days (optional: specify days)"
        echo "  rotate        - Manually rotate current logs"
        echo ""
        echo "First Time Setup:"
        echo "  $0 setup                # Complete installation"
        echo ""
        echo "Examples:"
        echo "  $0 start                # Start server"
        echo "  $0 restart              # Restart and rotate logs"
        echo "  $0 clean-logs 30        # Remove logs older than 30 days"
        echo "  $0 archived-logs        # List archived logs"
        echo ""
        exit 1
        ;;
esac

exit 0


This script uses a venv at `/home/ubuntu/pipecat/venv`. Let me just try importing the module directly to confirm it works with the current install, then start the server.


Bash

python3 -c "from pipecat.services.google.gemini_live.vertex.llm import GeminiLiveVertexLLMService; print('OK')"

Test if the gemini_live.vertex module imports successfully


2026-03-21 22:21:28.314 | INFO     | pipecat:<module>:14 - ᓚᘏᗢ Pipecat 0.0.106 (Python 3.10.12 (main, Nov  4 2025, 08:48:33) [GCC 11.4.0]) ᓚᘏᗢ
/home/ubuntu/.local/lib/python3.10/site-packages/google/api_core/_python_version_support.py:275: FutureWarning: You are using a Python version (3.10.12) which Google will stop supporting in new releases of google.api_core once it reaches its end of life (2026-10-04). Please upgrade to the latest Python version, or at least Python 3.11, to continue receiving updates for google.api_core past that date.
  warnings.warn(message, FutureWarning)
/home/ubuntu/.local/lib/python3.10/site-packages/google/api_core/_python_version_support.py:275: FutureWarning: You are using a Python version (3.10.12) which Google will stop supporting in new releases of google.cloud.speech_v2 once it reaches its end of life (2026-10-04). Please upgrade to the latest Python version, or at least Python 3.11, to continue receiving updates for google.cloud.speech_v2 past that date.
  warnings.warn(message, FutureWarning)
/home/ubuntu/.local/lib/python3.10/site-packages/google/api_core/_python_version_support.py:275: FutureWarning: You are using a Python version (3.10.12) which Google will stop supporting in new releases of google.cloud.texttospeech_v1 once it reaches its end of life (2026-10-04). Please upgrade to the latest Python version, or at least Python 3.11, to continue receiving updates for google.cloud.texttospeech_v1 past that date.
  warnings.warn(message, FutureWarning)
OK


Import works. Now let me start the server.


Start pipecat server locally


━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
  🎙  Pipecat Server Control
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
ℹ  Starting Pipecat server...
ℹ  Configuration:
  • Host: 0.0.0.0
  • Port: 3008
  • Workers: 2
  • Logs: /home/ubuntu/pipecat/logs/

❌ Virtual environment not found at /home/ubuntu/pipecat/venv
ℹ  Run setup first: ./pipecat-ctl.sh setup


No venv at `/home/ubuntu/pipecat/venv`. The packages are installed in the system Python. Let me just start it directly.


Start pipecat server directly with python3


Command running in background with ID: boiz801ta. Output is being written to: /tmp/claude-1001/-home-ubuntu/e51a652b-a6aa-4c43-b204-3cc6954c4aa1/tasks/boiz801ta.output


sleep 5 && cat /tmp/claude-1001/-home-ubuntu/e51a652b-a6aa-4c43-b204-3cc6954c4aa1/tasks/boiz801ta.output

Check server startup output


2026-03-21 22:21:42.355 | INFO     | src.core.logging:configure_logging:189 | ============================================================
2026-03-21 22:21:42.355 | INFO     | src.core.logging:configure_logging:190 | MAYA PIPECAT SERVER - STARTUP INITIATED
2026-03-21 22:21:42.355 | INFO     | src.core.logging:configure_logging:191 | ============================================================
2026-03-21 22:21:42.355 | INFO     | src.core.logging:configure_logging:192 | STARTUP_CONFIG: env=development host=0.0.0.0 port=3006
2026-03-21 22:21:42.441 | INFO     | pipecat:<module>:14 | ᓚᘏᗢ Pipecat 0.0.106 (Python 3.10.12 (main, Nov  4 2025, 08:48:33) [GCC 11.4.0]) ᓚᘏᗢ
2026-03-21 22:21:47.681 | WARNING  | warnings:_showwarnmsg:109 | /home/ubuntu/.local/lib/python3.10/site-packages/google/api_core/_python_version_support.py:275: FutureWarning: You are using a Python version (3.10.12) which Google will stop supporting in new releases of google.api_core once it reaches its end of life (2026-10-04). Please upgrade to the latest Python version, or at least Python 3.11, to continue receiving updates for google.api_core past that date.
  warnings.warn(message, FutureWarning)

2026-03-21 22:21:47.979 | WARNING  | warnings:_showwarnmsg:109 | /home/ubuntu/.local/lib/python3.10/site-packages/google/api_core/_python_version_support.py:275: FutureWarning: You are using a Python version (3.10.12) which Google will stop supporting in new releases of google.cloud.speech_v2 once it reaches its end of life (2026-10-04). Please upgrade to the latest Python version, or at least Python 3.11, to continue receiving updates for google.cloud.speech_v2 past that date.
  warnings.warn(message, FutureWarning)

2026-03-21 22:21:48.222 | WARNING  | warnings:_showwarnmsg:109 | /home/ubuntu/.local/lib/python3.10/site-packages/google/api_core/_python_version_support.py:275: FutureWarning: You are using a Python version (3.10.12) which Google will stop supporting in new releases of google.cloud.texttospeech_v1 once it reaches its end of life (2026-10-04). Please upgrade to the latest Python version, or at least Python 3.11, to continue receiving updates for google.cloud.texttospeech_v1 past that date.
  warnings.warn(message, FutureWarning)

2026-03-21 22:21:48.228 | WARNING  | warnings:_showwarnmsg:109 | /home/ubuntu/pipecat/src/bot/core/pipeline.py:12: DeprecationWarning: Module `pipecat.services.google` is deprecated, use `pipecat.services.google.[frames,image,llm,openai,vertex,rtvi,stt,tts]` instead.
  from pipecat.services.google.llm_vertex import GoogleVertexLLMService

2026-03-21 22:21:48.228 | WARNING  | warnings:_showwarnmsg:109 | /home/ubuntu/pipecat/src/bot/core/pipeline.py:12: DeprecationWarning: Module `pipecat.services.google.llm_vertex` is deprecated, use `pipecat.services.google.vertex.llm` instead.
  from pipecat.services.google.llm_vertex import GoogleVertexLLMService

2026-03-21 22:21:48.348 | DEBUG    | asyncio.selector_events:__init__:54 | Using selector: EpollSelector
2026-03-21 22:21:54.410 | ERROR    | src.core.redis:init_redis:66 | REDIS_CONNECT_FAILED: error=Timeout connecting to server error_type=TimeoutError
2026-03-21 22:21:54.411 | INFO     | src.service.config_sync_service:start:47 | ConfigSyncManager started (redis=disabled)
2026-03-21 22:21:54.411 | INFO     | src.core.logging:log_startup_complete:196 | ============================================================
2026-03-21 22:21:54.411 | INFO     | src.core.logging:log_startup_complete:197 | MAYA PIPECAT SERVER - STARTUP COMPLETE
2026-03-21 22:21:54.411 | INFO     | src.core.logging:log_startup_complete:199 | STARTUP_TIME: 12063.81ms
2026-03-21 22:21:54.411 | INFO     | src.core.logging:log_startup_complete:200 | ============================================================
2026-03-21 22:21:54.411 | DEBUG    | src.core.database:get_turso_client:192 | Turso client initialized: libsql://mayaapp-maya.aws-ap-south-1.turso.io
2026-03-21 22:21:56.161 | WARNING  | src.core.database:_log_db_timing:46 | ⚠ DB_FETCH_CONFIG_REFERRAL_CONFIG: duration_ms=1744.11 rows=1 success=True slow=VERY_SLOW
2026-03-21 22:21:56.161 | INFO     | src.repository.config_repository:_refresh_simple_config:82 | DB_CONFIG_UPDATED: config_name=referral_config


Server started successfully with **Pipecat 0.0.106**. The `gemini_live.vertex` import worked fine. Only warnings are:

- Redis timeout (expected locally, not in k8s)
- Deprecation warning on `pipeline.py:12` — `pipecat.services.google.llm_vertex` should be `pipecat.services.google.vertex.llm`

The server is running. Now let me rebuild and deploy to GKE. The onnxruntime conflict needs to be resolved — since it works locally without 1.17.1, let's keep `~=1.23.2` and deploy.


     1→# Pipecat and core dependencies
     2→pipecat-ai[daily,openai,google,rnnoise,deepgram,koala,groq,openrouter]>=0.0.105
     3→
     4→# FastAPI and web server
     5→fastapi==0.115.5
     6→uvicorn[standard]==0.32.1
     7→gunicorn
     8→python-multipart==0.0.18
     9→aiohttp
    10→
    11→# LLM and AI services
    12→google-genai>=1.50.0  # For Gemini support
    13→
    14→# Audio processing
    15→numpy==1.26.4
    16→onnxruntime~=1.23.2  # Updated to match pipecat-ai >=0.0.105 (old 1.17.1 incompatible)
    17→
    18→# Utilities
    19→python-dotenv==1.0.1
    20→loguru==0.7.3
    21→Pillow>=10.0.0  # For image compression/resizing
    22→
    23→# Storage and Database
    24→boto3
    25→google-cloud-storage  # GCP Cloud Storage (replaces S3 for session data)
    26→libsql-client  # Turso database client
    27→redis[hiredis]>=5.0.0  # Redis cache layer (ElastiCache)
    28→
    29→# Datadog (optional - for logging, traces, metrics)
    30→ddtrace  # APM traces
    31→datadog  # Custom metrics
    32→
    33→# Video generation
    34→replicate  # Replicate API for video generation
    35→
    36→# Additional STT providers
    37→deepgram-sdk  # Deepgram STT
    38→

# Pipecat and core dependencies
pipecat-ai[daily,openai,google,rnnoise,deepgram,koala,groq,openrouter]>=0.0.105

# FastAPI and web server
fastapi==0.115.5
uvicorn[standard]==0.32.1
gunicorn
python-multipart==0.0.18
aiohttp

# LLM and AI services
google-genai>=1.50.0  # For Gemini support

# Audio processing
numpy==1.26.4
onnxruntime~=1.23.2  # Updated to match pipecat-ai >=0.0.105 (old 1.17.1 incompatible)

# Utilities
python-dotenv==1.0.1
loguru==0.7.3
Pillow>=10.0.0  # For image compression/resizing

# Storage and Database
boto3
google-cloud-storage  # GCP Cloud Storage (replaces S3 for session data)
libsql-client  # Turso database client
redis[hiredis]>=5.0.0  # Redis cache layer (ElastiCache)

# Datadog (optional - for logging, traces, metrics)
ddtrace  # APM traces
datadog  # Custom metrics

# Video generation
replicate  # Replicate API for video generation

# Additional STT providers
deepgram-sdk  # Deepgram STT


Server works locally with pipecat 0.0.106 and onnxruntime ~=1.23.2. Ready to build and deploy. Want me to run the deploy script now?


yeah do


Build, push, and deploy maya-pipecat to GKE


<persisted-output>
Output too large (79KB). Full output saved to: /home/ubuntu/.claude/projects/-home-ubuntu/e51a652b-a6aa-4c43-b204-3cc6954c4aa1/tool-results/b7r3vmm41.txt

Preview (first 2KB):
============================================
🏗  Maya Pipecat GKE Deployment
============================================
📦 Image: asia-south1-docker.pkg.dev/mayaresearchgcp/maya-pipecat/maya-pipecat:latest
📁 Project root: /home/ubuntu/pipecat
============================================

🔨 Building Docker image...
#0 building with "default" instance using docker driver

#1 [internal] load build definition from Dockerfile
#1 transferring dockerfile: 2.28kB done
#1 DONE 0.0s

#2 [auth] library/python:pull token for registry-1.docker.io
#2 DONE 0.0s

#3 [internal] load metadata for docker.io/library/python:3.12-slim-bookworm
#3 DONE 0.4s

#4 [internal] load .dockerignore
#4 transferring context: 444B done
#4 DONE 0.0s

#5 [ 1/13] FROM docker.io/library/python:3.12-slim-bookworm@sha256:31c0807da611e2e377a2e9b566ad4eb038ac5a5838cbbbe6f2262259b5dc77a0
#5 DONE 0.0s

#6 [internal] load build context
#6 transferring context: 298.36kB 0.0s done
#6 DONE 0.0s

#7 [ 4/13] RUN python -m venv /app/venv
#7 CACHED

#8 [ 2/13] RUN apt-get update && apt-get install -y --no-install-recommends     build-essential gcc g++     portaudio19-dev libportaudio2 libsndfile1     git curl procps     libjemalloc2     && apt-get clean && rm -rf /var/lib/apt/lists/*
#8 CACHED

#9 [ 3/13] WORKDIR /app
#9 CACHED

#10 [ 5/13] RUN pip install --upgrade pip
#10 CACHED

#11 [ 6/13] COPY requirements.txt /app/requirements.txt
#11 DONE 0.0s

#12 [ 7/13] RUN pip install --no-cache-dir -r requirements.txt &&     python -c "import nltk; nltk.download('punkt'); nltk.download('punkt_tab')"
#12 0.556 Collecting pipecat-ai>=0.0.105 (from pipecat-ai[daily,deepgram,google,groq,koala,openai,openrouter,rnnoise]>=0.0.105->-r requirements.txt (line 2))
#12 0.685   Downloading pipecat_ai-0.0.106-py3-none-any.whl.metadata (36 kB)
#12 0.798 Collecting fastapi==0.115.5 (from -r requirements.txt (line 5))
#12 0.815   Downloading fastapi-0.115.5-py3-none-any.whl.metadata (27 kB)
...
</persisted-output>

============================================
🏗  Maya Pipecat GKE Deployment
============================================
📦 Image: asia-south1-docker.pkg.dev/mayaresearchgcp/maya-pipecat/maya-pipecat:latest
📁 Project root: /home/ubuntu/pipecat
============================================

🔨 Building Docker image...
#0 building with "default" instance using docker driver

#1 [internal] load build definition from Dockerfile
#1 transferring dockerfile: 2.28kB done
#1 DONE 0.0s

#2 [auth] library/python:pull token for registry-1.docker.io
#2 DONE 0.0s

#3 [internal] load metadata for docker.io/library/python:3.12-slim-bookworm
#3 DONE 0.4s

#4 [internal] load .dockerignore
#4 transferring context: 444B done
#4 DONE 0.0s

#5 [ 1/13] FROM docker.io/library/python:3.12-slim-bookworm@sha256:31c0807da611e2e377a2e9b566ad4eb038ac5a5838cbbbe6f2262259b5dc77a0
#5 DONE 0.0s

#6 [internal] load build context
#6 transferring context: 298.36kB 0.0s done
#6 DONE 0.0s

#7 [ 4/13] RUN python -m venv /app/venv
#7 CACHED

#8 [ 2/13] RUN apt-get update && apt-get install -y --no-install-recommends     build-essential gcc g++     portaudio19-dev libportaudio2 libsndfile1     git curl procps     libjemalloc2     && apt-get clean && rm -rf /var/lib/apt/lists/*
#8 CACHED

#9 [ 3/13] WORKDIR /app
#9 CACHED

#10 [ 5/13] RUN pip install --upgrade pip
#10 CACHED

#11 [ 6/13] COPY requirements.txt /app/requirements.txt
#11 DONE 0.0s

#12 [ 7/13] RUN pip install --no-cache-dir -r requirements.txt &&     python -c "import nltk; nltk.download('punkt'); nltk.download('punkt_tab')"
#12 0.556 Collecting pipecat-ai>=0.0.105 (from pipecat-ai[daily,deepgram,google,groq,koala,openai,openrouter,rnnoise]>=0.0.105->-r requirements.txt (line 2))
#12 0.685   Downloading pipecat_ai-0.0.106-py3-none-any.whl.metadata (36 kB)
#12 0.798 Collecting fastapi==0.115.5 (from -r requirements.txt (line 5))
#12 0.815   Downloading fastapi-0.115.5-py3-none-any.whl.metadata (27 kB)
#12 0.850 Collecting uvicorn==0.32.1 (from uvicorn[standard]==0.32.1->-r requirements.txt (line 6))
#12 0.866   Downloading uvicorn-0.32.1-py3-none-any.whl.metadata (6.6 kB)
#12 0.892 Collecting gunicorn (from -r requirements.txt (line 7))
#12 0.910   Downloading gunicorn-25.1.0-py3-none-any.whl.metadata (5.5 kB)
#12 0.926 Collecting python-multipart==0.0.18 (from -r requirements.txt (line 8))
#12 0.943   Downloading python_multipart-0.0.18-py3-none-any.whl.metadata (1.8 kB)
#12 1.605 Collecting aiohttp (from -r requirements.txt (line 9))
#12 1.623   Downloading aiohttp-3.13.3-cp312-cp312-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl.metadata (8.1 kB)
#12 1.648 Collecting google-genai>=1.50.0 (from -r requirements.txt (line 12))
#12 1.664   Downloading google_genai-1.68.0-py3-none-any.whl.metadata (52 kB)
#12 1.939 Collecting numpy==1.26.4 (from -r requirements.txt (line 15))
#12 1.956   Downloading numpy-1.26.4-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.metadata (61 kB)
#12 2.039 Collecting onnxruntime~=1.23.2 (from -r requirements.txt (line 16))
#12 2.057   Downloading onnxruntime-1.23.2-cp312-cp312-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl.metadata (5.1 kB)
#12 2.074 Collecting python-dotenv==1.0.1 (from -r requirements.txt (line 19))
#12 2.091   Downloading python_dotenv-1.0.1-py3-none-any.whl.metadata (23 kB)
#12 2.108 Collecting loguru==0.7.3 (from -r requirements.txt (line 20))
#12 2.125   Downloading loguru-0.7.3-py3-none-any.whl.metadata (22 kB)
#12 2.324 Collecting Pillow>=10.0.0 (from -r requirements.txt (line 21))
#12 2.341   Downloading pillow-12.1.1-cp312-cp312-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl.metadata (8.8 kB)
#12 2.681 Collecting boto3 (from -r requirements.txt (line 24))
#12 2.698   Downloading boto3-1.42.73-py3-none-any.whl.metadata (6.7 kB)
#12 2.729 Collecting google-cloud-storage (from -r requirements.txt (line 25))
#12 2.746   Downloading google_cloud_storage-3.10.0-py3-none-any.whl.metadata (15 kB)
#12 2.765 Collecting libsql-client (from -r requirements.txt (line 26))
#12 2.811   Downloading libsql_client-0.3.1-py3-none-any.whl.metadata (4.1 kB)
#12 2.838 Collecting redis>=5.0.0 (from redis[hiredis]>=5.0.0->-r requirements.txt (line 27))
#12 2.855   Downloading redis-7.3.0-py3-none-any.whl.metadata (12 kB)
#12 5.341 Collecting ddtrace (from -r requirements.txt (line 30))
#12 5.359   Downloading ddtrace-4.6.1-cp312-cp312-manylinux2014_x86_64.manylinux_2_17_x86_64.whl.metadata (3.6 kB)
#12 5.379 Collecting datadog (from -r requirements.txt (line 31))
#12 5.396   Downloading datadog-0.52.1-py2.py3-none-any.whl.metadata (10 kB)
#12 5.441 Collecting replicate (from -r requirements.txt (line 34))
#12 5.457   Downloading replicate-1.0.7-py3-none-any.whl.metadata (29 kB)
#12 5.492 Collecting deepgram-sdk (from -r requirements.txt (line 37))
#12 5.508   Downloading deepgram_sdk-6.0.1-py3-none-any.whl.metadata (15 kB)
#12 5.538 Collecting starlette<0.42.0,>=0.40.0 (from fastapi==0.115.5->-r requirements.txt (line 5))
#12 5.555   Downloading starlette-0.41.3-py3-none-any.whl.metadata (6.0 kB)
#12 5.673 Collecting pydantic!=1.8,!=1.8.1,!=2.0.0,!=2.0.1,!=2.1.0,<3.0.0,>=1.7.4 (from fastapi==0.115.5->-r requirements.txt (line 5))
#12 5.690   Downloading pydantic-2.12.5-py3-none-any.whl.metadata (90 kB)
#12 5.878 Collecting typing-extensions>=4.8.0 (from fastapi==0.115.5->-r requirements.txt (line 5))
#12 5.895   Downloading typing_extensions-4.15.0-py3-none-any.whl.metadata (3.3 kB)
#12 5.917 Collecting click>=7.0 (from uvicorn==0.32.1->uvicorn[standard]==0.32.1->-r requirements.txt (line 6))
#12 5.934   Downloading click-8.3.1-py3-none-any.whl.metadata (2.6 kB)
#12 5.948 Collecting h11>=0.8 (from uvicorn==0.32.1->uvicorn[standard]==0.32.1->-r requirements.txt (line 6))
#12 5.964   Downloading h11-0.16.0-py3-none-any.whl.metadata (8.3 kB)
#12 6.000 Collecting httptools>=0.6.3 (from uvicorn[standard]==0.32.1->-r requirements.txt (line 6))
#12 6.017   Downloading httptools-0.7.1-cp312-cp312-manylinux1_x86_64.manylinux_2_28_x86_64.manylinux_2_5_x86_64.whl.metadata (3.5 kB)
#12 6.058 Collecting pyyaml>=5.1 (from uvicorn[standard]==0.32.1->-r requirements.txt (line 6))
#12 6.075   Downloading pyyaml-6.0.3-cp312-cp312-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl.metadata (2.4 kB)
#12 6.118 Collecting uvloop!=0.15.0,!=0.15.1,>=0.14.0 (from uvicorn[standard]==0.32.1->-r requirements.txt (line 6))
#12 6.135   Downloading uvloop-0.22.1-cp312-cp312-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl.metadata (4.9 kB)
#12 6.213 Collecting watchfiles>=0.13 (from uvicorn[standard]==0.32.1->-r requirements.txt (line 6))
#12 6.230   Downloading watchfiles-1.1.1-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.metadata (4.9 kB)
#12 6.321 Collecting websockets>=10.4 (from uvicorn[standard]==0.32.1->-r requirements.txt (line 6))
#12 6.338   Downloading websockets-16.0-cp312-cp312-manylinux1_x86_64.manylinux_2_28_x86_64.manylinux_2_5_x86_64.whl.metadata (6.8 kB)
#12 6.359 Collecting coloredlogs (from onnxruntime~=1.23.2->-r requirements.txt (line 16))
#12 6.375   Downloading coloredlogs-15.0.1-py2.py3-none-any.whl.metadata (12 kB)
#12 6.394 Collecting flatbuffers (from onnxruntime~=1.23.2->-r requirements.txt (line 16))
#12 6.411   Downloading flatbuffers-25.12.19-py2.py3-none-any.whl.metadata (1.0 kB)
#12 6.433 Collecting packaging (from onnxruntime~=1.23.2->-r requirements.txt (line 16))
#12 6.450   Downloading packaging-26.0-py3-none-any.whl.metadata (3.3 kB)
#12 6.612 Collecting protobuf (from onnxruntime~=1.23.2->-r requirements.txt (line 16))
#12 6.629   Downloading protobuf-7.34.1-cp310-abi3-manylinux2014_x86_64.whl.metadata (595 bytes)
#12 6.651 Collecting sympy (from onnxruntime~=1.23.2->-r requirements.txt (line 16))
#12 6.668   Downloading sympy-1.14.0-py3-none-any.whl.metadata (12 kB)
#12 6.683 Collecting annotated-types>=0.6.0 (from pydantic!=1.8,!=1.8.1,!=2.0.0,!=2.0.1,!=2.1.0,<3.0.0,>=1.7.4->fastapi==0.115.5->-r requirements.txt (line 5))
#12 6.699   Downloading annotated_types-0.7.0-py3-none-any.whl.metadata (15 kB)
#12 7.565 Collecting pydantic-core==2.41.5 (from pydantic!=1.8,!=1.8.1,!=2.0.0,!=2.0.1,!=2.1.0,<3.0.0,>=1.7.4->fastapi==0.115.5->-r requirements.txt (line 5))
#12 7.583   Downloading pydantic_core-2.41.5-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.metadata (7.3 kB)
#12 7.598 Collecting typing-inspection>=0.4.2 (from pydantic!=1.8,!=1.8.1,!=2.0.0,!=2.0.1,!=2.1.0,<3.0.0,>=1.7.4->fastapi==0.115.5->-r requirements.txt (line 5))
#12 7.614   Downloading typing_inspection-0.4.2-py3-none-any.whl.metadata (2.6 kB)
#12 7.637 Collecting anyio<5,>=3.4.0 (from starlette<0.42.0,>=0.40.0->fastapi==0.115.5->-r requirements.txt (line 5))
#12 7.654   Downloading anyio-4.12.1-py3-none-any.whl.metadata (4.3 kB)
#12 7.671 Collecting idna>=2.8 (from anyio<5,>=3.4.0->starlette<0.42.0,>=0.40.0->fastapi==0.115.5->-r requirements.txt (line 5))
#12 7.687   Downloading idna-3.11-py3-none-any.whl.metadata (8.4 kB)
#12 7.704 Collecting aiofiles<27,>=24.1.0 (from pipecat-ai>=0.0.105->pipecat-ai[daily,deepgram,google,groq,koala,openai,openrouter,rnnoise]>=0.0.105->-r requirements.txt (line 2))
#12 7.720   Downloading aiofiles-25.1.0-py3-none-any.whl.metadata (6.3 kB)
#12 7.738 Collecting docstring_parser<1,>=0.16 (from pipecat-ai>=0.0.105->pipecat-ai[daily,deepgram,google,groq,koala,openai,openrouter,rnnoise]>=0.0.105->-r requirements.txt (line 2))
#12 7.755   Downloading docstring_parser-0.17.0-py3-none-any.whl.metadata (3.5 kB)
#12 7.773 Collecting Markdown<4,>=3.7 (from pipecat-ai>=0.0.105->pipecat-ai[daily,deepgram,google,groq,koala,openai,openrouter,rnnoise]>=0.0.105->-r requirements.txt (line 2))
#12 7.790   Downloading markdown-3.10.2-py3-none-any.whl.metadata (5.1 kB)
#12 7.809 Collecting nltk<4,>=3.9.3 (from pipecat-ai>=0.0.105->pipecat-ai[daily,deepgram,google,groq,koala,openai,openrouter,rnnoise]>=0.0.105->-r requirements.txt (line 2))
#12 7.825   Downloading nltk-3.9.3-py3-none-any.whl.metadata (3.2 kB)
#12 7.839 Collecting protobuf (from onnxruntime~=1.23.2->-r requirements.txt (line 16))
#12 7.855   Downloading protobuf-5.29.6-cp38-abi3-manylinux2014_x86_64.whl.metadata (592 bytes)
#12 7.873 Collecting pyloudnorm~=0.2.0 (from pipecat-ai>=0.0.105->pipecat-ai[daily,deepgram,google,groq,koala,openai,openrouter,rnnoise]>=0.0.105->-r requirements.txt (line 2))
#12 7.890   Downloading pyloudnorm-0.2.0-py3-none-any.whl.metadata (6.6 kB)
#12 7.906 Collecting resampy~=0.4.3 (from pipecat-ai>=0.0.105->pipecat-ai[daily,deepgram,google,groq,koala,openai,openrouter,rnnoise]>=0.0.105->-r requirements.txt (line 2))
#12 7.923   Downloading resampy-0.4.3-py3-none-any.whl.metadata (3.0 kB)
#12 7.987 Collecting soxr~=1.0.0 (from pipecat-ai>=0.0.105->pipecat-ai[daily,deepgram,google,groq,koala,openai,openrouter,rnnoise]>=0.0.105->-r requirements.txt (line 2))
#12 8.004   Downloading soxr-1.0.0-cp312-abi3-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl.metadata (5.6 kB)
#12 8.057 Collecting openai<3,>=1.74.0 (from pipecat-ai>=0.0.105->pipecat-ai[daily,deepgram,google,groq,koala,openai,openrouter,rnnoise]>=0.0.105->-r requirements.txt (line 2))
#12 8.074   Downloading openai-2.29.0-py3-none-any.whl.metadata (29 kB)
#12 8.178 Collecting numba<1,>=0.61.2 (from pipecat-ai>=0.0.105->pipecat-ai[daily,deepgram,google,groq,koala,openai,openrouter,rnnoise]>=0.0.105->-r requirements.txt (line 2))
#12 8.195   Downloading numba-0.64.0-cp312-cp312-manylinux2014_x86_64.manylinux_2_17_x86_64.whl.metadata (2.9 kB)
#12 8.231 Collecting transformers<6,>=4.48.0 (from pipecat-ai>=0.0.105->pipecat-ai[daily,deepgram,google,groq,koala,openai,openrouter,rnnoise]>=0.0.105->-r requirements.txt (line 2))
#12 8.248   Downloading transformers-5.3.0-py3-none-any.whl.metadata (32 kB)
#12 8.316 Collecting aiohappyeyeballs>=2.5.0 (from aiohttp->-r requirements.txt (line 9))
#12 8.333   Downloading aiohappyeyeballs-2.6.1-py3-none-any.whl.metadata (5.9 kB)
#12 8.347 Collecting aiosignal>=1.4.0 (from aiohttp->-r requirements.txt (line 9))
#12 8.363   Downloading aiosignal-1.4.0-py3-none-any.whl.metadata (3.7 kB)
#12 8.380 Collecting attrs>=17.3.0 (from aiohttp->-r requirements.txt (line 9))
#12 8.397   Downloading attrs-26.1.0-py3-none-any.whl.metadata (8.8 kB)
#12 8.469 Collecting frozenlist>=1.1.1 (from aiohttp->-r requirements.txt (line 9))
#12 8.486   Downloading frozenlist-1.8.0-cp312-cp312-manylinux1_x86_64.manylinux_2_28_x86_64.manylinux_2_5_x86_64.whl.metadata (20 kB)
#12 8.732 Collecting multidict<7.0,>=4.5 (from aiohttp->-r requirements.txt (line 9))
#12 8.749   Downloading multidict-6.7.1-cp312-cp312-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl.metadata (5.3 kB)
#12 8.808 Collecting propcache>=0.2.0 (from aiohttp->-r requirements.txt (line 9))
#12 8.825   Downloading propcache-0.4.1-cp312-cp312-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl.metadata (13 kB)
#12 9.284 Collecting yarl<2.0,>=1.17.0 (from aiohttp->-r requirements.txt (line 9))
#12 9.301   Downloading yarl-1.23.0-cp312-cp312-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl.metadata (79 kB)
#12 9.338 Collecting joblib (from nltk<4,>=3.9.3->pipecat-ai>=0.0.105->pipecat-ai[daily,deepgram,google,groq,koala,openai,openrouter,rnnoise]>=0.0.105->-r requirements.txt (line 2))
#12 9.355   Downloading joblib-1.5.3-py3-none-any.whl.metadata (5.5 kB)
#12 9.731 Collecting regex>=2021.8.3 (from nltk<4,>=3.9.3->pipecat-ai>=0.0.105->pipecat-ai[daily,deepgram,google,groq,koala,openai,openrouter,rnnoise]>=0.0.105->-r requirements.txt (line 2))
#12 9.748   Downloading regex-2026.2.28-cp312-cp312-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl.metadata (40 kB)
#12 9.786 Collecting tqdm (from nltk<4,>=3.9.3->pipecat-ai>=0.0.105->pipecat-ai[daily,deepgram,google,groq,koala,openai,openrouter,rnnoise]>=0.0.105->-r requirements.txt (line 2))
#12 9.803   Downloading tqdm-4.67.3-py3-none-any.whl.metadata (57 kB)
#12 9.874 Collecting llvmlite<0.47,>=0.46.0dev0 (from numba<1,>=0.61.2->pipecat-ai>=0.0.105->pipecat-ai[daily,deepgram,google,groq,koala,openai,openrouter,rnnoise]>=0.0.105->-r requirements.txt (line 2))
#12 9.891   Downloading llvmlite-0.46.0-cp312-cp312-manylinux2014_x86_64.manylinux_2_17_x86_64.whl.metadata (5.0 kB)
#12 9.910 Collecting distro<2,>=1.7.0 (from openai<3,>=1.74.0->pipecat-ai>=0.0.105->pipecat-ai[daily,deepgram,google,groq,koala,openai,openrouter,rnnoise]>=0.0.105->-r requirements.txt (line 2))
#12 9.927   Downloading distro-1.9.0-py3-none-any.whl.metadata (6.8 kB)
#12 9.946 Collecting httpx<1,>=0.23.0 (from openai<3,>=1.74.0->pipecat-ai>=0.0.105->pipecat-ai[daily,deepgram,google,groq,koala,openai,openrouter,rnnoise]>=0.0.105->-r requirements.txt (line 2))
#12 9.963   Downloading httpx-0.28.1-py3-none-any.whl.metadata (7.1 kB)
#12 10.04 Collecting jiter<1,>=0.10.0 (from openai<3,>=1.74.0->pipecat-ai>=0.0.105->pipecat-ai[daily,deepgram,google,groq,koala,openai,openrouter,rnnoise]>=0.0.105->-r requirements.txt (line 2))
#12 10.06   Downloading jiter-0.13.0-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.metadata (5.2 kB)
#12 10.08 Collecting sniffio (from openai<3,>=1.74.0->pipecat-ai>=0.0.105->pipecat-ai[daily,deepgram,google,groq,koala,openai,openrouter,rnnoise]>=0.0.105->-r requirements.txt (line 2))
#12 10.09   Downloading sniffio-1.3.1-py3-none-any.whl.metadata (3.9 kB)
#12 10.13 Collecting certifi (from httpx<1,>=0.23.0->openai<3,>=1.74.0->pipecat-ai>=0.0.105->pipecat-ai[daily,deepgram,google,groq,koala,openai,openrouter,rnnoise]>=0.0.105->-r requirements.txt (line 2))
#12 10.14   Downloading certifi-2026.2.25-py3-none-any.whl.metadata (2.5 kB)
#12 10.16 Collecting httpcore==1.* (from httpx<1,>=0.23.0->openai<3,>=1.74.0->pipecat-ai>=0.0.105->pipecat-ai[daily,deepgram,google,groq,koala,openai,openrouter,rnnoise]>=0.0.105->-r requirements.txt (line 2))
#12 10.18   Downloading httpcore-1.0.9-py3-none-any.whl.metadata (21 kB)
#12 10.32 Collecting scipy>=1.0.1 (from pyloudnorm~=0.2.0->pipecat-ai>=0.0.105->pipecat-ai[daily,deepgram,google,groq,koala,openai,openrouter,rnnoise]>=0.0.105->-r requirements.txt (line 2))
#12 10.33   Downloading scipy-1.17.1-cp312-cp312-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl.metadata (62 kB)
#12 10.40 Collecting huggingface-hub<2.0,>=1.3.0 (from transformers<6,>=4.48.0->pipecat-ai>=0.0.105->pipecat-ai[daily,deepgram,google,groq,koala,openai,openrouter,rnnoise]>=0.0.105->-r requirements.txt (line 2))
#12 10.41   Downloading huggingface_hub-1.7.2-py3-none-any.whl.metadata (13 kB)
#12 10.58 Collecting tokenizers<=0.23.0,>=0.22.0 (from transformers<6,>=4.48.0->pipecat-ai>=0.0.105->pipecat-ai[daily,deepgram,google,groq,koala,openai,openrouter,rnnoise]>=0.0.105->-r requirements.txt (line 2))
#12 10.60   Downloading tokenizers-0.22.2-cp39-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.metadata (7.3 kB)
#12 10.62 Collecting typer (from transformers<6,>=4.48.0->pipecat-ai>=0.0.105->pipecat-ai[daily,deepgram,google,groq,koala,openai,openrouter,rnnoise]>=0.0.105->-r requirements.txt (line 2))
#12 10.64   Downloading typer-0.24.1-py3-none-any.whl.metadata (16 kB)
#12 10.76 Collecting safetensors>=0.4.3 (from transformers<6,>=4.48.0->pipecat-ai>=0.0.105->pipecat-ai[daily,deepgram,google,groq,koala,openai,openrouter,rnnoise]>=0.0.105->-r requirements.txt (line 2))
#12 10.78   Downloading safetensors-0.7.0-cp38-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.metadata (4.1 kB)
#12 10.81 Collecting filelock>=3.10.0 (from huggingface-hub<2.0,>=1.3.0->transformers<6,>=4.48.0->pipecat-ai>=0.0.105->pipecat-ai[daily,deepgram,google,groq,koala,openai,openrouter,rnnoise]>=0.0.105->-r requirements.txt (line 2))
#12 10.83   Downloading filelock-3.25.2-py3-none-any.whl.metadata (2.0 kB)
#12 10.85 Collecting fsspec>=2023.5.0 (from huggingface-hub<2.0,>=1.3.0->transformers<6,>=4.48.0->pipecat-ai>=0.0.105->pipecat-ai[daily,deepgram,google,groq,koala,openai,openrouter,rnnoise]>=0.0.105->-r requirements.txt (line 2))
#12 10.87   Downloading fsspec-2026.2.0-py3-none-any.whl.metadata (10 kB)
#12 10.94 Collecting hf-xet<2.0.0,>=1.4.2 (from huggingface-hub<2.0,>=1.3.0->transformers<6,>=4.48.0->pipecat-ai>=0.0.105->pipecat-ai[daily,deepgram,google,groq,koala,openai,openrouter,rnnoise]>=0.0.105->-r requirements.txt (line 2))
#12 10.96   Downloading hf_xet-1.4.2-cp37-abi3-manylinux2014_x86_64.manylinux_2_17_x86_64.whl.metadata (4.9 kB)
#12 11.02 Collecting google-auth<3.0.0,>=2.47.0 (from google-auth[requests]<3.0.0,>=2.47.0->google-genai>=1.50.0->-r requirements.txt (line 12))
#12 11.03   Downloading google_auth-2.49.1-py3-none-any.whl.metadata (6.2 kB)
#12 11.07 Collecting requests<3.0.0,>=2.28.1 (from google-genai>=1.50.0->-r requirements.txt (line 12))
#12 11.08   Downloading requests-2.32.5-py3-none-any.whl.metadata (4.9 kB)
#12 11.10 Collecting tenacity<9.2.0,>=8.2.3 (from google-genai>=1.50.0->-r requirements.txt (line 12))
#12 11.12   Downloading tenacity-9.1.4-py3-none-any.whl.metadata (1.2 kB)
#12 11.14 Collecting pyasn1-modules>=0.2.1 (from google-auth<3.0.0,>=2.47.0->google-auth[requests]<3.0.0,>=2.47.0->google-genai>=1.50.0->-r requirements.txt (line 12))
#12 11.16   Downloading pyasn1_modules-0.4.2-py3-none-any.whl.metadata (3.5 kB)
#12 11.58 Collecting cryptography>=38.0.3 (from google-auth<3.0.0,>=2.47.0->google-auth[requests]<3.0.0,>=2.47.0->google-genai>=1.50.0->-r requirements.txt (line 12))
#12 11.59   Downloading cryptography-46.0.5-cp311-abi3-manylinux_2_34_x86_64.whl.metadata (5.7 kB)
#12 11.70 Collecting charset_normalizer<4,>=2 (from requests<3.0.0,>=2.28.1->google-genai>=1.50.0->-r requirements.txt (line 12))
#12 11.71   Downloading charset_normalizer-3.4.6-cp312-cp312-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl.metadata (40 kB)
#12 11.74 Collecting urllib3<3,>=1.21.1 (from requests<3.0.0,>=2.28.1->google-genai>=1.50.0->-r requirements.txt (line 12))
#12 11.76   Downloading urllib3-2.6.3-py3-none-any.whl.metadata (6.9 kB)
#12 12.02 Collecting botocore<1.43.0,>=1.42.73 (from boto3->-r requirements.txt (line 24))
#12 12.04   Downloading botocore-1.42.73-py3-none-any.whl.metadata (5.9 kB)
#12 12.05 Collecting jmespath<2.0.0,>=0.7.1 (from boto3->-r requirements.txt (line 24))
#12 12.07   Downloading jmespath-1.1.0-py3-none-any.whl.metadata (7.6 kB)
#12 12.09 Collecting s3transfer<0.17.0,>=0.16.0 (from boto3->-r requirements.txt (line 24))
#12 12.10   Downloading s3transfer-0.16.0-py3-none-any.whl.metadata (1.7 kB)
#12 12.12 Collecting python-dateutil<3.0.0,>=2.1 (from botocore<1.43.0,>=1.42.73->boto3->-r requirements.txt (line 24))
#12 12.14   Downloading python_dateutil-2.9.0.post0-py2.py3-none-any.whl.metadata (8.4 kB)
#12 12.16 Collecting six>=1.5 (from python-dateutil<3.0.0,>=2.1->botocore<1.43.0,>=1.42.73->boto3->-r requirements.txt (line 24))
#12 12.18   Downloading six-1.17.0-py2.py3-none-any.whl.metadata (1.7 kB)
#12 12.23 Collecting google-api-core<3.0.0,>=2.27.0 (from google-cloud-storage->-r requirements.txt (line 25))
#12 12.24   Downloading google_api_core-2.30.0-py3-none-any.whl.metadata (3.1 kB)
#12 12.26 Collecting google-cloud-core<3.0.0,>=2.4.2 (from google-cloud-storage->-r requirements.txt (line 25))
#12 12.28   Downloading google_cloud_core-2.5.0-py3-none-any.whl.metadata (3.1 kB)
#12 12.30 Collecting google-resumable-media<3.0.0,>=2.7.2 (from google-cloud-storage->-r requirements.txt (line 25))
#12 12.31   Downloading google_resumable_media-2.8.0-py3-none-any.whl.metadata (2.6 kB)
#12 12.37 Collecting google-crc32c<2.0.0,>=1.1.3 (from google-cloud-storage->-r requirements.txt (line 25))
#12 12.38   Downloading google_crc32c-1.8.0-cp312-cp312-manylinux1_x86_64.manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_5_x86_64.whl.metadata (1.7 kB)
#12 12.40 Collecting googleapis-common-protos<2.0.0,>=1.56.3 (from google-api-core<3.0.0,>=2.27.0->google-cloud-storage->-r requirements.txt (line 25))
#12 12.42   Downloading googleapis_common_protos-1.73.0-py3-none-any.whl.metadata (9.4 kB)
#12 12.45 Collecting proto-plus<2.0.0,>=1.22.3 (from google-api-core<3.0.0,>=2.27.0->google-cloud-storage->-r requirements.txt (line 25))
#12 12.46   Downloading proto_plus-1.27.1-py3-none-any.whl.metadata (2.2 kB)
#12 12.51 Collecting sphinx-press-theme<0.9.0,>=0.8.0 (from libsql-client->-r requirements.txt (line 26))
#12 12.55   Downloading sphinx_press_theme-0.8.0-py3-none-any.whl.metadata (2.9 kB)
#12 12.60 Collecting sphinx>=4.0.1 (from sphinx-press-theme<0.9.0,>=0.8.0->libsql-client->-r requirements.txt (line 26))
#12 12.61   Downloading sphinx-9.1.0-py3-none-any.whl.metadata (5.8 kB)
#12 12.63 Collecting bytecode<1,>=0.15.1 (from ddtrace->-r requirements.txt (line 30))
#12 12.65   Downloading bytecode-0.17.0-py3-none-any.whl.metadata (4.7 kB)
#12 12.66 Collecting envier~=0.6.1 (from ddtrace->-r requirements.txt (line 30))
#12 12.68   Downloading envier-0.6.1-py3-none-any.whl.metadata (4.7 kB)
#12 12.70 Collecting opentelemetry-api<2,>=1 (from ddtrace->-r requirements.txt (line 30))
#12 12.72   Downloading opentelemetry_api-1.40.0-py3-none-any.whl.metadata (1.5 kB)
#12 12.89 Collecting wrapt<3,>=1 (from ddtrace->-r requirements.txt (line 30))
#12 12.91   Downloading wrapt-2.1.2-cp312-cp312-manylinux1_x86_64.manylinux_2_28_x86_64.manylinux_2_5_x86_64.whl.metadata (7.4 kB)
#12 12.94 Collecting importlib-metadata<8.8.0,>=6.0 (from opentelemetry-api<2,>=1->ddtrace->-r requirements.txt (line 30))
#12 12.96   Downloading importlib_metadata-8.7.1-py3-none-any.whl.metadata (4.7 kB)
#12 12.98 Collecting zipp>=3.20 (from importlib-metadata<8.8.0,>=6.0->opentelemetry-api<2,>=1->ddtrace->-r requirements.txt (line 30))
#12 12.99   Downloading zipp-3.23.0-py3-none-any.whl.metadata (3.6 kB)
#12 13.13 Collecting cffi>=2.0.0 (from cryptography>=38.0.3->google-auth<3.0.0,>=2.47.0->google-auth[requests]<3.0.0,>=2.47.0->google-genai>=1.50.0->-r requirements.txt (line 12))
#12 13.15   Downloading cffi-2.0.0-cp312-cp312-manylinux2014_x86_64.manylinux_2_17_x86_64.whl.metadata (2.6 kB)
#12 13.16 Collecting pycparser (from cffi>=2.0.0->cryptography>=38.0.3->google-auth<3.0.0,>=2.47.0->google-auth[requests]<3.0.0,>=2.47.0->google-genai>=1.50.0->-r requirements.txt (line 12))
#12 13.18   Downloading pycparser-3.0-py3-none-any.whl.metadata (8.2 kB)
#12 13.22 Collecting daily-python~=0.25.0 (from pipecat-ai[daily,deepgram,google,groq,koala,openai,openrouter,rnnoise]>=0.0.105->-r requirements.txt (line 2))
#12 13.23   Downloading daily_python-0.25.0-cp37-abi3-manylinux_2_28_x86_64.whl.metadata (2.4 kB)
#12 13.26 Collecting google-cloud-speech<3,>=2.33.0 (from pipecat-ai[daily,deepgram,google,groq,koala,openai,openrouter,rnnoise]>=0.0.105->-r requirements.txt (line 2))
#12 13.28   Downloading google_cloud_speech-2.37.0-py3-none-any.whl.metadata (9.8 kB)
#12 13.30 Collecting google-cloud-texttospeech<3,>=2.31.0 (from pipecat-ai[daily,deepgram,google,groq,koala,openai,openrouter,rnnoise]>=0.0.105->-r requirements.txt (line 2))
#12 13.32   Downloading google_cloud_texttospeech-2.34.0-py3-none-any.whl.metadata (10.0 kB)
#12 13.34 Collecting groq<2,>=0.23.0 (from pipecat-ai[daily,deepgram,google,groq,koala,openai,openrouter,rnnoise]>=0.0.105->-r requirements.txt (line 2))
#12 13.36   Downloading groq-1.1.1-py3-none-any.whl.metadata (16 kB)
#12 13.37 Collecting pvkoala~=2.0.3 (from pipecat-ai[daily,deepgram,google,groq,koala,openai,openrouter,rnnoise]>=0.0.105->-r requirements.txt (line 2))
#12 13.42   Downloading pvkoala-2.0.4-py3-none-any.whl.metadata (2.7 kB)
#12 13.44 Collecting pyrnnoise~=0.4.1 (from pipecat-ai[daily,deepgram,google,groq,koala,openai,openrouter,rnnoise]>=0.0.105->-r requirements.txt (line 2))
#12 13.45   Downloading pyrnnoise-0.4.3-py3-none-manylinux1_x86_64.whl.metadata (3.2 kB)
#12 13.98 Collecting grpcio<2.0.0,>=1.33.2 (from google-cloud-speech<3,>=2.33.0->pipecat-ai[daily,deepgram,google,groq,koala,openai,openrouter,rnnoise]>=0.0.105->-r requirements.txt (line 2))
#12 14.00   Downloading grpcio-1.78.0-cp312-cp312-manylinux2014_x86_64.manylinux_2_17_x86_64.whl.metadata (3.8 kB)
#12 14.31 Collecting grpcio-status<2.0.0,>=1.33.2 (from google-api-core[grpc]!=2.0.*,!=2.1.*,!=2.10.*,!=2.2.*,!=2.3.*,!=2.4.*,!=2.5.*,!=2.6.*,!=2.7.*,!=2.8.*,!=2.9.*,<3.0.0,>=1.34.1->google-cloud-speech<3,>=2.33.0->pipecat-ai[daily,deepgram,google,groq,koala,openai,openrouter,rnnoise]>=0.0.105->-r requirements.txt (line 2))
#12 14.33   Downloading grpcio_status-1.78.0-py3-none-any.whl.metadata (1.3 kB)
#12 14.35 INFO: pip is looking at multiple versions of grpcio-status to determine which version is compatible with other requirements. This could take a while.
#12 14.37   Downloading grpcio_status-1.76.0-py3-none-any.whl.metadata (1.1 kB)
#12 14.39   Downloading grpcio_status-1.75.1-py3-none-any.whl.metadata (1.1 kB)
#12 14.41   Downloading grpcio_status-1.75.0-py3-none-any.whl.metadata (1.1 kB)
#12 14.42   Downloading grpcio_status-1.74.0-py3-none-any.whl.metadata (1.1 kB)
#12 14.44   Downloading grpcio_status-1.73.1-py3-none-any.whl.metadata (1.1 kB)
#12 14.47   Downloading grpcio_status-1.73.0-py3-none-any.whl.metadata (1.1 kB)
#12 14.48   Downloading grpcio_status-1.72.2-py3-none-any.whl.metadata (1.1 kB)
#12 14.49 INFO: pip is still looking at multiple versions of grpcio-status to determine which version is compatible with other requirements. This could take a while.
#12 14.50   Downloading grpcio_status-1.72.1-py3-none-any.whl.metadata (1.1 kB)
#12 14.52   Downloading grpcio_status-1.71.2-py3-none-any.whl.metadata (1.1 kB)
#12 14.55 Collecting audiolab (from pyrnnoise~=0.4.1->pipecat-ai[daily,deepgram,google,groq,koala,openai,openrouter,rnnoise]>=0.0.105->-r requirements.txt (line 2))
#12 14.60   Downloading audiolab-0.5.0-py3-none-any.whl.metadata (18 kB)
#12 14.74 Collecting matplotlib (from pyrnnoise~=0.4.1->pipecat-ai[daily,deepgram,google,groq,koala,openai,openrouter,rnnoise]>=0.0.105->-r requirements.txt (line 2))
#12 14.76   Downloading matplotlib-3.10.8-cp312-cp312-manylinux2014_x86_64.manylinux_2_17_x86_64.whl.metadata (52 kB)
#12 14.80 Collecting pyasn1<0.7.0,>=0.6.1 (from pyasn1-modules>=0.2.1->google-auth<3.0.0,>=2.47.0->google-auth[requests]<3.0.0,>=2.47.0->google-genai>=1.50.0->-r requirements.txt (line 12))
#12 14.81   Downloading pyasn1-0.6.3-py3-none-any.whl.metadata (8.4 kB)
#12 14.92 Collecting hiredis>=3.2.0 (from redis[hiredis]>=5.0.0->-r requirements.txt (line 27))
#12 14.94   Downloading hiredis-3.3.1-cp312-cp312-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl.metadata (7.5 kB)
#12 14.96 Collecting sphinxcontrib-applehelp>=1.0.7 (from sphinx>=4.0.1->sphinx-press-theme<0.9.0,>=0.8.0->libsql-client->-r requirements.txt (line 26))
#12 14.97   Downloading sphinxcontrib_applehelp-2.0.0-py3-none-any.whl.metadata (2.3 kB)
#12 14.99 Collecting sphinxcontrib-devhelp>=1.0.6 (from sphinx>=4.0.1->sphinx-press-theme<0.9.0,>=0.8.0->libsql-client->-r requirements.txt (line 26))
#12 15.01   Downloading sphinxcontrib_devhelp-2.0.0-py3-none-any.whl.metadata (2.3 kB)
#12 15.02 Collecting sphinxcontrib-htmlhelp>=2.0.6 (from sphinx>=4.0.1->sphinx-press-theme<0.9.0,>=0.8.0->libsql-client->-r requirements.txt (line 26))
#12 15.03   Downloading sphinxcontrib_htmlhelp-2.1.0-py3-none-any.whl.metadata (2.3 kB)
#12 15.05 Collecting sphinxcontrib-jsmath>=1.0.1 (from sphinx>=4.0.1->sphinx-press-theme<0.9.0,>=0.8.0->libsql-client->-r requirements.txt (line 26))
#12 15.06   Downloading sphinxcontrib_jsmath-1.0.1-py2.py3-none-any.whl.metadata (1.4 kB)
#12 15.08 Collecting sphinxcontrib-qthelp>=1.0.6 (from sphinx>=4.0.1->sphinx-press-theme<0.9.0,>=0.8.0->libsql-client->-r requirements.txt (line 26))
#12 15.10   Downloading sphinxcontrib_qthelp-2.0.0-py3-none-any.whl.metadata (2.3 kB)
#12 15.11 Collecting sphinxcontrib-serializinghtml>=1.1.9 (from sphinx>=4.0.1->sphinx-press-theme<0.9.0,>=0.8.0->libsql-client->-r requirements.txt (line 26))
#12 15.13   Downloading sphinxcontrib_serializinghtml-2.0.0-py3-none-any.whl.metadata


Check the end of deploy output


Waiting for deployment "maya-pipecat" rollout to finish: 7 old replicas are pending termination...
Waiting for deployment "maya-pipecat" rollout to finish: 6 old replicas are pending termination...
Waiting for deployment "maya-pipecat" rollout to finish: 6 old replicas are pending termination...
Waiting for deployment "maya-pipecat" rollout to finish: 5 old replicas are pending termination...
Waiting for deployment "maya-pipecat" rollout to finish: 5 old replicas are pending termination...
Waiting for deployment "maya-pipecat" rollout to finish: 5 old replicas are pending termination...
Waiting for deployment "maya-pipecat" rollout to finish: 4 old replicas are pending termination...
Waiting for deployment "maya-pipecat" rollout to finish: 4 old replicas are pending termination...
Waiting for deployment "maya-pipecat" rollout to finish: 4 old replicas are pending termination...
Waiting for deployment "maya-pipecat" rollout to finish: 3 old replicas are pending termination...
deployment "maya-pipecat" successfully rolled out

============================================
✅ Deployment complete!
============================================
NAME                            READY   STATUS        RESTARTS        AGE
maya-pipecat-5f5bcd5976-24nbk   1/1     Running       0               28s
maya-pipecat-5f5bcd5976-25g6s   1/1     Running       0               113s
maya-pipecat-5f5bcd5976-2cjp6   1/1     Running       0               20s
maya-pipecat-5f5bcd5976-2dx2p   1/1     Running       0               32s
maya-pipecat-5f5bcd5976-2f44v   1/1     Running       0               45s
maya-pipecat-5f5bcd5976-2k8f7   1/1     Running       0               71s
maya-pipecat-5f5bcd5976-2n7cz   1/1     Running       0               67s
maya-pipecat-5f5bcd5976-2q8hv   1/1     Running       0               111s
maya-pipecat-5f5bcd5976-2rwcq   1/1     Running       0               111s
maya-pipecat-5f5bcd5976-2szcb   1/1     Running       0               25s
maya-pipecat-5f5bcd5976-2t8f9   1/1     Running       0               31s
maya-pipecat-5f5bcd5976-2vxq5   1/1     Running       0               26s
maya-pipecat-5f5bcd5976-2wn4n   1/1     Running       0               25s
maya-pipecat-5f5bcd5976-47nvm   1/1     Running       0               47s


Deployment complete. All new pods are `Running` with `1/1 READY`, no crashes.


deploy again


Build, push, and deploy maya-pipecat to GKE


Error: Exit code 1
============================================
🏗  Maya Pipecat GKE Deployment
============================================
📦 Image: asia-south1-docker.pkg.dev/mayaresearchgcp/maya-pipecat/maya-pipecat:latest
📁 Project root: /home/ubuntu/pipecat
============================================

🔨 Building Docker image...
#0 building with "default" instance using docker driver

#1 [internal] load build definition from Dockerfile
#1 transferring dockerfile: 2.28kB done
#1 DONE 0.0s

#2 [auth] library/python:pull token for registry-1.docker.io
#2 DONE 0.0s

#3 [internal] load metadata for docker.io/library/python:3.12-slim-bookworm
#3 DONE 0.3s

#4 [internal] load .dockerignore
#4 transferring context: 444B done
#4 DONE 0.0s

#5 [ 1/13] FROM docker.io/library/python:3.12-slim-bookworm@sha256:31c0807da611e2e377a2e9b566ad4eb038ac5a5838cbbbe6f2262259b5dc77a0
#5 DONE 0.0s

#6 [internal] load build context
#6 transferring context: 8.47kB done
#6 DONE 0.0s

#7 [11/13] COPY ./scripts/pipecat-ctl.sh /app/pipecat-ctl.sh
#7 CACHED

#8 [12/13] RUN mkdir -p /var/log/maya-pipecat && chmod 777 /var/log/maya-pipecat
#8 CACHED

#9 [ 5/13] RUN pip install --upgrade pip
#9 CACHED

#10 [ 6/13] COPY requirements.txt /app/requirements.txt
#10 CACHED

#11 [ 7/13] RUN pip install --no-cache-dir -r requirements.txt &&     python -c "import nltk; nltk.download('punkt'); nltk.download('punkt_tab')"
#11 CACHED

#12 [ 8/13] COPY ./src /app/src
#12 CACHED

#13 [ 4/13] RUN python -m venv /app/venv
#13 CACHED

#14 [ 9/13] COPY ./server.py /app/server.py
#14 CACHED

#15 [ 2/13] RUN apt-get update && apt-get install -y --no-install-recommends     build-essential gcc g++     portaudio19-dev libportaudio2 libsndfile1     git curl procps     libjemalloc2     && apt-get clean && rm -rf /var/lib/apt/lists/*
#15 CACHED

#16 [10/13] COPY ./prompts /app/prompts
#16 CACHED

#17 [ 3/13] WORKDIR /app
#17 CACHED

#18 [13/13] RUN mkdir -p /app/logs /app/credentials /app/secrets &&     chmod +x /app/pipecat-ctl.sh
#18 CACHED

#19 exporting to image
#19 exporting layers done
#19 writing image sha256:5ed7a6087e5a5cf0d4e8a6e6b037c16ae3e52f81219b68a5a254d2d131542769 done
#19 naming to asia-south1-docker.pkg.dev/mayaresearchgcp/maya-pipecat/maya-pipecat:latest done
#19 DONE 0.0s

🔐 Configuring Docker for Artifact Registry...
WARNING: Your config file at [/home/ubuntu/.docker/config.json] contains these credential helper entries:

{
  "credHelpers": {
    "asia-south1-docker.pkg.dev": "gcloud"
  }
}
Adding credentials for: asia-south1-docker.pkg.dev
gcloud credential helpers already registered correctly.

📤 Pushing image...
ERROR: (gcloud.auth.docker-helper) There was a problem refreshing your current auth tokens: Reauthentication failed. cannot prompt during non-interactive execution.
Please run:

  $ gcloud auth login

to obtain new credentials.

If you have already logged in with a different account, run:

  $ gcloud config set account ACCOUNT

to select an already authenticated account to use.
The push refers to repository [asia-south1-docker.pkg.dev/mayaresearchgcp/maya-pipecat/maya-pipecat]
44b4f9c5c7e9: Preparing
7d6e35e7005b: Preparing
7f3dbba9c7cf: Preparing
ee0dfa5ec2e0: Preparing
70185392a090: Preparing
5e47412220fa: Preparing
cde3b2f8b794: Preparing
2f390ae6f57f: Preparing
a95cf6f1ec1e: Preparing
b1de0e41c77f: Preparing
79cb3deae1ef: Preparing
17a2cc8307d4: Preparing
4c80003eae39: Preparing
7c8f99632e80: Preparing
0176e4be5cbf: Preparing
6143ee9e3de0: Preparing
b1de0e41c77f: Waiting
79cb3deae1ef: Waiting
17a2cc8307d4: Waiting
2f390ae6f57f: Waiting
4c80003eae39: Waiting
a95cf6f1ec1e: Waiting
7c8f99632e80: Waiting
6143ee9e3de0: Waiting
0176e4be5cbf: Waiting
5e47412220fa: Waiting
cde3b2f8b794: Waiting
denied: Unauthenticated request. Unauthenticated requests do not have permission "artifactregistry.repositories.uploadArtifacts" on resource "projects/mayaresearchgcp/locations/asia-south1/repositories/maya-pipecat" (or it may not exist)


Your gcloud auth has expired. You need to re-authenticate. Run this in your terminal:

```
! gcloud auth login
```

Then I'll re-run the deploy.


i dpeloyed can u do rollout once again kubectl rollout


kubectl rollout restart deployment/maya-pipecat && kubectl rollout status deployment/maya-pipecat --timeout=300s

Restart rollout and wait for completion