The Aleph-VM project allows you to run programs on Aleph.im.
Aleph-VM is optimized to run programs on demand in a "function-as-as-service", as a response to HTTP requests.
Programs can be written in any language as long as they can run a web server. They benefit from running in their own, customizable Linux virtual environment.
Writing programs in Python using ASGI compatible frameworks ( FastAPI, Django, ...) allows developers to use advanced functionalities not yet available for other languages.
Head over to the official user doc https://docs.aleph.im/nodes/compute/ on how to run an Aleph.im Compute Resource Node
This method is not recommended, except for development and testing. Read the installation document for the various components and the developer documentation.
- Install the VM-Connector
- Install the VM-Supervisor.
- Install and configure a reverse-proxy such as Caddy
Have a look at tutorials/README.md for a tutorial on how to program VMs as a user.
The rest of this document focuses on how to run an Aleph-VM node that hosts and executes the programs.
Due to aleph-vm’s deep integration with the Linux system, it must be run with root privileges and configured specifically for Linux. It is strongly recommended to deploy aleph-vm on a dedicated machine or a cloud-based server to ensure security and stability.
Note: aleph-vm does not run on macOS or Windows, including for testing purposes.
A typical setup for developing aleph-vm involves:
- Cloning the repository on your local machine for code editing.
- Setting up a remote Linux server for deployment and testing.
You can synchronize changes to the remote server using tools like rsync
or PyCharm’s Remote Interpreter feature.
To deploy aleph-vm for development on a remote server, we start with the Debian package as it includes essential binaries like firecracker
and sevctl
, system
configuration, and dependencies.
- Run the vm-connector.
The vm-connector need to run for aleph-vm to works, even when running py.test.
Unless your focus is developing the VM-Connector, using the Docker image is easier. See the VM-Connector README for more details.
docker run -d -p 127.0.0.1:4021:4021/tcp --restart=always --name vm-connector alephim/vm-connector:alpha
-
Install the Debian Package Replace
1.2.0
with the latest release version.On Debian 12 (Bookworm):
wget -P /opt https://github.com/aleph-im/aleph-vm/releases/download/1.2.0/aleph-vm.debian-12.deb sudo apt install /opt/aleph-vm.debian-12.deb
On Ubuntu 22.04 (Jammy Jellyfish):
sudo wget -P /opt https://github.com/aleph-im/aleph-vm/releases/download/1.2.0/aleph-vm.ubuntu-22.04.deb sudo apt install /opt/aleph-vm.ubuntu-22.04.deb
On Ubuntu 24.04 (Noble Numbat):
sudo wget -P /opt https://github.com/aleph-im/aleph-vm/releases/download/1.2.0/aleph-vm.ubuntu-24.04.deb sudo apt install /opt/aleph-vm.ubuntu-24.04.deb
-
Disable Systemd Service
To prevent conflicts, deactivate the system version of aleph-vm by disabling itssystemd
service.sudo systemctl disable aleph-vm-supervisor.service
-
Clone the Repository and Set Up a Virtual Environment
- Clone the aleph-vm repository to your development environment.
- Create a virtual environment to manage dependencies.
Inside the virtual environment, run:
pip install -e .
This installs aleph-vm in "editable" mode within the virtual environment, allowing you to use the
aleph-vm
command directly during development.
See Testinc doc
To help maintain a clean and consistent codebase, we provide automated tools for formatting and style checks. To ensure your code is properly formatted according to project standards, you can use:
hatch linting:fmt
Typing helps ensure your code adheres to expected type annotations, improving reliability and clarity. To validate typing in your code, use:
hatch linting:typing
These checks are also validated in Continuous Integration (CI) alongside unit tests. To ensure a smooth workflow, we recommend running these commands before committing changes.
Linting checks for potential errors, coding style violations, and patterns that may lead to bugs or reduce code quality (e.g., unused variables, incorrect imports, or inconsistent naming). While linting is not currently enforced in Continuous Integration (CI), it is considered a best practice to check linting manually to maintain high-quality code. You can manually lint your code by running:
hatch fmt
Following these best practices can help streamline code reviews and improve overall project quality.
Actually runs the programs in a secure environment on virtualization enabled systems.
Assist with operations related to the Aleph network.