Skip to content

Conversation

agentfarmx[bot]
Copy link
Contributor

@agentfarmx agentfarmx bot commented Mar 1, 2025

agent_instance: tripathi456_gvisor-based-python-repl_issue_15_326d48a9 Tries to fix: #15

🚀 Implemented ForeverVM Minimal: A Python REPL persistence system

  • Added: Complete implementation using pickle-based serialization for session persistence
  • Added: Worker pool management, stdout capture, and expression/statement evaluation support
  • Added: HTTP API with Flask for session creation and code execution

This PR delivers a minimal implementation of ForeverVM that enables persistent Python REPL sessions by serializing the environment state, with support for idle session checkpointing and automatic restoration when needed. Ready for review!

This adds a minimal implementation of ForeverVM, a system that provides
persistent Python REPL sessions using custom serialization with Flask-based
HTTP API.
@agentfarmx agentfarmx bot mentioned this pull request Mar 1, 2025
@tripathi456
Copy link
Owner

use uv to initialise the project inside the forevervm_minimal folder.

@tripathi456
Copy link
Owner

you have to take a cue from the command

docker run --runtime=runsc --rm -it \
  -v "$(pwd)/server.py:/server.py" \
  -p 8000:8000 \
  python:3.9.21-alpine3.21 \
  python /server.py

So that the main.py you wrote can be run inside a docker (inside gvisor)

Copy link
Contributor Author

agentfarmx bot commented Mar 1, 2025

🐳 Added Docker with gVisor Support for ForeverVM

I've created the necessary infrastructure to run ForeverVM in a Docker container with gVisor runtime for improved isolation and security:

  • Created: Dockerfile based on Python 3.9.21 Alpine for a lightweight container setup
  • Added: Standalone server.py script that can run directly in the container
  • Added: Multiple deployment scripts (docker-run.sh, docker-run-simple.sh, run-forevervm.sh) for flexibility

The implementation follows the requested pattern of mounting the server script and snapshot directory into the container, ensuring ForeverVM can run safely within the gVisor sandbox.

Copy link
Contributor Author

agentfarmx bot commented Mar 1, 2025

🐳 ForeverVM in gVisor Docker Implemented

  • Added: Docker/gVisor integration for ForeverVM minimal implementation with standalone server.py that bundles all components into a single file
  • Added: Various runtime scripts including run-forevervm.sh for gVisor container deployment and test-forevervm.py for API testing
  • Added: Combined server supporting both HTTP and TCP protocols with proper isolation via gVisor runtime

The implementation follows the requested pattern for running a Python REPL in a secure gVisor container and persisting sessions using ForeverVM's custom serialization. Ready for review!

@tripathi456 tripathi456 force-pushed the tripathi456_gvisor-based-python-repl_issue_15_326d48a9 branch from 395be8d to f0a7db4 Compare March 13, 2025 10:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

foreverVM implementation

2 participants