PyRuntime Forge is a web-based application that provides "Jupyter Notebook as a Service." It allows users to register and receive their own personal, isolated coding environment running inside a Kubernetes cluster. Users can log in and execute Python code directly from their browser, with the output streamed back in real-time.
Here's a look at the application's user interface.
Login & Registration Page
Users can easily toggle between creating a new account and logging in.

Command Execution Console
After logging in, users get access to their personal console to execute Python code.

- User Registration & Login: Securely register users and store their details in a MongoDB database.
- Dynamic Environment Provisioning: Automatically creates a dedicated Jupyter Notebook container for each new user in a Kubernetes cluster.
- Isolated Runtimes: Each user's coding environment is a separate Kubernetes pod, ensuring isolation and security.
- Remote Code Execution: Users can execute Python code from a web-based console.
- Real-time Output: Command output is streamed back to the user's browser instantly using WebSockets.
- Modern Frontend: A clean, responsive user interface with a toggle for login/registration and on-page notifications.
- Backend: Flask, Flask-SocketIO
- Database: MongoDB
- Orchestration: Kubernetes
- Frontend: HTML5, CSS3, JavaScript (with Socket.IO client)
- Python Libraries:
pymongo,kubernetes
Before you begin, ensure you have the following installed on your local machine:
- Python 3: Make sure
python3andpipare available in your terminal. - Docker Desktop: Required to run a local Kubernetes cluster.
- Kubernetes (via Docker Desktop): Enable the Kubernetes cluster within Docker Desktop's settings.
- Homebrew: The package manager for macOS (used to install MongoDB).
- MongoDB Community Edition:
- Install using Homebrew:
brew install mongodb-community
- Install using Homebrew:
Follow these steps to get the application running locally.
-
Clone the Repository (if applicable)
git clone <your-repository-url> cd PyRuntimeForge-main
-
Create and Activate a Python Virtual Environment
# Create the environment python3 -m venv venv # Activate it (on macOS/Linux) source venv/bin/activate
-
Install Python Dependencies It's best to create a
requirements.txtfile with all the necessary packages.requirements.txt:flask flask-socketio pymongo kubernetesThen, install them with a single command:
pip install -r requirements.txt
-
Start Required Services
-
Start the Kubernetes Cluster: Open Docker Desktop and ensure the Kubernetes cluster is running (the icon in the bottom-left should be green).
-
Start the MongoDB Service:
brew services start mongodb-community
-
-
Run the Application
python3 server.py
The application will be available at http://127.0.0.1:5000.
- Open your web browser and navigate to
http://127.0.0.1:5000. - Use the "Create an Account" form to register a new user.
- After successful registration, you will be switched to the login form.
- Use the "Welcome Back!" form to log in with the same email you used to register.
- Upon successful login, the Command Console will appear.
- Enter any Python code into the text area and click "Execute" to see the output.
Here is a summary of useful commands to manage your local development environment.
- Check cluster status:
kubectl cluster-info
- List all running deployments:
kubectl get deployments
- List all running pods (user containers):
kubectl get pods
- Delete a specific user's deployment:
# Replace <username> with the sanitized username kubectl delete deployment <username>-deployment
- Start the MongoDB server:
brew services start mongodb-community
- Stop the MongoDB server:
brew services stop mongodb-community
- Check the status of all Homebrew services:
brew services list
This project is a proof-of-concept and has significant security vulnerabilities. It should NOT be deployed to a public-facing production environment without major modifications.
- Arbitrary Code Execution: The application allows any user to run any code inside a container on your cluster.
- No Authentication: There is no password system; login is based solely on email.
- No Resource Limits: A user could easily consume all available CPU and memory by running an infinite loop.