Penvm
Programmable, extensible, network virtual machine.
Install / Use
/learn @penvm/PenvmREADME
PENVM
What Is PENVM?
PENVM stands for Programmable, Extensible, Network Virtual Machine.
PENVM is a platform which provides the building blocks to easily and efficiently leverage networked systems.
Why PENVM?
There is no lack of frameworks and tools for working with servers, communicating over the network, and processing. What PENVM does is make this simple and easy to use, reuse, and share.
Low-level concerns with networking and communication are not exposed. Network setup and management is simple. Communication is uncomplicated. And integration within applications is smooth with freedom to apply as needed.
PENVM provides the means to get up to speed quickly with little hassle.
What Does PENVM Offer?
Just as Python provides building blocks for writing programs, PENVM provides building blocks for building applications that can easily work across machines to work concurrently and/or in parallel.
PENVM provides the necessary low-level functionality for:
- VM management
- Query VM features
- Query VM state/information
- VM network management
- Hi level handling of networks
- Set up and control networks of VMs
- Inter-VM communication
- Structured and typed data
- Message-based communication
- Message queues
- Session management
- Message management and isolation
- Control flow
- Synchronization
- Process management
- Multithreading/concurrency
- Thread creation
- Thread termination
- Storage management
- Filesystem operations
Just like a library, this functionality can be trimmed down, enhanced, reused, and shared.
A PENVM kernel consists of a collection of operations (ops) that are callable by clients. This is done by passing requests to a VM. A kernel then processes that request and optionally generates a response and makes it available on a queue. On demand, a client retrieves the response.
While the default kernel is for general purpose use, domain-specific kernels can be developed to meet specific needs. Multiple kernels can be used concurrently by the same machine.
Build and Installation
PENVM is built and installed to a location from which it is then deployed.
Download (to ~/tmp) from repo:
mkdir ~/tmp
cd ~/tmp
git clone https://github.com/penvm/penvm.git
Build and install to a destination directory (e.g., ~/penvm):
cd ~/tmp/penvm
./penvm-build.py ~/penvm
Deployment
Deployment involves putting the necessary libraries and server across the network of machines which will be participating. This may be general, or for specific applications.
Local
Create a "local" world file (local.penvm):
meta:
name: local
description: Localhost
networks:
default:
targets: localhost
targets:
localhost:
scheme: ssh
host: localhost
Deploy libraries and penvm-server:
export PATH=~/penvm/bin:$PATH
penvm-deploy local.penvm
Add an SSL Profile
Create an SSL profile directory (default):
mkdir -p ~/.penvm/ssl/default
chmod go-rwx ~/.penvm/ssl/default
Create server SSL certificate and key files (requires a passphrase):
cd ~/.penvm/ssl/default
openssl req -x509 -newkey rsa:4096 -keyout server.key- -out server.crt -sha256 -days 365
Remove passphrase:
openssl rsa -in server.key- -out server.key
Network
Change (back) to working directory:
cd ~/tmp/penvm
Create a "network" world file (net.penvm) for machines using a shared home (be sure to replace "<host> ..."):
meta:
name: net
description: Network machines
networks:
default:
targets: <host> ...
templates:
default:
# change <host> ... as appropriate
targets: <host> ...
ncores: 1
memory: 4G
scheme: ssh
fshome-id: net
ssl-profile: default
Deploy libraries and penvm-server:
penvm-deploy net.penvm
Test
Warning: There should be no extraneous output to stdout when logging in via ssh. E.g., shell configuration files should only output to stderr, if at all.
Start network (net.penvm):
penvm-boot --verbose --shell /bin/bash net.penvm
Start penvm-connect (will use PENVM_AUTO_NETWORK setting):
penvm-connect
Get a session (with default kernel):
m = machines[0]
s = m.get_session()
print(s)
List kernel ops (local):
print("\n".join(dir(s.kernel)))
Get Machine snapshot:
s.kernel.machine_snapshot()
r = s.get_response()
print(r.payload.dict())
Print also as JSON:
print(r.payload.json())
Print also as YAML:
print(r.payload.yaml())
List kernels:
s.kernel.machine_list_kernels()
r = s.get_response()
print(r.payload.json())
Echo:
s.kernel.echo({"hello": "world"})
r = s.get_response()
print(r.payload.json())
Get session for each machine:
ss = [m.get_session() for m in machines]
print(ss)
Get Machine state from all machines:
[s.kernel.machine_get_state() for s in ss]
rs = [s.get_response() for s in ss]
for r in rs: print(r.payload.json())
Close penvm-connect shell:
exit()
Close PENVM boot session:
exit
See Also
- Main site: https://penvm.dev/.
- APIs: https://penvm.dev/docs/apis/penvm.
- Tools: https://penvm.dev/docs/tools.
- Examples/demos: https://penvm.dev/docs/examples.
- Details on the world configuration file: world.penvm-README.md.
Related Skills
node-connect
344.4kDiagnose OpenClaw node connection and pairing failures for Android, iOS, and macOS companion apps
frontend-design
99.2kCreate distinctive, production-grade frontend interfaces with high design quality. Use this skill when the user asks to build web components, pages, or applications. Generates creative, polished code that avoids generic AI aesthetics.
openai-whisper-api
344.4kTranscribe audio via OpenAI Audio Transcriptions API (Whisper).
qqbot-media
344.4kQQBot 富媒体收发能力。使用 <qqmedia> 标签,系统根据文件扩展名自动识别类型(图片/语音/视频/文件)。
