deploy_to_nest.shβ’2.62 kB
#!/bin/bash
# Deploy Resume Agent to NEST environment (local/remote)
# Usage: bash deploy_to_nest.sh [AGENT_ID] [PORT] [REGISTRY_URL] [PUBLIC_IP]
set -e
AGENT_ID="${1:-resume-agent}"
PORT="${2:-6050}"
REGISTRY_URL="${3:-http://registry.chat39.com:6900}"
PUBLIC_IP="${4:-$(curl -s ifconfig.me 2>/dev/null || echo '127.0.0.1')}"
PUBLIC_URL="http://${PUBLIC_IP}:${PORT}"
echo "==========================================================================="
echo "π Deploying Resume Agent to NEST"
echo "==========================================================================="
echo "Agent ID: $AGENT_ID"
echo "Port: $PORT"
echo "Registry: $REGISTRY_URL"
echo "Public URL: $PUBLIC_URL"
echo "==========================================================================="
echo ""
# Check for NEST directory
if [ ! -d "../nest" ]; then
echo "β NEST framework not found at ../nest"
echo " Please ensure NEST is cloned in the parent directory"
echo " Run: cd .. && git clone https://github.com/projnanda/NEST.git nest"
exit 1
fi
# Install NEST dependencies
echo "[1/5] Installing NEST framework..."
cd ../nest
pip install -q -e .
cd ../agent
# Install agent dependencies
echo "[2/5] Installing resume agent dependencies (CPU-optimized, no CUDA)..."
pip install -q -r requirements.txt
# Prepare data directory
echo "[3/5] Preparing data directory..."
mkdir -p data
# Check for resume files
if ! ls data/*.pdf data/*.docx data/*.txt data/*.md &>/dev/null; then
echo ""
echo "β οΈ WARNING: No resume files found in data/"
echo " Supported formats: PDF, DOCX, TXT, MD"
echo " Please add resume files to continue:"
echo ""
echo " cp /path/to/your/resume.pdf data/"
echo ""
read -p "Continue anyway? (y/N) " -n 1 -r
echo
if [[ ! $REPLY =~ ^[Yy]$ ]]; then
echo "β Deployment cancelled"
exit 1
fi
else
echo "β
Found resume files:"
ls -lh data/*.{pdf,docx,txt,md} 2>/dev/null | awk '{print " - " $9 " (" $5 ")"}'
fi
# Set environment variables
echo "[4/5] Configuring environment..."
export AGENT_ID="$AGENT_ID"
export PORT="$PORT"
export REGISTRY_URL="$REGISTRY_URL"
export PUBLIC_URL="$PUBLIC_URL"
export DATA_DIR="./data"
# Create .env file for persistence
cat > .env << EOF
AGENT_ID=$AGENT_ID
PORT=$PORT
REGISTRY_URL=$REGISTRY_URL
PUBLIC_URL=$PUBLIC_URL
DATA_DIR=./data
EOF
echo "β
Environment configured (.env file created)"
# Start agent
echo "[5/5] Starting resume agent..."
echo ""
echo "==========================================================================="
python nest_resume_agent.py