RayRun
A Jupyter notebook widget for on-demand GPU/CPU compute using RunPod and Ray.
Overview
RayRun provides a simple way to spin up cloud GPU/CPU instances directly from your Jupyter notebook, run distributed computations with Ray, and automatically shut down when idle to minimize costs.
Features
- One-click compute: Start GPU/CPU instances from within your notebook
- Pre-configured environment: PyTorch, data science tools, and Ray pre-installed
- Auto-shutdown: Automatically stops when idle to save money
- Ray integration: Direct connection to Ray cluster for distributed computing
- Cost-effective: Uses RunPod's community cloud by default
Installation
pip install rayrun
Quick Start
1. Set up your RunPod API key
export RUNPOD_API_KEY="your-api-key-here"
Or create a .env file in your project directory:
RUNPOD_API_KEY=your-api-key-here
2. Use in Jupyter
from rayrun import RayRun
# Create the widget
compute = RayRun(idle_timeout_minutes=30)
compute
3. Start compute
Click the "Start Compute" button in the widget. The widget will:
- Create a RunPod instance with Ray pre-installed
- Wait for the instance to be ready
- Display connection information (IP, Ray URL, Dashboard URL)
4. Connect to Ray
# Now you can use Ray!
import ray
ray.init("<url here>")
@ray.remote
def my_function(x):
return x * x
# Run distributed computation
futures = [my_function.remote(i) for i in range(10)]
results = ray.get(futures)
print(results)
5. Stop compute
Click "Stop Compute" in the widget, or the instance will automatically shut down after the idle timeout (default: 30 minutes).
Pre-installed Packages
The Docker image includes:
- Ray: Distributed computing framework
- PyTorch: torch, torchaudio, torchvision
- Data Science: polars, numpy, scipy, scikit-learn
- Visualization: matplotlib, altair
- System: ffmpeg
Future Work
The following features are currently outside the scope of this project:
- Custom Docker Images: Support for user-specified Docker images with custom dependencies
- TLS/SSL for Ray Connections: Encrypted Ray client connections via TLS
- Cost Tracking UI: Real-time cost display and accumulated spend in the widget
- Automatic Retry Logic: Retry on transient failures during pod creation or Ray connection
- Partial Failure Recovery: Handling cases where VM is up but Ray fails to start
- Pre-shutdown Warnings: Notification before automatic idle shutdown occurs
- VM Logs Display: Expandable section in widget to view container logs
- Resource Usage Monitoring: Display CPU/GPU/memory utilization in widget
- Estimated Cost Display: Show projected hourly/daily costs in widget
- Restart Button: Quick restart functionality without full stop/start cycle
- Multi-GPU Support: Configuration for pods with multiple GPUs
- Custom Data Center Selection: Fine-grained control over pod location
- Network Volume Management: Create and attach persistent network volumes
- Spot Instance Fallback: Automatic fallback to on-demand if spot unavailable
License
MIT License - see LICENSE file for details.
Metadata
Release files for rayrun 0.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| rayrun-0.1.0.tar.gz | 151.7 kB | With provenance | Details for rayrun-0.1.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| rayrun-0.1.0-py3-none-any.whl | Python 3 | none | any | Details for rayrun-0.1.0-py3-none-any.whl |
Total release size: 163.9 kB
Release files / rayrun-0.1.0.tar.gz
| Download URL | rayrun-0.1.0.tar.gz |
|---|---|
| Size | 151.7 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
d6c6568644c78c2d6aa0f08ceb26ce1d76e150d6a1708c1363149db96b6e9d22
|
|
BLAKE2b-256 checksum How to use checksums |
147a004e262bfba336f208e423db7f794d142699edcc1182a564ae2d0af1d73b
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.7
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Feb 19, 2026.
Transparency logRelease files / rayrun-0.1.0-py3-none-any.whl
| Download URL | rayrun-0.1.0-py3-none-any.whl |
|---|---|
| Size | 12.2 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
34b5f08d4d2bc68ff1849aaa5eb73193ee8a094dce76728006d542b7474667de
|
|
BLAKE2b-256 checksum How to use checksums |
9f77849aad452b8bf6d42851633a45888f0154aa4a135b0d57720377e3483c76
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.7
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Feb 19, 2026.
Transparency logSecurity for rayrun 0.1.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
Full provenance
Both files in this release have been uploaded with provenance metadata.
Attestation for rayrun-0.1.0.tar.gz
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Feb 19, 2026.
Transparency logA note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.