Created
November 24, 2025 00:31
-
-
Save donmorton/84533fffe83cce0d2352fb9467716c76 to your computer and use it in GitHub Desktop.
test env1
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/bash | |
| set -e # Exit on error | |
| echo "π Starting OpenPI Remote Server Setup..." | |
| # 1. Install System Dependencies | |
| echo "π¦ Installing system dependencies..." | |
| sudo apt-get update | |
| # libgl1-mesa-glx is deprecated in Ubuntu 22.04+, using libgl1 instead | |
| sudo apt-get install -y git python3.10 python3.10-venv tmux libgl1 libglib2.0-0 | |
| # 2. Install uv (Python package manager) | |
| if ! command -v uv &> /dev/null; then | |
| echo "π¦ Installing uv..." | |
| curl -LsSf https://astral.sh/uv/install.sh | sh | |
| source $HOME/.local/bin/env | |
| else | |
| echo "β uv is already installed" | |
| fi | |
| # Ensure uv is in PATH for this session | |
| export PATH="$HOME/.local/bin:$PATH" | |
| # 3. Clone Repository | |
| if [ ! -d "openpi" ]; then | |
| echo "β¬οΈ Cloning openpi..." | |
| git clone --recurse-submodules https://github.com/Physical-Intelligence/openpi.git | |
| else | |
| echo "β openpi directory exists, pulling latest..." | |
| cd openpi | |
| git pull | |
| git submodule update --init --recursive | |
| cd .. | |
| fi | |
| cd openpi | |
| # 4. Install Python Dependencies | |
| echo "π Installing Python dependencies..." | |
| GIT_LFS_SKIP_SMUDGE=1 uv sync | |
| GIT_LFS_SKIP_SMUDGE=1 uv pip install -e . | |
| # 5. Configure Environment (Fix for /tmp issues) | |
| echo "π§ Configuring environment..." | |
| mkdir -p tmp | |
| export TMPDIR=$(pwd)/tmp | |
| echo " Using local temp directory: $TMPDIR" | |
| # Optional: Clean cache if requested | |
| if [ "$CLEAN_CACHE" == "1" ]; then | |
| echo "π§Ή CLEAN_CACHE=1 detected. Deleting checkpoint cache..." | |
| rm -rf ~/.cache/openpi/openpi-assets/checkpoints/pi0_aloha_sim | |
| echo " Cache cleared." | |
| fi | |
| # 6. Start Server | |
| echo "π Starting Policy Server (ALOHA_SIM)..." | |
| echo " Listening on port 8000..." | |
| # Check if port is in use | |
| if lsof -ti:8000; then | |
| echo "β οΈ Port 8000 is in use. Killing process..." | |
| lsof -ti:8000 | xargs kill -9 | |
| fi | |
| uv run scripts/serve_policy.py --env ALOHA_SIM |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment