Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions terraform-gpu-devservers/lambda/reservation_processor/index.py
Original file line number Diff line number Diff line change
Expand Up @@ -3743,6 +3743,9 @@ def create_pod(
echo "[STARTUP] PyTorch ARM64 installation complete"
fi

# Install Claude Code for ARM64 CPU instances (runs after dev user setup below)
INSTALL_CLAUDE_CODE_ARM="{gpu_type}"

echo "[STARTUP] Setting up dev user..."
# Create dev user with UID 1081 to avoid conflicts with common base image users (e.g., ubuntu=1000)
# Use zsh as default shell, fallback to bash if not available
Expand Down Expand Up @@ -4427,6 +4430,19 @@ def create_pod(
echo "[STARTUP] No shared storage - skipping backup setup"
fi

# Install Claude Code for ARM64 CPU instances (not in base image)
if [ "$INSTALL_CLAUDE_CODE_ARM" = "cpu-arm" ]; then
echo "[STARTUP] Installing Claude Code for ARM64..."
# Install as dev user so it goes to ~/.local/bin
su - dev -c 'curl -fsSL https://claude.ai/install.sh | bash' || echo "[STARTUP] Warning: Claude Code installation failed"
# Add PATH and Bedrock config to shell RC files
echo 'export PATH="$HOME/.local/bin:$PATH"' >> /home/dev/.zshrc
echo 'export CLAUDE_CODE_USE_BEDROCK=1' >> /home/dev/.zshrc
echo 'export PATH="$HOME/.local/bin:$PATH"' >> /home/dev/.bashrc
echo 'export CLAUDE_CODE_USE_BEDROCK=1' >> /home/dev/.bashrc
echo "[STARTUP] ✓ Claude Code installed for ARM64"
fi

# Run user's custom startup script if it exists
USER_DIR="{user_id.split('@')[0] if user_id else 'default'}"
STARTUP_SCRIPT="/shared-personal/$USER_DIR/startup.sh"
Expand Down