Files
runpod-ai-orchestrator/start.sh
Sebastian Krüger 5f8c843b22
All checks were successful
Build and Push RunPod Docker Image / build-and-push (push) Successful in 14s
Initial commit
2025-11-26 20:20:45 +01:00

70 lines
2.0 KiB
Bash

#!/bin/bash
# RunPod container startup script
# This script initializes the container environment and starts all services
set -e
echo "========================================"
echo " RunPod AI Orchestrator - Starting"
echo "========================================"
# [1/7] Start SSH server (required by RunPod)
echo "[1/7] Starting SSH server..."
mkdir -p ~/.ssh
chmod 700 ~/.ssh
echo "$PUBLIC_KEY" >> ~/.ssh/authorized_keys
chmod 700 ~/.ssh/authorized_keys
service ssh start
echo " ✓ SSH server started"
# [2/7] Cloning repositories
echo "[2/7] Cloning repositories..."
ssh-keyscan -p 2222 -t rsa dev.pivoine.art >> ~/.ssh/known_hosts
chmod 700 ~/.ssh/known_hosts
if [ ! -d "$PWD/bin" ] ; then
git clone https://dev.pivoine.art/valknar/bin.git "$PWD/bin"
echo " ✓ bin cloned"
else
cd "$PWD/bin" && git fetch && git reset --hard origin/main
echo " ✓ bin updated"
cd -
fi
if [ ! -d "$PWD/orchestrator" ] ; then
git clone https://dev.pivoine.art/valknar/runpod-ai-orchestrator.git "$PWD/orchestrator"
echo " ✓ orchestrator cloned"
else
cd "$PWD/orchestrator" && git fetch && git reset --hard origin/main
echo " ✓ orchestrator updated"
cd -
fi
# [3/7] Add $PWD/bin to PATH for arty and custom scripts
echo "[3/7] Configuring PATH..."
ln -sf "$PWD/bin/artifact_git_download.sh" /usr/local/bin/arty
export PATH="$PWD/bin:$PATH"
echo " ✓ PATH updated: $PWD/bin added"
# [4/7] Setting up with arty
echo "[4/7] Setting up with arty..."
cd "$PWD/orchestrator"
arty setup
cd -
echo " ✓ Setup complete"
# Display connection information
echo ""
echo "========================================"
echo " Container Ready"
echo "========================================"
echo "Services:"
echo " - SSH: port 22"
if [ -n "${TAILSCALE_IP:-}" ] && [ "$TAILSCALE_IP" != "not connected" ]; then
echo " - Tailscale IP: $TAILSCALE_IP"
fi
echo ""
echo "========================================"
# Keep container running
echo "Container is running. Press Ctrl+C to stop."
sleep infinity