#!/bin/bash # bootstrap.sh - Initialize SIA (Self-Improving Agent) environment for cloud deployment set -eo pipefail # Exit on any error, pipe failures # Create directory structure echo "Creating directory structure..." mkdir -p "/root/data/iterations" mkdir -p "/root/desktop" mkdir -p "/root/venvs" # Clone SIA repository echo "Cloning SIA repository..." git clone "$SIA_REPO_URL" "/root/sia" # Install Node.js if needed if ! command -v node &> /dev/null; then echo "Installing Node.js..." curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.40.1/install.sh | bash export NVM_DIR="$HOME/.nvm" [ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" nvm install node fi # Build web interface echo "Building web interface" cd "/root/sia/web" npm install npm run build ln -s "/root/sia/web/dist" "/root/static" # Finetune model echo "Finetuning model..." train # Start SIA using restart script echo "Start restart script..." "/root/sia/scripts/restart.sh"