Configuration
Learn how to configure and customize your sandbox environment
You can specify exactly what resources and environment you need, similar to any other Beam container. You control CPU, memory, GPU, Python packages, and more. Here’s how to configure it for a few different use cases.
Basic
Start with the simplest configuration:
This gives you a minimal environment that works well for simple scripts and running untrusted code. For most real work, you’ll want to customize the resources.
Advanced compute settings
You can increase CPU, memory, or assign a GPU - depending on your use case:
Customize your environment
See the Images section for more information on how to customize the runtime.
Persistent Storage
Distributed Storage Volumes
Mount fast storage volumes to persist files between sessions:
Use volumes when you:
- Are working on a project that spans multiple sessions
- Need to share data between different sandbox instances
- Want to keep work safe even if sandbox crashes
Cloud Buckets
For large datasets or team sharing, you can use your own buckets:
Use cloud buckets for:
- Sensitive data
- Connecting existing object storage
- Long-term data storage in your own infrastructure
Session Management
Timeout Configuration
Set timeouts to control costs:
Start with shorter timeouts and increase as needed. You can always create a new sandbox if you need more time.
Manual vs Automatic Termination
Use manual termination for:
- Long-running training jobs
- Collaborative development sessions
- When you need to pause and resume work
Environment Variables and Secrets
Environment Variables
Pass configuration to your applications:
Environment variables are good for:
- Keeping sensitive data out of your code
- Configuring applications for different environments
- Sharing configuration across team members
Secrets Management
You can attach secrets to your sandbox using Beam’s secret management system - they will be exposed as environmental variables inside the Sandbox:
Use secrets for:
- Database passwords
- API keys and tokens
- Private keys and certificates
Best Practices
Start Small, Scale Up
You only pay for what you use. Start small and scale up as needed.
Common Mistakes
Over-provisioning
Start with minimal resources and scale up as needed.
Including Unnecessary Packages
Only include packages you actually use.
Long Timeouts for Short Tasks
Try to match timeout to expected task duration. You can always extend the timeout dynamically like so:
What’s Next?
Now that you understand configuration, let’s put it to work:
- Process Management: Run code and commands in your configured environment
- File System Operations: Upload, download, and manage files
- Networking: Deploy web services and expose them to the internet
- Examples: See real-world configurations in action