ubuntu-sandbox-v2 / docs /DEPLOYMENT.md
likhonsheikh's picture
Upload docs/DEPLOYMENT.md - Ubuntu Sandbox v2.0
4088bdc verified

πŸš€ Quick Deployment Instructions

What You've Got

A complete Ubuntu sandbox environment that AI models can use to:

  • βœ… Build applications in any language
  • βœ… Ship containers and deployments
  • βœ… Create innovative projects
  • βœ… Experiment with technologies
  • βœ… Access via web interface and REST API

Files Created

  • app.py - Main Gradio web application with terminal interface
  • Dockerfile - Complete Ubuntu environment with dev tools
  • requirements.txt - Python dependencies
  • config.yaml - Environment configuration
  • README.md - Comprehensive documentation
  • USAGE_GUIDE.md - Deployment and usage guide
  • test_environment.py - Environment validation script

Deploy to HuggingFace Spaces

Step 1: Create New Space

  1. Go to huggingface.co/spaces
  2. Click "Create new Space"
  3. Choose Docker as the SDK (important!)
  4. Name: ubuntu-sandbox (or your choice)
  5. License: MIT (recommended)
  6. Hardware: CPU (minimum), GPU (optional)

Step 2: Upload Files

Upload all the files to your space repository:

your-space/
β”œβ”€β”€ app.py
β”œβ”€β”€ requirements.txt  
β”œβ”€β”€ Dockerfile
β”œβ”€β”€ config.yaml
β”œβ”€β”€ README.md
β”œβ”€β”€ USAGE_GUIDE.md
└── test_environment.py

Step 3: Build & Deploy

  • HuggingFace will automatically build your space
  • Takes 5-10 minutes for first build
  • Your space will be available at: https://username-ubuntu-sandbox.hf.space

Key Features Enabled

πŸ€– For AI Models

  • REST API for programmatic control
  • Terminal interface via web UI
  • File management (create, read, write files)
  • System monitoring and resource info
  • Command execution with proper sandboxing

πŸ› οΈ Pre-installed Tools

  • Python 3.x + scientific libraries
  • Node.js & npm for JavaScript
  • Docker & Docker Compose
  • Git for version control
  • Cloud CLIs (AWS, GCP, Azure)
  • DevOps tools (Kubernetes, Terraform)
  • Development languages (Go, Rust, C/C++)

πŸ”’ Security & Safety

  • Isolated container environment
  • Resource limits prevent abuse
  • No root access for security
  • 30-second command timeouts
  • Session management

API Usage Examples

Python

import requests

BASE_URL = "https://your-space.hf.space"

# Execute command
response = requests.post(f"{BASE_URL}/api/execute", 
                        json={"command": "python3 --version"})
print(response.json())

# Create file
requests.post(f"{BASE_URL}/api/create",
              json={"filename": "test.py", "content": "print('Hello!')"})

# Run file
requests.post(f"{BASE_URL}/api/execute",
              json={"command": "python3 test.py"})

JavaScript

// Execute command
fetch('/api/execute', {
    method: 'POST',
    headers: {'Content-Type': 'application/json'},
    body: JSON.stringify({command: 'ls -la'})
}).then(r => r.json()).then(console.log);

Perfect for AI Agents

This environment enables AI models to:

  1. Build complete applications from scratch
  2. Test and debug code in real-time
  3. Deploy containers and cloud services
  4. Create documentation and reports
  5. Experiment safely without risk
  6. Collaborate on projects

What Makes This Special

βœ… AI-First Design - Built specifically for AI model interaction
βœ… Zero Configuration - Works out of the box
βœ… Comprehensive Tools - Everything pre-installed
βœ… Web + API - Both human and machine accessible
βœ… Secure Sandbox - Safe for experimentation
βœ… Full Ubuntu - Real Linux environment, not simulated

Next Steps

  1. Deploy to HuggingFace Spaces
  2. Test the environment using the web interface
  3. Integrate with your AI models via API
  4. Start building amazing projects!

Support

  • Documentation: See README.md for full details
  • Usage Guide: See USAGE_GUIDE.md for deployment help
  • Testing: Run test_environment.py to validate setup

Ready to give your AI models the power to build, ship, and create anything! 🎯